6.3
general documentation
cs_xdef_cw_eval.h
Go to the documentation of this file.
1 #ifndef __CS_XDEF_CW_EVAL_H__
2 #define __CS_XDEF_CW_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-2020 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_xdef.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*=============================================================================
46  * Local macro definition (unset at the end of file)
47  *============================================================================*/
48 
49 /* Redefined the name of functions from cs_math to get shorter names */
50 #define _dp3 cs_math_3_dot_product
51 
52 /*============================================================================
53  * Function pointer type definitions
54  *============================================================================*/
55 
56 /*----------------------------------------------------------------------------*/
67 /*----------------------------------------------------------------------------*/
68 
69 typedef void
71  cs_real_t time_eval,
72  void *input,
73  cs_real_t *eval);
74 
75 /*----------------------------------------------------------------------------*/
88 /*----------------------------------------------------------------------------*/
89 
90 typedef void
92  cs_lnum_t n_points,
93  const cs_real_t *xyz,
94  cs_real_t time_eval,
95  void *input,
96  cs_real_t *eval);
97 
98 /*----------------------------------------------------------------------------*/
110 /*----------------------------------------------------------------------------*/
111 
112 typedef void
114  cs_real_t time_eval,
115  void *input,
116  cs_quadrature_type_t qtype,
117  cs_real_t *eval);
118 
119 /*----------------------------------------------------------------------------*/
132 /*----------------------------------------------------------------------------*/
133 
134 typedef void
136  short int f,
137  cs_real_t time_eval,
138  void *input,
139  cs_quadrature_type_t qtype,
140  cs_real_t *eval);
141 
142 /*============================================================================
143  * Static inline public function prototypes
144  *============================================================================*/
145 
146 /*----------------------------------------------------------------------------*/
155 /*----------------------------------------------------------------------------*/
156 
157 static inline void
158 cs_xdef_cw_eval_scalar_by_val(const cs_cell_mesh_t *cm,
159  cs_real_t time_eval,
160  void *input,
161  cs_real_t *eval)
162 {
163  CS_UNUSED(cm);
164  CS_UNUSED(time_eval);
165 
166  cs_real_t *constant_val = (cs_real_t *)input;
167  *eval = constant_val[0];
168 }
169 
170 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 static inline void
182 cs_xdef_cw_eval_vector_by_val(const cs_cell_mesh_t *cm,
183  cs_real_t time_eval,
184  void *input,
185  cs_real_t *eval)
186 {
187  CS_UNUSED(cm);
188  CS_UNUSED(time_eval);
189 
190  const cs_real_t *constant_val = (cs_real_t *)input;
191 
192  eval[0] = constant_val[0];
193  eval[1] = constant_val[1];
194  eval[2] = constant_val[2];
195 }
196 
197 /*----------------------------------------------------------------------------*/
206 /*----------------------------------------------------------------------------*/
207 
208 static inline void
209 cs_xdef_cw_eval_tensor_by_val(const cs_cell_mesh_t *cm,
210  cs_real_t time_eval,
211  void *input,
212  cs_real_t *eval)
213 {
214  CS_UNUSED(cm);
215  CS_UNUSED(time_eval);
216 
217  const cs_real_3_t *constant_val = (const cs_real_3_t *)input;
218  for (int ki = 0; ki < 3; ki++)
219  for (int kj = 0; kj < 3; kj++)
220  eval[3*ki+kj] = constant_val[ki][kj];
221 }
222 
223 /*----------------------------------------------------------------------------*/
236 /*----------------------------------------------------------------------------*/
237 
238 static inline void
239 cs_xdef_cw_eval_vector_at_xyz_by_val(const cs_cell_mesh_t *cm,
240  cs_lnum_t n_points,
241  const cs_real_t *xyz,
242  cs_real_t time_eval,
243  void *input,
244  cs_real_t *eval)
245 {
246  CS_UNUSED(cm);
247  CS_UNUSED(xyz);
248  CS_UNUSED(time_eval);
249 
250  const cs_real_t *constant_val = (cs_real_t *)input;
251 
252  for (int i = 0; i < n_points; i++) {
253  eval[3*i ] = constant_val[0];
254  eval[3*i + 1] = constant_val[1];
255  eval[2*i + 2] = constant_val[2];
256  }
257 }
258 
259 
260 /*----------------------------------------------------------------------------*/
272 /*----------------------------------------------------------------------------*/
273 
274 static inline void
275 cs_xdef_cw_eval_flux_by_val(const cs_cell_mesh_t *cm,
276  short int f,
277  cs_real_t time_eval,
278  void *input,
279  cs_real_t *eval)
280 {
281  CS_UNUSED(time_eval);
282 
283  /* Sanity check */
284  assert(cs_eflag_test(cm->flag, CS_FLAG_COMP_PFQ));
285 
286  const cs_real_t *flux = (cs_real_t *)input;
287  const cs_quant_t fq = cm->face[f];
288 
289  eval[f] = fq.meas * _dp3(fq.unitv, flux);
290 }
291 
292 /*----------------------------------------------------------------------------*/
304 /*----------------------------------------------------------------------------*/
305 
306 static inline void
307 cs_xdef_cw_eval_tensor_flux_by_val(const cs_cell_mesh_t *cm,
308  short int f,
309  cs_real_t time_eval,
310  void *input,
311  cs_real_t *eval)
312 {
313  CS_UNUSED(time_eval);
314 
315  cs_real_t *flux = (cs_real_t *)input;
316  const cs_quant_t fq = cm->face[f];
317 
318  cs_math_33_3_product((const cs_real_t (*)[3])flux, fq.unitv, eval);
319  for (int k = 0; k < 3; k++)
320  eval[3*f+k] *= fq.meas;
321 }
322 
323 /*----------------------------------------------------------------------------*/
336 /*----------------------------------------------------------------------------*/
337 
338 static inline void
339 cs_xdef_cw_eval_scalar_face_avg_by_value(const cs_cell_mesh_t *cm,
340  short int f,
341  cs_real_t t_eval,
342  void *input,
343  cs_quadrature_type_t qtype,
344  cs_real_t *eval)
345 {
346  CS_UNUSED(cm);
347  CS_UNUSED(t_eval);
348  CS_UNUSED(f);
349  CS_UNUSED(qtype);
350 
351  if (eval == NULL)
352  bft_error(__FILE__, __LINE__, 0,
353  " %s: Array storing the evaluation should be allocated before"
354  " the call to this function.", __func__);
355  assert(input != NULL);
356 
357  eval[0] = ((const cs_real_t *)input)[0];
358 }
359 
360 /*----------------------------------------------------------------------------*/
373 /*----------------------------------------------------------------------------*/
374 
375 static inline void
376 cs_xdef_cw_eval_scalar_face_avg_by_array(const cs_cell_mesh_t *cm,
377  short int f,
378  cs_real_t t_eval,
379  void *input,
380  cs_quadrature_type_t qtype,
381  cs_real_t *eval)
382 {
383  CS_UNUSED(t_eval);
384  CS_UNUSED(qtype);
385 
386  if (eval == NULL)
387  bft_error(__FILE__, __LINE__, 0,
388  " %s: Array storing the evaluation should be allocated before"
389  " the call to this function.", __func__);
390 
391  const cs_xdef_array_context_t *array_input
392  = (const cs_xdef_array_context_t *)input;
393 
394  assert(input != NULL);
395  assert(cs_flag_test(array_input->loc, cs_flag_primal_face));
396 
397  eval[0] = array_input->values[cm->f_ids[f]];
398 }
399 
400 /*----------------------------------------------------------------------------*/
415 /*----------------------------------------------------------------------------*/
416 
417 static inline void
418 cs_xdef_cw_eval_face_drhm_by_analytic(const cs_cell_mesh_t *cm,
419  short int f,
420  cs_real_t t_eval,
421  void *input,
422  cs_quadrature_type_t qtype,
423  cs_real_t *eval)
424 {
425  CS_UNUSED(qtype);
427 
428  anai->func(t_eval, 1, NULL, cm->face[f].center, false, anai->input, eval);
429 }
430 
431 /*----------------------------------------------------------------------------*/
444 /*----------------------------------------------------------------------------*/
445 
446 static inline void
447 cs_xdef_cw_eval_vector_face_avg_by_value(const cs_cell_mesh_t *cm,
448  short int f,
449  cs_real_t t_eval,
450  void *input,
451  cs_quadrature_type_t qtype,
452  cs_real_t *eval)
453 {
454  CS_UNUSED(cm);
455  CS_UNUSED(f);
456  CS_UNUSED(t_eval);
457  CS_UNUSED(qtype);
458 
459  if (eval == NULL)
460  bft_error(__FILE__, __LINE__, 0,
461  " %s: Array storing the evaluation should be allocated before"
462  " the call to this function.", __func__);
463 
464  assert(input != NULL);
465 
466  memcpy(eval, (const cs_real_t *)input, 3*sizeof(cs_real_t));
467 }
468 
469 /*----------------------------------------------------------------------------*/
482 /*----------------------------------------------------------------------------*/
483 
484 static inline void
485 cs_xdef_cw_eval_vector_face_avg_by_array(const cs_cell_mesh_t *cm,
486  short int f,
487  cs_real_t t_eval,
488  void *input,
489  cs_quadrature_type_t qtype,
490  cs_real_t *eval)
491 {
492  CS_UNUSED(t_eval);
493  CS_UNUSED(qtype);
494 
495  if (eval == NULL)
496  bft_error(__FILE__, __LINE__, 0,
497  " %s: Array storing the evaluation should be allocated before"
498  " the call to this function.", __func__);
499 
500  const cs_xdef_array_context_t *array_input
501  = (const cs_xdef_array_context_t *)input;
502 
503  assert(input != NULL);
504  assert(cs_flag_test(array_input->loc, cs_flag_primal_face));
505 
506  memcpy(eval, array_input->values + 3*cm->f_ids[f], 3*sizeof(cs_real_t));
507 }
508 
509 /*----------------------------------------------------------------------------*/
522 /*----------------------------------------------------------------------------*/
523 
524 static inline void
525 cs_xdef_cw_eval_tensor_face_avg_by_value(const cs_cell_mesh_t *cm,
526  short int f,
527  cs_real_t t_eval,
528  void *input,
529  cs_quadrature_type_t qtype,
530  cs_real_t *eval)
531 {
532  CS_UNUSED(cm);
533  CS_UNUSED(f);
534  CS_UNUSED(t_eval);
535  CS_UNUSED(qtype);
536 
537  assert(input != NULL);
538  if (eval == NULL)
539  bft_error(__FILE__, __LINE__, 0,
540  " %s: Array storing the evaluation should be allocated before"
541  " the call to this function.", __func__);
542 
543  const cs_real_3_t *constant_val = (const cs_real_3_t *)input;
544  for (int ki = 0; ki < 3; ki++)
545  for (int kj = 0; kj < 3; kj++)
546  eval[3*ki+kj] = constant_val[ki][kj];
547 }
548 
549 /*----------------------------------------------------------------------------*/
562 /*----------------------------------------------------------------------------*/
563 
564 static inline void
565 cs_xdef_cw_eval_tensor_face_avg_by_array(const cs_cell_mesh_t *cm,
566  short int f,
567  cs_real_t t_eval,
568  void *input,
569  cs_quadrature_type_t qtype,
570  cs_real_t *eval)
571 {
572  CS_UNUSED(t_eval);
573  CS_UNUSED(qtype);
574 
575  if (eval == NULL)
576  bft_error(__FILE__, __LINE__, 0,
577  " %s: Array storing the evaluation should be allocated before"
578  " the call to this function.", __func__);
579 
580  const cs_xdef_array_context_t *array_input
581  = (const cs_xdef_array_context_t *)input;
582 
583  assert(input != NULL);
584  assert(cs_flag_test(array_input->loc, cs_flag_primal_face));
585 
586  memcpy(eval, array_input->values + 9*cm->f_ids[f], 9*sizeof(cs_real_t));
587 }
588 
589 /*============================================================================
590  * Public function prototypes
591  *============================================================================*/
592 
593 /*----------------------------------------------------------------------------*/
605 /*----------------------------------------------------------------------------*/
606 
607 void
609  double t_eval,
610  short int f,
611  cs_analytic_func_t *ana,
612  void *input,
614  cs_real_t *eval);
615 
616 /*----------------------------------------------------------------------------*/
627 /*----------------------------------------------------------------------------*/
628 
629 void
631  double t_eval,
632  cs_analytic_func_t *ana,
633  void *input,
635  cs_real_t *eval);
636 
637 /*----------------------------------------------------------------------------*/
651 /*----------------------------------------------------------------------------*/
652 
653 void
655  cs_real_t t_eval,
656  cs_analytic_func_t *ana,
657  void *input,
658  const short int dim,
661  cs_real_t *c_int,
662  cs_real_t *f_int);
663 
664 /*----------------------------------------------------------------------------*/
677 /*----------------------------------------------------------------------------*/
678 
679 void
681  short int f,
682  cs_real_t time_eval,
683  void *input,
684  cs_quadrature_type_t qtype,
685  cs_real_t *eval);
686 
687 /*----------------------------------------------------------------------------*/
700 /*----------------------------------------------------------------------------*/
701 
702 void
704  short int f,
705  cs_real_t t_eval,
706  void *context,
707  cs_quadrature_type_t qtype,
708  cs_real_t *eval);
709 
710 /*----------------------------------------------------------------------------*/
723 /*----------------------------------------------------------------------------*/
724 
725 void
727  short int f,
728  cs_real_t t_eval,
729  void *context,
730  cs_quadrature_type_t qtype,
731  cs_real_t *eval);
732 
733 /*----------------------------------------------------------------------------*/
746 /*----------------------------------------------------------------------------*/
747 
748 void
750  cs_real_t t_eval,
751  void *context,
752  cs_quadrature_type_t qtype,
753  cs_real_t *eval);
754 
755 /*----------------------------------------------------------------------------*/
769 /*----------------------------------------------------------------------------*/
770 
771 void
773  cs_real_t t_eval,
774  void *context,
775  cs_quadrature_type_t qtype,
776  cs_real_t *eval);
777 
778 /*----------------------------------------------------------------------------*/
792 /*----------------------------------------------------------------------------*/
793 
794 void
796  cs_real_t t_eval,
797  void *context,
798  cs_quadrature_type_t qtype,
799  cs_real_t *eval);
800 
801 /*----------------------------------------------------------------------------*/
811 /*----------------------------------------------------------------------------*/
812 
813 void
815  cs_real_t time_eval,
816  void *context,
817  cs_real_t *eval);
818 
819 /*----------------------------------------------------------------------------*/
829 /*----------------------------------------------------------------------------*/
830 
831 void
833  cs_real_t time_eval,
834  void *context,
835  cs_real_t *eval);
836 
837 /*----------------------------------------------------------------------------*/
848 /*----------------------------------------------------------------------------*/
849 
850 void
852  cs_real_t time_eval,
853  void *context,
854  cs_real_t *eval);
855 
856 /*----------------------------------------------------------------------------*/
866 /*----------------------------------------------------------------------------*/
867 
868 void
870  cs_real_t time_eval,
871  void *context,
872  cs_real_t *eval);
873 
874 /*----------------------------------------------------------------------------*/
887 /*----------------------------------------------------------------------------*/
888 
889 void
891  cs_lnum_t n_points,
892  const cs_real_t *xyz,
893  cs_real_t time_eval,
894  void *context,
895  cs_real_t *eval);
896 
897 /*----------------------------------------------------------------------------*/
911 /*----------------------------------------------------------------------------*/
912 
913 void
915  cs_lnum_t n_points,
916  const cs_real_t *xyz,
917  cs_real_t time_eval,
918  void *context,
919  cs_real_t *eval);
920 
921 /*----------------------------------------------------------------------------*/
935 /*----------------------------------------------------------------------------*/
936 
937 void
939  cs_lnum_t n_points,
940  const cs_real_t *xyz,
941  cs_real_t time_eval,
942  void *context,
943  cs_real_t *eval);
944 
945 /*----------------------------------------------------------------------------*/
958 /*----------------------------------------------------------------------------*/
959 
960 void
962  short int f,
963  cs_real_t time_eval,
964  void *context,
965  cs_real_t *eval);
966 
967 /*----------------------------------------------------------------------------*/
981 /*----------------------------------------------------------------------------*/
982 
983 void
985  short int f,
986  cs_real_t time_eval,
987  void *context,
988  cs_quadrature_type_t qtype,
989  cs_real_t *eval);
990 
991 /*----------------------------------------------------------------------------*/
1004 /*----------------------------------------------------------------------------*/
1005 
1006 void
1008  short int f,
1009  cs_real_t time_eval,
1010  void *context,
1011  cs_quadrature_type_t qtype,
1012  cs_real_t *eval);
1013 
1014 /*----------------------------------------------------------------------------*/
1028 /*----------------------------------------------------------------------------*/
1029 
1030 void
1032  short int f,
1033  cs_real_t time_eval,
1034  void *context,
1035  cs_quadrature_type_t qtype,
1036  cs_real_t *eval);
1037 
1038 /*----------------------------------------------------------------------------*/
1053 /*----------------------------------------------------------------------------*/
1054 
1055 void
1057  cs_real_t t_eval,
1058  void *context,
1059  cs_quadrature_type_t qtype,
1060  cs_real_t *eval);
1061 
1062 /*----------------------------------------------------------------------------*/
1077 /*----------------------------------------------------------------------------*/
1078 
1079 void
1081  cs_real_t t_eval,
1082  void *context,
1083  cs_quadrature_type_t qtype,
1084  cs_real_t *eval);
1085 
1086 /*----------------------------------------------------------------------------*/
1087 
1088 #undef _dp3
1089 
1091 
1092 #endif /* __CS_XDEF_CW_EVAL_H__ */
cs_quadrature.h
cs_xdef_cw_eval_face_t
void() cs_xdef_cw_eval_face_t(const cs_cell_mesh_t *cm, short int f, cs_real_t time_eval, 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_cw_eval.h:135
cs_xdef_cw_eval_vector_avg_by_analytic
void cs_xdef_cw_eval_vector_avg_by_analytic(const cs_cell_mesh_t *cm, cs_real_t t_eval, void *context, 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_cw_eval.c:545
cs_xdef_cw_eval_vect_avg_reduction_by_analytic
void cs_xdef_cw_eval_vect_avg_reduction_by_analytic(const cs_cell_mesh_t *cm, cs_real_t t_eval, void *context, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the reduction by averages of a analytic function by a cellwise proces...
Definition: cs_xdef_cw_eval.c:1759
cs_xdef_cw_eval_vector_at_xyz_by_array
void cs_xdef_cw_eval_vector_at_xyz_by_array(const cs_cell_mesh_t *cm, cs_lnum_t n_points, const cs_real_t *xyz, cs_real_t time_eval, void *context, cs_real_t *eval)
Function pointer for evaluating a quantity defined by analytic function at a precise location inside ...
Definition: cs_xdef_cw_eval.c:831
cs_xdef_cw_eval_by_analytic
void cs_xdef_cw_eval_by_analytic(const cs_cell_mesh_t *cm, cs_real_t time_eval, void *context, 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_cw_eval.c:656
cs_analytic_func_t
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 dense_output, void *input, cs_real_t *retval)
Generic function pointer for an evaluation relying on an analytic function elt_ids is optional....
Definition: cs_param_types.h:94
cs_xdef_cw_eval_vector_face_avg_by_analytic
void cs_xdef_cw_eval_vector_face_avg_by_analytic(const cs_cell_mesh_t *cm, short int f, cs_real_t t_eval, void *context, 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_cw_eval.c:414
cs_xdef_cw_eval_fc_int_by_analytic
void cs_xdef_cw_eval_fc_int_by_analytic(const cs_cell_mesh_t *cm, cs_real_t t_eval, 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_cw_eval.c:255
cs_real_3_t
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:317
cs_xdef_cw_eval_flux_by_analytic
void cs_xdef_cw_eval_flux_by_analytic(const cs_cell_mesh_t *cm, short int f, cs_real_t time_eval, void *context, 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_cw_eval.c:1344
cs_quant_t::center
double center[3]
Definition: cs_cdo_quantities.h:120
cs_xdef_cw_eval_scalar_avg_by_analytic
void cs_xdef_cw_eval_scalar_avg_by_analytic(const cs_cell_mesh_t *cm, cs_real_t t_eval, void *context, 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_cw_eval.c:502
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:493
cs_xdef_cw_eval_xyz_t
void() cs_xdef_cw_eval_xyz_t(const cs_cell_mesh_t *cm, cs_lnum_t n_points, const cs_real_t *xyz, cs_real_t time_eval, 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_cw_eval.h:91
cs_xdef_analytic_context_t::func
cs_analytic_func_t * func
Definition: cs_xdef.h:256
cs_quant_t::meas
double meas
Definition: cs_cdo_quantities.h:118
cs_xdef_cw_eval_t
void() cs_xdef_cw_eval_t(const cs_cell_mesh_t *cm, cs_real_t time_eval, 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_cw_eval.h:70
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:304
cs_flag_primal_face
const cs_flag_t cs_flag_primal_face
Definition: cs_flag.c:55
cs_xdef_cw_eval_int_t
void() cs_xdef_cw_eval_int_t(const cs_cell_mesh_t *cm, cs_real_t time_eval, 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_cw_eval.h:113
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:492
cs_xdef_cw_eval_by_time_func
void cs_xdef_cw_eval_by_time_func(const cs_cell_mesh_t *cm, cs_real_t time_eval, void *context, cs_real_t *eval)
Evaluate a quantity by a cellwise process using a definition by time function.
Definition: cs_xdef_cw_eval.c:631
cs_xdef_cw_eval_flux_at_vtx_by_val
void cs_xdef_cw_eval_flux_at_vtx_by_val(const cs_cell_mesh_t *cm, short int f, cs_real_t time_eval, void *context, 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_cw_eval.c:977
cs_xdef_array_context_t
Context structure when an array is used for the definition.
Definition: cs_xdef.h:207
cs_cdo_quantities.h
cs_xdef_cw_eval_at_xyz_by_analytic
void cs_xdef_cw_eval_at_xyz_by_analytic(const cs_cell_mesh_t *cm, cs_lnum_t n_points, const cs_real_t *xyz, cs_real_t time_eval, void *context, cs_real_t *eval)
Function pointer for evaluating a quantity defined by analytic function at a precise location (x,...
Definition: cs_xdef_cw_eval.c:796
CS_FLAG_COMP_PFQ
@ CS_FLAG_COMP_PFQ
Definition: cs_flag.h:201
cs_xdef_cw_eval_f_int_by_analytic
void cs_xdef_cw_eval_f_int_by_analytic(const cs_cell_mesh_t *cm, double t_eval, short int f, cs_analytic_func_t *ana, void *input, cs_quadrature_tria_integral_t *qfunc, cs_real_t *eval)
Integrate an analytic function over a face.
Definition: cs_xdef_cw_eval.c:103
bft_error
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
cs_xdef_analytic_context_t
Context structure when a definition by analytic function is used.
Definition: cs_xdef.h:246
cs_mesh.h
cs_xdef_array_context_t::values
cs_real_t * values
Definition: cs_xdef.h:235
cs_xdef.h
cs_xdef_analytic_context_t::input
void * input
Definition: cs_xdef.h:262
cs_xdef_cw_eval_scal_avg_reduction_by_analytic
void cs_xdef_cw_eval_scal_avg_reduction_by_analytic(const cs_cell_mesh_t *cm, cs_real_t t_eval, void *context, cs_quadrature_type_t qtype, cs_real_t *eval)
Function pointer for evaluating the reduction by averages of a analytic function by a cellwise proces...
Definition: cs_xdef_cw_eval.c:1705
cs_quadrature_tria_integral_t
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:169
cs_quant_t::unitv
double unitv[3]
Definition: cs_cdo_quantities.h:119
cs_quadrature_tetra_integral_t
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:196
_dp3
#define _dp3
Definition: cs_xdef_cw_eval.h:50
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_xdef_cw_eval_vector_at_xyz_by_field
void cs_xdef_cw_eval_vector_at_xyz_by_field(const cs_cell_mesh_t *cm, cs_lnum_t n_points, const cs_real_t *xyz, cs_real_t time_eval, void *context, 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_cw_eval.c:912
cs_xdef_cw_eval_tensor_face_avg_by_analytic
void cs_xdef_cw_eval_tensor_face_avg_by_analytic(const cs_cell_mesh_t *cm, short int f, cs_real_t t_eval, void *context, 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_cw_eval.c:458
cs_xdef_cw_eval_flux_at_vtx_by_analytic
void cs_xdef_cw_eval_flux_at_vtx_by_analytic(const cs_cell_mesh_t *cm, short int f, cs_real_t time_eval, void *context, 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_cw_eval.c:1038
cs_cdo_connect.h
cs_cell_mesh_t::face
cs_quant_t * face
Definition: cs_cdo_local.h:195
CS_UNUSED
#define CS_UNUSED(x)
Definition: cs_defs.h:478
cs_xdef_cw_eval_by_field
void cs_xdef_cw_eval_by_field(const cs_cell_mesh_t *cm, cs_real_t time_eval, void *context, 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_cw_eval.c:743
cs_xdef_cw_eval_scalar_face_avg_by_analytic
void cs_xdef_cw_eval_scalar_face_avg_by_analytic(const cs_cell_mesh_t *cm, short int f, cs_real_t time_eval, 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_cw_eval.c:372
cs_xdef_array_context_t::loc
cs_flag_t loc
Definition: cs_xdef.h:234
cs_xdef_cw_eval_by_array
void cs_xdef_cw_eval_by_array(const cs_cell_mesh_t *cm, cs_real_t time_eval, void *context, cs_real_t *eval)
Evaluate a quantity at cells defined by an array. Array is assumed to be interlaced....
Definition: cs_xdef_cw_eval.c:684
cs_quant_t
Definition: cs_cdo_quantities.h:116
cs_cell_mesh_t::f_ids
cs_lnum_t * f_ids
Definition: cs_cdo_local.h:191
cs_xdef_cw_eval_c_int_by_analytic
void cs_xdef_cw_eval_c_int_by_analytic(const cs_cell_mesh_t *cm, double t_eval, cs_analytic_func_t *ana, void *input, cs_quadrature_tetra_integral_t *qfunc, cs_real_t *eval)
Integrate an analytic function over a cell.
Definition: cs_xdef_cw_eval.c:159
cs_quadrature_type_t
cs_quadrature_type_t
Definition: cs_quadrature.h:52
cs_xdef_cw_eval_tensor_flux_by_analytic
void cs_xdef_cw_eval_tensor_flux_by_analytic(const cs_cell_mesh_t *cm, short int f, cs_real_t time_eval, void *context, 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_cw_eval.c:1521
cs_cell_mesh_t
Set of local quantities and connectivities related to a mesh cell This is a key structure for all cel...
Definition: cs_cdo_local.h:159
cs_xdef_cw_eval_tensor_avg_by_analytic
void cs_xdef_cw_eval_tensor_avg_by_analytic(const cs_cell_mesh_t *cm, cs_real_t t_eval, void *context, 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_cw_eval.c:590
cs_cell_mesh_t::flag
cs_eflag_t flag
Definition: cs_cdo_local.h:161
k
@ k
Definition: cs_field_pointer.h:70
cs_cdo_local.h