programmer's documentation
Macros | Functions
cs_cdo_bc.c File Reference
#include "cs_defs.h"
#include <errno.h>
#include <locale.h>
#include <assert.h>
#include "bft_mem.h"
#include "bft_printf.h"
#include "cs_mesh_location.h"
#include "cs_cdo_bc.h"
Include dependency graph for cs_cdo_bc.c:

Macros

#define CS_BC_FLAG_HMG   (1 << 0) /* 1: homogeneous (i.e. 0) */
 
#define CS_BC_FLAG_CONST   (1 << 1) /* 2: constant value */
 
#define CS_BC_FLAG_DIRI   (1 << 2) /* 4: Dirichlet BC*/
 
#define CS_BC_FLAG_NEUM   (1 << 3) /* 8: Neumann BC */
 
#define CS_BC_FLAG_ROBIN   (1 << 4) /* 16: Robin BC*/
 
#define CS_BC_FLAG_SCAL   (1 << 5) /* 32: scalar-valued */
 
#define CS_BC_FLAG_VECT   (1 << 6) /* 64: vector-valued */
 
#define CS_BC_FLAG_TENS   (1 << 7) /* 128: tensor-valued */
 
#define CS_BC_FLAG_TANG   (1 << 8) /* 256: tangential component */
 
#define CS_BC_FLAG_NORM   (1 << 9) /* 512: normal component */
 
#define CS_BC_FLAG_VTX   (1 << 10) /* 1024: on vertices */
 
#define CS_BC_FLAG_EDGE   (1 << 11) /* 2048: on edges */
 
#define CS_BC_FLAG_FACE   (1 << 12) /* 4096: on faces */
 
#define CS_BC_FLAG_CELL   (1 << 13) /* 8192: on cells */
 
#define CS_BC_FLAG_PRIM   (1 << 14) /* 16384: on primal mesh */
 
#define CS_BC_FLAG_DUAL   (1 << 15) /* 32768: on dual mesh */
 

Functions

cs_cdo_bc_list_tcs_cdo_bc_list_create (cs_lnum_t n_elts, cs_lnum_t n_nhmg_elts)
 Create a cs_cdo_bc_list_t structure. More...
 
cs_cdo_bc_list_tcs_cdo_bc_list_free (cs_cdo_bc_list_t *bcl)
 Free a cs_cdo_bc_list_t structure. More...
 
cs_cdo_bc_tcs_cdo_bc_init (const cs_param_bc_t *param_bc, cs_lnum_t n_b_faces)
 Prepare the treatment of the boundary conditions. Compile the information detailed in a cs_param_bc_t structure into the structure cs_cdo_bc_t (based on border faces). This is a primilary step to be ready to set the values of the BC. More...
 
cs_cdo_bc_tcs_cdo_bc_free (cs_cdo_bc_t *face_bc)
 Free a cs_cdo_bc_t structure. More...
 
cs_cdo_bc_list_tcs_cdo_bc_vtx_dir_create (const cs_mesh_t *m, const cs_cdo_bc_t *face_bc)
 Build cs_cdo_bc_list_t structures for Dirichlet BC on primal vertices. When there is a choice between homogeneous or non homogeneous BCs, we always set the homogeneous condition for Dirichlet BCs. More...
 
void cs_cdo_bc_dirichlet_set (cs_flag_t dof_flag, const cs_time_step_t *time_step, const void *geom, const cs_param_bc_t *bc, const cs_cdo_bc_list_t *ent_dir, double *dir_val)
 Set the Dirichlet values to enforce on the corresponding entities. More...
 

Macro Definition Documentation

