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 for the discretization in space */
53 typedef enum {
54 
55  CS_SPACE_SCHEME_CDOVB, /* CDO scheme with vertex-based positionning */
56  CS_SPACE_SCHEME_CDOFB, /* CDO cell-based scheme with hybridization */
58 
60 
61 /* Vector-valued quantity stored using its measure (i.e. length) and
62  its direction given by a unitary vector */
63 typedef struct {
64 
65  double meas;
66  double unitv[3];
67 
68 } cs_nvec3_t;
69 
70 /* Values associated to the different ways to retrieve data */
71 typedef union {
72 
73  cs_flag_t flag; // flag
74  int id; // identification number
75  cs_lnum_t num; // local number
76  cs_real_t val; // value
77  cs_real_2_t couple; // two values
78  cs_real_3_t vect; // vector: 3 values
79  cs_nvec3_t nvec3; // meas + unit vector
80  cs_real_6_t twovects; // two vectors
81  cs_real_33_t tens; // tensor: 9 values
82 
83 } cs_get_t;
84 
85 /*----------------------------------------------------------------------------*/
93 /*----------------------------------------------------------------------------*/
94 
95 typedef void
97  const cs_real_3_t xyz,
98  cs_get_t *retval);
99 
100 /*----------------------------------------------------------------------------*/
109 /*----------------------------------------------------------------------------*/
110 
111 typedef cs_real_t
112 (cs_timestep_func_t) (int time_iter);
113 
114 /*----------------------------------------------------------------------------*/
125 /*----------------------------------------------------------------------------*/
126 
127 typedef void
128 (cs_onevar_law_func_t) (double var_value,
129  const void *law_param,
130  cs_get_t *retval);
131 
132 /*============================================================================
133  * Global variables
134  *============================================================================*/
135 
136 /* Separation lines: long, medium, short */
137 extern const char lsepline[];
138 extern const char msepline[];
139 extern const char ssepline[];
140 
141 /*============================================================================
142  * Public function prototypes
143  *============================================================================*/
144 
145 /*----------------------------------------------------------------------------*/
153 /*----------------------------------------------------------------------------*/
154 
155 const char *
156 cs_base_strtf(bool boolean);
157 
158 /*----------------------------------------------------------------------------*/
162 /*----------------------------------------------------------------------------*/
163 
164 void
165 cs_set_eps_machine(void);
166 
167 /*----------------------------------------------------------------------------*/
171 /*----------------------------------------------------------------------------*/
172 
173 double
174 cs_get_eps_machine(void);
175 
176 /*----------------------------------------------------------------------------*/
180 /*----------------------------------------------------------------------------*/
181 
182 double
184 
185 /*----------------------------------------------------------------------------*/
192 /*----------------------------------------------------------------------------*/
193 
194 void
195 cs_nvec3(const cs_real_3_t v,
196  cs_nvec3_t *qv);
197 
198 /*----------------------------------------------------------------------------*/
199 
201 
202 #endif /* __CS_CDO_H__ */
const char ssepline[]
Definition: cs_cdo.c:66
double cs_get_zero_threshold(void)
Get the threshold under which one considers it's zero.
Definition: cs_cdo.c:147
cs_nvec3_t nvec3
Definition: cs_cdo.h:79
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
Definition: cs_cdo.h:57
cs_real_33_t tens
Definition: cs_cdo.h:81
#define BEGIN_C_DECLS
Definition: cs_defs.h:429
double cs_get_eps_machine(void)
Get the machine precision.
Definition: cs_cdo.c:135
int id
Definition: cs_cdo.h:74
void cs_set_eps_machine(void)
Compute epsilon which is the machine precision.
Definition: cs_cdo.c:110
Definition: cs_cdo.h:71
Definition: cs_cdo.h:63
double precision, dimension(:,:,:), allocatable v
Definition: atimbr.f90:114
cs_space_scheme_t
Definition: cs_cdo.h:53
cs_real_2_t couple
Definition: cs_cdo.h:77
const char * cs_base_strtf(bool boolean)
Return a string "true" or "false" according to the boolean.
Definition: cs_cdo.c:95
void( cs_onevar_law_func_t)(double var_value, const void *law_param, cs_get_t *retval)
Compute the value of a quantity according to a law depending only on one variable. This law is described by a set of parameters stored in a structure. result = law(var_value)
Definition: cs_cdo.h:128
void( cs_analytic_func_t)(cs_real_t time, const cs_real_3_t xyz, cs_get_t *retval)
Generic analytic function.
Definition: cs_cdo.h:96
double meas
Definition: cs_cdo.h:65
cs_real_t val
Definition: cs_cdo.h:76
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:80
void cs_nvec3(const cs_real_3_t v, cs_nvec3_t *qv)
Define a cs_nvec3_t structure from a cs_real_3_t.
Definition: cs_cdo.c:162
cs_real_t( cs_timestep_func_t)(int time_iter)
Simple function to define the time step according to the number of iteration already done...
Definition: cs_cdo.h:112
cs_lnum_t num
Definition: cs_cdo.h:75
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
const char lsepline[]
Definition: cs_cdo.c:62
#define END_C_DECLS
Definition: cs_defs.h:430
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:56
cs_flag_t flag
Definition: cs_cdo.h:73
unsigned short int cs_flag_t
Definition: cs_cdo.h:50
Definition: cs_cdo.h:55
cs_real_3_t vect
Definition: cs_cdo.h:78