programmer's documentation
Macros | Functions
cs_equation_bc.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <string.h>
#include <bft_mem.h>
#include "cs_boundary_zone.h"
#include "cs_xdef.h"
#include "cs_equation_bc.h"
Include dependency graph for cs_equation_bc.c:

Macros

#define CS_EQUATION_BC_DBG   0
 

Functions

static void _assign_vb_dirichlet_values (int dim, int n_vf, const cs_lnum_t *lst, const cs_real_t *eval, _Bool is_constant, cs_real_t *vvals, cs_flag_t flag[], int counter[])
 Set the Dirichlet BC values to the face vertices. Case of vertex-based schemes. More...
 
void cs_equation_init_boundary_flux_from_bc (cs_real_t t_eval, const cs_cdo_quantities_t *cdoq, const cs_equation_param_t *eqp, cs_real_t *values)
 Set the values for the normal boundary flux stemming from the Neumann boundary conditions (zero is left where a Dirichlet is set. This can be updated later on) More...
 
void cs_equation_vb_set_cell_bc (const cs_cell_mesh_t *cm, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_equation_param_t *eqp, const cs_real_t dir_values[], const short int neu_tags[], cs_real_t t_eval, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
 Set the BC into a cellwise view of the current system. Case of vertex-based schemes. More...
 
void cs_equation_fb_set_cell_bc (const cs_cell_mesh_t *cm, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_equation_param_t *eqp, const cs_real_t dir_values[], const short int neu_tags[], cs_real_t t_eval, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
 Set the BC into a cellwise view of the current system. Case of Face-based schemes. More...
 
void cs_equation_compute_dirichlet_vb (const cs_mesh_t *mesh, const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_equation_param_t *eqp, const cs_cdo_bc_t *face_bc, cs_real_t t_eval, cs_cell_builder_t *cb, cs_real_t *values)
 Compute the values of the Dirichlet BCs when DoFs are attached to vertices. More...
 
void cs_equation_compute_dirichlet_fb (const cs_mesh_t *mesh, const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_equation_param_t *eqp, const cs_cdo_bc_t *face_bc, cs_real_t t_eval, cs_cell_builder_t *cb, cs_real_t *values)
 Compute the values of the Dirichlet BCs when DoFs are attached to CDO face-based schemes. More...
 
cs_flag_tcs_equation_set_vertex_bc_flag (const cs_cdo_connect_t *connect, const cs_cdo_bc_t *face_bc)
 Define an array of flags for each vertex collecting the flags of associated boundary faces. More...
 
short int * cs_equation_tag_neumann_face (const cs_cdo_quantities_t *quant, const cs_equation_param_t *eqp)
 Tag each face related to a Neumann BC with its definition id. Default tag is -1 (not a Neumann face) More...
 
void cs_equation_compute_neumann_sv (short int def_id, short int f, const cs_cdo_quantities_t *quant, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const short int *f2v_ids, cs_real_t t_eval, double *neu_values)
 Compute the values of the Neumann BCs when DoFs are scalar-valued and attached to vertices. More...
 
void cs_equation_compute_neumann_fb (short int def_id, short int f, const cs_cdo_quantities_t *quant, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_real_t t_eval, double *neu_values)
 Compute the values of the Neumann BCs when DoFs are attached to faces. More...
 

Macro Definition Documentation

◆ CS_EQUATION_BC_DBG

#define CS_EQUATION_BC_DBG   0

Function Documentation

◆ _assign_vb_dirichlet_values()

static void _assign_vb_dirichlet_values ( int  dim,
int  n_vf,
const cs_lnum_t lst,
const cs_real_t eval,
_Bool  is_constant,
cs_real_t vvals,
cs_flag_t  flag[],
int  counter[] 
)
inlinestatic

Set the Dirichlet BC values to the face vertices. Case of vertex-based schemes.

Parameters
[in]dimnumber of values to assign to each vertex
[in]n_vfnumber of vertices in a face
[in]lstlist of vertex numbering
[in]evalresult of the evaluation to set
[in]is_constantsame value for all vertices ?
[in,out]vvalsvertex values to update
[in,out]flagflag to update
[in,out]countercounter to update

◆ cs_equation_compute_dirichlet_fb()

void cs_equation_compute_dirichlet_fb ( const cs_mesh_t mesh,
const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
const cs_equation_param_t eqp,
const cs_cdo_bc_t face_bc,
cs_real_t  t_eval,
cs_cell_builder_t cb,
cs_real_t values 
)

Compute the values of the Dirichlet BCs when DoFs are attached to CDO face-based schemes.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]connectpointer to a cs_cdo_connect_t struct.
[in]eqppointer to a cs_equation_param_t
[in]face_bcpointer to a cs_cdo_bc_t structure
[in]t_evaltime at which one evaluates the boundary cond.
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]valuespointer to the array of values to set

◆ cs_equation_compute_dirichlet_vb()

void cs_equation_compute_dirichlet_vb ( const cs_mesh_t mesh,
const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
const cs_equation_param_t eqp,
const cs_cdo_bc_t face_bc,
cs_real_t  t_eval,
cs_cell_builder_t cb,
cs_real_t values 
)

