programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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-2017 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.h"
36 #include "cs_cdo_quantities.h"
37 #include "cs_cdo_local.h"
38 #include "cs_param.h"
39 #include "cs_quadrature.h"
40 #include "cs_time_step.h"
41 #include "cs_xdef.h"
42 
43 /*----------------------------------------------------------------------------*/
44 
46 
47 /*============================================================================
48  * Macro definitions
49  *============================================================================*/
50 
51 #define CS_N_MAX_SOURCE_TERMS 8 // Max number of source terms in an equation
52 
53 /*============================================================================
54  * Type definitions
55  *============================================================================*/
56 
57 /*----------------------------------------------------------------------------*/
68 /*----------------------------------------------------------------------------*/
69 
70 typedef void
72  const cs_cell_mesh_t *cm,
74  void *input,
75  double *values);
76 
77 
78 /*============================================================================
79  * Public function prototypes
80  *============================================================================*/
81 
82 /*----------------------------------------------------------------------------*/
90 /*----------------------------------------------------------------------------*/
91 
92 void
94  const cs_cdo_connect_t *connect,
95  const cs_time_step_t *time_step);
96 
97 /*----------------------------------------------------------------------------*/
106 /*----------------------------------------------------------------------------*/
107 
108 cs_flag_t
110 
111 /*----------------------------------------------------------------------------*/
119 /*----------------------------------------------------------------------------*/
120 
121 void
123  cs_flag_t flag);
124 
125 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 cs_flag_t
137 
138 /*----------------------------------------------------------------------------*/
152 /*----------------------------------------------------------------------------*/
153 
154 cs_flag_t
156  const int n_source_terms,
157  const cs_xdef_t **source_terms,
158  cs_source_term_cellwise_t *compute_source[],
159  cs_flag_t *sys_flag,
160  cs_mask_t *source_mask[]);
161 
162 /*----------------------------------------------------------------------------*/
176 /*----------------------------------------------------------------------------*/
177 
178 void
179 cs_source_term_compute_cellwise(const int n_source_terms,
180  const cs_xdef_t **source_terms,
181  const cs_cell_mesh_t *cm,
182  const cs_mask_t *source_mask,
183  cs_source_term_cellwise_t *compute_source[],
184  void *input,
185  cs_cell_builder_t *cb,
186  cs_cell_sys_t *csys);
187 
188 /*----------------------------------------------------------------------------*/
197 /*----------------------------------------------------------------------------*/
198 
199 void
201  const cs_xdef_t *source,
202  double *p_values[]);
203 
204 /*----------------------------------------------------------------------------*/
213 /*----------------------------------------------------------------------------*/
214 
215 void
217  const cs_xdef_t *source,
218  double *p_values[]);
219 
220 /*----------------------------------------------------------------------------*/
235 /*----------------------------------------------------------------------------*/
236 
237 void
239  const cs_cell_mesh_t *cm,
240  cs_cell_builder_t *cb,
241  void *input,
242  double *values);
243 
244 /*----------------------------------------------------------------------------*/
259 /*----------------------------------------------------------------------------*/
260 
261 void
263  const cs_cell_mesh_t *cm,
264  cs_cell_builder_t *cb,
265  void *input,
266  double *values);
267 
268 /*----------------------------------------------------------------------------*/
280 /*----------------------------------------------------------------------------*/
281 
282 void
284  const cs_cell_mesh_t *cm,
285  cs_cell_builder_t *cb,
286  void *input,
287  double *values);
288 
289 /*----------------------------------------------------------------------------*/
304 /*----------------------------------------------------------------------------*/
305 
306 void
308  const cs_cell_mesh_t *cm,
309  cs_cell_builder_t *cb,
310  void *input,
311  double *values);
312 
313 /*----------------------------------------------------------------------------*/
328 /*----------------------------------------------------------------------------*/
329 
330 void
332  const cs_cell_mesh_t *cm,
333  cs_cell_builder_t *cb,
334  void *input,
335  double *values);
336 
337 /*----------------------------------------------------------------------------*/
352 /*----------------------------------------------------------------------------*/
353 
354 void
356  const cs_cell_mesh_t *cm,
357  cs_cell_builder_t *cb,
358  void *input,
359  double *values);
360 
361 /*----------------------------------------------------------------------------*/
378 /*----------------------------------------------------------------------------*/
379 
380 void
382  const cs_cell_mesh_t *cm,
383  cs_cell_builder_t *cb,
384  void *input,
385  double *values);
386 
387 /*----------------------------------------------------------------------------*/
402 /*----------------------------------------------------------------------------*/
403 
404 void
406  const cs_cell_mesh_t *cm,
407  cs_cell_builder_t *cb,
408  void *input,
409  double *values);
410 
411 /*----------------------------------------------------------------------------*/
426 /*----------------------------------------------------------------------------*/
427 
428 void
430  const cs_cell_mesh_t *cm,
431  cs_cell_builder_t *cb,
432  void *input,
433  double *values);
434 
435 /*----------------------------------------------------------------------------*/
448 /*----------------------------------------------------------------------------*/
449 
450 void
452  const cs_cell_mesh_t *cm,
453  cs_cell_builder_t *cb,
454  void *input,
455  double *values);
456 
457 /*----------------------------------------------------------------------------*/
472 /*----------------------------------------------------------------------------*/
473 
474 void
476  const cs_cell_mesh_t *cm,
477  cs_cell_builder_t *cb,
478  void *input,
479  double *values);
480 
481 /*----------------------------------------------------------------------------*/
494 /*----------------------------------------------------------------------------*/
495 
496 void
498  const cs_cell_mesh_t *cm,
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_cell_builder_t *cb,
523  void *input,
524  double *values);
525 
526 /*----------------------------------------------------------------------------*/
527 
529 
530 #endif /* __CS_SOURCE_TERM_H__ */
void cs_source_term_compute_from_potential(cs_flag_t loc, const cs_xdef_t *source, 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:730
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:337
void cs_source_term_vcsp_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1399
time step descriptor
Definition: cs_time_step.h:51
void cs_source_term_dcsd_q1o1_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1023
void cs_source_term_compute_from_density(cs_flag_t loc, const cs_xdef_t *source, 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:669
void cs_source_term_dcsd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:933
void cs_source_term_pvsp_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:844
#define BEGIN_C_DECLS
Definition: cs_defs.h:453
unsigned char cs_mask_t
Definition: cs_cdo.h:126
Definition: cs_cdo_local.h:138
Definition: cs_cdo_connect.h:55
void cs_source_term_compute_cellwise(const int n_source_terms, const cs_xdef_t **source_terms, const cs_cell_mesh_t *cm, const cs_mask_t *source_mask, cs_source_term_cellwise_t *compute_source[], void *input, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Compute the local contributions of source terms in a cell.
Definition: cs_source_term.c:610
Definition: cs_cdo_quantities.h:89
Definition: cs_cdo_local.h:94
void cs_source_term_dcsd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:893
void cs_source_term_pvsp_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:795
cs_space_scheme_t
Definition: cs_cdo.h:138
void cs_source_term_set_shared_pointers(const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step)
Set shared pointers to main domain members.
Definition: cs_source_term.c:220
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:282
cs_flag_t cs_source_term_init(cs_space_scheme_t space_scheme, const int n_source_terms, const cs_xdef_t **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:362
void cs_source_term_dcsd_q10o2_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1102
void cs_source_term_vcsp_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1448
Definition: cs_cdo_local.h:71
Definition: cs_xdef.h:72
void cs_source_term_fbsd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1502
void cs_source_term_dcsd_q5o3_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1302
void cs_source_term_fbsd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1539
#define END_C_DECLS
Definition: cs_defs.h:454
unsigned short int cs_flag_t
Definition: cs_defs.h:299
cs_flag_t cs_source_term_set_default_flag(cs_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:242
void cs_source_term_hhosd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1621
void cs_source_term_hhosd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1583
void( cs_source_term_cellwise_t)(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:71