8.3
general documentation
cs_enforcement.h File Reference
#include "cs_defs.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_local.h"
+ Include dependency graph for cs_enforcement.h:

Go to the source code of this file.

Data Structures

struct  cs_enforcement_param_t
 Set of data defining an enforcement. More...
 

Enumerations

enum  cs_enforcement_selection_t { CS_ENFORCEMENT_SELECTION_CELLS , CS_ENFORCEMENT_SELECTION_FACES , CS_ENFORCEMENT_SELECTION_EDGES , CS_ENFORCEMENT_SELECTION_VERTICES }
 Type of entities used to define the selection where the enforcement takes place. More...
 
enum  cs_enforcement_type_t { CS_ENFORCEMENT_BY_CONSTANT , CS_ENFORCEMENT_BY_DOF_VALUES }
 Describe the way the values to enforce are defined. More...
 

Functions

cs_enforcement_param_tcs_enforcement_param_create (cs_enforcement_selection_t sel_type, cs_enforcement_type_t type, int stride, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *values)
 Create and define a cs_enforcement_param_t structure. More...
 
void cs_enforcement_param_reset (cs_enforcement_param_t *efp, cs_enforcement_selection_t sel_type, cs_enforcement_type_t type, int stride, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *values)
 Reset an existing cs_enforcement_param_t structure. More...
 
cs_enforcement_param_tcs_enforcement_param_copy (const cs_enforcement_param_t *ref)
 Copy a cs_enforcement_param_t structure. More...
 
void cs_enforcement_param_free (cs_enforcement_param_t **p_efp)
 Free a cs_enforcement_param_t structure. More...
 
void cs_enforcement_param_log (const char *eqname, const cs_enforcement_param_t *efp)
 Log a cs_enforcement_param_t structure. More...
 
cs_real_tcs_enforcement_define_at_vertices (const cs_cdo_connect_t *connect, int n_params, cs_enforcement_param_t **efp_array)
 Build a cs_enforcement_t structure for vertex-based scheme. More...
 
cs_real_tcs_enforcement_define_at_faces (const cs_cdo_connect_t *connect, int n_params, cs_enforcement_param_t **efp_array)
 Build a cs_enforcement_t structure for face-based scheme. More...
 
cs_real_tcs_enforcement_define_at_edges (const cs_cdo_connect_t *connect, int n_params, cs_enforcement_param_t **efp_array)
 Build a cs_enforcement_t structure for edge-based scheme. More...
 
bool cs_enforcement_dofs_cw (const cs_real_t *forced_values, cs_cell_sys_t *csys, cs_real_t *cw_forced_values)
 Build the cell-wise value to enforce. More...
 

Enumeration Type Documentation

◆ cs_enforcement_selection_t

Type of entities used to define the selection where the enforcement takes place.

Two mechanisms are possible.

1) Cell selection: defined a selection of cells and then automatically built the related selection of degrees of freedom and assigned a value to each selected degrees of freedom

2) DoF selection (faces or vertices up to now): defined a selection of degrees of freedom (DoFs) and assign a values to a selection of degrees of freedom inside

Enumerator
CS_ENFORCEMENT_SELECTION_CELLS 

List of cell ids

CS_ENFORCEMENT_SELECTION_FACES 

List of face ids

CS_ENFORCEMENT_SELECTION_EDGES 

List of edge ids

CS_ENFORCEMENT_SELECTION_VERTICES 

List of vertex ids

◆ cs_enforcement_type_t

Describe the way the values to enforce are defined.

Enumerator
CS_ENFORCEMENT_BY_CONSTANT 

The same constant value for each DoF

CS_ENFORCEMENT_BY_DOF_VALUES 

A prescribed value for each DoF

Function Documentation

◆ cs_enforcement_define_at_edges()

cs_real_t * cs_enforcement_define_at_edges ( const cs_cdo_connect_t connect,
int  n_params,
cs_enforcement_param_t **  efp_array 
)

