CAMP 1.0.0
Chemistry Across Multiple Phases
Functions
sub_model_solver.h File Reference

Header file for abstract sub model functions. More...

Include dependency graph for sub_model_solver.h:
This graph shows which files directly or indirectly include this file:

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.
 

Detailed Description

Header file for abstract sub model functions.

Definition in file sub_model_solver.h.

Function Documentation

◆ sub_model_add_condensed_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.

Parameters
sub_model_typeSub model type
n_int_paramNumber of integer parameters
n_float_paramNumber of floating-point parameters
n_env_paramNumber of environment-dependent parameters
int_paramPointer to integer parameter array
float_paramPointer to floating-point parameter array
solver_dataPointer to solver data

Definition at line 413 of file sub_model_solver.c.

◆ sub_model_calculate()

void sub_model_calculate ( ModelData model_data)

Perform the sub model calculations for the current model state.

Parameters
model_dataPointer to the model data

Definition at line 308 of file sub_model_solver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sub_model_get_jac_contrib()

void sub_model_get_jac_contrib ( ModelData model_data,
double *  J_data,
realtype  time_step 
)

Calculate the Jacobian constributions from sub model calculations.

Parameters
model_dataPointer to the model data
J_dataPointer to sub-model Jacobian data
time_stepCurrent time step [s]

Definition at line 354 of file sub_model_solver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sub_model_get_used_jac_elem()

void sub_model_get_used_jac_elem ( ModelData model_data,
Jacobian jac 
)

Get the Jacobian elements used by a particular sub model.

Public sub model functions

Parameters
model_dataA pointer to the model data
jacJacobian

Definition at line 25 of file sub_model_solver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sub_model_print_data()

void sub_model_print_data ( void *  solver_data)

Print the sub model data.

Parameters
solver_dataPointer to the solver data

Definition at line 509 of file sub_model_solver.c.

Here is the call graph for this function:

◆ sub_model_set_jac_map()

void sub_model_set_jac_map ( ModelData model_data,
Jacobian  jac 
)

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.

Parameters
model_dataPointer to the model data
jacJacobian

Definition at line 121 of file sub_model_solver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sub_model_update_data()

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).

Parameters
cell_idId of the grid cell to update
sub_model_idIndex of the sub model to update (or 0 if unknown)
update_sub_model_typeType of the sub-model
update_dataPointer to updated data to pass to the sub-model
solver_dataPointer to solver data

Definition at line 468 of file sub_model_solver.c.

◆ sub_model_update_env_state()

void sub_model_update_env_state ( ModelData model_data)

Update sub model data for a new environmental state.

Parameters
model_dataPointer to the model data with updated env state

Definition at line 264 of file sub_model_solver.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sub_model_update_ids()

void sub_model_update_ids ( ModelData model_data,
int *  deriv_ids,
Jacobian  jac 
)

Update the time derivative and Jacobian array ids.

Parameters
model_dataPointer to the model data
deriv_idsIds for state variables on the time derivative array
jacJacobian

Definition at line 225 of file sub_model_solver.c.

Here is the call graph for this function:
Here is the caller graph for this function: