programmer's documentation
Data Structures | Functions
cs_equation_common.h File Reference
#include "cs_cdo_bc.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_quantities.h"
#include "cs_cdo_time.h"
#include "cs_domain.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"
Include dependency graph for cs_equation_common.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...
 

Functions

static cs_flag_t cs_equation_get_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...
 
void cs_equation_common_allocate (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, const cs_domain_cdo_context_t *cc)
 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 the scheme flag 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_free (const cs_domain_cdo_context_t *cc)
 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 the scheme flag The size of the temporary buffer can be bigger according to the numerical settings. More...
 
cs_equation_builder_tcs_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...
 
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, double *tpty_val, double *rpty_vals, cs_cell_builder_t *cb)
 Initialize all properties for an algebraic system. More...
 
void cs_equation_set_diffusion_property (const cs_equation_param_t *eqp, cs_lnum_t c_id, cs_flag_t c_flag, cs_cell_builder_t *cb)
 Set the diffusion property inside a cell and its related quantities. More...
 
void cs_equation_set_diffusion_property_cw (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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_assemble_v (const cs_cell_sys_t *csys, const cs_range_set_t *rset, const cs_equation_param_t *eqp, cs_real_t *rhs, cs_real_t *sources, cs_matrix_assembler_values_t *mav)
 Assemble a cellwise system related to cell vertices into the global algebraic system. More...
 
void cs_equation_assemble_f (const cs_cell_sys_t *csys, const cs_range_set_t *rset, const cs_equation_param_t *eqp, int n_face_dofs, cs_real_t *rhs, cs_matrix_assembler_values_t *mav)
 Assemble a cellwise system related to cell faces into the global algebraic system. More...
 
const cs_adjacency_tcs_equation_get_v2v_index (void)
 Get the connectivity vertex->vertices for the local rank. More...
 
const cs_adjacency_tcs_equation_get_f2f_index (void)
 Get the connectivity face->faces for the local rank. More...
 
cs_real_tcs_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...
 

Function Documentation

◆ cs_equation_assemble_f()

void cs_equation_assemble_f ( const cs_cell_sys_t csys,
const cs_range_set_t rset,
const cs_equation_param_t eqp,
int  n_face_dofs,
cs_real_t rhs,
cs_matrix_assembler_values_t mav 
)

Assemble a cellwise system related to cell faces into the global algebraic system.

Parameters
[in]csyscellwise view of the algebraic system
[in]rsetpointer to a cs_range_set_t structure
[in]eqppointer to a cs_equation_param_t structure
[in]n_face_dofsnumber of DoFs for each face
[in,out]rhsarray storing the right-hand side
[in,out]mavpointer to a matrix assembler structure

◆ cs_equation_assemble_v()

void cs_equation_assemble_v ( const cs_cell_sys_t csys,
const cs_range_set_t rset,
const cs_equation_param_t eqp,
cs_real_t rhs,
cs_real_t sources,
cs_matrix_assembler_values_t mav 
)

Assemble a cellwise system related to cell vertices into the global algebraic system.

Parameters
[in]csyscellwise view of the algebraic system
[in]rsetpointer to a cs_range_set_t structure on vertices
[in]eqppointer to a cs_equation_param_t structure
[in,out]rhsarray storing the right-hand side
[in,out]sourcesarray storing the contribution of source terms
[in,out]mavpointer to a matrix assembler structure

◆ cs_equation_common_allocate()

void cs_equation_common_allocate ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const cs_time_step_t time_step,
const cs_domain_cdo_context_t cc 
)

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 the scheme flag The size of the temporary buffer can be bigger according to the numerical settings Set also shared pointers from the main domain members.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to additional mesh quantities struct.
[in]time_steppointer to a time step structure
[in]ccpointer to a cs_domain_cdo_context_t struct.

◆ cs_equation_common_free()

void cs_equation_common_free ( const cs_domain_cdo_context_t cc)

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 the scheme flag The size of the temporary buffer can be bigger according to the numerical settings.

Parameters
[in]ccpointer to a structure storing CDO/HHO metadata

◆ cs_equation_free_builder()

void cs_equation_free_builder ( 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_get_cell_mesh_flag()

static cs_flag_t cs_equation_get_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_get_f2f_index()

const cs_adjacency_t* cs_equation_get_f2f_index ( void  )

Get the connectivity face->faces for the local rank.

Returns
a pointer to a cs_adjacency_t structure

◆ cs_equation_get_tmpbuf()

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.

Returns
a pointer to an array of double

◆ cs_equation_get_tmpbuf_size()

size_t cs_equation_get_tmpbuf_size ( void  )

Get the allocation size of the temporary buffer.

Returns
the size of the temporary buffer

◆ cs_equation_get_v2v_index()

const cs_adjacency_t* cs_equation_get_v2v_index ( void  )

Get the connectivity vertex->vertices for the local rank.

Returns
a pointer to a cs_adjacency_t structure

◆ cs_equation_init_builder()

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.

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

Allocate a new structure to handle the building of algebraic system related to an 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_init_properties()

void cs_equation_init_properties ( const cs_equation_param_t eqp,
const cs_equation_builder_t eqb,
double *  tpty_val,
double *  rpty_vals,
cs_cell_builder_t cb 
)

Initialize all properties for an algebraic system.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]eqbpointer to a cs_equation_builder_t structure
[in,out]tpty_valpointer to the value for the time property
[in,out]rpty_valspointer to the values for reaction properties
[in,out]cbpointer to a cs_cell_builder_t structure (diffusion property is stored inside)

◆ cs_equation_set_diffusion_property()

void cs_equation_set_diffusion_property ( const cs_equation_param_t eqp,
cs_lnum_t  c_id,
cs_flag_t  c_flag,
cs_cell_builder_t cb 
)

Set the diffusion property inside a cell and its related quantities.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]c_idid of the cell to deal with
[in]c_flagflag related to this cell
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_equation_set_diffusion_property_cw()

void cs_equation_set_diffusion_property_cw ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
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.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]c_flagflag related to this cell
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_equation_write_monitoring()

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.

Parameters
[in]eqnamepointer to the name of the current equation
[in]eqbpointer to a cs_equation_builder_t structure