8.2
general documentation
cs_log_iteration.h
Go to the documentation of this file.
1 #ifndef __CS_LOG_ITERATION_H__
2 #define __CS_LOG_ITERATION_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-2024 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 #include "cs_mesh_location.h"
40 #include "cs_time_step.h"
41 
42 /*----------------------------------------------------------------------------*/
43 
45 
46 /*============================================================================
47  * Macro definitions
48  *============================================================================*/
49 
50 /*============================================================================
51  * Local type definitions
52  *============================================================================*/
53 
54 /*=============================================================================
55  * Global variables
56  *============================================================================*/
57 
58 /*============================================================================
59  * Public function prototypes
60  *============================================================================*/
61 
62 /*----------------------------------------------------------------------------
63  * Free arrays possible used by logging of array statistics.
64  *----------------------------------------------------------------------------*/
65 
66 void
68 
69 /*----------------------------------------------------------------------------
70  * Log field and other array statistics for the current time step.
71  *----------------------------------------------------------------------------*/
72 
73 void
74 cs_log_iteration(void);
75 
76 /*----------------------------------------------------------------------------
77  * Set adaptive interval for "per time step" logging information.
78  *
79  * Logging will also occur:
80  * - Each time step for the first n absolute or restarted time steps.
81  * - Every 5 time steps between n and 5.n time steps.
82  * - Every 10 time steps between 5.n and 10.n time steps.
83  * - Every 50 time steps between 10.n and 50.n time steps.
84  * - Every 100 time steps between 50.n and 100.n time steps.
85  * - ...
86  * - At the last time step\n\n"),
87  *
88  * parameters:
89  * n <-- base interval for output.
90  *----------------------------------------------------------------------------*/
91 
92 void
94 
95 /*----------------------------------------------------------------------------
96  * Set interval for "per time step" logging information.
97  *
98  * Logging will also occur for the 10 first time steps, as well as the last one.
99  *
100  * parameters:
101  * n <-- interval between 2 output time steps.
102  *----------------------------------------------------------------------------*/
103 
104 void
106 
107 /*----------------------------------------------------------------------------*/
111 /*----------------------------------------------------------------------------*/
112 
113 void
115 
116 /*----------------------------------------------------------------------------
117  * Add or update array not saved as permanent field to iteration log.
118  *
119  * parameters:
120  * name <-- array name
121  * category <-- category name
122  * loc_id <-- associated mesh location id
123  * is_intensive <-- are the matching values intensive ?
124  * dim <-- associated dimension (interleaved)
125  * val <-- associated values
126  *----------------------------------------------------------------------------*/
127 
128 void
129 cs_log_iteration_add_array(const char *name,
130  const char *category,
131  const cs_mesh_location_type_t loc_id,
132  bool is_intensive,
133  int dim,
134  const cs_real_t val[]);
135 
136 /*----------------------------------------------------------------------------
137  * Add or update clipping info for a given array.
138  *
139  * parameters:
140  * name <-- array name
141  * dim <-- associated dimension
142  * n_clip_min <-- number of local clippings to minimum value
143  * n_clip_max <-- number of local clippings to maximum value
144  * min_pre_clip <-- minimum values prior to clipping
145  * max_pre_clip <-- maximum values prior to clipping
146  */
147 /*----------------------------------------------------------------------------*/
148 
149 void
150 cs_log_iteration_clipping(const char *name,
151  int dim,
152  cs_lnum_t n_clip_min,
153  cs_lnum_t n_clip_max,
154  const cs_real_t min_pre_clip[],
155  const cs_real_t max_pre_clip[]);
156 
157 /*----------------------------------------------------------------------------
158  * Add or update clipping info for a field.
159  *
160  * parameters:
161  * f_id <-- associated field id
162  * n_clip_min <-- number of local clippings to minimum value
163  * n_clip_max <-- number of local clippings to maximum value
164  * min_pre_clip <-- minimum values prior to clipping
165  * max_pre_clip <-- maximum values prior to clipping
166  */
167 /*----------------------------------------------------------------------------*/
168 
169 void
171  cs_lnum_t n_clip_min,
172  cs_lnum_t n_clip_max,
173  const cs_real_t min_pre_clip[],
174  const cs_real_t max_pre_clip[],
175  cs_lnum_t n_clip_min_comp[],
176  cs_lnum_t n_clip_max_comp[]);
177 
178 /*----------------------------------------------------------------------------*/
182 /*----------------------------------------------------------------------------*/
183 
184 void
186 
187 /*----------------------------------------------------------------------------
188  * Log L2 time residual for variable fields.
189  *----------------------------------------------------------------------------*/
190 
191 void
193 
194 /*----------------------------------------------------------------------------
195  * Print default log per iteration options to setup.log.
196  *----------------------------------------------------------------------------*/
197 
198 void
200 
201 /*----------------------------------------------------------------------------*/
202 
204 
205 #endif /* __CS_LOG_ITERATION_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:528
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
#define END_C_DECLS
Definition: cs_defs.h:529
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
void cs_log_iteration_set_active(void)
Activate or deactivate default log for current iteration.
Definition: cs_log_iteration.c:1761
void cs_log_iteration_set_interval(int n)
Set interval for "per time step" logging information.
Definition: cs_log_iteration.c:1743
void cs_log_iteration(void)
Log field and other array statistics for the current time step.
Definition: cs_log_iteration.c:1683
void cs_log_iteration_destroy_all(void)
Free arrays possible used by logging of array statistics.
Definition: cs_log_iteration.c:1643
void cs_log_iteration_prepare(void)
Initialize structures used for logging for new iteration.
Definition: cs_log_iteration.c:1995
void cs_log_iteration_set_automatic(int n)
Set adaptive interval for "per time step" logging information.
Definition: cs_log_iteration.c:1721
void cs_log_iteration_clipping_field(int f_id, cs_lnum_t n_clip_min, cs_lnum_t n_clip_max, const cs_real_t min_pre_clip[], const cs_real_t max_pre_clip[], cs_lnum_t n_clip_min_comp[], cs_lnum_t n_clip_max_comp[])
Add or update clipping info for a field.
Definition: cs_log_iteration.c:1973
void cs_log_iteration_clipping(const char *name, int dim, cs_lnum_t n_clip_min, cs_lnum_t n_clip_max, const cs_real_t min_pre_clip[], const cs_real_t max_pre_clip[])
Add or update clipping info for a given array.
Definition: cs_log_iteration.c:1939
void cs_log_iteration_add_array(const char *name, const char *category, const cs_mesh_location_type_t loc_id, bool is_intensive, int dim, const cs_real_t val[])
Add or update array not saved as permanent field to iteration log.
Definition: cs_log_iteration.c:1784
void cs_log_iteration_l2residual(void)
Log L2 time residual for variable fields.
Definition: cs_log_iteration.c:2018
void cs_log_iteration_log_setup(void)
Print default log per iteration options to setup.log.
Definition: cs_log_iteration.c:2095
cs_mesh_location_type_t
Definition: cs_mesh_location.h:60