8.3
general documentation
cs_evaluate.h File Reference
#include "cs_base.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_local.h"
#include "cs_cdo_quantities.h"
#include "cs_xdef.h"
+ Include dependency graph for cs_evaluate.h:

Go to the source code of this file.

Functions

void cs_evaluate_init_sharing (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_mesh_t *mesh)
 Set shared pointers to main domain members. More...
 
void cs_evaluate_array_reduction (int dim, cs_lnum_t n_x, const cs_real_t *array, const cs_real_t *w_x, cs_real_t *min, cs_real_t *max, cs_real_t *wsum, cs_real_t *asum, cs_real_t *ssum)
 Compute reduced quantities for an array of size equal to dim * n_x The computed quantities are synchronized in parallel. More...
 
void cs_evaluate_scatter_array_reduction (int dim, cs_lnum_t n_x, const cs_real_t *array, const cs_adjacency_t *c2x, const cs_real_t *w_x, cs_real_t *min, cs_real_t *max, cs_real_t *wsum, cs_real_t *asum, cs_real_t *ssum)
 Compute reduced quantities for an array attached to either vertex, face or edge DoFs The weight to apply to each entity x is scanned using the adjacency structure. array size is equal to dim * n_x The computed quantities are synchronized in parallel. More...
 
void cs_evaluate_density_by_value (cs_flag_t dof_flag, const cs_xdef_t *def, cs_real_t retval[])
 Evaluate the quantity defined by a value in the case of a density field for all the degrees of freedom Accessor to the value is by unit of volume and the return values are integrated over a volume. More...
 
void cs_evaluate_density_by_analytic (cs_flag_t dof_flag, const cs_xdef_t *def, cs_real_t time_eval, cs_real_t retval[])
 Compute the value related to each DoF in the case of a density field The value defined by the analytic function is by unity of volume and the return values are integrated over a volume. More...
 
