6.2
general documentation
cs_param_types.h
Go to the documentation of this file.
1 #ifndef __CS_PARAM_TYPES_H__
2 #define __CS_PARAM_TYPES_H__
3 
4 /*============================================================================
5  * Manage the definition/setting of a computation
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2020 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_defs.h"
35 
36 /*----------------------------------------------------------------------------*/
37 
39 
40 /*============================================================================
41  * Macro definitions
42  *============================================================================*/
43 
50 /*
51  * Field property type
52  */
53 
55 #define CS_ISOTROPIC_DIFFUSION (1 << 0)
56 
58 #define CS_ORTHOTROPIC_DIFFUSION (1 << 1)
59 
61 #define CS_ANISOTROPIC_LEFT_DIFFUSION (1 << 2)
62 
64 #define CS_ANISOTROPIC_RIGHT_DIFFUSION (1 << 3)
65 
67 #define CS_ANISOTROPIC_DIFFUSION ((1 << 2) + (1 << 3))
68 
71 /*============================================================================
72  * Type definitions
73  *============================================================================*/
74 
75 /*----------------------------------------------------------------------------*/
90 /*----------------------------------------------------------------------------*/
91 
92 typedef void
94  cs_lnum_t n_elts,
95  const cs_lnum_t *elt_ids,
96  const cs_real_t *coords,
97  bool compact,
98  void *input,
99  cs_real_t *retval);
100 
101 /*----------------------------------------------------------------------------*/
115 /*----------------------------------------------------------------------------*/
116 
117 typedef void
119  const cs_lnum_t *elt_ids,
120  bool compact,
121  void *input,
122  cs_real_t *retval);
123 
124 /*----------------------------------------------------------------------------*/
135 /*----------------------------------------------------------------------------*/
136 
137 typedef void
138 (cs_time_func_t) (int time_iter,
139  double time,
140  void *input,
141  cs_real_t *retval);
142 
143 /* ================
144  * ENUM definitions
145  * ================ */
146 
178 typedef enum {
179 
188 
190 
192 
205 typedef enum {
206 
209 
211 
213 
237 typedef enum {
238 
244 
246 
248 
269 typedef enum {
270 
274 
276 
278 
313 typedef enum {
314 
322 
324 
326 
365 typedef enum {
366 
374 
376 
378 
408 typedef enum {
409 
414 
416 
418 
444 typedef enum {
445 
450 
452 
454 
461 typedef enum {
462 
471 
473 
537 typedef enum {
538 
540 
554 
556 
558 
624 typedef enum {
625 
627 
644 
646 
648 
655 typedef enum {
656 
666 
668 
675 typedef struct {
676 
677  bool setup_done;
678  int verbosity;
679  int field_id;
682  cs_param_sles_class_t solver_class;
683  cs_param_precond_type_t precond;
684  cs_param_itsol_type_t solver;
685  cs_param_amg_type_t amg_type;
691  cs_param_resnorm_type_t resnorm_type;
693  double eps;
696 
697 /*============================================================================
698  * Global variables
699  *============================================================================*/
700 
701 /* Separation lines: header1, header2 (compatible with markdown), other */
702 extern const char cs_sep_h1[80];
703 extern const char cs_sep_h2[80];
704 extern const char cs_sepline[80];
705 extern const char cs_med_sepline[50];
706 
707 /*============================================================================
708  * Public function prototypes
709  *============================================================================*/
710 
711 /*----------------------------------------------------------------------------*/
720 /*----------------------------------------------------------------------------*/
721 
722 bool
723 cs_param_space_scheme_is_face_based(cs_param_space_scheme_t scheme);
724 
725 /*----------------------------------------------------------------------------*/
733 /*----------------------------------------------------------------------------*/
734 
735 const char *
736 cs_param_get_space_scheme_name(cs_param_space_scheme_t scheme);
737 
738 /*----------------------------------------------------------------------------*/
746 /*----------------------------------------------------------------------------*/
747 
748 const char *
749 cs_param_get_time_scheme_name(cs_param_time_scheme_t scheme);
750 
751 /*----------------------------------------------------------------------------*/
759 /*----------------------------------------------------------------------------*/
760 
761 const char *
762 cs_param_get_bc_name(cs_param_bc_type_t bc);
763 
764 /*----------------------------------------------------------------------------*/
772 /*----------------------------------------------------------------------------*/
773 
774 const char *
775 cs_param_get_bc_enforcement_name(cs_param_bc_enforce_t type);
776 
777 /*----------------------------------------------------------------------------*/
785 /*----------------------------------------------------------------------------*/
786 
787 const char *
788 cs_param_get_solver_name(cs_param_itsol_type_t solver);
789 
790 /*----------------------------------------------------------------------------*/
798 /*----------------------------------------------------------------------------*/
799 
800 const char *
801 cs_param_get_precond_name(cs_param_precond_type_t precond);
802 
803 /*----------------------------------------------------------------------------*/
811 /*----------------------------------------------------------------------------*/
812 
813 const char *
814 cs_param_get_amg_type_name(cs_param_amg_type_t type);
815 
816 /*----------------------------------------------------------------------------*/
817 
819 
820 #endif /* __CS_PARAM_TYPES_H__ */
const char * cs_param_get_time_scheme_name(cs_param_time_scheme_t scheme)
Get the name of the time discretization scheme.
Definition: cs_param_types.c:181
Definition: cs_param_types.h:319
Definition: cs_param_types.h:545
Definition: cs_param_types.h:539
const char * cs_param_get_space_scheme_name(cs_param_space_scheme_t scheme)
Get the name of the space discretization scheme.
Definition: cs_param_types.c:162
Definition: cs_param_types.h:372
bool setup_done
Definition: cs_param_types.h:677
Definition: cs_param_types.h:239
Definition: cs_param_types.h:541
Definition: cs_param_types.h:368
double eps
Definition: cs_param_types.h:693
cs_param_precond_type_t precond
Definition: cs_param_types.h:683
Definition: cs_param_types.h:468
Definition: cs_param_types.h:243
Definition: cs_param_types.h:321
Definition: cs_param_types.h:551
Definition: cs_param_types.h:410
Definition: cs_param_types.h:630
cs_param_resnorm_type_t
Definition: cs_param_types.h:655
Definition: cs_param_types.h:550
const char cs_med_sepline[50]
Definition: cs_param_types.c:71
Definition: cs_param_types.h:447
Definition: cs_param_types.h:210
Definition: cs_param_types.h:369
const char * cs_param_get_precond_name(cs_param_precond_type_t precond)
Get the name of the preconditioner.
Definition: cs_param_types.c:314
cs_param_sles_class_t solver_class
Definition: cs_param_types.h:682
Definition: cs_param_types.h:546
cs_param_bc_enforce_t
Definition: cs_param_types.h:408
Definition: cs_param_types.h:411
Definition: cs_param_types.h:187
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
Definition: cs_param_types.h:371
Definition: cs_param_types.h:635
Definition: cs_param_types.h:470
Definition: cs_param_types.h:643
cs_param_amg_type_t
Definition: cs_param_types.h:461
Definition: cs_param_types.h:552
Definition: cs_param_types.h:544
Definition: cs_param_types.h:320
cs_param_precond_type_t
Definition: cs_param_types.h:537
const char cs_sep_h2[80]
Definition: cs_param_types.c:67
Definition: cs_param_types.h:466
const char * cs_param_get_bc_name(cs_param_bc_type_t bc)
Get the name of the type of boundary condition.
Definition: cs_param_types.c:200
Definition: cs_param_types.h:318
Definition: cs_param_types.h:317
cs_param_sles_class_t
Class of iterative solvers to consider for solver the linear system.
Definition: cs_param_types.h:444
Definition: cs_param_types.h:638
Definition: cs_param_types.h:637
Definition: cs_param_types.h:208
Definition: cs_param_types.h:547
Definition: cs_param_types.h:189
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
Definition: cs_param_types.h:207
int n_max_iter
Definition: cs_param_types.h:692
Definition: cs_param_types.h:543
Definition: cs_param_types.h:316
Definition: cs_param_types.h:632
Definition: cs_param_types.h:465
Definition: cs_param_types.h:639
Definition: cs_param_types.h:415
Definition: cs_param_types.h:626
Definition: cs_param_types.h:634
Definition: cs_param_types.h:640
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param_types.h:178
Definition: cs_param_types.h:549
cs_param_resnorm_type_t resnorm_type
Definition: cs_param_types.h:691
void() cs_analytic_func_t(cs_real_t time, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *coords, bool compact, void *input, cs_real_t *retval)
Generic function pointer for an analytic function elt_ids is optional. If not NULL, it enables to access in coords at the right location and the same thing to fill retval if compact is set to false.
Definition: cs_param_types.h:93
Definition: cs_param_types.h:555
void() cs_dof_func_t(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool compact, void *input, cs_real_t *retval)
Generic function pointer for defining a quantity at known locations (cells, faces, edges or vertices) with a function. elt_ids is optional. If not NULL, the function works on a sub-list of elements. Moreover, it enables to fill retval with an indirection if compact is set to false.
Definition: cs_param_types.h:118
Definition: cs_param_types.h:631
Definition: cs_param_types.h:315
void() cs_time_func_t(int time_iter, double time, void *input, cs_real_t *retval)
Function which defines the evolution of a quantity according to the number of iteration already done...
Definition: cs_param_types.h:138
int verbosity
Definition: cs_param_types.h:678
Definition: cs_param_types.h:180
Definition: cs_param_types.h:241
Definition: cs_param_types.h:629
Definition: cs_param_types.h:181
cs_param_itsol_type_t solver
Definition: cs_param_types.h:684
Definition: cs_param_types.h:463
Definition: cs_param_types.h:636
Definition: cs_param_types.h:272
Definition: cs_param_types.h:413
Definition: cs_param_types.h:182
Definition: cs_param_types.h:665
Definition: cs_param_types.h:245
Definition: cs_param_types.h:373
Definition: cs_param_types.h:323
Definition: cs_param_types.h:633
Definition: cs_param_types.h:542
const char * cs_param_get_bc_enforcement_name(cs_param_bc_enforce_t type)
Get the name of the type of enforcement of the boundary condition.
Definition: cs_param_types.c:219
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:301
Definition: cs_param_types.h:240
Definition: cs_param_types.h:184
Definition: cs_param_types.h:645
Definition: cs_param_types.h:662
Definition: cs_param_types.h:642
Definition: cs_param_types.h:553
#define END_C_DECLS
Definition: cs_defs.h:496
Definition: cs_param_types.h:242
Definition: cs_param_types.h:375
Definition: cs_param_types.h:464
Definition: cs_param_types.h:448
Definition: cs_param_types.h:628
cs_param_dof_reduction_t
Definition: cs_param_types.h:205
int field_id
Definition: cs_param_types.h:679
cs_param_bc_type_t
Definition: cs_param_types.h:365
cs_param_itsol_type_t
Definition: cs_param_types.h:624
Definition: cs_param_types.h:273
const char cs_sepline[80]
Definition: cs_param_types.c:69
Definition: cs_param_types.h:451
const char cs_sep_h1[80]
Definition: cs_param_types.c:65
Definition: cs_param_types.h:275
Definition: cs_param_types.h:183
Definition: cs_param_types.h:271
const char * cs_param_get_amg_type_name(cs_param_amg_type_t type)
Get the name of the type of algebraic multigrid (AMG)
Definition: cs_param_types.c:381
bool cs_param_space_scheme_is_face_based(cs_param_space_scheme_t scheme)
Return true if the space scheme has degrees of freedom on faces, otherwise false. ...
Definition: cs_param_types.c:140
cs_param_advection_scheme_t
Definition: cs_param_types.h:313
Definition: cs_param_types.h:658
cs_param_amg_type_t amg_type
Definition: cs_param_types.h:685
const char * cs_param_get_solver_name(cs_param_itsol_type_t solver)
Get the name of the solver.
Definition: cs_param_types.c:238
Definition: cs_param_types.h:412
Definition: cs_param_types.h:467
Definition: cs_param_types.h:641
cs_param_time_scheme_t
Definition: cs_param_types.h:237
Definition: cs_param_types.h:548
cs_param_advection_form_t
Definition: cs_param_types.h:269
Definition: cs_param_types.h:660
Definition: cs_param_types.h:446
Definition: cs_param_types.h:186
Structure storing all metadata related to the resolution of a linear system with an iterative solver...
Definition: cs_param_types.h:675
Definition: cs_param_types.h:657
Definition: cs_param_types.h:185
Definition: cs_param_types.h:367
Definition: cs_param_types.h:449
Definition: cs_param_types.h:370