![]() |
MoDeNa
1.0
Software framework facilitating sequential multi-scale modelling
|
Data Structures | |
struct | modena_function_t |
struct | modena_index_set_t |
struct | modena_siunits_t |
struct | modena_inputs_t |
struct | modena_outputs_t |
struct | modena_substitute_model_t |
stores a model and mapping for substitution More... | |
struct | modena_model_t |
stores a surrogate model More... | |
Typedefs | |
typedef struct modena_function_t | modena_function_t |
typedef struct modena_index_set_t | modena_index_set_t |
typedef struct modena_substitute_model_t | modena_substitute_model_t |
stores a model and mapping for substitution | |
typedef struct modena_model_t | modena_model_t |
stores a surrogate model | |
Functions | |
modena_function_t * | modena_function_new (const char *functionId) |
modena_function_t * | modena_function_new_from_model (const struct modena_model_t *self) |
modena_index_set_t * | modena_function_get_index_set (const modena_function_t *self, const char *name) |
void | modena_function_destroy (modena_function_t *model) |
modena_index_set_t * | modena_index_set_new (const char *indexSetId) |
size_t | modena_index_set_get_index (const modena_index_set_t *self, const char *name) |
const char * | modena_index_set_get_name (const modena_index_set_t *self, const size_t index) |
size_t | modena_index_set_iterator_start (const modena_index_set_t *self) |
size_t | modena_index_set_iterator_end (const modena_index_set_t *self) |
void | modena_index_set_destroy (modena_index_set_t *indexSet) |
modena_siunits_t * | modena_siunits_new () |
int | modena_siunits_get (const modena_siunits_t *self, const size_t i) |
void | modena_siunits_destroy (modena_siunits_t *self) |
modena_inputs_t * | modena_inputs_new (const struct modena_model_t *self) |
modena_outputs_t * | modena_outputs_new (const struct modena_model_t *self) |
void | modena_inputs_destroy (modena_inputs_t *inputs) |
void | modena_outputs_destroy (modena_outputs_t *outputs) |
INLINE_DECL void | modena_inputs_set (modena_inputs_t *self, const size_t i, double x) |
INLINE_DECL void | modena_inherited_inputs_set (modena_inputs_t *self, const size_t i, double x) |
INLINE_DECL double | modena_inputs_get (const modena_inputs_t *self, const size_t i) |
INLINE_DECL double | modena_inherited_inputs_get (const modena_inputs_t *self, const size_t i) |
INLINE_DECL double | modena_outputs_get (const modena_outputs_t *self, const size_t i) |
modena_model_t * | modena_model_new (const char *modelId) |
Function fetching a surrogate model from MongoDB. More... | |
size_t | modena_model_inputs_argPos (const modena_model_t *self, const char *name) |
Function determining position of an argument in the input vector. More... | |
void | modena_model_argPos_check (const modena_model_t *self) |
Function checking that the user has queried all input positions. More... | |
size_t | modena_model_outputs_argPos (const modena_model_t *self, const char *name) |
Function determining position of a result in the output vector. More... | |
char ** | modena_model_inputs_names (const modena_model_t *self) |
Function returning the names of the inputs. More... | |
char ** | modena_model_outputs_names (const modena_model_t *self) |
Function returning the names of the outputs. More... | |
char ** | modena_model_parameters_names (const modena_model_t *self) |
Function returning the names of the parameters. More... | |
size_t | modena_model_inputs_size (const modena_model_t *self) |
Function returning the size of the input vector. More... | |
size_t | modena_model_outputs_size (const modena_model_t *self) |
Function returning the size of the output vector. More... | |
size_t | modena_model_parameters_size (const modena_model_t *self) |
Function returning the size of the parameter vector. More... | |
void | modena_model_inputs_siunits (const modena_model_t *self, const size_t i, modena_siunits_t *units) |
void | modena_model_outputs_siunits (const modena_model_t *self, const size_t i, modena_siunits_t *units) |
int | modena_model_call (modena_model_t *model, modena_inputs_t *inputs, modena_outputs_t *outputs) |
Function calling the surrogate model and checking for errors. More... | |
void | modena_model_call_no_check (modena_model_t *model, modena_inputs_t *inputs, modena_outputs_t *outputs) |
Function calling the surrogate model w/o checking for errors. More... | |
void | modena_model_destroy (modena_model_t *model) |
Function deallocating the memory allocated for the surrogate model. More... | |
MoDeNa C interface library
typedef struct modena_function_t modena_function_t |
stores a surrogate function
typedef struct modena_index_set_t modena_index_set_t |
stores an index set
void modena_model_argPos_check | ( | const modena_model_t * | self | ) |
Function checking that the user has queried all input positions.
struct | modena_model_t pointer to a surrogate model created by modena_model_new. |
int modena_model_call | ( | modena_model_t * | model, |
modena_inputs_t * | inputs, | ||
modena_outputs_t * | outputs | ||
) |
Function calling the surrogate model and checking for errors.
modena_model_t | model pointer to a surrogate model. |
modena_inputs_t | inputs pointer to the input vector |
modena_outputs_t | outputs pointer to the output vector |
void modena_model_call_no_check | ( | modena_model_t * | model, |
modena_inputs_t * | inputs, | ||
modena_outputs_t * | outputs | ||
) |
Function calling the surrogate model w/o checking for errors.
model | modena_model_t pointer to a surrogate model. |
inputs | modena_inputs_t pointer to the input vector |
outputs | modena_outputs_t pointer to the output vector |
void modena_model_destroy | ( | modena_model_t * | model | ) |
Function deallocating the memory allocated for the surrogate model.
model | modena_model_t pointer to a surrogate model. |
size_t modena_model_inputs_argPos | ( | const modena_model_t * | self, |
const char * | name | ||
) |
Function determining position of an argument in the input vector.
The function is used to determine the position of an argument name
in the input vector.
self | pointer to surrogate model created by modena_model_new . |
name | (char) name of the argument whose position is sought. |
char** modena_model_inputs_names | ( | const modena_model_t * | self | ) |
size_t modena_model_inputs_size | ( | const modena_model_t * | self | ) |
Function returning the size of the input vector.
modena_model_t | pointer to a surrogate model created by modena_model_new. |
modena_model_t* modena_model_new | ( | const char * | modelId | ) |
Function fetching a surrogate model from MongoDB.
A adaptor is a code fragment which makes an application able to use the surrogate models (SM) that are stored in the MongoDB database. Writing a adaptor for a SM requires implementation of code fragments that corresponds to the life-span of a surrogate model, which consists of three phases:
The function modena_model_new
is used in the initialisation phase of the adaptor, and its purpose is to fetch a surrogate model from the database. The input to the function is the name, technically the database "_id", of the surrogate model.
When the surrogate model has been fetched from the database the initialisation continues with allocating memory for the input and output vectors. However, this procedure is only performed one time for every surrogate model.
The function is only called one time for every surrogate model that the user want to employ in a application. It is implemented as a pointer to modena_model_t
as follows:
The name of the model, here "MY_MODEL", must correspond to the "_id" field in the definition of the surrogate model, which is located in a Python module.
modelId | (char) database '_id' if the desired surrogate model. |
size_t modena_model_outputs_argPos | ( | const modena_model_t * | self, |
const char * | name | ||
) |
Function determining position of a result in the output vector.
The function is used to determine the position of a result name
in the input vector.
self | pointer to surrogate model created by modena_model_new. |
name | (char) name of the result whose position is sought. |
char** modena_model_outputs_names | ( | const modena_model_t * | self | ) |
size_t modena_model_outputs_size | ( | const modena_model_t * | self | ) |
Function returning the size of the output vector.
modena_model_t | surrogate model created by modena_model_new. |
char** modena_model_parameters_names | ( | const modena_model_t * | self | ) |
size_t modena_model_parameters_size | ( | const modena_model_t * | self | ) |
Function returning the size of the parameter vector.
modena_model_t | surrogate model created by modena_model_new. |
modena_siunits_t* modena_siunits_new | ( | ) |
creates from nothing
Definition at line 54 of file inputsoutputs.c.