#include "cs_cdo_toolbox.h"
#include "cs_equation_param.h"
#include "cs_equation_builder.h"
#include "cs_field.h"
#include "cs_restart.h"
Go to the source code of this file.
Data Structures | |
struct | cs_equation_t |
Typedefs | |
typedef void *() | cs_equation_init_context_t(const cs_equation_param_t *eqp, int var_id, int bflux_id, cs_equation_builder_t *eqb) |
Initialize a scheme data structure used during the building of the algebraic system. More... | |
typedef void *() | cs_equation_free_context_t(void *scheme_context) |
Destroy a scheme data structure. More... | |
typedef void() | cs_equation_init_values_t(cs_real_t t_eval, const int field_id, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context) |
Initialize the variable field values related to an equation. More... | |
typedef void() | cs_equation_solve_t(bool cur2prev, const cs_mesh_t *mesh, const int field_id, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *eqc) |
Build and solve a linear system within the CDO framework. More... | |
typedef void() | cs_equation_set_dir_bc_t(cs_real_t t_eval, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context, cs_real_t field_val[]) |
Set the Dirichlet boundary stemming from the settings. More... | |
typedef void() | cs_equation_build_system_t(const cs_mesh_t *mesh, const cs_real_t *field_val, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context) |
Build a linear system within the CDO framework. More... | |
typedef void() | cs_equation_prepare_solve_t(void *eq_to_cast, cs_real_t *p_x[]) |
Carry out operations for allocating and/or initializing the solution array and the right hand side of the linear system to solve. Handle parallelism thanks to cs_range_set_t structure. More... | |
typedef void() | cs_equation_update_field_t(const cs_real_t *solu, const cs_real_t *rhs, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context, cs_real_t *field_val) |
Store solution(s) of the linear system into a field structure Update extra-field values if required (for hybrid discretization) More... | |
typedef cs_cdo_balance_t *() | cs_equation_get_balance_t(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context) |
Compute the balance for an equation over the full computational domain between time t_cur and t_cur + dt_cur. More... | |
typedef void() | cs_equation_apply_sitffness_t(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context, const cs_property_t *property, const cs_real_t *pot, cs_flag_t loc_res, cs_real_t *res) |
Compute the cellwise stiffness matrix associated to the property given as a parameter and apply it to the pot array to define the resulting array associated to entities defined at loc_res. More... | |
typedef void() | cs_equation_extra_op_t(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context) |
Generic prototype for extra-operations related to an equation. More... | |
typedef void() | cs_equation_get_builders_t(cs_cell_sys_t **csys, cs_cell_builder_t **cb) |
Retrieve cellwise structure including work buffers used to build a CDO system cellwise. Generic prototype for all CDO schemes. More... | |
typedef cs_real_t *() | cs_equation_get_values_t(void *scheme_context, bool previous) |
Compute or retrieve an array of values at a given mesh location Currently, vertices, cells or faces are possible locations The lifecycle of this array is managed by the code. So one does not have to free the return pointer. More... | |
typedef void() | cs_equation_restart_t(cs_restart_t *restart, const char *eqname, void *scheme_context) |
Generic prototype dedicated to read or write additional arrays (not defined as fields) useful for the checkpoint/restart process. More... | |
typedef void() cs_equation_apply_sitffness_t(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context, const cs_property_t *property, const cs_real_t *pot, cs_flag_t loc_res, cs_real_t *res) |
Compute the cellwise stiffness matrix associated to the property given as a parameter and apply it to the pot array to define the resulting array associated to entities defined at loc_res.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to a scheme builder structure |
[in] | property | pointer to the property related to the stiffness op. |
[in] | pot | array to multiply with the stiffness matrix |
[in] | loc_res | location of entities in the resulting array |
[in,out] | res | resulting array |
typedef void() cs_equation_build_system_t(const cs_mesh_t *mesh, const cs_real_t *field_val, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context) |
Build a linear system within the CDO framework.
[in] | m | pointer to a cs_mesh_t structure |
[in] | field_val | pointer to the current value of the field |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to a scheme context structure |
typedef void() cs_equation_extra_op_t(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context) |
Generic prototype for extra-operations related to an equation.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to a generic data structure |
typedef void*() cs_equation_free_context_t(void *scheme_context) |
Destroy a scheme data structure.
[in,out] | scheme_context | pointer to a structure cast on-the-fly |
typedef cs_cdo_balance_t*() cs_equation_get_balance_t(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context) |
Compute the balance for an equation over the full computational domain between time t_cur and t_cur + dt_cur.
[in] | eqp | pointer to a cs_equation_param_t |
[in,out] | eqb | pointer to a cs_equation_builder_t |
[in,out] | context | pointer to a scheme context structure |
typedef void() cs_equation_get_builders_t(cs_cell_sys_t **csys, cs_cell_builder_t **cb) |
Retrieve cellwise structure including work buffers used to build a CDO system cellwise. Generic prototype for all CDO schemes.
[out] | csys | pointer to a pointer on a cs_cell_sys_t structure |
[out] | cb | pointer to a pointer on a cs_cell_builder_t structure |
typedef cs_real_t*() cs_equation_get_values_t(void *scheme_context, bool previous) |
Compute or retrieve an array of values at a given mesh location Currently, vertices, cells or faces are possible locations The lifecycle of this array is managed by the code. So one does not have to free the return pointer.
[in,out] | scheme_context | pointer to a data structure cast on-the-fly |
[in] | previous | retrieve the previous state (true/false) |
typedef void*() cs_equation_init_context_t(const cs_equation_param_t *eqp, int var_id, int bflux_id, cs_equation_builder_t *eqb) |
Initialize a scheme data structure used during the building of the algebraic system.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | var_id | id of the variable field |
[in] | bflux_id | id of the boundary flux field |
[in,out] | eqb | pointer to a cs_equation_builder_t struct. |
typedef void() cs_equation_init_values_t(cs_real_t t_eval, const int field_id, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context) |
Initialize the variable field values related to an equation.
[in] | t_eval | time at which one performs the evaluation |
[in] | field_id | id related to the variable field of this equation |
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to the scheme context (cast on-the-fly) |
typedef void() cs_equation_prepare_solve_t(void *eq_to_cast, cs_real_t *p_x[]) |
Carry out operations for allocating and/or initializing the solution array and the right hand side of the linear system to solve. Handle parallelism thanks to cs_range_set_t structure.
[in,out] | eq_cast | pointer to generic builder structure |
[in,out] | p_x | pointer of pointer to the solution array |
typedef void() cs_equation_restart_t(cs_restart_t *restart, const char *eqname, void *scheme_context) |
Generic prototype dedicated to read or write additional arrays (not defined as fields) useful for the checkpoint/restart process.
[in,out] | restart | pointer to cs_restart_t structure |
[in] | eqname | name of the related equation |
[in,out] | scheme_context | pointer to a data structure cast on-the-fly |
typedef void() cs_equation_set_dir_bc_t(cs_real_t t_eval, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context, cs_real_t field_val[]) |
Set the Dirichlet boundary stemming from the settings.
[in] | t_eval | time at which one evaluates BCs |
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to the scheme context (cast on-the-fly) |
[in,out] | field_val | pointer to the values of the variable field |
typedef void() cs_equation_solve_t(bool cur2prev, const cs_mesh_t *mesh, const int field_id, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *eqc) |
Build and solve a linear system within the CDO framework.
[in] | cur2prev | true="current to previous" operation is performed |
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | field_id | id related to the variable field of this equation |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | eqc | pointer to a scheme context structure |
typedef void() cs_equation_update_field_t(const cs_real_t *solu, const cs_real_t *rhs, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context, cs_real_t *field_val) |
Store solution(s) of the linear system into a field structure Update extra-field values if required (for hybrid discretization)
[in] | solu | solution array |
[in] | rhs | rhs associated to this solution array |
[in] | eqp | pointer to a cs_equation_param_t structure |
[in,out] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | context | pointer to a context structure |
[in,out] | field_val | pointer to the current value of the field |