1 #ifndef __CS_XDEF_EVAL_H__ 2 #define __CS_XDEF_EVAL_H__ 862 assert(cm->
n_fc == 4 && cm->
n_vc == 4);
863 qfunc(t_cur, cm->
xv, cm->
xv+3, cm->
xv+6, cm->
xv+9, cm->
vol_c,
873 for (
short int f = 0; f < cm->
n_fc; ++f) {
877 const int start = cm->
f2e_idx[f];
878 const int end = cm->
f2e_idx[f+1];
879 const short int n_vf = end - start;
880 const short int *f2e_ids = cm->
f2e_ids + start;
887 short int v0, v1, v2;
890 const double *xv0 = cm->
xv + 3*v0;
891 const double *xv1 = cm->
xv + 3*v1;
892 const double *xv2 = cm->
xv + 3*v2;
894 qfunc(t_cur, xv0, xv1, xv2, cm->
xc, hf_coef * pfq.
meas,
901 const double *tef = cm->
tef + start;
903 for (
short int e = 0; e < n_vf; e++) {
906 const short int e0 = f2e_ids[e];
907 const double *xv0 = cm->
xv + 3*cm->
e2v_ids[2*e0];
908 const double *xv1 = cm->
xv + 3*cm->
e2v_ids[2*e0+1];
910 qfunc(t_cur, xv0, xv1, pfq.
center, cm->
xc, hf_coef * tef[e],
923 bft_error(__FILE__, __LINE__, 0,
_(
" Unknown cell-type.\n"));
953 const int start = cm->
f2e_idx[f];
954 const int end = cm->
f2e_idx[f+1];
955 const short int n_vf = end - start;
956 const short int *f2e_ids = cm->
f2e_ids + start;
961 short int v0, v1, v2;
964 qfunc(t_cur, cm->
xv+3*v0, cm->
xv+3*v1, cm->
xv+3*v2, pfq.
meas,
970 const double *tef = cm->
tef + start;
971 for (
short int e = 0; e < n_vf; e++) {
974 const short int e0 = f2e_ids[e];
975 const double *xv0 = cm->
xv + 3*cm->
e2v_ids[2*e0];
976 const double *xv1 = cm->
xv + 3*cm->
e2v_ids[2*e0+1];
978 qfunc(t_cur, xv0, xv1, pfq.
center, tef[e], ana, input, eval);
1006 const short int dim,
1038 " %s: Array storing the evaluation should be allocated before the call" 1039 " to this function.",
1041 assert(input != NULL);
1042 eval[0] = ((
const cs_real_t *)input)[0];
1071 " %s: Array storing the evaluation should be allocated before the call" 1072 " to this function.",
1074 assert(input != NULL);
1077 eval[0] = array_input->
values[0];
1160 " %s: Array storing the evaluation should be allocated before the call" 1161 " to this function.",
1163 assert(input != NULL);
1193 " %s: Array storing the evaluation should be allocated before the call" 1194 " to this function.",
1196 assert(input != NULL);
1249 assert(input != NULL);
1252 " %s: Array storing the evaluation should be allocated before the call" 1253 " to this function.",
1256 for (
int ki = 0; ki < 3; ki++)
1257 for (
int kj = 0; kj < 3; kj++)
1258 eval[3*ki+kj] = constant_val[ki][kj];
1285 assert(input != NULL);
1288 " %s: Array storing the evaluation should be allocated before the call" 1289 " to this function.",
void cs_xdef_eval_cw_at_vtx_flux_by_val(const cs_cell_mesh_t *cm, short int f, void *input, cs_real_t *eval)
Function pointer for evaluating the normal flux of a quantity defined by values. The normal flux is t...
Definition: cs_xdef_eval.c:1567
void() cs_quadrature_tria_integral_t(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, double area, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a triangle based on a specified quadrature rule and add it to results...
Definition: cs_quadrature.h:168
Definition: fvm_defs.h:54
void cs_xdef_eval_cw_avg_scalar_by_analytic(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating a quantity defined through a descriptor (cs_xdef_t structure) by a ce...
Definition: cs_xdef_eval.c:2432
time step descriptor
Definition: cs_time_step.h:51
void cs_xdef_eval_cw_face_avg_tensor_by_analytic(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the average on a face of a scalar function defined through a descript...
Definition: cs_xdef_eval.c:2256
Definition: fvm_defs.h:55
static void cs_xdef_eval_cw_face_avg_scalar_by_value(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the average on a face of a scalar function defined through a descript...
Definition: cs_xdef_eval.h:1028
double * tef
Definition: cs_cdo_local.h:177
void() cs_analytic_func_t(cs_real_t time, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *coords, bool compact, void *input, cs_real_t *retval)
Generic function pointer for an analytic function elt_ids is optional. If not NULL, it enables to access in coords at the right location and the same thing to fill retval if compact is set to false.
Definition: cs_param.h:66
Definition: fvm_defs.h:57
double vol_c
Definition: cs_cdo_local.h:146
void cs_xdef_eval_cw_flux_by_analytic(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the normal flux of a quantity defined by analytic function...
Definition: cs_xdef_eval.c:1883
void cs_xdef_eval_scalar_by_val(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a scalar-valued quantity for a list of elements.
Definition: cs_xdef_eval.c:96
void cs_xdef_eval_cw_at_vtx_flux_by_analytic(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the normal flux of a quantity defined by analytic function...
Definition: cs_xdef_eval.c:1626
double center[3]
Definition: cs_cdo_quantities.h:90
void() cs_quadrature_tetra_integral_t(double tcur, const cs_real_3_t v1, const cs_real_3_t v2, const cs_real_3_t v3, const cs_real_3_t v4, double vol, cs_analytic_func_t *ana, void *input, double results[])
Compute the integral over a tetrahedron based on a specified quadrature rule and add it to results...
Definition: cs_quadrature.h:195
void cs_xdef_eval_cw_avg_reduction_by_analytic(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating a the reduction by averages of a analytic function by a cellwise proc...
Definition: cs_xdef_eval.c:2613
void cs_xdef_eval_cw_tensor_by_val(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a tensor-valued quantity by a cellwise process.
Definition: cs_xdef_eval.c:315
#define CS_TRIANGLE_CASE
Definition: cs_cdo_connect.h:62
void() cs_xdef_eval_cw_int_t(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating a quantity defined through a descriptor (cs_xdef_t structure) by a ce...
Definition: cs_xdef_eval.h:135
void cs_xdef_eval_at_cells_by_analytic(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a quantity defined at cells using an analytic function.
Definition: cs_xdef_eval.c:346
#define BEGIN_C_DECLS
Definition: cs_defs.h:461
void() cs_xdef_eval_cw_face_t(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating a quantity defined through a descriptor (cs_xdef_t structure) by a ce...
Definition: cs_xdef_eval.h:157
#define CS_UNUSED(x)
Definition: cs_defs.h:447
double meas
Definition: cs_cdo_quantities.h:88
void() cs_xdef_eval_cw_t(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Function pointer for evaluating a quantity defined through a descriptor (cs_xdef_t structure) by a ce...
Definition: cs_xdef_eval.h:92
double * hfc
Definition: cs_cdo_local.h:166
Definition: cs_cdo_local.h:133
void cs_xdef_eval_cw_cell_by_array(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a quantity at cells defined by an array. Array is assumed to be interlaced. Variation using a cs_cell_mesh_t structure.
Definition: cs_xdef_eval.c:1121
Definition: cs_cdo_connect.h:69
short int * f2e_ids
Definition: cs_cdo_local.h:176
void cs_xdef_eval_cw_cell_by_field(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a quantity inside a cell defined using a field Variation using a cs_cell_mesh_t structure...
Definition: cs_xdef_eval.c:1291
double * xv
Definition: cs_cdo_local.h:152
void bft_error(const char *const file_name, const int line_num, const int sys_error_code, const char *const format,...)
Calls the error handler (set by bft_error_handler_set() or default).
Definition: bft_error.c:193
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_cdo_quantities.h:94
void cs_xdef_eval_scalar_at_cells_by_array(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a scalar-valued quantity at cells defined by an array. Array is assumed to be interlaced...
Definition: cs_xdef_eval.c:689
static void cs_xdef_eval_cw_face_avg_vector_by_array(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the average on a face of a vector function defined through a descript...
Definition: cs_xdef_eval.h:1183
void cs_xdef_eval_int_on_cell_faces(const cs_cell_mesh_t *cm, double t_cur, cs_analytic_func_t *ana, void *input, const short int dim, cs_quadrature_tetra_integral_t *q_tet, cs_quadrature_tria_integral_t *q_tri, cs_real_t *c_int, cs_real_t *f_int)
Routine to integrate an analytic function over a cell and its faces.
Definition: cs_xdef_eval.c:2319
void cs_xdef_eval_cw_tensor_flux_by_analytic(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the normal flux of a quantity defined by analytic function...
Definition: cs_xdef_eval.c:2005
void cs_xdef_eval_cw_3_at_xyz_by_array(const cs_cell_mesh_t *cm, cs_lnum_t n_points, const cs_real_t *xyz, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Function pointer for evaluating a quantity defined by analytic function at a precise location inside ...
Definition: cs_xdef_eval.c:1415
void cs_xdef_eval_avg_at_b_faces_by_analytic(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, const short int dim, cs_real_t *eval)
Evaluate a quantity defined at border faces using an analytic function.
Definition: cs_xdef_eval.c:430
fvm_element_t type
Definition: cs_cdo_local.h:136
cs_quadrature_type_t
Definition: cs_quadrature.h:51
void cs_xdef_eval_at_b_faces_by_analytic(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a quantity defined at border faces using an analytic function.
Definition: cs_xdef_eval.c:387
void cs_xdef_eval_at_vertices_by_array(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a quantity defined at vertices using an array.
Definition: cs_xdef_eval.c:899
static void cs_xdef_eval_int_on_cell(const cs_cell_mesh_t *cm, double t_cur, cs_analytic_func_t *ana, void *input, cs_quadrature_tetra_integral_t *qfunc, cs_real_t *eval)
Routine to integrate an analytic function over a cell.
Definition: cs_xdef_eval.h:851
Definition: fvm_defs.h:56
void cs_xdef_eval_cw_vector_by_val(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a vector-valued quantity by a cellwise process.
Definition: cs_xdef_eval.c:224
short int n_fc
Definition: cs_cdo_local.h:162
static void cs_xdef_eval_int_on_face(const cs_cell_mesh_t *cm, double t_cur, short int f, cs_analytic_func_t *ana, void *input, cs_quadrature_tria_integral_t *qfunc, cs_real_t *eval)
Routine to integrate an analytic function over a face.
Definition: cs_xdef_eval.h:944
void cs_xdef_eval_cw_scalar_by_val(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a scalar-valued quantity by a cellwise process.
Definition: cs_xdef_eval.c:142
void cs_xdef_eval_tensor_by_val(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a tensor-valued quantity for a list of elements.
Definition: cs_xdef_eval.c:256
double t_cur
Definition: cs_time_step.h:67
void cs_xdef_eval_cw_vector_at_xyz_by_val(const cs_cell_mesh_t *cm, cs_lnum_t n_points, const cs_real_t *xyz, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Function pointer for evaluating a quantity defined by analytic function at a precise location inside ...
Definition: cs_xdef_eval.c:1379
cs_quant_t * face
Definition: cs_cdo_local.h:167
static void cs_xdef_eval_cw_face_avg_scalar_by_array(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the average on a face of a scalar function defined through a descript...
Definition: cs_xdef_eval.h:1061
void cs_xdef_eval_cw_tensor_flux_by_val(const cs_cell_mesh_t *cm, short int f, void *input, cs_real_t *eval)
Function pointer for evaluating the normal flux of a quantity defined by values. Use of a cs_cell_mes...
Definition: cs_xdef_eval.c:1854
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:309
void cs_xdef_eval_cw_cell_by_analytic(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a quantity defined using an analytic function by a cellwise process (usage of a cs_cell_mesh...
Definition: cs_xdef_eval.c:656
void cs_xdef_eval_vector_by_val(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a vector-valued quantity for a list of elements.
Definition: cs_xdef_eval.c:171
cs_real_3_t xc
Definition: cs_cdo_local.h:145
void cs_xdef_eval_3_at_all_vertices_by_array(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a vector-valued quantity at all vertices defined by an array. Array is assumed to be interla...
Definition: cs_xdef_eval.c:993
static void cs_xdef_eval_cw_face_drhm_by_analytic(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating at the center of the face a scalar function defined through a descrip...
Definition: cs_xdef_eval.h:1121
void cs_xdef_eval_cw_flux_by_val(const cs_cell_mesh_t *cm, short int f, void *input, cs_real_t *eval)
Function pointer for evaluating the normal flux of a quantity defined by values. Use of a cs_cell_mes...
Definition: cs_xdef_eval.c:1829
Definition: cs_cdo_quantities.h:86
const cs_real_t cs_math_onethird
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:293
short int n_vc
Definition: cs_cdo_local.h:150
void cs_xdef_eval_cw_3_at_xyz_by_field(const cs_cell_mesh_t *cm, cs_lnum_t n_points, const cs_real_t *xyz, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Function pointer for evaluating a quantity defined by a field at a precise location inside a cell Use...
Definition: cs_xdef_eval.c:1499
void cs_xdef_eval_cw_face_avg_vector_by_analytic(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the average on a face of a scalar function defined through a descript...
Definition: cs_xdef_eval.c:2194
void cs_xdef_eval_cw_avg_vector_by_analytic(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating a quantity defined through a descriptor (cs_xdef_t structure) by a ce...
Definition: cs_xdef_eval.c:2492
#define END_C_DECLS
Definition: cs_defs.h:462
#define _(String)
Definition: cs_defs.h:52
void cs_xdef_eval_cw_at_xyz_by_analytic(const cs_cell_mesh_t *cm, cs_lnum_t n_points, const cs_real_t *xyz, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Function pointer for evaluating a quantity defined by analytic function at a precise location inside ...
Definition: cs_xdef_eval.c:1344
short int * e2v_ids
Definition: cs_cdo_local.h:171
void cs_xdef_eval_cw_avg_tensor_by_analytic(const cs_cell_mesh_t *cm, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating a quantity defined through a descriptor (cs_xdef_t structure) by a ce...
Definition: cs_xdef_eval.c:2552
void cs_xdef_eval_cell_by_field(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a quantity inside a cell defined using a field.
Definition: cs_xdef_eval.c:1184
static void cs_xdef_eval_cw_face_avg_vector_by_value(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the average on a face of a vector function defined through a descript...
Definition: cs_xdef_eval.h:1150
void cs_xdef_eval_at_vertices_by_analytic(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a quantity defined at vertices using an analytic function.
Definition: cs_xdef_eval.c:620
Definition: fvm_defs.h:58
static void cs_xdef_eval_cw_face_avg_tensor_by_array(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the average on a face of a tensor function defined through a descript...
Definition: cs_xdef_eval.h:1277
static void cs_xdef_eval_cw_face_avg_tensor_by_value(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the average on a face of a tensor function defined through a descript...
Definition: cs_xdef_eval.h:1241
static void cs_cell_mesh_get_next_3_vertices(const short int *f2e_ids, const short int *e2v_ids, short int *v0, short int *v1, short int *v2)
Get the next three vertices in a row from a face to edge connectivity and a edge to vertex connectivi...
Definition: cs_cdo_local.h:542
void() cs_xdef_eval_t(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Function pointer for evaluating a quantity defined through a descriptor (cs_xdef_t structure) ...
Definition: cs_xdef_eval.h:68
void cs_xdef_eval_cw_face_avg_scalar_by_analytic(const cs_cell_mesh_t *cm, short int f, const cs_time_step_t *ts, void *input, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the average on a face of a scalar function defined through a descript...
Definition: cs_xdef_eval.c:2133
short int * f2e_idx
Definition: cs_cdo_local.h:175
void() cs_xdef_eval_cw_xyz_t(const cs_cell_mesh_t *cm, cs_lnum_t n_points, const cs_real_t *xyz, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Function pointer for evaluating a quantity at several locations in a cell defined through a descripto...
Definition: cs_xdef_eval.h:113
void cs_xdef_eval_nd_at_cells_by_array(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, void *input, cs_real_t *eval)
Evaluate a nd-valued quantity at cells defined by an array. Array is assumed to be interlaced...
Definition: cs_xdef_eval.c:791