programmer's documentation
Macros | 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_mesh_location.h"
#include "cs_evaluate.h"
Include dependency graph for cs_evaluate.c:

Macros

#define CS_EVALUATE_DBG   0
 

Functions

static double _analytic_quad_tet1 (double tcur, cs_real_3_t xv, cs_real_3_t xe, cs_real_3_t xf, 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, cs_real_3_t xv, cs_real_3_t xe, cs_real_3_t xf, 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, cs_real_3_t xv, cs_real_3_t xe, cs_real_3_t xf, 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 _scd_by_analytic_func (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, cs_analytic_func_t *ana, double tcur, int ml_id, cs_quadra_type_t quad_type, bool use_subdiv, double values[])
 Compute the integral over a dual cell (or a portion) of a variable defined by a user function on a selection of (primal) cells. More...
 
static void _scp_by_analytic_func (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, cs_analytic_func_t *ana, double tcur, int ml_id, cs_quadra_type_t quad_type, bool use_subdiv, double values[])
 Compute the integral over primal cells (or a portion) of a variable defined by a analytical function. More...
 
static void _pvp_by_analytic_func (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, cs_analytic_func_t *ana, double tcur, int ml_id, double values[])
 Get the values at each primal vertices of a variable defined by a analytical function. More...
 
static void _scd_by_val (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const double const_val, int ml_id, 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 _scp_by_val (const cs_cdo_quantities_t *quant, const double const_val, int ml_id, double values[])
 Compute the integral over a (primal) cell of a value defined on a selection of (primal) cells. More...
 
static void _pvp_by_val (const cs_cdo_quantities_t *quant, const double const_val, int ml_id, double values[])
 Get the values at each primal vertices of a variable defined by a constant value. More...
 
void cs_evaluate (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step, cs_flag_t dof_flag, int ml_id, cs_param_def_type_t def_type, cs_quadra_type_t quad_type, bool use_subdiv, cs_def_t def, double *p_values[])
 Compute the contribution related to a source term or a boundary condition for instance. More...
 

Variables

static const cs_flag_t scd_tag
 
static const cs_flag_t scp_tag
 
static const cs_flag_t pvp_tag
 

Macro Definition Documentation

#define CS_EVALUATE_DBG   0

Function Documentation

static double _analytic_quad_tet1 ( double  tcur,
cs_real_3_t  xv,
cs_real_3_t  xe,
cs_real_3_t  xf,
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
static double _analytic_quad_tet4 ( double  tcur,
cs_real_3_t  xv,
cs_real_3_t  xe,
cs_real_3_t  xf,
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
static double _analytic_quad_tet5 ( double  tcur,
cs_real_3_t  xv,
cs_real_3_t  xe,
cs_real_3_t  xf,
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
static void _pvp_by_analytic_func ( const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
cs_analytic_func_t ana,
double  tcur,
int  ml_id,
double  values[] 
)
static

Get the values at each primal vertices of a variable defined by a analytical function.

Parameters
[in]quantadditional mesh quantities struct.
[in]connectpointer to a cs_cdo_connect_t struct.
[in]anapointer to the analytic function
[in]tcurcurrent physical time of the simulation
[in]ml_idid related to a cs_mesh_location_t struct.
[in,out]valuespointer to the computed values
static void _pvp_by_val ( const cs_cdo_quantities_t quant,
const double  const_val,
int  ml_id,
double  values[] 
)
static

Get the values at each primal vertices of a variable defined by a constant value.

Parameters
[in]quantadditional mesh quantities struct.
[in]const_valconstant value
[in]ml_idid related to a cs_mesh_location_t struct.
[in,out]valuespointer to the computed values
static void _scd_by_analytic_func ( const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
cs_analytic_func_t ana,
double  tcur,
int  ml_id,
cs_quadra_type_t  quad_type,
bool  use_subdiv,
double  values[] 
)
static

Compute the integral over a dual cell (or a portion) of a variable defined by a user function on a selection of (primal) cells.

Parameters
[in]quantadditional mesh quantities struct.
[in]connectpointer to a cs_cdo_connect_t struct.
[in]anapointer to the analytic function
[in]tcurcurrent physical time of the simulation
[in]ml_idid related to a cs_mesh_location_t struct.
[in]quad_typetype of quadrature to use
[in]use_subdivconsider or not the subdivision into tetrahedra
[in,out]valuespointer to the computed values
static void _scd_by_val ( const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
const double  const_val,
int  ml_id,
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]quantadditional mesh quantities struct.
[in]connectpointer to a cs_cdo_connect_t struct.
[in]const_valconstant value
[in]ml_idid related to a cs_mesh_location_t struct.
[in,out]valuespointer to the computed values
static void _scp_by_analytic_func ( const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
cs_analytic_func_t ana,
double  tcur,
int  ml_id,
cs_quadra_type_t  quad_type,
bool  use_subdiv,
double  values[] 
)
static

Compute the integral over primal cells (or a portion) of a variable defined by a analytical function.

Parameters
[in]quantadditional mesh quantities struct.
[in]connectpointer to a cs_cdo_connect_t struct.
[in]anapointer to the analytic function
[in]tcurcurrent physical time of the simulation
[in]ml_idid related to a cs_mesh_location_t struct.
[in]quad_typetype of quadrature to use
[in]use_subdivconsider or not the subdivision into tetrahedra
[in,out]valuespointer to the computed values
static void _scp_by_val ( const cs_cdo_quantities_t quant,
const double  const_val,
int  ml_id,
double  values[] 
)
static

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

Parameters
[in]quantadditional mesh quantities struct.
[in]const_valconstant value
[in]ml_idid related to a cs_mesh_location_t struct.
[in,out]valuespointer to the computed values
void cs_evaluate ( const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
const cs_time_step_t time_step,
cs_flag_t  dof_flag,
int  ml_id,
cs_param_def_type_t  def_type,
cs_quadra_type_t  quad_type,
bool  use_subdiv,
cs_def_t  def,
double *  p_values[] 
)

Compute the contribution related to a source term or a boundary condition for instance.

Parameters
[in]quantadditional mesh quantities struct.
[in]connectpointer to a cs_cdo_connect_t struct.
[in]time_steppointer to a time step structure
[in]dof_flagindicate where the evaluation has to be done
[in]ml_idid related to a cs_mesh_location_t struct.
[in]def_typetype of definition
[in]quad_typetype of quadrature (not always used)
[in]use_subdivconsider or not the subdivision into tetrahedra
[in]defaccess to the definition of the values
[in,out]p_valuespointer to the computed values (allocated if NULL)

Variable Documentation

const cs_flag_t pvp_tag
static
Initial value:
=
#define CS_PARAM_FLAG_SCAL
Definition: cs_param.h:57
#define CS_PARAM_FLAG_VERTEX
Definition: cs_param.h:50
#define CS_PARAM_FLAG_PRIMAL
Definition: cs_param.h:54
const cs_flag_t scd_tag
static
Initial value:
=
#define CS_PARAM_FLAG_DUAL
Definition: cs_param.h:55
#define CS_PARAM_FLAG_CELL
Definition: cs_param.h:53
#define CS_PARAM_FLAG_SCAL
Definition: cs_param.h:57
const cs_flag_t scp_tag
static
Initial value:
=
#define CS_PARAM_FLAG_CELL
Definition: cs_param.h:53
#define CS_PARAM_FLAG_SCAL
Definition: cs_param.h:57
#define CS_PARAM_FLAG_PRIMAL
Definition: cs_param.h:54