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-2018 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 /*----------------------------------------------------------------------------*/
338 /*----------------------------------------------------------------------------*/
339 
340 void
342  const cs_cell_mesh_t *cm,
343  cs_real_t time_eval,
344  cs_cell_builder_t *cb,
345  void *input,
346  double *values);
347 
348 /*----------------------------------------------------------------------------*/
364 /*----------------------------------------------------------------------------*/
365 
366 void
368  const cs_cell_mesh_t *cm,
369  cs_real_t time_eval,
370  cs_cell_builder_t *cb,
371  void *input,
372  double *values);
373 
374 /*----------------------------------------------------------------------------*/
390 /*----------------------------------------------------------------------------*/
391 
392 void
394  const cs_cell_mesh_t *cm,
395  cs_real_t time_eval,
396  cs_cell_builder_t *cb,
397  void *input,
398  double *values);
399 
400 /*----------------------------------------------------------------------------*/
418 /*----------------------------------------------------------------------------*/
419 
420 void
422  const cs_cell_mesh_t *cm,
423  cs_real_t time_eval,
424  cs_cell_builder_t *cb,
425  void *input,
426  double *values);
427 
428 /*----------------------------------------------------------------------------*/
444 /*----------------------------------------------------------------------------*/
445 
446 void
448  const cs_cell_mesh_t *cm,
449  cs_real_t time_eval,
450  cs_cell_builder_t *cb,
451  void *input,
452  double *values);
453 
454 /*----------------------------------------------------------------------------*/
470 /*----------------------------------------------------------------------------*/
471 
472 void
474  const cs_cell_mesh_t *cm,
475  cs_real_t time_eval,
476  cs_cell_builder_t *cb,
477  void *input,
478  double *values);
479 
480 /*----------------------------------------------------------------------------*/
494 /*----------------------------------------------------------------------------*/
495 
496 void
498  const cs_cell_mesh_t *cm,
499  cs_real_t time_eval,
500  cs_cell_builder_t *cb,
501  void *input,
502  double *values);
503 
504 /*----------------------------------------------------------------------------*/
519 /*----------------------------------------------------------------------------*/
520 
521 void
523  const cs_cell_mesh_t *cm,
524  cs_real_t time_eval,
525  cs_cell_builder_t *cb,
526  void *input,
527  double *values);
528 
529 /*----------------------------------------------------------------------------*/
546 /*----------------------------------------------------------------------------*/
547 
548 void
550  const cs_cell_mesh_t *cm,
551  cs_real_t time_eval,
552  cs_cell_builder_t *cb,
553  void *input,
554  double *values);
555 
556 /*----------------------------------------------------------------------------*/
570 /*----------------------------------------------------------------------------*/
571 
572 void
574  const cs_cell_mesh_t *cm,
575  cs_real_t time_eval,
576  cs_cell_builder_t *cb,
577  void *input,
578  double *values);
579 
580 /*----------------------------------------------------------------------------*/
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 /*----------------------------------------------------------------------------*/
620 /*----------------------------------------------------------------------------*/
621 
622 void
624  const cs_cell_mesh_t *cm,
625  cs_real_t time_eval,
626  cs_cell_builder_t *cb,
627  void *input,
628  double *values);
629 
630 /*----------------------------------------------------------------------------*/
644 /*----------------------------------------------------------------------------*/
645 
646 void
648  const cs_cell_mesh_t *cm,
649  cs_real_t time_eval,
650  cs_cell_builder_t *cb,
651  void *input,
652  double *values);
653 
654 /*----------------------------------------------------------------------------*/
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 /*----------------------------------------------------------------------------*/
691 /*----------------------------------------------------------------------------*/
692 
693 void
695  const cs_cell_mesh_t *cm,
696  cs_real_t time_eval,
697  cs_cell_builder_t *cb,
698  void *input,
699  double *values);
700 
701 /*----------------------------------------------------------------------------*/
716 /*----------------------------------------------------------------------------*/
717 
718 void
720  const cs_cell_mesh_t *cm,
721  cs_real_t time_eval,
722  cs_cell_builder_t *cb,
723  void *input,
724  double *values);
725 
726 /*----------------------------------------------------------------------------*/
741 /*----------------------------------------------------------------------------*/
742 
743 void
745  const cs_cell_mesh_t *cm,
746  cs_real_t time_eval,
747  cs_cell_builder_t *cb,
748  void *input,
749  double *values);
750 
751 /*----------------------------------------------------------------------------*/
752 
753 
754 
756 
757 #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 the given array of values...
Definition: cs_source_term.c:1549
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
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:2054
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:2535
unsigned char cs_mask_t
Definition: cs_flag.h:129
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:1176
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:920
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:987
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:2412
#define BEGIN_C_DECLS
Definition: cs_defs.h:462
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:1090
Set of local quantities and connectivities related to a mesh cell This is a key structure for all cel...
Definition: cs_cdo_local.h:163
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:1348
Definition: cs_cdo_connect.h:74
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:1268
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_cdo_quantities.h:94
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:1757
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
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
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
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:1701
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:1040
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:1797
static int input(void)
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:1131
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:2281
Set of local and temporary buffers useful for building the algebraic system with a cellwise process...
Definition: cs_cdo_local.h:75
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:126
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
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:1885
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:2103
#define END_C_DECLS
Definition: cs_defs.h:463
unsigned short int cs_flag_t
Definition: cs_defs.h:299
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:796
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param.h:122
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:854
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:1839
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:2236
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:1648
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
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:2011