programmer's documentation
cs_cdo.h
Go to the documentation of this file.
1 #ifndef __CS_CDO_H__
2 #define __CS_CDO_H__
3 
4 /*============================================================================
5  * General functions or variables for the INNOV module
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2015 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 
36 /*----------------------------------------------------------------------------*/
37 
39 
40 /*============================================================================
41  * Macro definitions
42  *============================================================================*/
43 
44 #define CS_CDO_LEN_NAME 64
45 
46 /*============================================================================
47  * Type definitions
48  *============================================================================*/
49 
50 typedef unsigned short int cs_flag_t;
51 
52 /* Type of numerical scheme */
53 typedef enum {
54 
56  CS_SPACE_SCHEME_CDOVB, /* CDO scheme with vertex-based positionning */
57  CS_SPACE_SCHEME_CDOFB, /* CDO cell-based scheme with hybridization */
59 
61 
62 /* Values associated to the different ways to retrieve data */
63 typedef union {
64 
65  cs_flag_t flag; // flag
66  char *name; // file name for instance
67  int id; // identification number
68  cs_lnum_t num; // local number
69  cs_real_t val; // value
70  cs_real_2_t couple; // two values
71  cs_real_3_t vect; // vector: 3 values
72  cs_real_6_t twovects; // two vectors
73  cs_real_33_t tens; // tensor: 9 values
74 
75 } cs_get_t;
76 
77 /* Analytic definition through a function */
78 typedef void
80  cs_real_3_t xyz,
81  cs_get_t *retval);
82 
83 typedef void
84 (cs_user_func_t) (const void *input1,
85  const void *input2,
86  cs_real_t cur_time,
87  cs_real_3_t xyz,
88  cs_get_t *output);
89 
90 /*============================================================================
91  * Global variables
92  *============================================================================*/
93 
94 /* Zero threshold */
95 extern double cs_base_zthreshold;
96 
97 /* Separation lines: long, medium, short */
98 extern const char lsepline[];
99 extern const char msepline[];
100 extern const char ssepline[];
101 
102 /*============================================================================
103  * Public function prototypes
104  *============================================================================*/
105 
106 /*----------------------------------------------------------------------------*/
114 /*----------------------------------------------------------------------------*/
115 
116 const char *
117 cs_base_strtf(bool boolean);
118 
119 /*----------------------------------------------------------------------------*/
123 /*----------------------------------------------------------------------------*/
124 
125 void
126 cs_set_eps_machine(void);
127 
128 /*----------------------------------------------------------------------------*/
132 /*----------------------------------------------------------------------------*/
133 
134 double
135 cs_get_eps_machine(void);
136 
137 /*----------------------------------------------------------------------------*/
138 
140 
141 #endif /* __CS_CDO_H__ */
const char ssepline[]
Definition: cs_cdo.c:65
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition: cs_defs.h:306
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:309
void( cs_user_func_t)(const void *input1, const void *input2, cs_real_t cur_time, cs_real_3_t xyz, cs_get_t *output)
Definition: cs_cdo.h:84
Definition: cs_cdo.h:58
cs_real_33_t tens
Definition: cs_cdo.h:73
#define BEGIN_C_DECLS
Definition: cs_defs.h:419
double cs_get_eps_machine(void)
Get the machine precision.
Definition: cs_cdo.c:132
int id
Definition: cs_cdo.h:67
void cs_set_eps_machine(void)
Compute epsilon which is the machine precision.
Definition: cs_cdo.c:107
Definition: cs_cdo.h:63
Definition: cs_cdo.h:55
void( cs_analytic_func_t)(cs_real_t time, cs_real_3_t xyz, cs_get_t *retval)
Definition: cs_cdo.h:79
cs_space_scheme_t
Definition: cs_cdo.h:53
cs_real_2_t couple
Definition: cs_cdo.h:70
const char * cs_base_strtf(bool boolean)
Return a string "true" or "false" according to the boolean.
Definition: cs_cdo.c:92
cs_real_t val
Definition: cs_cdo.h:69
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:307
cs_real_6_t twovects
Definition: cs_cdo.h:72
char * name
Definition: cs_cdo.h:66
cs_lnum_t num
Definition: cs_cdo.h:68
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
const char lsepline[]
Definition: cs_cdo.c:63
#define END_C_DECLS
Definition: cs_defs.h:420
const char msepline[]
Definition: cs_cdo.c:64
double cs_real_t
Definition: cs_defs.h:296
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:311
Definition: cs_cdo.h:57
cs_flag_t flag
Definition: cs_cdo.h:65
unsigned short int cs_flag_t
Definition: cs_cdo.h:50
double cs_base_zthreshold
Definition: cs_cdo.c:60
Definition: cs_cdo.h:56
cs_real_3_t vect
Definition: cs_cdo.h:71