My Project
programmer's 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-2019 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.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 cs_flag_t
108 
109 /*----------------------------------------------------------------------------*/
117 /*----------------------------------------------------------------------------*/
118 
119 void
121  cs_flag_t flag);
122 
123 /*----------------------------------------------------------------------------*/
131 /*----------------------------------------------------------------------------*/
132 
133 cs_flag_t
135 
136 /*----------------------------------------------------------------------------*/
150 /*----------------------------------------------------------------------------*/
151 
152 cs_flag_t
154  const int n_source_terms,
155  cs_xdef_t *const *source_terms,
156  cs_source_term_cellwise_t *compute_source[],
157  cs_flag_t *sys_flag,
158  cs_mask_t *source_mask[]);
159 
160 /*----------------------------------------------------------------------------*/
175 /*----------------------------------------------------------------------------*/
176 
177 void
178 cs_source_term_compute_cellwise(const int n_source_terms,
179  cs_xdef_t *const *source_terms,
180  const cs_cell_mesh_t *cm,
181  const cs_mask_t *source_mask,
182  cs_source_term_cellwise_t *compute_source[],
183  cs_real_t time_eval,
184  void *input,
185  cs_cell_builder_t *cb,
186  cs_real_t *result);
187 
188 /*----------------------------------------------------------------------------*/
198 /*----------------------------------------------------------------------------*/
199 
200 void
202  const cs_xdef_t *source,
203  cs_real_t time_eval,
204  double *p_values[]);
205 
206 /*----------------------------------------------------------------------------*/
216 /*----------------------------------------------------------------------------*/
217 
218 void
220  const cs_xdef_t *source,
221  cs_real_t time_eval,
222  double *p_values[]);
223 
224 /*----------------------------------------------------------------------------*/
240 /*----------------------------------------------------------------------------*/
241 
242 void
244  const cs_cell_mesh_t *cm,
245  cs_real_t time_eval,
246  cs_cell_builder_t *cb,
247  void *input,
248  double *values);
249 
250 /*----------------------------------------------------------------------------*/
266 /*----------------------------------------------------------------------------*/
267 
268 void
270  const cs_cell_mesh_t *cm,
271  cs_real_t time_eval,
272  cs_cell_builder_t *cb,
273  void *input,
274  double *values);
275 
276 /*----------------------------------------------------------------------------*/
289 /*----------------------------------------------------------------------------*/
290 
291 void
293  const cs_cell_mesh_t *cm,
294  cs_real_t time_eval,
295  cs_cell_builder_t *cb,
296  void *input,
297  double *values);
298 
299 /*----------------------------------------------------------------------------*/
312 /*----------------------------------------------------------------------------*/
313 
314 void
316  const cs_cell_mesh_t *cm,
317  cs_real_t time_eval,
318  cs_cell_builder_t *cb,
319  void *input,
320  double *values);
321 
322 /*----------------------------------------------------------------------------*/
335 /*----------------------------------------------------------------------------*/
336 
337 void
339  const cs_cell_mesh_t *cm,
340  cs_real_t time_eval,
341  cs_cell_builder_t *cb,
342  void *input,
343  double *values);
344 
345 /*----------------------------------------------------------------------------*/
361 /*----------------------------------------------------------------------------*/
362 
363 void
365  const cs_cell_mesh_t *cm,
366  cs_real_t time_eval,
367  cs_cell_builder_t *cb,
368  void *input,
369  double *values);
370 
371 /*----------------------------------------------------------------------------*/
387 /*----------------------------------------------------------------------------*/
388 
389 void
391  const cs_cell_mesh_t *cm,
392  cs_real_t time_eval,
393  cs_cell_builder_t *cb,
394  void *input,
395  double *values);
396 
397 /*----------------------------------------------------------------------------*/
413 /*----------------------------------------------------------------------------*/
414 
415 void
417  const cs_cell_mesh_t *cm,
418  cs_real_t time_eval,
419  cs_cell_builder_t *cb,
420  void *input,
421  double *values);
422 
423 /*----------------------------------------------------------------------------*/
441 /*----------------------------------------------------------------------------*/
442 
443 void
445  const cs_cell_mesh_t *cm,
446  cs_real_t time_eval,
447  cs_cell_builder_t *cb,
448  void *input,
449  double *values);
450 
451 /*----------------------------------------------------------------------------*/
467 /*----------------------------------------------------------------------------*/
468 
469 void
471  const cs_cell_mesh_t *cm,
472  cs_real_t time_eval,
473  cs_cell_builder_t *cb,
474  void *input,
475  double *values);
476 
477 /*----------------------------------------------------------------------------*/
493 /*----------------------------------------------------------------------------*/
494 
495 void
497  const cs_cell_mesh_t *cm,
498  cs_real_t time_eval,
499  cs_cell_builder_t *cb,
500  void *input,
501  double *values);
502 
503 /*----------------------------------------------------------------------------*/
517 /*----------------------------------------------------------------------------*/
518 
519 void
521  const cs_cell_mesh_t *cm,
522  cs_real_t time_eval,
523  cs_cell_builder_t *cb,
524  void *input,
525  double *values);
526 
527 /*----------------------------------------------------------------------------*/
542 /*----------------------------------------------------------------------------*/
543 
544 void
546  const cs_cell_mesh_t *cm,
547  cs_real_t time_eval,
548  cs_cell_builder_t *cb,
549  void *input,
550  double *values);
551 
552 /*----------------------------------------------------------------------------*/
569 /*----------------------------------------------------------------------------*/
570 
571 void
573  const cs_cell_mesh_t *cm,
574  cs_real_t time_eval,
575  cs_cell_builder_t *cb,
576  void *input,
577  double *values);
578 
579 /*----------------------------------------------------------------------------*/
593 /*----------------------------------------------------------------------------*/
594 
595 void
597  const cs_cell_mesh_t *cm,
598  cs_real_t time_eval,
599  cs_cell_builder_t *cb,
600  void *input,
601  double *values);
602 
603 /*----------------------------------------------------------------------------*/
616 /*----------------------------------------------------------------------------*/
617 
618 void
620  const cs_cell_mesh_t *cm,
621  cs_real_t time_eval,
622  cs_cell_builder_t *cb,
623  void *input,
624  double *values);
625 
626 /*----------------------------------------------------------------------------*/
643 /*----------------------------------------------------------------------------*/
644 
645 void
647  const cs_cell_mesh_t *cm,
648  cs_real_t time_eval,
649  cs_cell_builder_t *cb,
650  void *input,
651  double *values);
652 
653 /*----------------------------------------------------------------------------*/
667 /*----------------------------------------------------------------------------*/
668 
669 void
671  const cs_cell_mesh_t *cm,
672  cs_real_t time_eval,
673  cs_cell_builder_t *cb,
674  void *input,
675  double *values);
676 
677 /*----------------------------------------------------------------------------*/
690 /*----------------------------------------------------------------------------*/
691 
692 void
694  const cs_cell_mesh_t *cm,
695  cs_real_t time_eval,
696  cs_cell_builder_t *cb,
697  void *input,
698  double *values);
699 
700 /*----------------------------------------------------------------------------*/
714 /*----------------------------------------------------------------------------*/
715 
716 void
718  const cs_cell_mesh_t *cm,
719  cs_real_t time_eval,
720  cs_cell_builder_t *cb,
721  void *input,
722  double *values);
723 
724 /*----------------------------------------------------------------------------*/
739 /*----------------------------------------------------------------------------*/
740 
741 void
743  const cs_cell_mesh_t *cm,
744  cs_real_t time_eval,
745  cs_cell_builder_t *cb,
746  void *input,
747  double *values);
748 
749 /*----------------------------------------------------------------------------*/
764 /*----------------------------------------------------------------------------*/
765 
766 void
768  const cs_cell_mesh_t *cm,
769  cs_real_t time_eval,
770  cs_cell_builder_t *cb,
771  void *input,
772  double *values);
773 
774 /*----------------------------------------------------------------------------*/
775 
776 
777 
779 
780 #endif /* __CS_SOURCE_TERM_H__ */
cs_quadrature.h
input
static int input(void)
cs_source_term_init
cs_flag_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:482
cs_source_term_dcvd_by_value
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 the given array of values....
Definition: cs_source_term.c:1134
cs_source_term_pcvd_by_value
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:1841
cs_xdef_t
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:126
cs_source_term_dcsd_by_array
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 the given array of values....
Definition: cs_source_term.c:1175
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_source_term_hhosd_by_analytic
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:2456
cs_source_term_dcsd_q1o1_by_analytic
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 the given array of values....
Definition: cs_source_term.c:1312
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
cs_source_term_pcvd_bary_by_analytic
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 the given array of values....
Definition: cs_source_term.c:2098
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_cdo_quantities.h
cs_source_term_dcsd_q5o3_by_analytic
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 the given array of values....
Definition: cs_source_term.c:1593
cs_source_term_get_flag
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:457
cs_source_term_dcsd_bary_by_analytic
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 the given array of values....
Definition: cs_source_term.c:1220
cs_source_term_compute_from_potential
void cs_source_term_compute_from_potential(cs_flag_t loc, const cs_xdef_t *source, cs_real_t time_eval, double *p_values[])
Compute the contribution related to a source term in the case of an input data which is a potential.
Definition: cs_source_term.c:923
cs_source_term_cellwise_t
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 the given array of values.
Definition: cs_source_term.h:70
cs_source_term_vcsp_by_analytic
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 the given array of values....
Definition: cs_source_term.c:1745
cs_xdef.h
cs_source_term_set_default_flag
cs_flag_t cs_source_term_set_default_flag(cs_param_space_scheme_t scheme)
Set the default flag related to a source term according to the numerical scheme chosen for discretizi...
Definition: cs_source_term.c:362
cs_source_term_pcsd_by_array
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 the given array of values....
Definition: cs_source_term.c:2055
cs_source_term_pcsd_by_analytic
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:1929
cs_cdo_quantities_t
Definition: cs_cdo_quantities.h:94
cs_source_term_pcsd_by_value
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 the given array of values....
Definition: cs_source_term.c:1801
cs_source_term_set_shared_pointers
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:342
cs_source_term_pvsp_by_analytic
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 the given array of values....
Definition: cs_source_term.c:1043
cs_source_term_hhovd_by_analytic
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:2579
cs_source_term_pvsp_by_value
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 the given array of values....
Definition: cs_source_term.c:990
cs_cdo_connect_t
Definition: cs_cdo_connect.h:74
cs_param_space_scheme_t
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param.h:125
cs_source_term_hhosd_by_value
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:2325
cs_cell_builder_t
Set of local and temporary buffers useful for building the algebraic system with a cellwise process....
Definition: cs_cdo_local.h:56
cs_source_term_pcsd_bary_by_analytic
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 the given array of values....
Definition: cs_source_term.c:1883
cs_mask_t
unsigned char cs_mask_t
Definition: cs_flag.h:152
cs_source_term_set_reduction
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:402
cs_source_term_compute_cellwise
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:799
cs_source_term_pcvd_by_array
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:2280
cs_source_term_vcsp_by_value
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 the given array of values....
Definition: cs_source_term.c:1692
cs_flag_t
unsigned short int cs_flag_t
Definition: cs_defs.h:304
cs_source_term_dcsd_by_value
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 the given array of values....
Definition: cs_source_term.c:1093
cs_source_term_dcsd_q10o2_by_analytic
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 the given array of values....
Definition: cs_source_term.c:1392
cs_source_term_pcvd_by_analytic
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:2147
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:146
cs_param.h
cs_base.h
cs_cdo_local.h
cs_source_term_compute_from_density
void cs_source_term_compute_from_density(cs_flag_t loc, const cs_xdef_t *source, cs_real_t time_eval, double *p_values[])
Compute the contribution related to a source term in the case of an input data which is a density.
Definition: cs_source_term.c:857