#define CS_BC_FLAG_CELL   (1 << 13) /* 8192: on cells */
#define CS_BC_FLAG_CONST   (1 << 1) /* 2: constant value */
#define CS_BC_FLAG_DIRI   (1 << 2) /* 4: Dirichlet BC*/
#define CS_BC_FLAG_DUAL   (1 << 15) /* 32768: on dual mesh */
#define CS_BC_FLAG_EDGE   (1 << 11) /* 2048: on edges */
#define CS_BC_FLAG_FACE   (1 << 12) /* 4096: on faces */
#define CS_BC_FLAG_HMG   (1 << 0) /* 1: homogeneous (i.e. 0) */
#define CS_BC_FLAG_NEUM   (1 << 3) /* 8: Neumann BC */
#define CS_BC_FLAG_NORM   (1 << 9) /* 512: normal component */
#define CS_BC_FLAG_PRIM   (1 << 14) /* 16384: on primal mesh */
#define CS_BC_FLAG_ROBIN   (1 << 4) /* 16: Robin BC*/
#define CS_BC_FLAG_SCAL   (1 << 5) /* 32: scalar-valued */
#define CS_BC_FLAG_TANG   (1 << 8) /* 256: tangential component */
#define CS_BC_FLAG_TENS   (1 << 7) /* 128: tensor-valued */
#define CS_BC_FLAG_VECT   (1 << 6) /* 64: vector-valued */
#define CS_BC_FLAG_VTX   (1 << 10) /* 1024: on vertices */

Function Documentation

void cs_cdo_bc_dirichlet_set ( cs_flag_t  dof_flag,
const cs_time_step_t time_step,
const void *  geom,
const cs_param_bc_t bc,
const cs_cdo_bc_list_t ent_dir,
double *  dir_val 
)

Set the Dirichlet values to enforce on the corresponding entities.

Parameters
[in]dof_flaginformation about the corresponding DoF to treat
[in]time_steppointer to a time step structure
[in]geomstructure storing geometric information
[in]bcpointer to a cs_param_bc_t structure
[in]ent_dirpointer to a cs_cdo_bc_list_t
[in,out]dir_valarray used to store Dirichlet values
cs_cdo_bc_t* cs_cdo_bc_free ( cs_cdo_bc_t face_bc)

Free a cs_cdo_bc_t structure.

Parameters
[in,out]face_bcpointer to a cs_cdo_bc_t structure
Returns
a NULL pointer
cs_cdo_bc_t* cs_cdo_bc_init ( const cs_param_bc_t param_bc,
cs_lnum_t  n_b_faces 
)

Prepare the treatment of the boundary conditions. Compile the information detailed in a cs_param_bc_t structure into the structure cs_cdo_bc_t (based on border faces). This is a primilary step to be ready to set the values of the BC.

Parameters
[in]param_bcpointer to the parameters related to BCs
[in]n_b_facesnumber of border faces
Returns
a pointer to a new allocated cs_cdo_bc_t structure
cs_cdo_bc_list_t* cs_cdo_bc_list_create ( cs_lnum_t  n_elts,
cs_lnum_t  n_nhmg_elts 
)

Create a cs_cdo_bc_list_t structure.

Parameters
[in]n_eltsnumber of entries of the list
[in]n_nhmg_eltsnumber of elements attached to a homogeneous BC
Returns
a new allocated pointer to a cs_cdo_bc_list_t structure
cs_cdo_bc_list_t* cs_cdo_bc_list_free ( cs_cdo_bc_list_t bcl)

Free a cs_cdo_bc_list_t structure.

Parameters
[in]bclpointer to the cs_cdo_bc_list_t structure to free
Returns
a NULL pointer
cs_cdo_bc_list_t* cs_cdo_bc_vtx_dir_create ( const cs_mesh_t m,
const cs_cdo_bc_t face_bc 
)

Build cs_cdo_bc_list_t structures for Dirichlet BC on primal vertices. When there is a choice between homogeneous or non homogeneous BCs, we always set the homogeneous condition for Dirichlet BCs.

Parameters
[in]mpointer to a cs_mesh_t structure
[in]face_bcpointer to a cs_cdo_bc_t structure
Returns
a pointer to a new allocated cs_cdo_bc_list_t structure