void cs_evaluate_potential_at_vertices_by_value (const cs_xdef_t *def, const cs_lnum_t n_v_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate a potential field at vertices from a definition by a constant value. More...
 
void cs_evaluate_potential_at_vertices_by_analytic (const cs_xdef_t *def, const cs_real_t time_eval, const cs_lnum_t n_v_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate the quantity attached to a potential field at vertices when the definition relies on an analytic expression. More...
 
void cs_evaluate_potential_at_vertices_by_dof_func (const cs_xdef_t *def, const cs_lnum_t n_v_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate the quantity attached to a potential field at vertices when the definition relies on a DoF function (Degrees of freedom) More...
 
void cs_evaluate_potential_at_faces_by_value (const cs_xdef_t *def, const cs_lnum_t n_f_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate a potential field at face centers from a definition by a constant value. More...
 
void cs_evaluate_potential_at_faces_by_analytic (const cs_xdef_t *def, const cs_real_t time_eval, const cs_lnum_t n_f_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate the quantity attached to a potential field at face centers when the definition relies on an analytic expression. More...
 
void cs_evaluate_potential_at_cells_by_array (const cs_xdef_t *def, cs_real_t retval[])
 Evaluate a potential field at cell centers from a definition by array. More...
 
void cs_evaluate_potential_at_cells_by_value (const cs_xdef_t *def, cs_real_t retval[])
 Evaluate a potential field at cell centers from a definition by value. More...
 
void cs_evaluate_potential_at_cells_by_analytic (const cs_xdef_t *def, const cs_real_t time_eval, cs_real_t retval[])
 Evaluate the quantity attached to a potential field at cell centers when the definition relies on an analytic expression. More...
 
void cs_evaluate_potential_at_cells_by_dof_func (const cs_xdef_t *def, cs_real_t retval[])
 Evaluate the quantity attached to a potential field at cells when the definition relies on a DoF function (Degrees of freedom) More...
 
void cs_evaluate_potential_by_qov (cs_flag_t dof_flag, const cs_xdef_t *def, cs_real_t vvals[], cs_real_t wvals[])
 Define a value to each DoF in the case of a potential field in order to put a given quantity inside the volume associated to the zone related to the given definition wvals may be null. More...
 
void cs_evaluate_circulation_along_edges_by_value (const cs_xdef_t *def, const cs_lnum_t n_e_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate the circulation along a selection of (primal) edges. Circulation is defined thanks to a constant vector field (by value) More...
 
void cs_evaluate_circulation_along_edges_by_array (const cs_xdef_t *def, const cs_lnum_t n_e_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate the circulation along a selection of (primal) edges. Circulation is defined thanks to an array. More...
 
void cs_evaluate_circulation_along_edges_by_analytic (const cs_xdef_t *def, const cs_real_t time_eval, const cs_lnum_t n_e_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate the circulation along a selection of (primal) edges. Circulation is defined by an analytical function. More...
 
void cs_evaluate_average_on_faces_by_value (const cs_xdef_t *def, const cs_lnum_t n_f_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate the average of a function on the faces. More...
 
void cs_evaluate_average_on_faces_by_analytic (const cs_xdef_t *def, const cs_real_t time_eval, const cs_lnum_t n_f_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate the average of a function on the faces. Warning: retval has to be initialize before calling this function. More...
 
void cs_evaluate_average_on_faces (const cs_xdef_t *def, cs_real_t time_eval, const cs_lnum_t n_f_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
 Evaluate the average value on faces following the given definition. More...
 
void cs_evaluate_average_on_cells_by_value (const cs_xdef_t *def, cs_real_t retval[])
 Evaluate the average of a function on the cells. More...
 
void cs_evaluate_average_on_cells_by_array (const cs_xdef_t *def, cs_real_t retval[])
 Evaluate the average of a function on the cells. More...
 
void cs_evaluate_average_on_cells_by_analytic (const cs_xdef_t *def, cs_real_t time_eval, cs_real_t retval[])
 Evaluate the average of a function on the cells Warning: retval has to be initialize before calling this function. More...
 
void cs_evaluate_average_on_cells (const cs_xdef_t *def, cs_real_t time_eval, cs_real_t retval[])
 Evaluate the average value on cells following the given definition The cells associated to this definition (through the related zone) are all considered. More...
 
cs_real_t cs_evaluate_scal_domain_integral_by_array (cs_flag_t array_loc, const cs_real_t *array_val)
 Evaluate the integral over the full computational domain of a quantity defined by an array. The parallel sum reduction is performed inside this function. More...
 

Function Documentation

◆ cs_evaluate_array_reduction()

void cs_evaluate_array_reduction ( int  dim,
cs_lnum_t  n_x,
const cs_real_t array,
const cs_real_t w_x,
cs_real_t min,
cs_real_t max,
cs_real_t wsum,
cs_real_t asum,
cs_real_t ssum 
)

Compute reduced quantities for an array of size equal to dim * n_x The computed quantities are synchronized in parallel.

Parameters
[in]dimlocal array dimension (max: 3)
[in]n_xnumber of elements
[in]arrayarray to analyze
[in]w_xweight to apply (may be set to null)
[in,out]minresulting min array (size: dim, or 4 if dim = 3)
[in,out]maxresulting max array (size: dim, or 4 if dim = 3)
[in,out]wsum(weighted) sum array (size: dim, or 4 if dim = 3)
[in,out]asum(weighted) sum of absolute values (same size as wsum)
[in,out]ssum(weighted) sum of squared values (same size as wsum)
[in]dimlocal array dimension (max: 3)
[in]n_xnumber of elements
[in]arrayarray to analyze
[in]w_xweight to apply (may be set to nullptr)
[in,out]minresulting min array (size: dim, or 4 if dim = 3)
[in,out]maxresulting max array (size: dim, or 4 if dim = 3)
[in,out]wsum(weighted) sum array (size: dim, or 4 if dim = 3)
[in,out]asum(weighted) sum of absolute values (same size as wsum)
[in,out]ssum(weighted) sum of squared values (same size as wsum)

◆ cs_evaluate_average_on_cells()

void cs_evaluate_average_on_cells ( const cs_xdef_t def,
cs_real_t  time_eval,
cs_real_t  retval[] 
)

Evaluate the average value on cells following the given definition The cells associated to this definition (through the related zone) are all considered.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]time_evalphysical time at which one evaluates the term
[in,out]retvalpointer to the computed values

◆ cs_evaluate_average_on_cells_by_analytic()

void cs_evaluate_average_on_cells_by_analytic ( const cs_xdef_t def,
cs_real_t  time_eval,
cs_real_t  retval[] 
)

Evaluate the average of a function on the cells Warning: retval has to be initialize before calling this function.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]time_evalphysical time at which one evaluates the term
[in,out]retvalpointer to the computed values

Evaluate the average of a function on the cells Warning: retval has to be initialize before calling this function.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]time_evalphysical time at which one evaluates the term
[in,out]retvalpointer to the computed values

◆ cs_evaluate_average_on_cells_by_array()

void cs_evaluate_average_on_cells_by_array ( const cs_xdef_t def,
cs_real_t  retval[] 
)

Evaluate the average of a function on the cells.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in,out]retvalpointer to the computed values

◆ cs_evaluate_average_on_cells_by_value()

void cs_evaluate_average_on_cells_by_value ( const cs_xdef_t def,
cs_real_t  retval[] 
)

Evaluate the average of a function on the cells.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in,out]retvalpointer to the computed values

◆ cs_evaluate_average_on_faces()

void cs_evaluate_average_on_faces ( const cs_xdef_t def,
cs_real_t  time_eval,
const cs_lnum_t  n_f_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate the average value on faces following the given definition.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]time_evalphysical time at which one evaluates the term
[in]n_f_selectednumber of selected faces
[in]selected_lstlist of selected faces
[in,out]retvalpointer to the computed values

◆ cs_evaluate_average_on_faces_by_analytic()

void cs_evaluate_average_on_faces_by_analytic ( const cs_xdef_t def,
const cs_real_t  time_eval,
const cs_lnum_t  n_f_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate the average of a function on the faces. Warning: retval has to be initialize before calling this function.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]time_evalphysical time at which one evaluates the term
[in]n_f_selectednumber of selected faces
[in]selected_lstlist of selected faces
[in,out]retvalpointer to the computed values

◆ cs_evaluate_average_on_faces_by_value()

void cs_evaluate_average_on_faces_by_value ( const cs_xdef_t def,
const cs_lnum_t  n_f_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate the average of a function on the faces.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]n_f_selectednumber of selected faces
[in]selected_lstlist of selected faces
[in,out]retvalpointer to the computed values

◆ cs_evaluate_circulation_along_edges_by_analytic()

void cs_evaluate_circulation_along_edges_by_analytic ( const cs_xdef_t def,
const cs_real_t  time_eval,
const cs_lnum_t  n_e_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate the circulation along a selection of (primal) edges. Circulation is defined by an analytical function.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]time_evalphysical time at which one evaluates the term
[in]n_e_selectednumber of selected edges
[in]selected_lstlist of selected edges
[in,out]retvalpointer to the computed values

◆ cs_evaluate_circulation_along_edges_by_array()

void cs_evaluate_circulation_along_edges_by_array ( const cs_xdef_t def,
const cs_lnum_t  n_e_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate the circulation along a selection of (primal) edges. Circulation is defined thanks to an array.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]n_e_selectednumber of selected edges
[in]selected_lstlist of selected edges
[in,out]retvalpointer to the computed values

◆ cs_evaluate_circulation_along_edges_by_value()

void cs_evaluate_circulation_along_edges_by_value ( const cs_xdef_t def,
const cs_lnum_t  n_e_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate the circulation along a selection of (primal) edges. Circulation is defined thanks to a constant vector field (by value)

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]n_e_selectednumber of selected edges
[in]selected_lstlist of selected edges
[in,out]retvalpointer to the computed values

◆ cs_evaluate_density_by_analytic()

void cs_evaluate_density_by_analytic ( cs_flag_t  dof_flag,
const cs_xdef_t def,
cs_real_t  time_eval,
cs_real_t  retval[] 
)

Compute the value related to each DoF in the case of a density field The value defined by the analytic function is by unity of volume and the return values are integrated over a volume.

Parameters
[in]dof_flagindicate where the evaluation has to be done
[in]defpointer to a cs_xdef_t structure
[in]time_evalphysical time at which one evaluates the term
[in,out]retvalpointer to the computed values

◆ cs_evaluate_density_by_value()

void cs_evaluate_density_by_value ( cs_flag_t  dof_flag,
const cs_xdef_t def,
cs_real_t  retval[] 
)

Evaluate the quantity defined by a value in the case of a density field for all the degrees of freedom Accessor to the value is by unit of volume and the return values are integrated over a volume.

Parameters
[in]dof_flagindicate where the evaluation has to be done
[in]defpointer to a cs_xdef_t structure
[in,out]retvalpointer to the computed values

◆ cs_evaluate_init_sharing()

void cs_evaluate_init_sharing ( const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
const cs_mesh_t mesh 
)

Set shared pointers to main domain members.

Parameters
[in]quantpointer to additional mesh quantities for CDO schemes
[in]connectpointer to additional mesh connectivities for CDO schemes
[in]meshpointer to the shared mesh structure

◆ cs_evaluate_potential_at_cells_by_analytic()

void cs_evaluate_potential_at_cells_by_analytic ( const cs_xdef_t def,
const cs_real_t  time_eval,
cs_real_t  retval[] 
)

Evaluate the quantity attached to a potential field at cell centers when the definition relies on an analytic expression.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]time_evalphysical time at which one evaluates the term
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_at_cells_by_array()

void cs_evaluate_potential_at_cells_by_array ( const cs_xdef_t def,
cs_real_t  retval[] 
)

Evaluate a potential field at cell centers from a definition by array.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_at_cells_by_dof_func()

void cs_evaluate_potential_at_cells_by_dof_func ( const cs_xdef_t def,
cs_real_t  retval[] 
)

Evaluate the quantity attached to a potential field at cells when the definition relies on a DoF function (Degrees of freedom)

Parameters
[in]defpointer to a cs_xdef_t pointer
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_at_cells_by_value()

void cs_evaluate_potential_at_cells_by_value ( const cs_xdef_t def,
cs_real_t  retval[] 
)

Evaluate a potential field at cell centers from a definition by value.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_at_faces_by_analytic()

void cs_evaluate_potential_at_faces_by_analytic ( const cs_xdef_t def,
const cs_real_t  time_eval,
const cs_lnum_t  n_f_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate the quantity attached to a potential field at face centers when the definition relies on an analytic expression.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]time_evalphysical time at which one evaluates the term
[in]n_f_selectednumber of selected faces
[in]selected_lstlist of selected faces
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_at_faces_by_value()

void cs_evaluate_potential_at_faces_by_value ( const cs_xdef_t def,
const cs_lnum_t  n_f_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate a potential field at face centers from a definition by a constant value.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]n_f_selectednumber of selected faces
[in]selected_lstlist of selected faces
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_at_vertices_by_analytic()

void cs_evaluate_potential_at_vertices_by_analytic ( const cs_xdef_t def,
const cs_real_t  time_eval,
const cs_lnum_t  n_v_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate the quantity attached to a potential field at vertices when the definition relies on an analytic expression.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]time_evalphysical time at which one evaluates the term
[in]n_v_selectednumber of selected vertices
[in]selected_lstlist of selected vertices
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_at_vertices_by_dof_func()

void cs_evaluate_potential_at_vertices_by_dof_func ( const cs_xdef_t def,
const cs_lnum_t  n_v_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate the quantity attached to a potential field at vertices when the definition relies on a DoF function (Degrees of freedom)

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]n_v_selectednumber of selected vertices
[in]selected_lstlist of selected vertices
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_at_vertices_by_value()

void cs_evaluate_potential_at_vertices_by_value ( const cs_xdef_t def,
const cs_lnum_t  n_v_selected,
const cs_lnum_t selected_lst,
cs_real_t  retval[] 
)

Evaluate a potential field at vertices from a definition by a constant value.

Parameters
[in]defpointer to a cs_xdef_t pointer
[in]n_v_selectednumber of selected vertices
[in]selected_lstlist of selected vertices
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_by_qov()

void cs_evaluate_potential_by_qov ( cs_flag_t  dof_flag,
const cs_xdef_t def,
cs_real_t  vvals[],
cs_real_t  wvals[] 
)

Define a value to each DoF in the case of a potential field in order to put a given quantity inside the volume associated to the zone related to the given definition wvals may be null.

Parameters
[in]dof_flagindicate where the evaluation has to be done
[in]defpointer to a cs_xdef_t pointer
[in,out]vvalspointer to the first array of computed values
[in,out]wvalspointer to the second array of computed values

Define a value to each DoF in the case of a potential field in order to put a given quantity inside the volume associated to the zone related to the given definition wvals may be null.

Parameters
[in]dof_flagindicate where the evaluation has to be done
[in]defpointer to a cs_xdef_t pointer
[in,out]vvalspointer to the first array of computed values
[in,out]wvalspointer to the second array of computed values

◆ cs_evaluate_scal_domain_integral_by_array()

cs_real_t cs_evaluate_scal_domain_integral_by_array ( cs_flag_t  array_loc,
const cs_real_t array_val 
)

Evaluate the integral over the full computational domain of a quantity defined by an array. The parallel sum reduction is performed inside this function.

Parameters
[in]array_locflag indicating where are located values
[in]array_valarray of values
Returns
the value of the integration (parallel sum reduction done)

◆ cs_evaluate_scatter_array_reduction()

void cs_evaluate_scatter_array_reduction ( int  dim,
cs_lnum_t  n_x,
const cs_real_t array,
const cs_adjacency_t c2x,
const cs_real_t w_x,
cs_real_t min,
cs_real_t max,
cs_real_t wsum,
cs_real_t asum,
cs_real_t ssum 
)

Compute reduced quantities for an array attached to either vertex, face or edge DoFs The weight to apply to each entity x is scanned using the adjacency structure. array size is equal to dim * n_x The computed quantities are synchronized in parallel.

Parameters
[in]dimlocal array dimension (max: 3)
[in]n_xnumber of elements
[in]arrayarray to analyze
[in]c2xpointer to the associated cs_adjacency_t structure
[in]w_xweight to apply (may be set to null)
[in,out]minresulting min array (size: dim, or 4 if dim = 3)
[in,out]maxresulting max array (size: dim, or 4 if dim = 3)
[in,out]wsum(weighted) sum array (size: dim, or 4 if dim = 3)
[in,out]asum(weighted) sum of absolute values (same size as vsum)
[in,out]ssum(weighted) sum of squared values (same size as vsum)
[in]dimlocal array dimension (max: 3)
[in]n_xnumber of elements
[in]arrayarray to analyze
[in]c2xpointer to the associated cs_adjacency_t structure
[in]w_xweight to apply (may be set to nullptr)
[in,out]minresulting min array (size: dim, or 4 if dim = 3)
[in,out]maxresulting max array (size: dim, or 4 if dim = 3)
[in,out]wsum(weighted) sum array (size: dim, or 4 if dim = 3)
[in,out]asum(weighted) sum of absolute values (same size as wsum)
[in,out]ssum(weighted) sum of squared values (same size as wsum)