My Project
programmer's documentation
Loading...
Searching...
No Matches
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
69typedef 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
91void
93 const cs_cdo_connect_t *connect);
94
95/*----------------------------------------------------------------------------*/
104/*----------------------------------------------------------------------------*/
105
108
109/*----------------------------------------------------------------------------*/
117/*----------------------------------------------------------------------------*/
118
119void
121 cs_flag_t flag);
122
123/*----------------------------------------------------------------------------*/
131/*----------------------------------------------------------------------------*/
132
135
136/*----------------------------------------------------------------------------*/
150/*----------------------------------------------------------------------------*/
151
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
177void
178cs_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,
186 cs_real_t *result);
187
188/*----------------------------------------------------------------------------*/
198/*----------------------------------------------------------------------------*/
199
200void
202 const cs_xdef_t *source,
203 cs_real_t time_eval,
204 double *p_values[]);
205
206/*----------------------------------------------------------------------------*/
216/*----------------------------------------------------------------------------*/
217
218void
220 const cs_xdef_t *source,
221 cs_real_t time_eval,
222 double *p_values[]);
223
224/*----------------------------------------------------------------------------*/
240/*----------------------------------------------------------------------------*/
241
242void
244 const cs_cell_mesh_t *cm,
245 cs_real_t time_eval,
247 void *input,
248 double *values);
249
250/*----------------------------------------------------------------------------*/
266/*----------------------------------------------------------------------------*/
267
268void
270 const cs_cell_mesh_t *cm,
271 cs_real_t time_eval,
273 void *input,
274 double *values);
275
276/*----------------------------------------------------------------------------*/
289/*----------------------------------------------------------------------------*/
290
291void
293 const cs_cell_mesh_t *cm,
294 cs_real_t time_eval,
296 void *input,
297 double *values);
298
299/*----------------------------------------------------------------------------*/
312/*----------------------------------------------------------------------------*/
313
314void
316 const cs_cell_mesh_t *cm,
317 cs_real_t time_eval,
319 void *input,
320 double *values);
321
322/*----------------------------------------------------------------------------*/
335/*----------------------------------------------------------------------------*/
336
337void
339 const cs_cell_mesh_t *cm,
340 cs_real_t time_eval,
342 void *input,
343 double *values);
344
345/*----------------------------------------------------------------------------*/
361/*----------------------------------------------------------------------------*/
362
363void
365 const cs_cell_mesh_t *cm,
366 cs_real_t time_eval,
368 void *input,
369 double *values);
370
371/*----------------------------------------------------------------------------*/
387/*----------------------------------------------------------------------------*/
388
389void
391 const cs_cell_mesh_t *cm,
392 cs_real_t time_eval,
394 void *input,
395 double *values);
396
397/*----------------------------------------------------------------------------*/
413/*----------------------------------------------------------------------------*/
414
415void
417 const cs_cell_mesh_t *cm,
418 cs_real_t time_eval,
420 void *input,
421 double *values);
422
423/*----------------------------------------------------------------------------*/
441/*----------------------------------------------------------------------------*/
442
443void
445 const cs_cell_mesh_t *cm,
446 cs_real_t time_eval,
448 void *input,
449 double *values);
450
451/*----------------------------------------------------------------------------*/
467/*----------------------------------------------------------------------------*/
468
469void
471 const cs_cell_mesh_t *cm,
472 cs_real_t time_eval,
474 void *input,
475 double *values);
476
477/*----------------------------------------------------------------------------*/
493/*----------------------------------------------------------------------------*/
494
495void
497 const cs_cell_mesh_t *cm,
498 cs_real_t time_eval,
500 void *input,
501 double *values);
502
503/*----------------------------------------------------------------------------*/
517/*----------------------------------------------------------------------------*/
518
519void
521 const cs_cell_mesh_t *cm,
522 cs_real_t time_eval,
524 void *input,
525 double *values);
526
527/*----------------------------------------------------------------------------*/
542/*----------------------------------------------------------------------------*/
543
544void
546 const cs_cell_mesh_t *cm,
547 cs_real_t time_eval,
549 void *input,
550 double *values);
551
552/*----------------------------------------------------------------------------*/
569/*----------------------------------------------------------------------------*/
570
571void
573 const cs_cell_mesh_t *cm,
574 cs_real_t time_eval,
576 void *input,
577 double *values);
578
579/*----------------------------------------------------------------------------*/
593/*----------------------------------------------------------------------------*/
594
595void
597 const cs_cell_mesh_t *cm,
598 cs_real_t time_eval,
600 void *input,
601 double *values);
602
603/*----------------------------------------------------------------------------*/
616/*----------------------------------------------------------------------------*/
617
618void
620 const cs_cell_mesh_t *cm,
621 cs_real_t time_eval,
623 void *input,
624 double *values);
625
626/*----------------------------------------------------------------------------*/
643/*----------------------------------------------------------------------------*/
644
645void
647 const cs_cell_mesh_t *cm,
648 cs_real_t time_eval,
650 void *input,
651 double *values);
652
653/*----------------------------------------------------------------------------*/
667/*----------------------------------------------------------------------------*/
668
669void
671 const cs_cell_mesh_t *cm,
672 cs_real_t time_eval,
674 void *input,
675 double *values);
676
677/*----------------------------------------------------------------------------*/
690/*----------------------------------------------------------------------------*/
691
692void
694 const cs_cell_mesh_t *cm,
695 cs_real_t time_eval,
697 void *input,
698 double *values);
699
700/*----------------------------------------------------------------------------*/
714/*----------------------------------------------------------------------------*/
715
716void
718 const cs_cell_mesh_t *cm,
719 cs_real_t time_eval,
721 void *input,
722 double *values);
723
724/*----------------------------------------------------------------------------*/
739/*----------------------------------------------------------------------------*/
740
741void
743 const cs_cell_mesh_t *cm,
744 cs_real_t time_eval,
746 void *input,
747 double *values);
748
749/*----------------------------------------------------------------------------*/
764/*----------------------------------------------------------------------------*/
765
766void
768 const cs_cell_mesh_t *cm,
769 cs_real_t time_eval,
771 void *input,
772 double *values);
773
774/*----------------------------------------------------------------------------*/
775
776
777
779
780#endif /* __CS_SOURCE_TERM_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:467
double cs_real_t
Floating-point value.
Definition cs_defs.h:302
#define END_C_DECLS
Definition cs_defs.h:468
unsigned short int cs_flag_t
Definition cs_defs.h:304
unsigned char cs_mask_t
Definition cs_flag.h:150
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition cs_param.h:125
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
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
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
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
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_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
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_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_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
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
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
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
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
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 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_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
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
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
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
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
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_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
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
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
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
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
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_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
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
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_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
static int input(void)
Definition cs_cdo_connect.h:74
Definition cs_cdo_quantities.h:94
Set of local and temporary buffers useful for building the algebraic system with a cellwise process....
Definition cs_cdo_local.h:56
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
Structure storing medata for defining a quantity in a very flexible way.
Definition cs_xdef.h:126