8.0
general documentation
cs_equation_builder.h File Reference
#include "cs_cdo_bc.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_local.h"
#include "cs_cdo_quantities.h"
#include "cs_cdo_system.h"
#include "cs_enforcement.h"
#include "cs_equation_param.h"
#include "cs_flag.h"
#include "cs_matrix.h"
#include "cs_source_term.h"
+ Include dependency graph for cs_equation_builder.h:

Go to the source code of this file.

Data Structures

struct  cs_equation_builder_t
 

Typedefs

typedef void() cs_equation_build_hook_t(const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const void *eqc, const cs_cell_mesh_t *cm, void *context, cs_hodge_t *mass_hodge, cs_hodge_t *diff_hodge, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
 Generic function prototype for a hook during the cellwise building of the linear system Enable an advanced user to get a fine control of the discretization. More...
 

Functions

static cs_eflag_t cs_equation_builder_cell_mesh_flag (cs_flag_t cell_flag, const cs_equation_builder_t *eqb)
 Retrieve the flag to give for building a cs_cell_mesh_t structure. More...
 
cs_equation_builder_tcs_equation_builder_create (const cs_equation_param_t *eqp, const cs_mesh_t *mesh)
 Allocate a new structure to handle the building of algebraic system related to a cs_equation_t structure. More...
 
const cs_matrix_tcs_equation_builder_get_matrix (const cs_equation_builder_t *builder, int block_id)
 Retrieve the range set structure associated to a builder structure for the block defined in block_id in the system helper structure. More...
 
const cs_range_set_tcs_equation_builder_get_range_set (const cs_equation_builder_t *builder, int block_id)
 Retrieve the range set structure associated to a builder structure for the block defined in block_id in the system helper structure. More...
 
void cs_equation_builder_free (cs_equation_builder_t **p_builder)
 Free a cs_equation_builder_t structure. More...
 
void cs_equation_builder_reset (cs_equation_builder_t *eqb)
 Free some members of a cs_equation_builder_t structure. More...
 
void cs_equation_builder_log_performance (const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb)
 Print a message in the performance output file related to the monitoring of equation. More...
 
bool cs_equation_builder_set_reaction_pty_cw (const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb)
 Initialize all reaction properties. This function is shared across all CDO schemes. The cs_cell_builder_t structure stores the computed property values. If the property is uniform, a first call to the function cs_equation_builder_init_properties has to be done before the loop on cells. More...
 
void cs_equation_builder_init_properties (const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, cs_hodge_t *diff_hodge, cs_cell_builder_t *cb)
 Initialize all properties potentially useful to build the algebraic system. This function is shared across all CDO schemes. The cs_cell_builder_t structure stores property values related to the reaction term, unsteady term and grad-div term. More...
 
void cs_equation_builder_enforce_dofs (const cs_equation_builder_t *eqb, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account the enforcement of internal DoFs. Apply an algebraic manipulation. Update members of the cs_cell_sys_t structure related to the internal enforcement. More...
 
void cs_equation_builder_enforce_block_dofs (const cs_equation_builder_t *eqb, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Take into account the enforcement of internal DoFs. Case of matrices defined by blocks. Apply an algebraic manipulation. Update members of the cs_cell_sys_t structure related to the internal enforcement. More...
 

Typedef Documentation

◆ cs_equation_build_hook_t

typedef void() cs_equation_build_hook_t(const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const void *eqc, const cs_cell_mesh_t *cm, void *context, cs_hodge_t *mass_hodge, cs_hodge_t *diff_hodge, cs_cell_sys_t *csys, cs_cell_builder_t *cb)

Generic function prototype for a hook during the cellwise building of the linear system Enable an advanced user to get a fine control of the discretization.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]eqbpointer to a cs_equation_builder_t structure
[in]eqccontext to cast for this discretization
[in]cmpointer to a cellwise view of the mesh
[in,out]contextpointer to a context structure
[in,out]mass_hodgepointer to a cs_hodge_t structure (mass matrix)
[in,out]diff_hodgepointer to a cs_hodge_t structure (diffusion)
[in,out]csyspointer to a cellwise view of the system
[in,out]cbpointer to a cellwise builder

Function Documentation

◆ cs_equation_builder_cell_mesh_flag()

static cs_eflag_t cs_equation_builder_cell_mesh_flag ( cs_flag_t  cell_flag,
const cs_equation_builder_t eqb 
)
inlinestatic

Retrieve the flag to give for building a cs_cell_mesh_t structure.

Parameters
[in]cell_flagflag related to the current cell
[in]eqbpointer to a cs_equation_builder_t structure
Returns
the flag to set for the current cell

◆ cs_equation_builder_create()

cs_equation_builder_t* cs_equation_builder_create ( const cs_equation_param_t eqp,
const cs_mesh_t mesh 
)

Allocate a new structure to handle the building of algebraic system related to a cs_equation_t structure.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]meshpointer to a cs_mesh_t structure
Returns
a pointer to a new allocated cs_equation_builder_t structure

◆ cs_equation_builder_enforce_block_dofs()

void cs_equation_builder_enforce_block_dofs ( const cs_equation_builder_t eqb,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account the enforcement of internal DoFs. Case of matrices defined by blocks. Apply an algebraic manipulation. Update members of the cs_cell_sys_t structure related to the internal enforcement.

| | | | | | | | | | | Aii | Aie | | Aii | 0 | |bi| |bi -Aid.x_enf| |---------—| --> |---------—| and |–| --> |----------—| | | | | | | | | | | | Aei | Aee | | 0 | Id | |be| | x_enf |

where x_enf is the value of the enforcement for the selected internal DoFs

Parameters
[in]eqbpointer to a cs_equation_builder_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cell-wise system

◆ cs_equation_builder_enforce_dofs()

void cs_equation_builder_enforce_dofs ( const cs_equation_builder_t eqb,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Take into account the enforcement of internal DoFs. Apply an algebraic manipulation. Update members of the cs_cell_sys_t structure related to the internal enforcement.

| | | | | | | | | | | Aii | Aie | | Aii | 0 | |bi| |bi -Aid.x_enf| |---------—| --> |---------—| and |–| --> |----------—| | | | | | | | | | | | Aei | Aee | | 0 | Id | |be| | x_enf |

where x_enf is the value of the enforcement for the selected internal DoFs

Parameters
[in]eqbpointer to a cs_equation_builder_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csysstructure storing the cell-wise system

◆ cs_equation_builder_free()

void cs_equation_builder_free ( cs_equation_builder_t **  p_builder)

Free a cs_equation_builder_t structure.

Parameters
[in,out]p_builderpointer of pointer to the cs_equation_builder_t structure to free

◆ cs_equation_builder_get_matrix()

const cs_matrix_t* cs_equation_builder_get_matrix ( const cs_equation_builder_t builder,
int  block_id 
)

Retrieve the range set structure associated to a builder structure for the block defined in block_id in the system helper structure.

Parameters
[in,out]builderpointer to a cs_equation_builder_t
[in]block_idid of the block to consider
Returns
a pointer to a cs_matrix_t structure

◆ cs_equation_builder_get_range_set()

const cs_range_set_t* cs_equation_builder_get_range_set ( const cs_equation_builder_t builder,
int  block_id 
)

Retrieve the range set structure associated to a builder structure for the block defined in block_id in the system helper structure.

Parameters
[in,out]builderpointer to a cs_equation_builder_t
[in]block_idid of the block to consider
Returns
a pointer to a cs_range_set structure

◆ cs_equation_builder_init_properties()

void cs_equation_builder_init_properties ( const cs_equation_param_t eqp,
const cs_equation_builder_t eqb,
cs_hodge_t diff_hodge,
cs_cell_builder_t cb 
)

Initialize all properties potentially useful to build the algebraic system. This function is shared across all CDO schemes. The cs_cell_builder_t structure stores property values related to the reaction term, unsteady term and grad-div term.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]eqbpointer to a cs_equation_builder_t structure
[in,out]diff_hodgepointer to the diffusion hodge structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_equation_builder_log_performance()

void cs_equation_builder_log_performance ( const cs_equation_param_t eqp,
const cs_equation_builder_t eqb 
)

Print a message in the performance output file related to the monitoring of equation.

Parameters
[in]eqppointer to a set of equation parameters
[in]eqbpointer to an equation builder structure

◆ cs_equation_builder_reset()

void cs_equation_builder_reset ( cs_equation_builder_t eqb)

Free some members of a cs_equation_builder_t structure.

Parameters
[in,out]eqbpointer to the cs_equation_builder_t structure

◆ cs_equation_builder_set_reaction_pty_cw()

bool cs_equation_builder_set_reaction_pty_cw ( const cs_equation_param_t eqp,
const cs_equation_builder_t eqb,
const cs_cell_mesh_t cm,
cs_cell_builder_t cb 
)

Initialize all reaction properties. This function is shared across all CDO schemes. The cs_cell_builder_t structure stores the computed property values. If the property is uniform, a first call to the function cs_equation_builder_init_properties has to be done before the loop on cells.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]eqbpointer to a cs_equation_builder_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
Returns
true if the reaction property is not equal to zero