/[ascend]/trunk/models/johnpye/fprops/python/fprops.i
ViewVC logotype

Contents of /trunk/models/johnpye/fprops/python/fprops.i

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2225 - (show annotations) (download)
Mon Jul 26 03:40:18 2010 UTC (13 years, 11 months ago) by jpye
File size: 1259 byte(s)
Added python bindings for new function. 
We can see that it's not converging for about 10% of cases.
1 %module fprops
2
3 %{
4 #include "../carbondioxide.h"
5 #include "../water.h"
6 #include "../ammonia.h"
7 #include "../hydrogen.h"
8 #include "../nitrogen.h"
9 #include "../helmholtz.h"
10 #include "../sat.h"
11 #include "../sat2.h"
12 %}
13
14 %include exception.i
15
16 %immutable helmholtz_data_water;
17 %immutable helmholtz_data_carbondioxide;
18 %immutable helmholtz_data_ammonia;
19 %immutable helmholtz_data_nitrogen;
20 %immutable helmholtz_data_hydrogen;
21
22 %include "../helmholtz.h"
23
24 %apply double *OUTPUT {double *p_sat};
25 %apply double *OUTPUT {double *rho_f};
26 %apply double *OUTPUT {double *rho_g};
27 %include "../sat.h"
28 %clear double *p_sat;
29 %clear double *rho_f;
30 %clear double *rho_g;
31
32 %apply double *OUTPUT {double *p_sat};
33 %apply double *OUTPUT {double *rho_f};
34 %apply double *OUTPUT {double *rho_g};
35 int fprops_sat_T(double T, double *p_sat, double *rho_f, double *rho_g, const HelmholtzData *d);
36 %clear double *p_sat;
37 %clear double *rho_f;
38 %clear double *rho_g;
39
40 %exception;
41
42 %include "../carbondioxide.h"
43 %include "../water.h"
44 %include "../ammonia.h"
45 %include "../hydrogen.h"
46 %include "../nitrogen.h"
47
48 /*
49 If you're not using SCons, then try something like...
50 swig -python fprops.i
51 gcc -I /usr/include/python2.5 -shared fprops_wrap.c ../helmholtz.c ../ideal.c ../water.c -o _fprops.so
52 */

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22