9.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-2026 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 "base/cs_base.h"
35#include "base/cs_param_types.h"
36#include "cdo/cs_cdo_local.h"
38#include "cdo/cs_quadrature.h"
39#include "cdo/cs_xdef.h"
40
41/*============================================================================
42 * Macro definitions
43 *============================================================================*/
44
45/*============================================================================
46 * Type definitions
47 *============================================================================*/
48
49/*----------------------------------------------------------------------------*/
61/*----------------------------------------------------------------------------*/
62
63typedef void
65 const cs_cell_mesh_t *cm,
66 cs_real_t time_eval,
68 void *input,
69 double *values);
70
71
72/*============================================================================
73 * Public function prototypes
74 *============================================================================*/
75
76/*----------------------------------------------------------------------------*/
83/*----------------------------------------------------------------------------*/
84
85void
87 const cs_cdo_connect_t *connect);
88
89/*----------------------------------------------------------------------------*/
98/*----------------------------------------------------------------------------*/
99
100void
102 cs_flag_t *state_flag,
103 cs_flag_t *meta_flag);
104
105/*----------------------------------------------------------------------------*/
113/*----------------------------------------------------------------------------*/
114
115void
117 cs_flag_t flag);
118
119/*----------------------------------------------------------------------------*/
127/*----------------------------------------------------------------------------*/
128
131
132/*----------------------------------------------------------------------------*/
146/*----------------------------------------------------------------------------*/
147
150 const int n_source_terms,
151 cs_xdef_t *const *source_terms,
152 cs_source_term_cellwise_t **p_compute_source[],
153 cs_flag_t *sys_flag,
154 cs_mask_t *source_mask[]);
155
156/*----------------------------------------------------------------------------*/
171/*----------------------------------------------------------------------------*/
172
173void
174cs_source_term_compute_cellwise(const int n_source_terms,
175 cs_xdef_t *const *source_terms,
176 const cs_cell_mesh_t *cm,
177 const cs_mask_t *source_mask,
178 cs_source_term_cellwise_t *compute_source[],
179 cs_real_t time_eval,
180 void *input,
182 cs_real_t *result);
183
184/*----------------------------------------------------------------------------*/
200/*----------------------------------------------------------------------------*/
201
202void
204 const cs_cell_mesh_t *cm,
205 cs_real_t time_eval,
207 void *input,
208 double *values);
209
210/*----------------------------------------------------------------------------*/
226/*----------------------------------------------------------------------------*/
227
228void
230 const cs_cell_mesh_t *cm,
231 cs_real_t time_eval,
233 void *input,
234 double *values);
235
236/*----------------------------------------------------------------------------*/
251/*----------------------------------------------------------------------------*/
252
253void
255 const cs_cell_mesh_t *cm,
256 cs_real_t time_eval,
258 void *input,
259 double *values);
260
261/*----------------------------------------------------------------------------*/
276/*----------------------------------------------------------------------------*/
277
278void
280 const cs_cell_mesh_t *cm,
281 cs_real_t time_eval,
283 void *input,
284 double *values);
285
286/*----------------------------------------------------------------------------*/
299/*----------------------------------------------------------------------------*/
300
301void
303 const cs_cell_mesh_t *cm,
304 cs_real_t time_eval,
306 void *input,
307 double *values);
308
309/*----------------------------------------------------------------------------*/
322/*----------------------------------------------------------------------------*/
323
324void
326 const cs_cell_mesh_t *cm,
327 cs_real_t time_eval,
329 void *input,
330 double *values);
331
332/*----------------------------------------------------------------------------*/
346/*----------------------------------------------------------------------------*/
347
348void
350 const cs_cell_mesh_t *cm,
351 cs_real_t time_eval,
353 void *input,
354 double *values);
355
356/*----------------------------------------------------------------------------*/
370/*----------------------------------------------------------------------------*/
371
372void
374 const cs_cell_mesh_t *cm,
375 cs_real_t time_eval,
377 void *input,
378 double *values);
379
380/*----------------------------------------------------------------------------*/
394/*----------------------------------------------------------------------------*/
395
396void
398 const cs_cell_mesh_t *cm,
399 cs_real_t time_eval,
401 void *input,
402 double *values);
403
404/*----------------------------------------------------------------------------*/
418/*----------------------------------------------------------------------------*/
419
420void
422 const cs_cell_mesh_t *cm,
423 cs_real_t time_eval,
425 void *input,
426 double *values);
427
428/*----------------------------------------------------------------------------*/
441/*----------------------------------------------------------------------------*/
442
443void
445 const cs_cell_mesh_t *cm,
446 cs_real_t time_eval,
448 void *input,
449 double *values);
450
451/*----------------------------------------------------------------------------*/
465/*----------------------------------------------------------------------------*/
466
467void
469 const cs_cell_mesh_t *cm,
470 cs_real_t time_eval,
472 void *input,
473 double *values);
474
475/*----------------------------------------------------------------------------*/
491/*----------------------------------------------------------------------------*/
492
493void
495 const cs_cell_mesh_t *cm,
496 cs_real_t time_eval,
498 void *input,
499 double *values);
500
501/*----------------------------------------------------------------------------*/
517/*----------------------------------------------------------------------------*/
518
519void
521 const cs_cell_mesh_t *cm,
522 cs_real_t time_eval,
524 void *input,
525 double *values);
526
527/*----------------------------------------------------------------------------*/
543/*----------------------------------------------------------------------------*/
544
545void
547 const cs_cell_mesh_t *cm,
548 cs_real_t time_eval,
550 void *input,
551 double *values);
552
553/*----------------------------------------------------------------------------*/
571/*----------------------------------------------------------------------------*/
572
573void
575 const cs_cell_mesh_t *cm,
576 cs_real_t time_eval,
578 void *input,
579 double *values);
580
581/*----------------------------------------------------------------------------*/
597/*----------------------------------------------------------------------------*/
598
599void
601 const cs_cell_mesh_t *cm,
602 cs_real_t time_eval,
604 void *input,
605 double *values);
606
607/*----------------------------------------------------------------------------*/
623/*----------------------------------------------------------------------------*/
624
625void
627 const cs_cell_mesh_t *cm,
628 cs_real_t time_eval,
630 void *input,
631 double *values);
632
633/*----------------------------------------------------------------------------*/
647/*----------------------------------------------------------------------------*/
648
649void
651 const cs_cell_mesh_t *cm,
652 cs_real_t time_eval,
654 void *input,
655 double *values);
656
657/*----------------------------------------------------------------------------*/
671/*----------------------------------------------------------------------------*/
672
673void
675 const cs_cell_mesh_t *cm,
676 cs_real_t time_eval,
678 void *input,
679 double *values);
680
681/*----------------------------------------------------------------------------*/
695/*----------------------------------------------------------------------------*/
696
697void
699 const cs_cell_mesh_t *cm,
700 cs_real_t time_eval,
702 void *input,
703 double *values);
704
705/*----------------------------------------------------------------------------*/
720/*----------------------------------------------------------------------------*/
721
722void
724 const cs_cell_mesh_t *cm,
725 cs_real_t time_eval,
727 void *input,
728 double *values);
729
730/*----------------------------------------------------------------------------*/
747/*----------------------------------------------------------------------------*/
748
749void
751 const cs_cell_mesh_t *cm,
752 cs_real_t time_eval,
754 void *input,
755 double *values);
756
757/*----------------------------------------------------------------------------*/
772/*----------------------------------------------------------------------------*/
773
774void
776 const cs_cell_mesh_t *cm,
777 cs_real_t time_eval,
779 void *input,
780 double *values);
781
782/*----------------------------------------------------------------------------*/
796/*----------------------------------------------------------------------------*/
797
798void
800 const cs_cell_mesh_t *cm,
801 cs_real_t time_eval,
803 void *input,
804 double *values);
805
806/*----------------------------------------------------------------------------*/
823/*----------------------------------------------------------------------------*/
824
825void
827 const cs_cell_mesh_t *cm,
828 cs_real_t time_eval,
830 void *input,
831 double *values);
832
833/*----------------------------------------------------------------------------*/
848/*----------------------------------------------------------------------------*/
849
850void
852 const cs_cell_mesh_t *cm,
853 cs_real_t time_eval,
855 void *input,
856 double *values);
857
858/*----------------------------------------------------------------------------*/
873/*----------------------------------------------------------------------------*/
874
876 const cs_cell_mesh_t *cm,
877 cs_real_t time_eval,
879 void *input,
880 double *values);
881
882/*----------------------------------------------------------------------------*/
896/*----------------------------------------------------------------------------*/
897
898void
900 const cs_cell_mesh_t *cm,
901 cs_real_t time_eval,
903 void *input,
904 double *values);
905
906/*----------------------------------------------------------------------------*/
920/*----------------------------------------------------------------------------*/
921
922void
924 const cs_cell_mesh_t *cm,
925 cs_real_t time_eval,
927 void *input,
928 double *values);
929
930/*----------------------------------------------------------------------------*/
945/*----------------------------------------------------------------------------*/
946
947void
949 const cs_cell_mesh_t *cm,
950 cs_real_t time_eval,
952 void *input,
953 double *values);
954
955/*----------------------------------------------------------------------------*/
970/*----------------------------------------------------------------------------*/
971
972void
974 const cs_cell_mesh_t *cm,
975 cs_real_t time_eval,
977 void *input,
978 double *values);
979
980/*----------------------------------------------------------------------------*/
993/*----------------------------------------------------------------------------*/
994
995void
997 const cs_cell_mesh_t *cm,
998 cs_real_t time_eval,
1000 void *input,
1001 double *values);
1002
1003/*----------------------------------------------------------------------------*/
1004
1005#endif /* CS_SOURCE_TERM_H */
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
unsigned short int cs_flag_t
Definition: cs_defs.h:334
unsigned char cs_mask_t
Definition: cs_flag.h:157
unsigned int cs_eflag_t
Definition: cs_flag.h:190
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param_types.h:215
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.cpp:503
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.cpp:1065
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.cpp:3013
void cs_source_term_fcb_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.cpp:2522
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.cpp:484
void cs_source_term_fb_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.cpp:2690
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.cpp:1752
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.cpp:551
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.cpp:1603
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.cpp:1001
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.cpp:1235
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.cpp:1551
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.cpp:3374
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.cpp:608
void cs_source_term_fcb_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.cpp:2647
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.cpp:3140
void cs_source_term_fb_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.cpp:2380
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.cpp:1460
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.cpp:3259
void cs_source_term_fb_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.cpp:2967
void cs_source_term_fb_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.cpp:2431
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.cpp:2225
void cs_source_term_fcb_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.cpp:2472
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.cpp:2169
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.cpp:2062
void cs_source_term_fb_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.cpp:2834
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.cpp:1655
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.cpp:1509
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.cpp:1327
void cs_source_term_fcb_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.cpp:2292
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.cpp:1831
void cs_source_term_macfb_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.cpp:2745
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.cpp:1121
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:64
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 **p_compute_source[], cs_flag_t *sys_flag, cs_mask_t *source_mask[])
Initialize data to build the source terms.
Definition: cs_source_term.cpp:633
void cs_source_term_dcvd_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.cpp:1412
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.cpp:1176
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.cpp:1368
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.cpp:1287
void cs_source_term_fcb_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.cpp:2331
Definition: cs_cdo_connect.h:57
Definition: cs_cdo_quantities.h:142
Set of local and temporary buffers.
Definition: cs_cdo_local.h:56
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:242
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:156