-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add r283 in pywrapper and in library.
- Loading branch information
1 parent
448083e
commit a3a5556
Showing
9 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#include <string.h> | ||
#include <stdio.h> | ||
#include "iapws_g704.h" | ||
#include "iapws.h" | ||
|
||
int main(void){ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
#ifndef IAPWS_H | ||
#define IAPWS_H | ||
#include "iapws_g704.h" | ||
#include "iapws_r283.h" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"""Python wrapper of the (Modern Fortran) iapws library.""" | ||
from .version import * | ||
from . import g704 | ||
from . import g704, r283 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include "iapws_r283.h" | ||
|
||
PyDoc_STRVAR(module_docstring, "C extension wrapping the iapws_r283 module of the Fortran iapws library."); | ||
|
||
|
||
static PyMethodDef myMethods[] = { | ||
{ NULL, NULL, 0, NULL } | ||
}; | ||
|
||
// Our Module Definition struct | ||
static struct PyModuleDef r283 = { | ||
PyModuleDef_HEAD_INIT, | ||
"r283", | ||
module_docstring, | ||
-1, | ||
myMethods | ||
}; | ||
|
||
// Initializes our module using our above struct | ||
PyMODINIT_FUNC PyInit_r283(void) | ||
{ | ||
PyObject *m; | ||
PyObject *d; | ||
PyObject *v; | ||
|
||
m = PyModule_Create(&r283); | ||
d = PyModule_GetDict(m); | ||
|
||
v = PyFloat_FromDouble(iapws_r283_capi_Tc_H2O); | ||
PyDict_SetItemString(d, "Tc_H2O", v); | ||
Py_INCREF(v); | ||
v = PyFloat_FromDouble(iapws_r283_capi_Tc_D2O); | ||
PyDict_SetItemString(d, "Tc_D2O", v); | ||
Py_INCREF(v); | ||
|
||
v = PyFloat_FromDouble(iapws_r283_capi_pc_H2O); | ||
PyDict_SetItemString(d, "pc_H2O", v); | ||
Py_INCREF(v); | ||
v = PyFloat_FromDouble(iapws_r283_capi_pc_D2O); | ||
PyDict_SetItemString(d, "pc_D2O", v); | ||
Py_INCREF(v); | ||
|
||
v = PyFloat_FromDouble(iapws_r283_capi_rhoc_H2O); | ||
PyDict_SetItemString(d, "rho_H2O", v); | ||
Py_INCREF(v); | ||
v = PyFloat_FromDouble(iapws_r283_capi_rhoc_D2O); | ||
PyDict_SetItemString(d, "rho_D2O", v); | ||
Py_INCREF(v); | ||
|
||
|
||
return m; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
module iapws | ||
!! Main module for the IAPWS library. | ||
use iapws__g704 | ||
use iapws__r797 | ||
use iapws__g704_capi | ||
use iapws__r283 | ||
use iapws__r283_capi | ||
|
||
|
||
end module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters