CAMP 1.0.0
Chemistry Across Multiple Phases
|
Header file for abstract sub model functions. More...
Go to the source code of this file.
Functions | |
void | sub_model_get_used_jac_elem (ModelData *model_data, Jacobian *jac) |
Get the Jacobian elements used by a particular sub model. | |
void | sub_model_set_jac_map (ModelData *model_data, Jacobian jac) |
Set the map for sub-model interdependence. | |
void | sub_model_update_ids (ModelData *model_data, int *deriv_ids, Jacobian jac) |
Update the time derivative and Jacobian array ids. | |
void | sub_model_update_env_state (ModelData *model_data) |
Update sub model data for a new environmental state. | |
void | sub_model_calculate (ModelData *model_data) |
Perform the sub model calculations for the current model state. | |
void | sub_model_get_jac_contrib (ModelData *model_data, double *J_data, realtype time_step) |
Calculate the Jacobian constributions from sub model calculations. | |
void | sub_model_print_data (void *solver_data) |
Print the sub model data. | |
void | sub_model_add_condensed_data (int sub_model_type, int n_int_param, int n_float_param, int n_env_param, int *int_param, double *float_param, void *solver_data) |
Add condensed data to the condensed data block for sub models. | |
void | sub_model_update_data (int cell_id, int *sub_model_id, int update_sub_model_type, void *update_data, void *solver_data) |
Update sub-model data. | |
Header file for abstract sub model functions.
Definition in file sub_model_solver.h.
void sub_model_add_condensed_data | ( | int | sub_model_type, |
int | n_int_param, | ||
int | n_float_param, | ||
int | n_env_param, | ||
int * | int_param, | ||
double * | float_param, | ||
void * | solver_data | ||
) |
Add condensed data to the condensed data block for sub models.
sub_model_type | Sub model type |
n_int_param | Number of integer parameters |
n_float_param | Number of floating-point parameters |
n_env_param | Number of environment-dependent parameters |
int_param | Pointer to integer parameter array |
float_param | Pointer to floating-point parameter array |
solver_data | Pointer to solver data |
Definition at line 413 of file sub_model_solver.c.
void sub_model_calculate | ( | ModelData * | model_data | ) |
Perform the sub model calculations for the current model state.
model_data | Pointer to the model data |
Definition at line 308 of file sub_model_solver.c.
void sub_model_get_jac_contrib | ( | ModelData * | model_data, |
double * | J_data, | ||
realtype | time_step | ||
) |
Calculate the Jacobian constributions from sub model calculations.
model_data | Pointer to the model data |
J_data | Pointer to sub-model Jacobian data |
time_step | Current time step [s] |
Definition at line 354 of file sub_model_solver.c.
Get the Jacobian elements used by a particular sub model.
Public sub model functions
model_data | A pointer to the model data |
jac | Jacobian |
Definition at line 25 of file sub_model_solver.c.
void sub_model_print_data | ( | void * | solver_data | ) |
Print the sub model data.
solver_data | Pointer to the solver data |
Definition at line 509 of file sub_model_solver.c.
Set the map for sub-model interdependence.
Uses the indices provided in jac_struct
along with individual calls to the sub-model get_used_jac_elem()
functions to set up a map to account for the dependence of sub model calculations on the results of other sub model calculations. The sub model priorities used to assemble the array of sub models, must result in independent sub-model calculations appearing before dependent sub-model calculations in the sub-model array.
model_data | Pointer to the model data |
jac | Jacobian |
Definition at line 121 of file sub_model_solver.c.
void sub_model_update_data | ( | int | cell_id, |
int * | sub_model_id, | ||
int | update_sub_model_type, | ||
void * | update_data, | ||
void * | solver_data | ||
) |
Update sub-model data.
Update data for one or more sub-models. Sub-models of a certain type are passed a void pointer to updated data that must be in the format specified by the sub-model type. This data could be used to find specific sub-models of the specified type and change some model parameter(s).
cell_id | Id of the grid cell to update |
sub_model_id | Index of the sub model to update (or 0 if unknown) |
update_sub_model_type | Type of the sub-model |
update_data | Pointer to updated data to pass to the sub-model |
solver_data | Pointer to solver data |
Definition at line 468 of file sub_model_solver.c.
void sub_model_update_env_state | ( | ModelData * | model_data | ) |
Update sub model data for a new environmental state.
model_data | Pointer to the model data with updated env state |
Definition at line 264 of file sub_model_solver.c.
Update the time derivative and Jacobian array ids.
model_data | Pointer to the model data |
deriv_ids | Ids for state variables on the time derivative array |
jac | Jacobian |
Definition at line 225 of file sub_model_solver.c.