CAMP 1.0.0
Chemistry Across Multiple Phases
sub_model_solver.h
Go to the documentation of this file.
1/* Copyright (C) 2021 Barcelona Supercomputing Center and University of
2 * Illinois at Urbana-Champaign
3 * SPDX-License-Identifier: MIT
4 *
5 * Header file for sub_model_solver.c
6 *
7 */
8/** \file
9 * \brief Header file for abstract sub model functions
10 */
11#ifndef SUB_MODEL_SOLVER_H
12#define SUB_MODEL_SOLVER_H
13#include "camp_common.h"
14
15/** Public sub model functions **/
16
17/* Solver functions */
18void sub_model_get_used_jac_elem(ModelData *model_data, Jacobian *jac);
19void sub_model_set_jac_map(ModelData *model_data, Jacobian jac);
20void sub_model_update_ids(ModelData *model_data, int *deriv_ids, Jacobian jac);
22void sub_model_calculate(ModelData *model_data);
23#ifdef CAMP_USE_SUNDIALS
24void sub_model_get_jac_contrib(ModelData *model_data, double *J_data,
25 realtype time_step);
26#endif
27void sub_model_print_data(void *solver_data);
28
29/* Setup functions */
30void sub_model_add_condensed_data(int sub_model_type, int n_int_param,
31 int n_float_param, int n_env_param,
32 int *int_param, double *float_param,
33 void *solver_data);
34void sub_model_update_data(int cell_id, int *sub_model_id,
35 int update_sub_model_type, void *update_data,
36 void *solver_data);
37
38#endif
Header file for common constants and structures.
void sub_model_print_data(void *solver_data)
Print the sub model data.
void sub_model_update_ids(ModelData *model_data, int *deriv_ids, Jacobian jac)
Update the time derivative and Jacobian array ids.
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_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_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_update_data(int cell_id, int *sub_model_id, int update_sub_model_type, void *update_data, void *solver_data)
Update sub-model data.