programmer's documentation
Functions | Variables
cs_evaluate.c File Reference
#include "cs_defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <float.h>
#include <bft_mem.h>
#include <bft_printf.h>
#include "cs_math.h"
#include "cs_mesh_location.h"
#include "cs_evaluate.h"
Include dependency graph for cs_evaluate.c:

Functions

static double _analytic_quad_tet1 (double tcur, const cs_real_3_t xv, const cs_real_3_t xe, const cs_real_3_t xf, const cs_real_3_t xc, cs_analytic_func_t *ana)
 Compute the integral over a tetrahedron of the barycentric subdiv. using a barycentric quadrature rule. More...
 
static double _analytic_quad_tet4 (double tcur, const cs_real_3_t xv, const cs_real_3_t xe, const cs_real_3_t xf, const cs_real_3_t xc, cs_analytic_func_t *ana)
 Compute the integral over a tetrahedron of the barycentric subdiv. with a quadrature rule using 4 Gauss points and a unique weight. More...
 
static double _analytic_quad_tet5 (double tcur, const cs_real_3_t xv, const cs_real_3_t xe, const cs_real_3_t xf, const cs_real_3_t xc, cs_analytic_func_t *ana)
 Compute the integral over a tetrahedron of the barycentric subdiv. with a quadrature rule using 5 Gauss points and 5 weights. More...
 
static void _dcsd_by_analytic (cs_analytic_func_t *ana, const cs_lnum_t n_elts, const cs_lnum_t *elt_ids, cs_quadra_type_t quad_type, double values[])
 Compute the integral over dual cells of a scalar density field defined by an analytical function on a selection of (primal) cells. More...
 
static void _pcsd_by_analytic (cs_analytic_func_t *ana, const cs_lnum_t n_elts, const cs_lnum_t *elt_ids, cs_quadra_type_t quad_type, double values[])
 Compute the integral over primal cells of a scalar density field defined by an analytical function on a selection of (primal) cells. More...
 
static void _dcsd_by_value (const double const_val, const cs_lnum_t n_elts, const cs_lnum_t *elt_ids, double values[])
 Compute the integral over a dual cell (or a portion) of a value defined on a selection of (primal) cells. More...
 
static void _pcsd_by_value (const double const_val, const cs_lnum_t n_elts, const cs_lnum_t *elt_ids, double values[])
 Compute the integral over a (primal) cell of a value related to scalar density field. More...
 
static void _pfsp_by_analytic (cs_analytic_func_t *ana, const cs_lnum_t n_elts, const cs_lnum_t *elt_ids, double values[])
 Get the values at each primal faces for a scalar potential defined by an analytical function on a selection of (primal) cells. More...
 
static void _pvsp_by_analytic (cs_analytic_func_t *ana, const cs_lnum_t n_elts, const cs_lnum_t *elt_ids, double values[])
 Get the values at each primal vertices for a scalar potential defined by an analytical function on a selection of (primal) cells. More...
 
static void _pfsp_by_value (const double const_val, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, double values[])
 Get the values at each primal faces for a scalar potential. More...
 
static void _pvsp_by_qov (const double quantity_val, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, double values[])
 Define a value to each DoF such that a given quantity is put inside the volume associated to the list of cells. More...
 
static void _pvsp_by_value (const double const_val, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, double values[])
 Get the values at each primal vertices for a scalar potential. More...
 
void cs_evaluate_set_shared_pointers (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step)
 Set shared pointers to main domain members. More...
 
