7.1
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-2021 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 /*----------------------------------------------------------------------------*/
255 /*----------------------------------------------------------------------------*/
256 
257 void
259  const cs_cell_mesh_t *cm,
260  cs_real_t time_eval,
261  cs_cell_builder_t *cb,
262  void *input,
263  double *values);
264 
265 /*----------------------------------------------------------------------------*/
278 /*----------------------------------------------------------------------------*/
279 
280 void
282  const cs_cell_mesh_t *cm,
283  cs_real_t time_eval,
284  cs_cell_builder_t *cb,
285  void *input,
286  double *values);
287 
288 /*----------------------------------------------------------------------------*/
301 /*----------------------------------------------------------------------------*/
302 
303 void
305  const cs_cell_mesh_t *cm,
306  cs_real_t time_eval,
307  cs_cell_builder_t *cb,
308  void *input,
309  double *values);
310 
311 /*----------------------------------------------------------------------------*/
324 /*----------------------------------------------------------------------------*/
325 
326 void
328  const cs_cell_mesh_t *cm,
329  cs_real_t time_eval,
330  cs_cell_builder_t *cb,
331  void *input,
332  double *values);
333 
334 /*----------------------------------------------------------------------------*/
350 /*----------------------------------------------------------------------------*/
351 
352 void
354  const cs_cell_mesh_t *cm,
355  cs_real_t time_eval,
356  cs_cell_builder_t *cb,
357  void *input,
358  double *values);
359 
360 /*----------------------------------------------------------------------------*/
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 /*----------------------------------------------------------------------------*/
402 /*----------------------------------------------------------------------------*/
403 
404 void
406  const cs_cell_mesh_t *cm,
407  cs_real_t time_eval,
408  cs_cell_builder_t *cb,
409  void *input,
410  double *values);
411 
412 /*----------------------------------------------------------------------------*/
430 /*----------------------------------------------------------------------------*/
431 
432 void
434  const cs_cell_mesh_t *cm,
435  cs_real_t time_eval,
436  cs_cell_builder_t *cb,
437  void *input,
438  double *values);
439 
440 /*----------------------------------------------------------------------------*/
456 /*----------------------------------------------------------------------------*/
457 
458 void
460  const cs_cell_mesh_t *cm,
461  cs_real_t time_eval,
462  cs_cell_builder_t *cb,
463  void *input,
464  double *values);
465 
466 /*----------------------------------------------------------------------------*/
482 /*----------------------------------------------------------------------------*/
483 
484 void
486  const cs_cell_mesh_t *cm,
487  cs_real_t time_eval,
488  cs_cell_builder_t *cb,
489  void *input,
490  double *values);
491 
492 /*----------------------------------------------------------------------------*/
506 /*----------------------------------------------------------------------------*/
507 
508 void
510  const cs_cell_mesh_t *cm,
511  cs_real_t time_eval,
512  cs_cell_builder_t *cb,
513  void *input,
514  double *values);
515 
516 /*----------------------------------------------------------------------------*/
530 /*----------------------------------------------------------------------------*/
531 
532 void
534  const cs_cell_mesh_t *cm,
535  cs_real_t time_eval,
536  cs_cell_builder_t *cb,
537  void *input,
538  double *values);
539 
540 /*----------------------------------------------------------------------------*/
554 /*----------------------------------------------------------------------------*/
555 
556 void
558  const cs_cell_mesh_t *cm,
559  cs_real_t time_eval,
560  cs_cell_builder_t *cb,
561  void *input,
562  double *values);
563 
564 /*----------------------------------------------------------------------------*/
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 /*----------------------------------------------------------------------------*/
606 /*----------------------------------------------------------------------------*/
607 
608 void
610  const cs_cell_mesh_t *cm,
611  cs_real_t time_eval,
612  cs_cell_builder_t *cb,
613  void *input,
614  double *values);
615 
616 /*----------------------------------------------------------------------------*/
630 /*----------------------------------------------------------------------------*/
631 
632 void
634  const cs_cell_mesh_t *cm,
635  cs_real_t time_eval,
636  cs_cell_builder_t *cb,
637  void *input,
638  double *values);
639 
640 /*----------------------------------------------------------------------------*/
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 /*----------------------------------------------------------------------------*/
680 /*----------------------------------------------------------------------------*/
681 
682 void
684  const cs_cell_mesh_t *cm,
685  cs_real_t time_eval,
686  cs_cell_builder_t *cb,
687  void *input,
688  double *values);
689 
690 /*----------------------------------------------------------------------------*/
704 /*----------------------------------------------------------------------------*/
705 
706 void
708  const cs_cell_mesh_t *cm,
709  cs_real_t time_eval,
710  cs_cell_builder_t *cb,
711  void *input,
712  double *values);
713 
714 /*----------------------------------------------------------------------------*/
727 /*----------------------------------------------------------------------------*/
728 
729 void
731  const cs_cell_mesh_t *cm,
732  cs_real_t time_eval,
733  cs_cell_builder_t *cb,
734  void *input,
735  double *values);
736 
737 /*----------------------------------------------------------------------------*/
751 /*----------------------------------------------------------------------------*/
752 
753 void
755  const cs_cell_mesh_t *cm,
756  cs_real_t time_eval,
757  cs_cell_builder_t *cb,
758  void *input,
759  double *values);
760 
761 /*----------------------------------------------------------------------------*/
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 /*----------------------------------------------------------------------------*/
801 /*----------------------------------------------------------------------------*/
802 
803 void
805  const cs_cell_mesh_t *cm,
806  cs_real_t time_eval,
807  cs_cell_builder_t *cb,
808  void *input,
809  double *values);
810 
811 /*----------------------------------------------------------------------------*/
824 /*----------------------------------------------------------------------------*/
825 
826 void
828  const cs_cell_mesh_t *cm,
829  cs_real_t time_eval,
830  cs_cell_builder_t *cb,
831  void *input,
832  double *values);
833 
834 /*----------------------------------------------------------------------------*/
835 
836 
837 
839 
840 #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:1584
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:468
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:2194
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:493
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:2675
unsigned char cs_mask_t
Definition: cs_flag.h:143
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:1195
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:911
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:2553
#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:1018
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:202
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:1382
Definition: cs_cdo_connect.h:79
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:1301
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
Definition: cs_cdo_quantities.h:129
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:1796
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:2793
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param_types.h:180
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:413
void cs_source_term_set_shared_pointers(const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect)
Set shared pointers to main domain members.
Definition: cs_source_term.c:345
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:1883
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:1737
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:966
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:1933
void cs_source_term_dcsd_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:1100
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:1835
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:2424
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:1059
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:2022
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:365
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:2244
#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:847
unsigned int cs_eflag_t
Definition: cs_flag.h:170
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:1142
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:1975
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:2377
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:1682
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:2150