programmer's documentation
cs_xdef_eval.h
Go to the documentation of this file.
1 #ifndef __CS_XDEF_EVAL_H__
2 #define __CS_XDEF_EVAL_H__
3 
4 /*============================================================================
5  * Manage the (generic) evaluation of extended definitions
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2018 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_cdo_connect.h"
35 #include "cs_cdo_local.h"
36 #include "cs_cdo_quantities.h"
37 #include "cs_mesh.h"
38 #include "cs_quadrature.h"
39 #include "cs_time_step.h"
40 #include "cs_xdef.h"
41 
42 /*----------------------------------------------------------------------------*/
43 
45 
46 /*============================================================================
47  * Function pointer type definitions
48  *============================================================================*/
49 
50 /*----------------------------------------------------------------------------*/
65 /*----------------------------------------------------------------------------*/
66 
67 typedef void
69  const cs_lnum_t *elt_ids,
70  bool compact,
71  const cs_mesh_t *mesh,
72  const cs_cdo_connect_t *connect,
73  const cs_cdo_quantities_t *quant,
74  const cs_time_step_t *ts,
75  void *input,
76  cs_real_t *eval);
77 
78 /*----------------------------------------------------------------------------*/
89 /*----------------------------------------------------------------------------*/
90 
91 typedef void
93  const cs_time_step_t *ts,
94  void *input,
95  cs_real_t *eval);
96 
97 /*----------------------------------------------------------------------------*/
110 /*----------------------------------------------------------------------------*/
111 
112 typedef void
114  cs_lnum_t n_points,
115  const cs_real_t *xyz,
116  const cs_time_step_t *ts,
117  void *input,
118  cs_real_t *eval);
119 
120 /*----------------------------------------------------------------------------*/
132 /*----------------------------------------------------------------------------*/
133 
134 typedef void
136  const cs_time_step_t *ts,
137  void *input,
138  cs_quadrature_type_t qtype,
139  cs_real_t *eval);
140 
141 /*----------------------------------------------------------------------------*/
154 /*----------------------------------------------------------------------------*/
155 
156 typedef void
158  short int f,
159  const cs_time_step_t *ts,
160  void *input,
161  cs_quadrature_type_t qtype,
162  cs_real_t *eval);
163 
164 /*============================================================================
165  * Type definitions
166  *============================================================================*/
167 
168 /*============================================================================
169  * Global variables
170  *============================================================================*/
171 
172 /*============================================================================
173  * Public function prototypes
174  *============================================================================*/
175 
176 /*----------------------------------------------------------------------------*/
190 /*----------------------------------------------------------------------------*/
191 
192 void
194  const cs_lnum_t *elt_ids,
195  bool compact,
196  const cs_mesh_t *mesh,
197  const cs_cdo_connect_t *connect,
198  const cs_cdo_quantities_t *quant,
199  const cs_time_step_t *ts,
200  void *input,
201  cs_real_t *eval);
202 
203 /*----------------------------------------------------------------------------*/
212 /*----------------------------------------------------------------------------*/
213 
214 void
216  const cs_time_step_t *ts,
217  void *input,
218  cs_real_t *eval);
219 
220 /*----------------------------------------------------------------------------*/
234 /*----------------------------------------------------------------------------*/
235 
236 void
238  const cs_lnum_t *elt_ids,
239  bool compact,
240  const cs_mesh_t *mesh,
241  const cs_cdo_connect_t *connect,
242  const cs_cdo_quantities_t *quant,
243  const cs_time_step_t *ts,
244  void *input,
245  cs_real_t *eval);
246 
247 /*----------------------------------------------------------------------------*/
256 /*----------------------------------------------------------------------------*/
257 
258 void
260  const cs_time_step_t *ts,
261  void *input,
262  cs_real_t *eval);
263 
264 /*----------------------------------------------------------------------------*/
278 /*----------------------------------------------------------------------------*/
279 
280 void
282  const cs_lnum_t *elt_ids,
283  bool compact,
284  const cs_mesh_t *mesh,
285  const cs_cdo_connect_t *connect,
286  const cs_cdo_quantities_t *quant,
287  const cs_time_step_t *ts,
288  void *input,
289  cs_real_t *eval);
290 
291 /*----------------------------------------------------------------------------*/
300 /*----------------------------------------------------------------------------*/
301 
302 void
304  const cs_time_step_t *ts,
305  void *input,
306  cs_real_t *eval);
307 
308 /*----------------------------------------------------------------------------*/
322 /*----------------------------------------------------------------------------*/
323 
324 void
326  const cs_lnum_t *elt_ids,
327  bool compact,
328  const cs_mesh_t *mesh,
329  const cs_cdo_connect_t *connect,
330  const cs_cdo_quantities_t *quant,
331  const cs_time_step_t *ts,
332  void *input,
333  cs_real_t *eval);
334 
335 /*----------------------------------------------------------------------------*/
352 /*----------------------------------------------------------------------------*/
353 
354 void
356  const cs_lnum_t *elt_ids,
357  bool compact,
358  const cs_mesh_t *mesh,
359  const cs_cdo_connect_t *connect,
360  const cs_cdo_quantities_t *quant,
361  const cs_time_step_t *ts,
362  void *input,
363  cs_quadrature_type_t qtype,
364  const short int dim,
365  cs_real_t *eval);
366 
367 /*----------------------------------------------------------------------------*/
381 /*----------------------------------------------------------------------------*/
382 
383 void
385  const cs_lnum_t *elt_ids,
386  bool compact,
387  const cs_mesh_t *mesh,
388  const cs_cdo_connect_t *connect,
389  const cs_cdo_quantities_t *quant,
390  const cs_time_step_t *ts,
391  void *input,
392  cs_real_t *eval);
393 
394 /*----------------------------------------------------------------------------*/
409 /*----------------------------------------------------------------------------*/
410 
411 void
413  const cs_lnum_t *elt_ids,
414  bool compact,
415  const cs_mesh_t *mesh,
416  const cs_cdo_connect_t *connect,
417  const cs_cdo_quantities_t *quant,
418  const cs_time_step_t *ts,
419  void *input,
420  cs_real_t *eval);
421 
422 /*----------------------------------------------------------------------------*/
432 /*----------------------------------------------------------------------------*/
433 
434 void
436  const cs_time_step_t *ts,
437  void *input,
438  cs_real_t *eval);
439 
440 /*----------------------------------------------------------------------------*/
455 /*----------------------------------------------------------------------------*/
456 
457 void
459  const cs_lnum_t *elt_ids,
460  bool compact,
461  const cs_mesh_t *mesh,
462  const cs_cdo_connect_t *connect,
463  const cs_cdo_quantities_t *quant,
464  const cs_time_step_t *ts,
465  void *input,
466  cs_real_t *eval);
467 
468 /*----------------------------------------------------------------------------*/
483 /*----------------------------------------------------------------------------*/
484 
485 void
487  const cs_lnum_t *elt_ids,
488  bool compact,
489  const cs_mesh_t *mesh,
490  const cs_cdo_connect_t *connect,
491  const cs_cdo_quantities_t *quant,
492  const cs_time_step_t *ts,
493  void *input,
494  cs_real_t *eval);
495 
496 /*----------------------------------------------------------------------------*/
510 /*----------------------------------------------------------------------------*/
511 
512 void
514  const cs_lnum_t *elt_ids,
515  bool compact,
516  const cs_mesh_t *mesh,
517  const cs_cdo_connect_t *connect,
518  const cs_cdo_quantities_t *quant,
519  const cs_time_step_t *ts,
520  void *input,
521  cs_real_t *eval);
522 
523 /*----------------------------------------------------------------------------*/
539 /*----------------------------------------------------------------------------*/
540 
541 void
543  const cs_lnum_t *elt_ids,
544  bool compact,
545  const cs_mesh_t *mesh,
546  const cs_cdo_connect_t *connect,
547  const cs_cdo_quantities_t *quant,
548  const cs_time_step_t *ts,
549  void *input,
550  cs_real_t *eval);
551 
552 /*----------------------------------------------------------------------------*/
563 /*----------------------------------------------------------------------------*/
564 
565 void
567  const cs_time_step_t *ts,
568  void *input,
569  cs_real_t *eval);
570 
571 /*----------------------------------------------------------------------------*/
585 /*----------------------------------------------------------------------------*/
586 
587 void
589  const cs_lnum_t *elt_ids,
590  bool compact,
591  const cs_mesh_t *mesh,
592  const cs_cdo_connect_t *connect,
593  const cs_cdo_quantities_t *quant,
594  const cs_time_step_t *ts,
595  void *input,
596  cs_real_t *eval);
597 
598 /*----------------------------------------------------------------------------*/
608 /*----------------------------------------------------------------------------*/
609 
610 void
612  const cs_time_step_t *ts,
613  void *input,
614  cs_real_t *eval);
615 
616 /*----------------------------------------------------------------------------*/
629 /*----------------------------------------------------------------------------*/
630 
631 void
633  cs_lnum_t n_points,
634  const cs_real_t *xyz,
635  const cs_time_step_t *ts,
636  void *input,
637  cs_real_t *eval);
638 
639 /*----------------------------------------------------------------------------*/
652 /*----------------------------------------------------------------------------*/
653 
654 void
656  cs_lnum_t n_points,
657  const cs_real_t *xyz,
658  const cs_time_step_t *ts,
659  void *input,
660  cs_real_t *eval);
661 
662 /*----------------------------------------------------------------------------*/
675 /*----------------------------------------------------------------------------*/
676 
677 void
679  cs_lnum_t n_points,
680  const cs_real_t *xyz,
681  const cs_time_step_t *ts,
682  void *input,
683  cs_real_t *eval);
684 
685 /*----------------------------------------------------------------------------*/
698 /*----------------------------------------------------------------------------*/
699 
700 void
702  cs_lnum_t n_points,
703  const cs_real_t *xyz,
704  const cs_time_step_t *ts,
705  void *input,
706  cs_real_t *eval);
707 
708 /*----------------------------------------------------------------------------*/
720 /*----------------------------------------------------------------------------*/
721 
722 void
724  short int f,
725  void *input,
726  cs_real_t *eval);
727 
728 /*----------------------------------------------------------------------------*/
742 /*----------------------------------------------------------------------------*/
743 
744 void
746  short int f,
747  const cs_time_step_t *ts,
748  void *input,
749  cs_quadrature_type_t qtype,
750  cs_real_t *eval);
751 
752 /*----------------------------------------------------------------------------*/
763 /*----------------------------------------------------------------------------*/
764 
765 void
767  short int f,
768  void *input,
769  cs_real_t *eval);
770 
771 /*----------------------------------------------------------------------------*/
782 /*----------------------------------------------------------------------------*/
783 
784 void
786  short int f,
787  void *input,
788  cs_real_t *eval);
789 
790 /*----------------------------------------------------------------------------*/
803 /*----------------------------------------------------------------------------*/
804 
805 void
807  short int f,
808  const cs_time_step_t *ts,
809  void *input,
810  cs_quadrature_type_t qtype,
811  cs_real_t *eval);
812 
813 /*----------------------------------------------------------------------------*/
827 /*----------------------------------------------------------------------------*/
828 
829 void
831  short int f,
832  const cs_time_step_t *ts,
833  void *input,
834  cs_quadrature_type_t qtype,
835  cs_real_t *eval);
836 
837 /*----------------------------------------------------------------------------*/
848 /*----------------------------------------------------------------------------*/
849 
850 static inline void
852  double t_cur,
853  cs_analytic_func_t *ana,
854  void *input,
856  cs_real_t *eval)
857 {
858  switch (cm->type) {
859 
860  case FVM_CELL_TETRA:
861  {
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,
864  ana, input, eval);
865  }
866  break;
867 
868  case FVM_CELL_PYRAM:
869  case FVM_CELL_PRISM:
870  case FVM_CELL_HEXA:
871  case FVM_CELL_POLY:
872  {
873  for (short int f = 0; f < cm->n_fc; ++f) {
874 
875  const cs_quant_t pfq = cm->face[f];
876  const double hf_coef = cs_math_onethird * cm->hfc[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; // #vertices (=#edges)
880  const short int *f2e_ids = cm->f2e_ids + start;
881 
882  assert(n_vf > 2);
883  switch(n_vf){
884 
885  case CS_TRIANGLE_CASE: /* triangle (optimized version, no subdivision) */
886  {
887  short int v0, v1, v2;
888  cs_cell_mesh_get_next_3_vertices(f2e_ids, cm->e2v_ids, &v0, &v1, &v2);
889 
890  const double *xv0 = cm->xv + 3*v0;
891  const double *xv1 = cm->xv + 3*v1;
892  const double *xv2 = cm->xv + 3*v2;
893 
894  qfunc(t_cur, xv0, xv1, xv2, cm->xc, hf_coef * pfq.meas,
895  ana, input, eval);
896  }
897  break;
898 
899  default:
900  {
901  const double *tef = cm->tef + start;
902 
903  for (short int e = 0; e < n_vf; e++) { /* Loop on face edges */
904 
905  // Edge-related variables
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];
909 
910  qfunc(t_cur, xv0, xv1, pfq.center, cm->xc, hf_coef * tef[e],
911  ana, input, eval);
912  }
913  }
914  break;
915 
916  } /* End of switch */
917  } /* End of loop on faces */
918 
919  }
920  break;
921 
922  default:
923  bft_error(__FILE__, __LINE__, 0, _(" Unknown cell-type.\n"));
924  break;
925 
926  } /* End of switch on the cell-type */
927 }
928 
929 /*----------------------------------------------------------------------------*/
941 /*----------------------------------------------------------------------------*/
942 
943 static inline void
945  double t_cur,
946  short int f,
947  cs_analytic_func_t *ana,
948  void *input,
950  cs_real_t *eval)
951 {
952  const cs_quant_t pfq = cm->face[f];
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; // #vertices (=#edges)
956  const short int *f2e_ids = cm->f2e_ids + start;
957 
958  switch (n_vf) {
959  case CS_TRIANGLE_CASE:
960  {
961  short int v0, v1, v2;
962  cs_cell_mesh_get_next_3_vertices(f2e_ids, cm->e2v_ids, &v0, &v1, &v2);
963 
964  qfunc(t_cur, cm->xv+3*v0, cm->xv+3*v1, cm->xv+3*v2, pfq.meas,
965  ana, input, eval);
966  }
967  break;
968  default:
969  {
970  const double *tef = cm->tef + start;
971  for (short int e = 0; e < n_vf; e++) { /* Loop on face edges */
972 
973  // Edge-related variables
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];
977 
978  qfunc(t_cur, xv0, xv1, pfq.center, tef[e], ana, input, eval);
979  }
980  }
981 
982  } // Switch
983 }
984 
985 /*----------------------------------------------------------------------------*/
999 /*----------------------------------------------------------------------------*/
1000 
1001 void
1003  double t_cur,
1004  cs_analytic_func_t *ana,
1005  void *input,
1006  const short int dim,
1009  cs_real_t *c_int,
1010  cs_real_t *f_int);
1011 
1012 /*----------------------------------------------------------------------------*/
1025 /*----------------------------------------------------------------------------*/
1026 
1027 static inline void
1029  short int f,
1030  const cs_time_step_t *ts,
1031  void *input,
1032  cs_quadrature_type_t qtype,
1033  cs_real_t *eval)
1034 {
1035  CS_UNUSED(cm), CS_UNUSED(ts), CS_UNUSED(f), CS_UNUSED(qtype);
1036  if (eval == NULL)
1037  bft_error(__FILE__, __LINE__, 0,
1038  " %s: Array storing the evaluation should be allocated before the call"
1039  " to this function.",
1040  __func__);
1041  assert(input != NULL);
1042  eval[0] = ((const cs_real_t *)input)[0];
1043 }
1044 
1045 /*----------------------------------------------------------------------------*/
1058 /*----------------------------------------------------------------------------*/
1059 
1060 static inline void
1062  short int f,
1063  const cs_time_step_t *ts,
1064  void *input,
1065  cs_quadrature_type_t qtype,
1066  cs_real_t *eval)
1067 {
1068  CS_UNUSED(cm), CS_UNUSED(ts), CS_UNUSED(f), CS_UNUSED(qtype);
1069  if (eval == NULL)
1070  bft_error(__FILE__, __LINE__, 0,
1071  " %s: Array storing the evaluation should be allocated before the call"
1072  " to this function.",
1073  __func__);
1074  assert(input != NULL);
1075  const cs_xdef_array_input_t *array_input =
1076  (const cs_xdef_array_input_t *)input;
1077  eval[0] = array_input->values[0];
1078 }
1079 
1080 /*----------------------------------------------------------------------------*/
1093 /*----------------------------------------------------------------------------*/
1094 
1095 void
1097  short int f,
1098  const cs_time_step_t *ts,
1099  void *input,
1100  cs_quadrature_type_t qtype,
1101  cs_real_t *eval);
1102 
1103 /*----------------------------------------------------------------------------*/
1118 /*----------------------------------------------------------------------------*/
1119 
1120 static inline void
1122  short int f,
1123  const cs_time_step_t *ts,
1124  void *input,
1125  cs_quadrature_type_t qtype,
1126  cs_real_t *eval)
1127 {
1128  CS_UNUSED(qtype);
1130 
1131  anai->func(ts->t_cur, 1, NULL, cm->face[f].center, false, anai->input, eval);
1132 }
1133 
1134 /*----------------------------------------------------------------------------*/
1147 /*----------------------------------------------------------------------------*/
1148 
1149 static inline void
1151  short int f,
1152  const cs_time_step_t *ts,
1153  void *input,
1154  cs_quadrature_type_t qtype,
1155  cs_real_t *eval)
1156 {
1157  CS_UNUSED(cm), CS_UNUSED(ts), CS_UNUSED(f), CS_UNUSED(qtype);
1158  if (eval == NULL)
1159  bft_error(__FILE__, __LINE__, 0,
1160  " %s: Array storing the evaluation should be allocated before the call"
1161  " to this function.",
1162  __func__);
1163  assert(input != NULL);
1164  memcpy(eval,(const cs_real_t *)input,3*sizeof(cs_real_t));
1165 }
1166 
1167 /*----------------------------------------------------------------------------*/
1180 /*----------------------------------------------------------------------------*/
1181 
1182 static inline void
1184  short int f,
1185  const cs_time_step_t *ts,
1186  void *input,
1187  cs_quadrature_type_t qtype,
1188  cs_real_t *eval)
1189 {
1190  CS_UNUSED(cm), CS_UNUSED(ts), CS_UNUSED(f), CS_UNUSED(qtype);
1191  if (eval == NULL)
1192  bft_error(__FILE__, __LINE__, 0,
1193  " %s: Array storing the evaluation should be allocated before the call"
1194  " to this function.",
1195  __func__);
1196  assert(input != NULL);
1197  const cs_xdef_array_input_t *array_input =
1198  (const cs_xdef_array_input_t *)input;
1199  memcpy(eval,array_input->values,3*sizeof(cs_real_t));
1200 }
1201 
1202 /*----------------------------------------------------------------------------*/
1215 /*----------------------------------------------------------------------------*/
1216 
1217 void
1219  short int f,
1220  const cs_time_step_t *ts,
1221  void *input,
1222  cs_quadrature_type_t qtype,
1223  cs_real_t *eval);
1224 
1225 /*----------------------------------------------------------------------------*/
1238 /*----------------------------------------------------------------------------*/
1239 
1240 static inline void
1242  short int f,
1243  const cs_time_step_t *ts,
1244  void *input,
1245  cs_quadrature_type_t qtype,
1246  cs_real_t *eval)
1247 {
1248  CS_UNUSED(cm), CS_UNUSED(ts), CS_UNUSED(f), CS_UNUSED(qtype);
1249  assert(input != NULL);
1250  if (eval == NULL)
1251  bft_error(__FILE__, __LINE__, 0,
1252  " %s: Array storing the evaluation should be allocated before the call"
1253  " to this function.",
1254  __func__);
1255  const cs_real_3_t *constant_val = (const cs_real_3_t *)input;
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];
1259 }
1260 
1261 /*----------------------------------------------------------------------------*/
1274 /*----------------------------------------------------------------------------*/
1275 
1276 static inline void
1278  short int f,
1279  const cs_time_step_t *ts,
1280  void *input,
1281  cs_quadrature_type_t qtype,
1282  cs_real_t *eval)
1283 {
1284  CS_UNUSED(cm), CS_UNUSED(ts), CS_UNUSED(f), CS_UNUSED(qtype);
1285  assert(input != NULL);
1286  if (eval == NULL)
1287  bft_error(__FILE__, __LINE__, 0,
1288  " %s: Array storing the evaluation should be allocated before the call"
1289  " to this function.",
1290  __func__);
1291  const cs_xdef_array_input_t *array_input =
1292  (const cs_xdef_array_input_t *)input;
1293  memcpy(eval, array_input->values, 9*sizeof(cs_real_t));
1294 }
1295 
1296 /*----------------------------------------------------------------------------*/
1309 /*----------------------------------------------------------------------------*/
1310 
1311 void
1313  short int f,
1314  const cs_time_step_t *ts,
1315  void *input,
1316  cs_quadrature_type_t qtype,
1317  cs_real_t *eval);
1318 
1319 /*----------------------------------------------------------------------------*/
1331 /*----------------------------------------------------------------------------*/
1332 
1333 void
1335  const cs_time_step_t *ts,
1336  void *input,
1337  cs_quadrature_type_t qtype,
1338  cs_real_t *eval);
1339 
1340 /*----------------------------------------------------------------------------*/
1352 /*----------------------------------------------------------------------------*/
1353 
1354 void
1356  const cs_time_step_t *ts,
1357  void *input,
1358  cs_quadrature_type_t qtype,
1359  cs_real_t *eval);
1360 
1361 /*----------------------------------------------------------------------------*/
1373 /*----------------------------------------------------------------------------*/
1374 
1375 void
1377  const cs_time_step_t *ts,
1378  void *input,
1379  cs_quadrature_type_t qtype,
1380  cs_real_t *eval);
1381 
1382 /*----------------------------------------------------------------------------*/
1395 /*----------------------------------------------------------------------------*/
1396 
1397 void
1399  const cs_time_step_t *ts,
1400  void *input,
1401  cs_quadrature_type_t qtype,
1402  cs_real_t *eval);
1403 
1404 /*----------------------------------------------------------------------------*/
1405 
1407 
1408 #endif /* __CS_XDEF_EVAL_H__ */
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
cs_analytic_func_t * func
Definition: cs_xdef.h:212
#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
Input structure when an array is used for the definition.
Definition: cs_xdef.h:174
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
void * input
Definition: cs_xdef.h:207
Definition: cs_mesh.h:63
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
cs_real_t * values
Definition: cs_xdef.h:191
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
static int input(void)
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
Input structure when an analytic function is used for the definition.
Definition: cs_xdef.h:201
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
Definition: mesh.f90:26
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