My Project
programmer's documentation
|
#include "cs_cdo_bc.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_local.h"
#include "cs_cdo_quantities.h"
#include "cs_equation_param.h"
#include "cs_flag.h"
#include "cs_matrix.h"
#include "cs_time_step.h"
#include "cs_timer.h"
#include "cs_source_term.h"
Go to the source code of this file.
Data Structures | |
struct | cs_equation_builder_t |
Store common elements used when building an algebraic system related to an equation. More... | |
struct | cs_equation_balance_t |
Functions | |
static cs_flag_t | cs_equation_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... | |
static void | cs_equation_set_diffusion_property (const cs_equation_param_t *eqp, const cs_lnum_t c_id, const cs_real_t t_eval, const cs_flag_t c_flag, cs_cell_builder_t *cb) |
Set the diffusion property inside a cell and its related quantities. More... | |
static void | cs_equation_set_diffusion_property_cw (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_real_t t_eval, const cs_flag_t c_flag, cs_cell_builder_t *cb) |
Set the diffusion property inside a cell and its related quantities. Cellwise version using a cs_cell_mesh_t structure. More... | |
void | cs_equation_common_init (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, cs_flag_t vb_flag, cs_flag_t vcb_flag, cs_flag_t fb_flag, cs_flag_t hho_flag) |
Allocate a pointer to a buffer of size at least the n_cells for managing temporary usage of memory when dealing with equations The size of the temporary buffer can be bigger according to the numerical settings Set also shared pointers from the main domain members. More... | |
void | cs_equation_common_finalize (void) |
Allocate a pointer to a buffer of size at least the 2*n_cells for managing temporary usage of memory when dealing with equations Call specific structure allocation related to a numerical scheme according to the scheme flag The size of the temporary buffer can be bigger according to the numerical settings. More... | |
cs_equation_builder_t * | cs_equation_init_builder (const cs_equation_param_t *eqp, const cs_mesh_t *mesh) |
Allocate a new structure to handle the building of algebraic system related to an cs_equation_t structure. More... | |
void | cs_equation_free_builder (cs_equation_builder_t **p_builder) |
Free a cs_equation_builder_t structure. More... | |
cs_gnum_t | cs_equation_prepare_system (int stride, cs_lnum_t x_size, const cs_matrix_t *matrix, cs_range_set_t *rset, cs_real_t *x, cs_real_t *b) |
Prepare a linear system and synchronize buffers to handle parallelism. Transfer a mesh-based description of arrays x0 and rhs into an algebraic description for the linear system in x and b. More... | |
void | cs_equation_write_monitoring (const char *eqname, const cs_equation_builder_t *eqb) |
Print a message in the performance output file related to the monitoring of equation. More... | |
void | cs_equation_init_properties (const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const cs_real_t t_eval, cs_cell_builder_t *cb) |
Initialize all properties for an algebraic system. More... | |
void | cs_equation_init_properties_cw (const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const cs_real_t t_eval, const cs_flag_t cell_flag, const cs_cell_mesh_t *cm, cs_cell_builder_t *cb) |
Initialize all properties for a given cell when building the algebraic system. If the property is uniform, a first call has to be done before the loop on cells Call cs_eqution_init_properties for instance. More... | |
void | cs_equation_enforced_internal_dofs (const cs_equation_param_t *eqp, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Take into account the enforcement of internal DoFs. Apply an algebraic manipulation. More... | |
void | cs_equation_enforced_internal_block_dofs (const cs_equation_param_t *eqp, 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. More... | |
cs_real_t * | cs_equation_get_tmpbuf (void) |
Retrieve a pointer to a buffer of size at least the 2*n_cells The size of the temporary buffer can be bigger according to the numerical settings. More... | |
size_t | cs_equation_get_tmpbuf_size (void) |
Get the allocation size of the temporary buffer. More... | |
cs_equation_balance_t * | cs_equation_balance_create (cs_flag_t location, cs_lnum_t size) |
Allocate a cs_equation_balance_t structure. More... | |
void | cs_equation_balance_reset (cs_equation_balance_t *b) |
Reset a cs_equation_balance_t structure. More... | |
void | cs_equation_balance_sync (const cs_cdo_connect_t *connect, cs_equation_balance_t *b) |
Synchronize balance terms if this is a parallel computation. More... | |
void | cs_equation_balance_destroy (cs_equation_balance_t **p_balance) |
Free a cs_equation_balance_t structure. More... | |
cs_equation_balance_t* cs_equation_balance_create | ( | cs_flag_t | location, |
cs_lnum_t | size | ||
) |
Allocate a cs_equation_balance_t structure.
[in] | location | where the balance is performed |
[in] | size | size of arrays in the structure |
void cs_equation_balance_destroy | ( | cs_equation_balance_t ** | p_balance | ) |
Free a cs_equation_balance_t structure.
[in,out] | p_balance | pointer to the pointer to free |
void cs_equation_balance_reset | ( | cs_equation_balance_t * | b | ) |
Reset a cs_equation_balance_t structure.
[in,out] | b | pointer to a cs_equation_balance_t to reset |
void cs_equation_balance_sync | ( | const cs_cdo_connect_t * | connect, |
cs_equation_balance_t * | b | ||
) |
Synchronize balance terms if this is a parallel computation.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in,out] | b | pointer to a cs_equation_balance_t to rsync |
|
inlinestatic |
Retrieve the flag to give for building a cs_cell_mesh_t structure.
[in] | cell_flag | flag related to the current cell |
[in] | eqb | pointer to a cs_equation_builder_t structure |
void cs_equation_common_finalize | ( | void | ) |
Allocate a pointer to a buffer of size at least the 2*n_cells for managing temporary usage of memory when dealing with equations Call specific structure allocation related to a numerical scheme according to the scheme flag The size of the temporary buffer can be bigger according to the numerical settings.
Allocate a pointer to a buffer of size at least the 2*n_cells for managing temporary usage of memory when dealing with equations Call specific structure allocation related to a numerical scheme according to the scheme flag The size of the temporary buffer can be bigger according to the numerical settings.
void cs_equation_common_init | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | time_step, | ||
cs_flag_t | vb_flag, | ||
cs_flag_t | vcb_flag, | ||
cs_flag_t | fb_flag, | ||
cs_flag_t | hho_flag | ||
) |
Allocate a pointer to a buffer of size at least the n_cells for managing temporary usage of memory when dealing with equations The size of the temporary buffer can be bigger according to the numerical settings Set also shared pointers from the main domain members.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to additional mesh quantities struct. |
[in] | time_step | pointer to a time step structure |
[in] | vb_flag | metadata for Vb schemes |
[in] | vcb_flag | metadata for V+C schemes |
[in] | fb_flag | metadata for Fb schemes |
[in] | hho_flag | metadata for HHO schemes |
void cs_equation_enforced_internal_block_dofs | ( | const cs_equation_param_t * | eqp, |
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.
| | | | | | | | | | | 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] | eqp | pointer to a cs_equation_param_t struct. |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cell-wise system |
void cs_equation_enforced_internal_dofs | ( | const cs_equation_param_t * | eqp, |
cs_cell_builder_t * | cb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account the enforcement of internal DoFs. Apply an algebraic manipulation.
| | | | | | | | | | | 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] | eqp | pointer to a cs_equation_param_t struct. |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cell-wise system |
void cs_equation_free_builder | ( | 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 |
cs_real_t* cs_equation_get_tmpbuf | ( | void | ) |
Retrieve a pointer to a buffer of size at least the 2*n_cells The size of the temporary buffer can be bigger according to the numerical settings.
size_t cs_equation_get_tmpbuf_size | ( | void | ) |
Get the allocation size of the temporary buffer.
cs_equation_builder_t* cs_equation_init_builder | ( | const cs_equation_param_t * | eqp, |
const cs_mesh_t * | mesh | ||
) |
Allocate a new structure to handle the building of algebraic system related to an cs_equation_t structure.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | mesh | pointer to a cs_mesh_t structure |
Allocate a new structure to handle the building of algebraic system related to an 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_init_properties | ( | const cs_equation_param_t * | eqp, |
const cs_equation_builder_t * | eqb, | ||
cs_real_t | t_eval, | ||
cs_cell_builder_t * | cb | ||
) |
Initialize all properties for an algebraic system.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | eqb | pointer to a cs_equation_builder_t structure |
[in] | t_eval | time at which one performs the evaluation |
[in,out] | cb | pointer to a cs_cell_builder_t structure (diffusion property is stored inside) |
void cs_equation_init_properties_cw | ( | const cs_equation_param_t * | eqp, |
const cs_equation_builder_t * | eqb, | ||
const cs_real_t | t_eval, | ||
const cs_flag_t | cell_flag, | ||
const cs_cell_mesh_t * | cm, | ||
cs_cell_builder_t * | cb | ||
) |
Initialize all properties for a given cell when building the algebraic system. If the property is uniform, a first call has to be done before the loop on cells Call cs_eqution_init_properties for instance.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | eqb | pointer to a cs_equation_builder_t structure |
[in] | t_eval | time at which one performs the evaluation |
[in] | cell_flag | flag related to the current cell |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure (diffusion property is stored inside) |
cs_gnum_t cs_equation_prepare_system | ( | int | stride, |
cs_lnum_t | x_size, | ||
const cs_matrix_t * | matrix, | ||
cs_range_set_t * | rset, | ||
cs_real_t * | x, | ||
cs_real_t * | b | ||
) |
Prepare a linear system and synchronize buffers to handle parallelism. Transfer a mesh-based description of arrays x0 and rhs into an algebraic description for the linear system in x and b.
[in] | stride | stride to apply to the range set operations |
[in] | x_size | size of the vector unknows (scatter view) |
[in] | matrix | pointer to a cs_matrix_t structure |
[in] | rset | pointer to a range set structure |
[in,out] | x | array of unknows (in: initial guess) |
[in,out] | b | right-hand side |
|
inlinestatic |
Set the diffusion property inside a cell and its related quantities.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | c_id | id of the cell to deal with |
[in] | t_eval | time at which one performs the evaluation |
[in] | c_flag | flag related to this cell |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
|
inlinestatic |
Set the diffusion property inside a cell and its related quantities. Cellwise version using a cs_cell_mesh_t structure.
[in] | eqp | pointer to a cs_equation_param_t structure |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | t_eval | time at which one performs the evaluation |
[in] | c_flag | flag related to this cell |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
void cs_equation_write_monitoring | ( | const char * | eqname, |
const cs_equation_builder_t * | eqb | ||
) |
Print a message in the performance output file related to the monitoring of equation.
[in] | eqname | pointer to the name of the current equation |
[in] | eqb | pointer to a cs_equation_builder_t structure |