Compute the values of the Dirichlet BCs when DoFs are attached to vertices.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]connectpointer to a cs_cdo_connect_t struct.
[in]eqppointer to a cs_equation_param_t
[in]face_bcpointer to a cs_cdo_bc_t structure
[in]t_evaltime at which one performs the evaluation
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]valuespointer to the array of values to set

◆ cs_equation_compute_neumann_fb()

void cs_equation_compute_neumann_fb ( short int  def_id,
short int  f,
const cs_cdo_quantities_t quant,
const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_real_t  t_eval,
double *  neu_values 
)

Compute the values of the Neumann BCs when DoFs are attached to faces.

Parameters
[in]def_idid of the definition for setting the Neumann BC
[in]flocal face number in the cs_cell_mesh_t
[in]quantpointer to a cs_cdo_quantities_t structure
[in]eqppointer to a cs_equation_param_t
[in]cmpointer to a cs_cell_mesh_t structure
[in]t_evaltime at which one performs the evaluation
[in,out]neu_valuesarray storing Neumann values to use

◆ cs_equation_compute_neumann_sv()

void cs_equation_compute_neumann_sv ( short int  def_id,
short int  f,
const cs_cdo_quantities_t quant,
const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const short int *  f2v_ids,
cs_real_t  t_eval,
double *  neu_values 
)

Compute the values of the Neumann BCs when DoFs are scalar-valued and attached to vertices.

Parameters
[in]def_idid of the definition for setting the Neumann BC
[in]flocal face number in the cs_cell_mesh_t
[in]quantpointer to a cs_cdo_quantities_t structure
[in]eqppointer to a cs_equation_param_t
[in]cmpointer to a cs_cell_mesh_t structure
[in]f2v_idsvertex ids of the face in the cell numbering
[in]t_evaltime at which one performs the evaluation
[in,out]neu_valuesarray storing the Neumann values

◆ cs_equation_fb_set_cell_bc()

void cs_equation_fb_set_cell_bc ( const cs_cell_mesh_t cm,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const cs_equation_param_t eqp,
const cs_real_t  dir_values[],
const short int  neu_tags[],
cs_real_t  t_eval,
cs_cell_sys_t csys,
cs_cell_builder_t cb 
)

Set the BC into a cellwise view of the current system. Case of Face-based schemes.

Parameters
[in]cmpointer to a cellwise view of the mesh
[in]connectpointer to a cs_cdo_connect_t struct.
[in]quantpointer to a cs_cdo_quantities_t structure
[in]eqppointer to a cs_equation_param_t structure
[in]dir_valuesDirichlet values associated to each vertex
[in]neu_tagsdefinition id related to each Neumann face
[in]t_evaltime at which one performs the evaluation
[in,out]csyspointer to a cellwise view of the system
[in,out]cbpointer to a cellwise builder

◆ cs_equation_init_boundary_flux_from_bc()

void cs_equation_init_boundary_flux_from_bc ( cs_real_t  t_eval,
const cs_cdo_quantities_t cdoq,
const cs_equation_param_t eqp,
cs_real_t values 
)

Set the values for the normal boundary flux stemming from the Neumann boundary conditions (zero is left where a Dirichlet is set. This can be updated later on)

Set the values for the normal boundary flux stemming from the Neumann boundary conditions (zero is left where a Dirichlet is set. This can be updated later one)

Parameters
[in]t_evaltime at which one performs the evaluation
[in]cdoqpointer to a cs_cdo_quantities_t structure
[in]eqppointer to a cs_equation_param_t structure
[in,out]valuespointer to the array of values to set

◆ cs_equation_set_vertex_bc_flag()

cs_flag_t* cs_equation_set_vertex_bc_flag ( const cs_cdo_connect_t connect,
const cs_cdo_bc_t face_bc 
)

Define an array of flags for each vertex collecting the flags of associated boundary faces.

Parameters
[in]connectpointer to a cs_cdo_connect_t struct.
[in]face_bcpointer to a structure collecting boundary conditions applied to faces
Returns
an array collecting bc flags

◆ cs_equation_tag_neumann_face()

short int* cs_equation_tag_neumann_face ( const cs_cdo_quantities_t quant,
const cs_equation_param_t eqp 
)

Tag each face related to a Neumann BC with its definition id. Default tag is -1 (not a Neumann face)

Parameters
[in]quantpointer to a cs_cdo_quantities_t structure
[in]eqppointer to a cs_equation_param_t
Returns
an array with prescribed tags

◆ cs_equation_vb_set_cell_bc()

void cs_equation_vb_set_cell_bc ( const cs_cell_mesh_t cm,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const cs_equation_param_t eqp,
const cs_real_t  dir_values[],
const short int  neu_tags[],
cs_real_t  t_eval,
cs_cell_sys_t csys,
cs_cell_builder_t cb 
)

Set the BC into a cellwise view of the current system. Case of vertex-based schemes.

Parameters
[in]cmpointer to a cellwise view of the mesh
[in]connectpointer to a cs_cdo_connect_t struct.
[in]quantpointer to a cs_cdo_quantities_t structure
[in]eqppointer to a cs_equation_param_t structure
[in]dir_valuesDirichlet values associated to each vertex
[in]neu_tagsdefinition id related to each Neumann face
[in]t_evaltime at which one performs the evaluation
[in,out]csyspointer to a cellwise view of the system
[in,out]cbpointer to a cellwise builder