49 main(
int argc,
char *argv[])
56 cout <<
"index[N2] = " 57 << modena_index_set_get_index(indexSet,
"N2")
61 size_t start = modena_index_set_iterator_start(indexSet);
62 size_t end = modena_index_set_iterator_end(indexSet);
63 for(
int i = start; i < end; i++)
65 cout <<
"index[" << i <<
"] = " 66 << modena_index_set_get_name(indexSet, i)
70 modena_index_set_destroy(indexSet);
76 modena_function_new(
"fullerEtAlDiffusion");
80 modena_function_get_index_set(
function,
"A");
83 cout <<
"index[N2] = " 84 << modena_index_set_get_index(indexSet,
"N2")
88 size_t start = modena_index_set_iterator_start(indexSet);
89 size_t end = modena_index_set_iterator_end(indexSet);
90 for(
int i = start; i < end; i++)
92 cout <<
"index[" << i <<
"] = " 93 << modena_index_set_get_name(indexSet, i)
97 modena_index_set_destroy(indexSet);
105 "fullerEtAlDiffusion[A=H2O,B=N2]" 108 if(modena_error_occurred())
110 return modena_error();
124 const double p = 1e5;
125 const double T = 290;
128 modena_inputs_set(inputs, ppos, p);
129 modena_inputs_set(inputs, TPos, T);
135 if(modena_error_occurred())
137 modena_inputs_destroy(inputs);
138 modena_outputs_destroy(outputs);
141 return modena_error();
145 double D = modena_outputs_get(outputs, 0);
147 cout <<
"p = " << p <<
" T = " << T <<
" D = " << D << endl;
149 modena_inputs_destroy(inputs);
150 modena_outputs_destroy(outputs);
size_t modena_model_inputs_argPos(const modena_model_t *self, const char *name)
Function determining position of an argument in the input vector.
modena_model_t * modena_model_new(const char *modelId)
Function fetching a surrogate model from MongoDB.
int modena_model_call(modena_model_t *self, modena_inputs_t *inputs, modena_outputs_t *outputs)
Function calling the surrogate model and checking for errors.
int main(int argc, char *argv[])
Reads parameters. Creates struts and walls. Saves foam morphology to a file.
void modena_model_destroy(modena_model_t *self)
Function deallocating the memory allocated for the 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.
void modena_model_argPos_check(const modena_model_t *self)
Function checking that the user has queried all input positions.