#include "cs_defs.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <bft_mem.h>
#include "cs_log.h"
#include "cs_parall.h"
#include "cs_equation_builder.h"
Functions | |
void | cs_equation_builder_update_default_flags (cs_eflag_t msh_flag, cs_eflag_t bdy_flag, cs_eflag_t src_flag) |
Update the default flags used to know which quantities have to be built by each cs_cell_mesh_t structure before building the linear system. More... | |
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. More... | |
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. More... | |
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. 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_apply_default_flags (cs_equation_builder_t *eqb) |
Update the flags with the default flags. These flags are used to know which quantities have to be built by each cs_cell_mesh_t structure before building the linear system. 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... | |
void cs_equation_builder_apply_default_flags | ( | cs_equation_builder_t * | eqb | ) |
Update the flags with the default flags. These flags are used to know which quantities have to be built by each cs_cell_mesh_t structure before building the linear system.
[in] | eqb | pointer to an equation builer |
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.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | mesh | pointer to a cs_mesh_t structure |
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
[in] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cell-wise system |
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
[in] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cell-wise system |
void cs_equation_builder_free | ( | cs_equation_builder_t ** | p_builder | ) |
Free a cs_equation_builder_t structure.
[in,out] | p_builder | pointer of pointer to the cs_equation_builder_t structure to free |
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.
[in,out] | builder | pointer to a cs_equation_builder_t |
[in] | block_id | id of the block to consider |
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.
[in,out] | builder | pointer to a cs_equation_builder_t |
[in] | block_id | id of the block to consider |
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.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | eqb | pointer to a cs_equation_builder_t structure |
[in,out] | diff_hodge | pointer to the diffusion hodge structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
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.
[in] | eqp | pointer to a set of equation parameters |
[in] | eqb | pointer to an equation builder structure |
void cs_equation_builder_reset | ( | cs_equation_builder_t * | eqb | ) |
Free some members of a cs_equation_builder_t structure.
[in,out] | eqb | pointer to the cs_equation_builder_t structure |
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.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | eqb | pointer to a cs_equation_builder_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
void cs_equation_builder_update_default_flags | ( | cs_eflag_t | msh_flag, |
cs_eflag_t | bdy_flag, | ||
cs_eflag_t | src_flag | ||
) |
Update the default flags used to know which quantities have to be built by each cs_cell_mesh_t structure before building the linear system.
[in] | msh_flag | flag for all cells |
[in] | bdy_flag | flag for all boundary cells |
[in] | src_flag | flag for cells with source terms |