void cs_evaluate_density_from_analytic (cs_flag_t dof_flag, int ml_id, cs_analytic_func_t *ana, cs_quadra_type_t quad_type, double 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. More...
 
void cs_evaluate_density_from_value (cs_flag_t dof_flag, int ml_id, cs_get_t get, double retval[])
 Compute the value related to each DoF in the case of a density field Accessor to the value is by unit of volume. More...
 
void cs_evaluate_potential_from_analytic (cs_flag_t dof_flag, int ml_id, cs_analytic_func_t *ana, double retval[])
 Compute the contribution related to a quantity defined by analytic function for all the degrees of freedom. More...
 
void cs_evaluate_potential_from_qov (cs_flag_t dof_flag, int ml_id, cs_get_t get, double retval[])
 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 ml_id. More...
 
void cs_evaluate_potential_from_value (cs_flag_t dof_flag, int ml_id, cs_get_t get, double retval[])
 Store the value related to each DoF in the case of a potential field. More...
 

Variables

static const cs_cdo_quantities_tcs_cdo_quant
 
static const cs_cdo_connect_tcs_cdo_connect
 
static const cs_time_step_tcs_time_step
 
static const char _err_empty_array []
 
static const char _err_not_handled [] = " This case is not handled yet."
 

Function Documentation

◆ _analytic_quad_tet1()

static double _analytic_quad_tet1 ( double  tcur,
const cs_real_3_t  xv,
const cs_real_3_t  xe,
const cs_real_3_t  xf,
const cs_real_3_t  xc,
cs_analytic_func_t ana 
)
inlinestatic

Compute the integral over a tetrahedron of the barycentric subdiv. using a barycentric quadrature rule.

Parameters
[in]tcurcurrent physical time of the simulation
[in]xvfirst point of the tetrahedron
[in]xesecond point of the tetrahedron
[in]xfthird point of the tetrahedron
[in]xcfourth point of the tetrahedron
[in]anapointer to the analytic function
Returns
the result of the integration

◆ _analytic_quad_tet4()

static double _analytic_quad_tet4 ( double  tcur,
const cs_real_3_t  xv,
const cs_real_3_t  xe,
const cs_real_3_t  xf,
const cs_real_3_t  xc,
cs_analytic_func_t ana 
)
inlinestatic

Compute the integral over a tetrahedron of the barycentric subdiv. with a quadrature rule using 4 Gauss points and a unique weight.

Parameters
[in]tcurcurrent physical time of the simulation
[in]xvfirst point of the tetrahedron
[in]xesecond point of the tetrahedron
[in]xfthird point of the tetrahedron
[in]xcfourth point of the tetrahedron
[in]anapointer to the analytic function
Returns
the result of the integration

◆ _analytic_quad_tet5()

static double _analytic_quad_tet5 ( double  tcur,
const cs_real_3_t  xv,
const cs_real_3_t  xe,
const cs_real_3_t  xf,
const cs_real_3_t  xc,
cs_analytic_func_t ana 
)
inlinestatic

Compute the integral over a tetrahedron of the barycentric subdiv. with a quadrature rule using 5 Gauss points and 5 weights.

Parameters
[in]tcurcurrent physical time of the simulation
[in]xvfirst point of the tetrahedron
[in]xesecond point of the tetrahedron
[in]xfthird point of the tetrahedron
[in]xcfourth point of the tetrahedron
[in]anapointer to the analytic function
Returns
the result of the integration

◆ _dcsd_by_analytic()

static void _dcsd_by_analytic ( cs_analytic_func_t ana,
const cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
cs_quadra_type_t  quad_type,
double  values[] 
)
static

Compute the integral over dual cells of a scalar density field defined by an analytical function on a selection of (primal) cells.

Parameters
[in]anapointer to the analytic function
[in]n_loc_eltsnumber of elements to consider
[in]elt_idspointer to the list od selected ids
[in]quad_typetype of quadrature to use
[in,out]valuespointer to the computed values

◆ _dcsd_by_value()

static void _dcsd_by_value ( const double  const_val,
const cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
double  values[] 
)
static

Compute the integral over a dual cell (or a portion) of a value defined on a selection of (primal) cells.

Parameters
[in]const_valconstant value
[in]n_loc_eltsnumber of elements to consider
[in]elt_idspointer to the list od selected ids
[in,out]valuespointer to the computed values

◆ _pcsd_by_analytic()

static void _pcsd_by_analytic ( cs_analytic_func_t ana,
const cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
cs_quadra_type_t  quad_type,
double  values[] 
)
static

Compute the integral over primal cells of a scalar density field defined by an analytical function on a selection of (primal) cells.

Parameters
[in]anapointer to the analytic function
[in]n_loc_eltsnumber of elements to consider
[in]elt_idspointer to the list od selected ids
[in]quad_typetype of quadrature to use
[in,out]valuespointer to the computed values

◆ _pcsd_by_value()

static void _pcsd_by_value ( const double  const_val,
const cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
double  values[] 
)
static

Compute the integral over a (primal) cell of a value related to scalar density field.

Parameters
[in]const_valconstant value
[in]n_loc_eltsnumber of elements to consider
[in]elt_idspointer to the list od selected ids
[in,out]valuespointer to the computed values

◆ _pfsp_by_analytic()

static void _pfsp_by_analytic ( cs_analytic_func_t ana,
const cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
double  values[] 
)
static

Get the values at each primal faces for a scalar potential defined by an analytical function on a selection of (primal) cells.

Parameters
[in]anapointer to the analytic function
[in]n_loc_eltsnumber of elements to consider
[in]elt_idspointer to the list od selected ids
[in,out]valuespointer to the computed values

◆ _pfsp_by_value()

static void _pfsp_by_value ( const double  const_val,
cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
double  values[] 
)
static

Get the values at each primal faces for a scalar potential.

Parameters
[in]const_valconstant value
[in]n_loc_eltsnumber of elements to consider
[in]elt_idspointer to the list od selected ids
[in,out]valuespointer to the array storing the values

◆ _pvsp_by_analytic()

static void _pvsp_by_analytic ( cs_analytic_func_t ana,
const cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
double  values[] 
)
static

Get the values at each primal vertices for a scalar potential defined by an analytical function on a selection of (primal) cells.

Parameters
[in]anapointer to the analytic function
[in]n_loc_eltsnumber of elements to consider
[in]elt_idspointer to the list od selected ids
[in,out]valuespointer to the computed values

◆ _pvsp_by_qov()

static void _pvsp_by_qov ( const double  quantity_val,
cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
double  values[] 
)
static

Define a value to each DoF such that a given quantity is put inside the volume associated to the list of cells.

Parameters
[in]quantity_valamount of quantity to distribute
[in]n_loc_eltsnumber of elements to consider
[in]elt_idspointer to the list od selected ids
[in,out]valuespointer to the array storing the values

◆ _pvsp_by_value()

static void _pvsp_by_value ( const double  const_val,
cs_lnum_t  n_elts,
const cs_lnum_t elt_ids,
double  values[] 
)
static

Get the values at each primal vertices for a scalar potential.

Parameters
[in]const_valconstant value
[in]n_loc_eltsnumber of elements to consider
[in]elt_idspointer to the list od selected ids
[in,out]valuespointer to the array storing the values

◆ cs_evaluate_density_from_analytic()

void cs_evaluate_density_from_analytic ( cs_flag_t  dof_flag,
int  ml_id,
cs_analytic_func_t ana,
cs_quadra_type_t  quad_type,
double  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.

Parameters
[in]dof_flagindicate where the evaluation has to be done
[in]ml_idid related to a cs_mesh_location_t structure
[in]anaaccessor to values thanks to a function pointer
[in]quad_typetype of quadrature (not always used)
[in,out]retvalpointer to the computed values

◆ cs_evaluate_density_from_value()

void cs_evaluate_density_from_value ( cs_flag_t  dof_flag,
int  ml_id,
cs_get_t  get,
double  retval[] 
)

Compute the value related to each DoF in the case of a density field Accessor to the value is by unit of volume.

Parameters
[in]dof_flagindicate where the evaluation has to be done
[in]ml_idid related to a cs_mesh_location_t structure
[in]getaccessor to the constant value to set
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_from_analytic()

void cs_evaluate_potential_from_analytic ( cs_flag_t  dof_flag,
int  ml_id,
cs_analytic_func_t ana,
double  retval[] 
)

Compute the contribution related to a quantity defined by analytic function for all the degrees of freedom.

Parameters
[in]dof_flagindicate where the evaluation has to be done
[in]ml_idid related to a cs_mesh_location_t structure
[in]anaaccessor to values thanks to a function pointer
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_from_qov()

void cs_evaluate_potential_from_qov ( cs_flag_t  dof_flag,
int  ml_id,
cs_get_t  get,
double  retval[] 
)

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 ml_id.

Parameters
[in]dof_flagindicate where the evaluation has to be done
[in]ml_idid related to a cs_mesh_location_t structure
[in]getaccessor to the constant value related to the quantity to put in the volume spanned by ml_id
[in,out]retvalpointer to the computed values

◆ cs_evaluate_potential_from_value()

void cs_evaluate_potential_from_value ( cs_flag_t  dof_flag,
int  ml_id,
cs_get_t  get,
double  retval[] 
)

Store the value related to each DoF in the case of a potential field.

Parameters
[in]dof_flagindicate where the evaluation has to be done
[in]ml_idid related to a cs_mesh_location_t structure
[in]getaccessor to the constant value to set
[in,out]retvalpointer to the computed values

◆ cs_evaluate_set_shared_pointers()

void cs_evaluate_set_shared_pointers ( const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
const cs_time_step_t time_step 
)

Set shared pointers to main domain members.

Parameters
[in]quantadditional mesh quantities struct.
[in]connectpointer to a cs_cdo_connect_t struct.
[in]time_steppointer to a time step structure

Variable Documentation

◆ _err_empty_array

const char _err_empty_array[]
static
Initial value:
=
" Array storing the evaluation should be allocated before the call"
" to this function."

◆ _err_not_handled

const char _err_not_handled[] = " This case is not handled yet."
static

◆ cs_cdo_connect

const cs_cdo_connect_t* cs_cdo_connect
static

◆ cs_cdo_quant

const cs_cdo_quantities_t* cs_cdo_quant
static

◆ cs_time_step

const cs_time_step_t* cs_time_step
static