8.1
general 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-2023 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 /*----------------------------------------------------------------------------*/
49 
52 typedef enum {
53 
60 
61 /*============================================================================
62  * Public function prototypes
63  *============================================================================*/
64 
65 /*----------------------------------------------------------------------------*/
75 /*----------------------------------------------------------------------------*/
76 
77 #if defined(__GNUC__)
78 
79 void
81  const char *section_desc,
82  const char *format,
83  ...)
84  __attribute__((format(printf, 3, 4)));
85 
86 #else
87 
88 void
90  const char *section_desc,
91  const char *format,
92  ...);
93 
94 #endif
95 
96 /*----------------------------------------------------------------------------*/
106 /*----------------------------------------------------------------------------*/
107 
108 void
110  const char *section_desc,
111  const char *format,
112  ...);
113 
114 /*----------------------------------------------------------------------------*/
122 /*----------------------------------------------------------------------------*/
123 
124 void
126  const char *section_desc);
127 
128 /*----------------------------------------------------------------------------*/
134 /*----------------------------------------------------------------------------*/
135 
136 void
138 
139 /*----------------------------------------------------------------------------*/
151 /*----------------------------------------------------------------------------*/
152 
153 void
155  const char *section_desc,
156  const char *param_name,
157  int param_value,
158  int range_l,
159  int range_u);
160 
161 /*----------------------------------------------------------------------------*/
174 /*----------------------------------------------------------------------------*/
175 
176 void
178  const char *section_desc,
179  const char *param_name,
180  int param_value,
181  int range_l,
182  int range_u);
183 
184 /*----------------------------------------------------------------------------*/
198 /*----------------------------------------------------------------------------*/
199 
200 void
202  const char *section_desc,
203  const char *param_name,
204  int param_value,
205  int enum_size,
206  const int *enum_values,
207  const char *enum_names[]);
208 
209 /*----------------------------------------------------------------------------*/
224 /*----------------------------------------------------------------------------*/
225 
226 void
228  const char *section_desc,
229  const char *param_name,
230  int param_value,
231  int enum_size,
232  const int *enum_values,
233  const char *enum_names[]);
234 
235 /*----------------------------------------------------------------------------*/
246 /*----------------------------------------------------------------------------*/
247 
248 void
250  const char *section_desc,
251  const char *param_name,
252  int param_value,
253  int std_value);
254 
255 /*----------------------------------------------------------------------------*/
266 /*----------------------------------------------------------------------------*/
267 
268 void
270  const char *section_desc,
271  const char *param_name,
272  int param_value,
273  int fbd_value);
274 
275 /*----------------------------------------------------------------------------*/
285 /*----------------------------------------------------------------------------*/
286 
287 void
289  const char *section_desc,
290  const char *param_name,
291  int param_value);
292 
293 /*----------------------------------------------------------------------------*/
304 /*----------------------------------------------------------------------------*/
305 
306 void
308  const char *section_desc,
309  const char *param_name,
310  int param_value,
311  int ib_value);
312 
313 /*----------------------------------------------------------------------------*/
325 /*----------------------------------------------------------------------------*/
326 
327 void
329  const char *section_desc,
330  const char *param_name,
331  double param_value,
332  double range_l,
333  double range_u);
334 
335 /*----------------------------------------------------------------------------*/
348 /*----------------------------------------------------------------------------*/
349 
350 void
352  const char *section_desc,
353  const char *param_name,
354  double param_value,
355  int enum_size,
356  const double *enum_values,
357  const char *enum_names[]);
358 
359 /*----------------------------------------------------------------------------*/
370 /*----------------------------------------------------------------------------*/
371 
372 void
374  const char *section_desc,
375  const char *param_name,
376  double param_value,
377  double std_value);
378 
379 /*----------------------------------------------------------------------------*/
390 /*----------------------------------------------------------------------------*/
391 
392 void
394  const char *section_desc,
395  const char *param_name,
396  double param_value,
397  double ib_value);
398 
399 /*----------------------------------------------------------------------------*/
403 /*----------------------------------------------------------------------------*/
404 
405 void
407 
408 /*----------------------------------------------------------------------------
409 !
410  * \brief Check data settings
411  */
412 /*----------------------------------------------------------------------------*/
413 
414 void
415 cs_parameters_check(void);
416 
417 /*----------------------------------------------------------------------------*/
418 
420 
421 #endif /* __CS_PARAMETERS_CHECK_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
#define END_C_DECLS
Definition: cs_defs.h:515
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:517
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:236
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:475
void cs_parameters_error_barrier(void)
Abort if the the parameter errors count is nonzero.
Definition: cs_parameters_check.c:786
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:259
cs_parameter_error_behavior_t
Definition: cs_parameters_check.h:52
@ CS_WARNING
Definition: cs_parameters_check.h:54
@ CS_ABORT_DELAYED
Definition: cs_parameters_check.h:55
@ CS_ABORT_IMMEDIATE
Definition: cs_parameters_check.h:57
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:551
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:336
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:169
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:659
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:405
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:716
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:758
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:297
void cs_parameters_check(void)
Check computation parameters after user modification.
Definition: cs_parameters_check.c:810
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:621
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:585
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:199