MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
function.h
Go to the documentation of this file.
1 
40 #ifndef __FUNCTION_H__
41 #define __FUNCTION_H__
42 
43 #include "Python.h"
44 #include <ltdl.h>
45 #include "indexset.h"
46 
47 #undef __BEGIN_DECLS
48 #undef __END_DECLS
49 #ifdef __cplusplus
50 # define __BEGIN_DECLS extern "C" {
51 # define __END_DECLS }
52 #else
53 # define __BEGIN_DECLS /* empty */
54 # define __END_DECLS /* empty */
55 #endif
56 
57 __BEGIN_DECLS
58 
59 // Forward declaration
60 struct modena_model_t;
61 
62 extern PyTypeObject modena_function_tType;
63 
64 extern PyObject *modena_SurrogateFunction;
65 
74 typedef struct modena_function_t
75 {
76  PyObject_HEAD
77 
78  PyObject *pFunction;
79 
80  size_t inputs_size;
81 
82  size_t outputs_size;
83 
84  size_t parameters_size;
85 
86  lt_dlhandle handle;
87 
88  void (*function)
89  (
90  const struct modena_model_t* model,
91  const double* i,
92  double *o
93  );
94 
96 
97 modena_function_t *modena_function_new
98 (
99  const char *functionId
100 );
101 
102 modena_function_t *modena_function_new_from_model
103 (
104  const struct modena_model_t *self
105 );
106 
107 modena_index_set_t *modena_function_get_index_set
108 (
109  const modena_function_t* self,
110  const char* name
111 );
112 
113 void modena_function_destroy(modena_function_t *model);
114  // end of C_interface_library
116 
117 __END_DECLS
118 
119 #endif /* __FUNCTION_H__ */
120 
struct modena_function_t modena_function_t
stores a surrogate model
Definition: model.h:94
Definition: model.f90:7