Build a cs_enforcement_t structure for edge-based scheme.

Parameters
[in]connectpointer to a cs_cdo_connect_t
[in]n_paramsnumber of enforcement parameters
[in]efp_arrayarray of parameter structures defining the enforcement
Returns
an array with the values to enforce

◆ cs_enforcement_define_at_faces()

cs_real_t * cs_enforcement_define_at_faces ( const cs_cdo_connect_t connect,
int  n_params,
cs_enforcement_param_t **  efp_array 
)

Build a cs_enforcement_t structure for face-based scheme.

Parameters
[in]connectpointer to a cs_cdo_connect_t
[in]n_paramsnumber of enforcement parameters
[in]efp_arrayarray of parameter structures defining the enforcement
Returns
an array with the values to enforce

◆ cs_enforcement_define_at_vertices()

cs_real_t * cs_enforcement_define_at_vertices ( const cs_cdo_connect_t connect,
int  n_params,
cs_enforcement_param_t **  efp_array 
)

Build a cs_enforcement_t structure for vertex-based scheme.

Parameters
[in]connectpointer to a cs_cdo_connect_t
[in]n_paramsnumber of enforcement parameters
[in]efp_arrayarray of parameter structures defining the enforcement
Returns
an array with the values to enforce

◆ cs_enforcement_dofs_cw()

bool cs_enforcement_dofs_cw ( const cs_real_t forced_values,
cs_cell_sys_t csys,
cs_real_t cw_forced_values 
)

Build the cell-wise value to enforce.

Parameters
[in]forced_valuesvalues to enforce or FLT_MAX
[in,out]csyspointer to a cs_cell_sys_t structure
[in,out]cw_forced_valueslocal values to enforce
Returns
true if at least one DoF has to be enforced

◆ cs_enforcement_param_copy()

cs_enforcement_param_t * cs_enforcement_param_copy ( const cs_enforcement_param_t ref)

Copy a cs_enforcement_param_t structure.

Parameters
[in]refreference structure to copy
Returns
a pointer to a cs_enforcement_param_t structure

◆ cs_enforcement_param_create()

cs_enforcement_param_t * cs_enforcement_param_create ( cs_enforcement_selection_t  sel_type,
cs_enforcement_type_t  type,
int  stride,
cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
const cs_real_t values 
)

Create and define a cs_enforcement_param_t structure.

Parameters
[in]sel_typetype of elements which have been selected
[in]typeway to set values for the selected elements
[in]stridenumber of values to enforce by element
[in]n_eltsnumber of selected elements locally
[in]elt_idslist of element ids
[in]valuesarray of values to enforce
Returns
a pointer to a cs_enforcement_param_t structure

◆ cs_enforcement_param_free()

void cs_enforcement_param_free ( cs_enforcement_param_t **  p_efp)

Free a cs_enforcement_param_t structure.

Parameters
[in,out]p_efpdouble pointer to the structure to free

◆ cs_enforcement_param_log()

void cs_enforcement_param_log ( const char *  eqname,
const cs_enforcement_param_t efp 
)

Log a cs_enforcement_param_t structure.

Parameters
[in]eqnamename of the related equation
[in]efppointer to a cs_enforcement_param_t structure

◆ cs_enforcement_param_reset()

void cs_enforcement_param_reset ( cs_enforcement_param_t efp,
cs_enforcement_selection_t  sel_type,
cs_enforcement_type_t  type,
int  stride,
cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
const cs_real_t values 
)

Reset an existing cs_enforcement_param_t structure.

Parameters
[in,out]efppointer to a cs_enforcement_param_t structure
[in]sel_typetype of elements which have been selected
[in]typeway to set values for the selected elements
[in]stridenumber of values to enforce by element
[in]n_eltsnumber of selected elements locally
[in]elt_idslist of element ids
[in]valuesarray of values to enforce