My Project
programmer's documentation
cs_parameters_check.h
Go to the documentation of this file.
1 #ifndef __CS_PARAMETERS_CHECK_H__
2 #define __CS_PARAMETERS_CHECK_H__
3 
4 /*============================================================================
5  * Log field and other array statistics at relevant time steps.
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  * Standard C library headers
32  *----------------------------------------------------------------------------*/
33 
34 /*----------------------------------------------------------------------------
35  * Local headers
36  *----------------------------------------------------------------------------*/
37 
38 #include "cs_base.h"
39 
40 /*----------------------------------------------------------------------------*/
41 
43 
44 /*============================================================================
45  * type definitions
46  *============================================================================*/
47 
48 /* Parameter check behavior when an error is detected */
49 
50 typedef enum {
51 
55 
57 
58 /*============================================================================
59  * Public function prototypes
60  *============================================================================*/
61 
62 /*----------------------------------------------------------------------------*/
72 /*----------------------------------------------------------------------------*/
73 
74 #if defined(__GNUC__)
75 
76 void
78  const char *section_desc,
79  const char *format,
80  ...)
81  __attribute__((format(printf, 3, 4)));
82 
83 #else
84 
85 void
87  const char *section_desc,
88  const char *format,
89  ...);
90 
91 #endif
92 
93 /*----------------------------------------------------------------------------*/
103 /*----------------------------------------------------------------------------*/
104 
105 void
107  const char *section_desc,
108  const char *format,
109  ...);
110 
111 /*----------------------------------------------------------------------------*/
119 /*----------------------------------------------------------------------------*/
120 
121 void
123  const char *section_desc);
124 
125 /*----------------------------------------------------------------------------*/
131 /*----------------------------------------------------------------------------*/
132 
133 void
135 
136 /*----------------------------------------------------------------------------*/
148 /*----------------------------------------------------------------------------*/
149 
150 void
152  const char *section_desc,
153  const char *param_name,
154  int param_value,
155  int range_l,
156  int range_u);
157 
158 /*----------------------------------------------------------------------------*/
171 /*----------------------------------------------------------------------------*/
172 
173 void
175  const char *section_desc,
176  const char *param_name,
177  int param_value,
178  int range_l,
179  int range_u);
180 
181 /*----------------------------------------------------------------------------*/
195 /*----------------------------------------------------------------------------*/
196 
197 void
199  const char *section_desc,
200  const char *param_name,
201  int param_value,
202  int enum_size,
203  const int *enum_values,
204  const char *enum_names[]);
205 
206 /*----------------------------------------------------------------------------*/
221 /*----------------------------------------------------------------------------*/
222 
223 void
225  const char *section_desc,
226  const char *param_name,
227  int param_value,
228  int enum_size,
229  const int *enum_values,
230  const char *enum_names[]);
231 
232 /*----------------------------------------------------------------------------*/
243 /*----------------------------------------------------------------------------*/
244 
245 void
247  const char *section_desc,
248  const char *param_name,
249  int param_value,
250  int std_value);
251 
252 /*----------------------------------------------------------------------------*/
263 /*----------------------------------------------------------------------------*/
264 
265 void
267  const char *section_desc,
268  const char *param_name,
269  int param_value,
270  int fbd_value);
271 
272 /*----------------------------------------------------------------------------*/
282 /*----------------------------------------------------------------------------*/
283 
284 void
286  const char *section_desc,
287  const char *param_name,
288  int param_value);
289 
290 /*----------------------------------------------------------------------------*/
301 /*----------------------------------------------------------------------------*/
302 
303 void
305  const char *section_desc,
306  const char *param_name,
307  int param_value,
308  int ib_value);
309 
310 /*----------------------------------------------------------------------------*/
322 /*----------------------------------------------------------------------------*/
323 
324 void
326  const char *section_desc,
327  const char *param_name,
328  double param_value,
329  double range_l,
330  double range_u);
331 
332 /*----------------------------------------------------------------------------*/
345 /*----------------------------------------------------------------------------*/
346 
347 void
349  const char *section_desc,
350  const char *param_name,
351  double param_value,
352  int enum_size,
353  const double *enum_values,
354  const char *enum_names[]);
355 
356 /*----------------------------------------------------------------------------*/
367 /*----------------------------------------------------------------------------*/
368 
369 void
371  const char *section_desc,
372  const char *param_name,
373  double param_value,
374  double std_value);
375 
376 /*----------------------------------------------------------------------------*/
387 /*----------------------------------------------------------------------------*/
388 
389 void
391  const char *section_desc,
392  const char *param_name,
393  double param_value,
394  double ib_value);
395 
396 /*----------------------------------------------------------------------------*/
400 /*----------------------------------------------------------------------------*/
401 
402 void
404 
405 /*----------------------------------------------------------------------------
406 !
407  * \brief Check data settings
408  */
409 /*----------------------------------------------------------------------------*/
410 
411 void
412 cs_parameters_check(void);
413 
414 /*----------------------------------------------------------------------------*/
415 
417 
418 #endif /* __CS_PARAMETERS_CHECK_H__ */
cs_parameters_is_equal_int
void cs_parameters_is_equal_int(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int std_value)
Check that a given integer keyword is equal to a specified value.
Definition: cs_parameters_check.c:470
cs_parameters_is_equal_double
void cs_parameters_is_equal_double(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, double param_value, double std_value)
Check that a given double keyword is equal to a specified value.
Definition: cs_parameters_check.c:711
cs_parameters_is_greater_int
void cs_parameters_is_greater_int(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int ib_value)
Check that a given int keyword is greater than a specified value.
Definition: cs_parameters_check.c:580
cs_parameters_is_in_range_double
void cs_parameters_is_in_range_double(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, double param_value, double range_l, double range_u)
Check that a given double keyword has values in a specified range.
Definition: cs_parameters_check.c:616
cs_parameters_error_barrier
void cs_parameters_error_barrier(void)
Abort if the the parameter errors count is nonzero.
Definition: cs_parameters_check.c:781
cs_parameters_error_footer
void cs_parameters_error_footer(cs_parameter_error_behavior_t err_behavior)
Print footer for a given parameters error message type.
Definition: cs_parameters_check.c:231
cs_parameters_is_greater_double
void cs_parameters_is_greater_double(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, double param_value, double ib_value)
Check that a given double keyword is greater than a specified value.
Definition: cs_parameters_check.c:753
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
CS_ABORT_DELAYED
Definition: cs_parameters_check.h:53
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_parameters_is_not_in_list_int
void cs_parameters_is_not_in_list_int(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int enum_size, const int *enum_values, const char *enum_names[])
Check that a given integer keyword does not have values in a specified list.
Definition: cs_parameters_check.c:400
cs_parameters_is_in_list_int
void cs_parameters_is_in_list_int(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int enum_size, const int *enum_values, const char *enum_names[])
Check that a given integer keyword has values in a specified range.
Definition: cs_parameters_check.c:331
cs_parameters_check
void cs_parameters_check(void)
Check computation parameters after user modification.
Definition: cs_parameters_check.c:805
cs_parameters_error_header
void cs_parameters_error_header(cs_parameter_error_behavior_t err_behavior, const char *section_desc)
Print header for a given parameters error message type.
Definition: cs_parameters_check.c:194
CS_ABORT_IMMEDIATE
Definition: cs_parameters_check.h:54
cs_parameters_is_in_list_double
void cs_parameters_is_in_list_double(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, double param_value, int enum_size, const double *enum_values, const char *enum_names[])
Check that a given double keyword has values in a specified list.
Definition: cs_parameters_check.c:654
cs_parameters_is_positive_int
void cs_parameters_is_positive_int(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value)
Check that a given integer keyword is strictly positive.
Definition: cs_parameters_check.c:546
cs_parameters_is_in_range_int
void cs_parameters_is_in_range_int(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int range_l, int range_u)
Check that a given integer keyword has values in a specified range.
Definition: cs_parameters_check.c:254
cs_parameters_is_not_equal_int
void cs_parameters_is_not_equal_int(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int fbd_value)
Check that a given integer keyword is not equal to a specified value.
Definition: cs_parameters_check.c:512
cs_parameter_error_behavior_t
cs_parameter_error_behavior_t
File acces modes.
Definition: cs_parameters_check.h:50
cs_parameters_is_not_in_range_int
void cs_parameters_is_not_in_range_int(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *param_name, int param_value, int range_l, int range_u)
Check that a given integer keyword has not values in a specified range.
Definition: cs_parameters_check.c:292
cs_parameters_error
void cs_parameters_error(cs_parameter_error_behavior_t err_behavior, const char *section_desc, const char *format,...)
Print general parameters error or warning info.
Definition: cs_parameters_check.c:164
CS_WARNING
Definition: cs_parameters_check.h:52
cs_base.h