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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2225 - (hide annotations) (download)
Mon Jul 26 03:40:18 2010 UTC (14 years 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 jpye 2007 %module fprops
2    
3     %{
4 jpye 2117 #include "../carbondioxide.h"
5     #include "../water.h"
6     #include "../ammonia.h"
7     #include "../hydrogen.h"
8     #include "../nitrogen.h"
9 jpye 2007 #include "../helmholtz.h"
10 jpye 2120 #include "../sat.h"
11 jpye 2225 #include "../sat2.h"
12 jpye 2007 %}
13    
14 jpye 2225 %include exception.i
15    
16 jpye 2007 %immutable helmholtz_data_water;
17 jpye 2117 %immutable helmholtz_data_carbondioxide;
18     %immutable helmholtz_data_ammonia;
19     %immutable helmholtz_data_nitrogen;
20     %immutable helmholtz_data_hydrogen;
21 jpye 2007
22     %include "../helmholtz.h"
23 jpye 2124
24     %apply double *OUTPUT {double *p_sat};
25     %apply double *OUTPUT {double *rho_f};
26     %apply double *OUTPUT {double *rho_g};
27 jpye 2120 %include "../sat.h"
28 jpye 2124 %clear double *p_sat;
29     %clear double *rho_f;
30     %clear double *rho_g;
31 jpye 2007
32 jpye 2225 %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 jpye 2117 %include "../carbondioxide.h"
43     %include "../water.h"
44     %include "../ammonia.h"
45     %include "../hydrogen.h"
46     %include "../nitrogen.h"
47    
48 jpye 2007 /*
49 jpye 2124 If you're not using SCons, then try something like...
50 jpye 2007 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     */
53    

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