7.2
general documentation
cs_source_term.h
Go to the documentation of this file.
1 #ifndef __CS_SOURCE_TERM_H__
2 #define __CS_SOURCE_TERM_H__
3 
4 /*============================================================================
5  * Functions and structures to deal with source term computation
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2022 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_base.h"
35 #include "cs_cdo_quantities.h"
36 #include "cs_cdo_local.h"
37 #include "cs_param_types.h"
38 #include "cs_quadrature.h"
39 #include "cs_xdef.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
49 #define CS_N_MAX_SOURCE_TERMS 8 // Max number of source terms in an equation
50 
51 /*============================================================================
52  * Type definitions
53  *============================================================================*/
54 
55 /*----------------------------------------------------------------------------*/
67 /*----------------------------------------------------------------------------*/
68 
69 typedef void
71  const cs_cell_mesh_t *cm,
72  cs_real_t time_eval,
74  void *input,
75  double *values);
76 
77 
78 /*============================================================================
79  * Public function prototypes
80  *============================================================================*/
81 
82 /*----------------------------------------------------------------------------*/
89 /*----------------------------------------------------------------------------*/
90 
91 void
93  const cs_cdo_connect_t *connect);
94 
95 /*----------------------------------------------------------------------------*/
104 /*----------------------------------------------------------------------------*/
105 
106 void
108  cs_flag_t *state_flag,
109  cs_flag_t *meta_flag);
110 
111 /*----------------------------------------------------------------------------*/
119 /*----------------------------------------------------------------------------*/
120 
121 void
123  cs_flag_t flag);
124 
125 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 cs_flag_t
137 
138 /*----------------------------------------------------------------------------*/
152 /*----------------------------------------------------------------------------*/
153 
156  const int n_source_terms,
157  cs_xdef_t *const *source_terms,
158  cs_source_term_cellwise_t *compute_source[],
159  cs_flag_t *sys_flag,
160  cs_mask_t *source_mask[]);
161 
162 /*----------------------------------------------------------------------------*/
177 /*----------------------------------------------------------------------------*/
178 
179 void
180 cs_source_term_compute_cellwise(const int n_source_terms,
181  cs_xdef_t *const *source_terms,
182  const cs_cell_mesh_t *cm,
183  const cs_mask_t *source_mask,
184  cs_source_term_cellwise_t *compute_source[],
185  cs_real_t time_eval,
186  void *input,
187  cs_cell_builder_t *cb,
188  cs_real_t *result);
189 
190 /*----------------------------------------------------------------------------*/
206 /*----------------------------------------------------------------------------*/
207 
208 void
210  const cs_cell_mesh_t *cm,
211  cs_real_t time_eval,
212  cs_cell_builder_t *cb,
213  void *input,
214  double *values);
215 
216 /*----------------------------------------------------------------------------*/
232 /*----------------------------------------------------------------------------*/
233 
234 void
236  const cs_cell_mesh_t *cm,
237  cs_real_t time_eval,
238  cs_cell_builder_t *cb,
239  void *input,
240  double *values);
241 
242 /*----------------------------------------------------------------------------*/
257 /*----------------------------------------------------------------------------*/
258 
259 void
261  const cs_cell_mesh_t *cm,
262  cs_real_t time_eval,
263  cs_cell_builder_t *cb,
264  void *input,
265  double *values);
266 
267 /*----------------------------------------------------------------------------*/
282 /*----------------------------------------------------------------------------*/
283 
284 void
286  const cs_cell_mesh_t *cm,
287  cs_real_t time_eval,
288  cs_cell_builder_t *cb,
289  void *input,
290  double *values);
291 
292 /*----------------------------------------------------------------------------*/
305 /*----------------------------------------------------------------------------*/
306 
307 void
309  const cs_cell_mesh_t *cm,
310  cs_real_t time_eval,
311  cs_cell_builder_t *cb,
312  void *input,
313  double *values);
314 
315 /*----------------------------------------------------------------------------*/
328 /*----------------------------------------------------------------------------*/
329 
330 void
332  const cs_cell_mesh_t *cm,
333  cs_real_t time_eval,
334  cs_cell_builder_t *cb,
335  void *input,
336  double *values);
337 
338 /*----------------------------------------------------------------------------*/
352 /*----------------------------------------------------------------------------*/
353 
354 void
356  const cs_cell_mesh_t *cm,
357  cs_real_t time_eval,
358  cs_cell_builder_t *cb,
359  void *input,
360  double *values);
361 
362 /*----------------------------------------------------------------------------*/
376 /*----------------------------------------------------------------------------*/
377 
378 void
380  const cs_cell_mesh_t *cm,
381  cs_real_t time_eval,
382  cs_cell_builder_t *cb,
383  void *input,
384  double *values);
385 
386 /*----------------------------------------------------------------------------*/
400 /*----------------------------------------------------------------------------*/
401 
402 void
404  const cs_cell_mesh_t *cm,
405  cs_real_t time_eval,
406  cs_cell_builder_t *cb,
407  void *input,
408  double *values);
409 
410 /*----------------------------------------------------------------------------*/
423 /*----------------------------------------------------------------------------*/
424 
425 void
427  const cs_cell_mesh_t *cm,
428  cs_real_t time_eval,
429  cs_cell_builder_t *cb,
430  void *input,
431  double *values);
432 
433 /*----------------------------------------------------------------------------*/
447 /*----------------------------------------------------------------------------*/
448 
449 void
451  const cs_cell_mesh_t *cm,
452  cs_real_t time_eval,
453  cs_cell_builder_t *cb,
454  void *input,
455  double *values);
456 
457 /*----------------------------------------------------------------------------*/
473 /*----------------------------------------------------------------------------*/
474 
475 void
477  const cs_cell_mesh_t *cm,
478  cs_real_t time_eval,
479  cs_cell_builder_t *cb,
480  void *input,
481  double *values);
482 
483 /*----------------------------------------------------------------------------*/
499 /*----------------------------------------------------------------------------*/
500 
501 void
503  const cs_cell_mesh_t *cm,
504  cs_real_t time_eval,
505  cs_cell_builder_t *cb,
506  void *input,
507  double *values);
508 
509 /*----------------------------------------------------------------------------*/
525 /*----------------------------------------------------------------------------*/
526 
527 void
529  const cs_cell_mesh_t *cm,
530  cs_real_t time_eval,
531  cs_cell_builder_t *cb,
532  void *input,
533  double *values);
534 
535 /*----------------------------------------------------------------------------*/
553 /*----------------------------------------------------------------------------*/
554 
555 void
557  const cs_cell_mesh_t *cm,
558  cs_real_t time_eval,
559  cs_cell_builder_t *cb,
560  void *input,
561  double *values);
562 
563 /*----------------------------------------------------------------------------*/
579 /*----------------------------------------------------------------------------*/
580 
581 void
583  const cs_cell_mesh_t *cm,
584  cs_real_t time_eval,
585  cs_cell_builder_t *cb,
586  void *input,
587  double *values);
588 
589 /*----------------------------------------------------------------------------*/
605 /*----------------------------------------------------------------------------*/
606 
607 void
609  const cs_cell_mesh_t *cm,
610  cs_real_t time_eval,
611  cs_cell_builder_t *cb,
612  void *input,
613  double *values);
614 
615 /*----------------------------------------------------------------------------*/
629 /*----------------------------------------------------------------------------*/
630 
631 void
633  const cs_cell_mesh_t *cm,
634  cs_real_t time_eval,
635  cs_cell_builder_t *cb,
636  void *input,
637  double *values);
638 
639 /*----------------------------------------------------------------------------*/
653 /*----------------------------------------------------------------------------*/
654 
655 void
657  const cs_cell_mesh_t *cm,
658  cs_real_t time_eval,
659  cs_cell_builder_t *cb,
660  void *input,
661  double *values);
662 
663 /*----------------------------------------------------------------------------*/
677 /*----------------------------------------------------------------------------*/
678 
679 void
681  const cs_cell_mesh_t *cm,
682  cs_real_t time_eval,
683  cs_cell_builder_t *cb,
684  void *input,
685  double *values);
686 
687 /*----------------------------------------------------------------------------*/
702 /*----------------------------------------------------------------------------*/
703 
704 void
706  const cs_cell_mesh_t *cm,
707  cs_real_t time_eval,
708  cs_cell_builder_t *cb,
709  void *input,
710  double *values);
711 
712 /*----------------------------------------------------------------------------*/
729 /*----------------------------------------------------------------------------*/
730 
731 void
733  const cs_cell_mesh_t *cm,
734  cs_real_t time_eval,
735  cs_cell_builder_t *cb,
736  void *input,
737  double *values);
738 
739 /*----------------------------------------------------------------------------*/
753 /*----------------------------------------------------------------------------*/
754 
755 void
757  const cs_cell_mesh_t *cm,
758  cs_real_t time_eval,
759  cs_cell_builder_t *cb,
760  void *input,
761  double *values);
762 
763 /*----------------------------------------------------------------------------*/
776 /*----------------------------------------------------------------------------*/
777 
778 void
780  const cs_cell_mesh_t *cm,
781  cs_real_t time_eval,
782  cs_cell_builder_t *cb,
783  void *input,
784  double *values);
785 
786 /*----------------------------------------------------------------------------*/
803 /*----------------------------------------------------------------------------*/
804 
805 void
807  const cs_cell_mesh_t *cm,
808  cs_real_t time_eval,
809  cs_cell_builder_t *cb,
810  void *input,
811  double *values);
812 
813 /*----------------------------------------------------------------------------*/
827 /*----------------------------------------------------------------------------*/
828 
829 void
831  const cs_cell_mesh_t *cm,
832  cs_real_t time_eval,
833  cs_cell_builder_t *cb,
834  void *input,
835  double *values);
836 
837 /*----------------------------------------------------------------------------*/
850 /*----------------------------------------------------------------------------*/
851 
852 void
854  const cs_cell_mesh_t *cm,
855  cs_real_t time_eval,
856  cs_cell_builder_t *cb,
857  void *input,
858  double *values);
859 
860 /*----------------------------------------------------------------------------*/
874 /*----------------------------------------------------------------------------*/
875 
876 void
878  const cs_cell_mesh_t *cm,
879  cs_real_t time_eval,
880  cs_cell_builder_t *cb,
881  void *input,
882  double *values);
883 
884 /*----------------------------------------------------------------------------*/
899 /*----------------------------------------------------------------------------*/
900 
901 void
903  const cs_cell_mesh_t *cm,
904  cs_real_t time_eval,
905  cs_cell_builder_t *cb,
906  void *input,
907  double *values);
908 
909 /*----------------------------------------------------------------------------*/
924 /*----------------------------------------------------------------------------*/
925 
926 void
928  const cs_cell_mesh_t *cm,
929  cs_real_t time_eval,
930  cs_cell_builder_t *cb,
931  void *input,
932  double *values);
933 
934 /*----------------------------------------------------------------------------*/
947 /*----------------------------------------------------------------------------*/
948 
949 void
951  const cs_cell_mesh_t *cm,
952  cs_real_t time_eval,
953  cs_cell_builder_t *cb,
954  void *input,
955  double *values);
956 
957 /*----------------------------------------------------------------------------*/
958 
959 
960 
962 
963 #endif /* __CS_SOURCE_TERM_H__ */
void cs_source_term_dcsd_q5o3_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1931
cs_flag_t cs_source_term_get_flag(const cs_xdef_t *st)
Get metadata related to the given source term structure.
Definition: cs_source_term.c:635
void cs_source_term_pcvd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:2543
cs_eflag_t cs_source_term_init(cs_param_space_scheme_t space_scheme, const int n_source_terms, cs_xdef_t *const *source_terms, cs_source_term_cellwise_t *compute_source[], cs_flag_t *sys_flag, cs_mask_t *source_mask[])
Initialize data to build the source terms.
Definition: cs_source_term.c:660
void cs_source_term_hhovd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values...
Definition: cs_source_term.c:3019
unsigned char cs_mask_t
Definition: cs_flag.h:158
void cs_source_term_dcsd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1530
void cs_source_term_pvsp_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:991
void cs_source_term_hhosd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values...
Definition: cs_source_term.c:2902
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
void cs_source_term_dcsd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1215
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:203
void cs_source_term_dcsd_q10o2_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1719
Definition: cs_cdo_connect.h:61
void cs_source_term_pvsp_by_c2v_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1161
void cs_source_term_dcsd_q1o1_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1640
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
Definition: cs_cdo_quantities.h:132
void cs_source_term_pcsd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:2149
void cs_source_term_dfsf_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:3132
void cs_source_term_dcsd_by_pv_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1296
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param_types.h:207
void cs_source_term_set_reduction(cs_xdef_t *st, cs_flag_t flag)
Set advanced parameters which are defined by default in a source term structure.
Definition: cs_source_term.c:578
void cs_source_term_dcsd_by_c2v_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term in a cell and add it to the given array of values...
Definition: cs_source_term.c:1337
void cs_source_term_dcsd_none_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1478
void cs_source_term_pcvd_by_dof_func(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:2236
void cs_source_term_vcsp_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:2088
void cs_source_term_pvsp_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1047
void cs_source_term_pcvd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it the given array of values...
Definition: cs_source_term.c:2287
void cs_source_term_pcsd_by_dof_func(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:2187
void cs_source_term_hhosd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values...
Definition: cs_source_term.c:2772
Set of local and temporary buffers.
Definition: cs_cdo_local.h:60
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:154
void cs_source_term_dcvd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1255
void cs_source_term_pcsd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values...
Definition: cs_source_term.c:2375
void cs_source_term_set_default_flag(cs_param_space_scheme_t scheme, cs_flag_t *state_flag, cs_flag_t *meta_flag)
Set the default flag related to a source term according to the numerical scheme chosen for discretizi...
Definition: cs_source_term.c:532
void cs_source_term_pcvd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values...
Definition: cs_source_term.c:2593
#define END_C_DECLS
Definition: cs_defs.h:511
unsigned short int cs_flag_t
Definition: cs_defs.h:324
void cs_source_term_compute_cellwise(const int n_source_terms, cs_xdef_t *const *source_terms, const cs_cell_mesh_t *cm, const cs_mask_t *source_mask, cs_source_term_cellwise_t *compute_source[], cs_real_t time_eval, void *input, cs_cell_builder_t *cb, cs_real_t *result)
Compute the local contributions of source terms in a cell.
Definition: cs_source_term.c:926
unsigned int cs_eflag_t
Definition: cs_flag.h:187
void cs_source_term_dcsd_by_dof_func(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1427
void cs_source_term_pvsp_by_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1102
void cs_source_term_pcsd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:2328
void cs_source_term_pcvd_by_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values...
Definition: cs_source_term.c:2727
void cs_source_term_vcsp_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:2032
void cs_source_term_init_sharing(const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect)
Set shared pointers to main domain members.
Definition: cs_source_term.c:513
void() cs_source_term_cellwise_t(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.h:70
void cs_source_term_pcsd_by_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:2501
void cs_source_term_dcsd_by_pc_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values...
Definition: cs_source_term.c:1386