9.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-2026 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 * Standard C library headers
30 *----------------------------------------------------------------------------*/
31
32/*----------------------------------------------------------------------------
33 * Local headers
34 *----------------------------------------------------------------------------*/
35
36#include "base/cs_base.h"
39#include "base/cs_time_step.h"
40
41/*============================================================================
42 * Macro definitions
43 *============================================================================*/
44
45/*============================================================================
46 * Local type definitions
47 *============================================================================*/
48
49/*=============================================================================
50 * Global variables
51 *============================================================================*/
52
53/*============================================================================
54 * Public function prototypes
55 *============================================================================*/
56
57/*----------------------------------------------------------------------------
58 * Free arrays possible used by logging of array statistics.
59 *----------------------------------------------------------------------------*/
60
61void
63
64/*----------------------------------------------------------------------------
65 * Log field and other array statistics for the current time step.
66 *----------------------------------------------------------------------------*/
67
68void
70
71/*----------------------------------------------------------------------------*/
77/*----------------------------------------------------------------------------*/
78
81
82/*----------------------------------------------------------------------------
83 * Log field and other array statistics for the current time step.
84 *----------------------------------------------------------------------------*/
85
86void
88
89/*----------------------------------------------------------------------------
90 * Set adaptive interval for "per time step" logging information.
91 *
92 * Logging will also occur:
93 * - Each time step for the first n absolute or restarted time steps.
94 * - Every 5 time steps between n and 5.n time steps.
95 * - Every 10 time steps between 5.n and 10.n time steps.
96 * - Every 50 time steps between 10.n and 50.n time steps.
97 * - Every 100 time steps between 50.n and 100.n time steps.
98 * - ...
99 * - At the last time step\n\n"),
100 *
101 * parameters:
102 * n <-- base interval for output.
103 *----------------------------------------------------------------------------*/
104
105void
107
108/*----------------------------------------------------------------------------
109 * Set interval for "per time step" logging information.
110 *
111 * Logging will also occur for the 10 first time steps, as well as the last one.
112 *
113 * parameters:
114 * n <-- interval between 2 output time steps.
115 *----------------------------------------------------------------------------*/
116
117void
119
120/*----------------------------------------------------------------------------*/
124/*----------------------------------------------------------------------------*/
125
126void
128
129/*----------------------------------------------------------------------------
130 * Add or update array not saved as permanent field to iteration log.
131 *
132 * parameters:
133 * name <-- array name
134 * category <-- category name
135 * loc_id <-- associated mesh location id
136 * is_intensive <-- are the matching values intensive ?
137 * dim <-- associated dimension (interleaved)
138 * val <-- associated values
139 *----------------------------------------------------------------------------*/
140
141void
142cs_log_iteration_add_array(const char *name,
143 const char *category,
144 const cs_mesh_location_type_t loc_id,
145 bool is_intensive,
146 int dim,
147 const cs_real_t val[]);
148
149/*----------------------------------------------------------------------------
150 * Add or update clipping info for a given array.
151 *
152 * parameters:
153 * name <-- array name
154 * dim <-- associated dimension
155 * n_clip_min <-- number of local clippings to minimum value
156 * n_clip_max <-- number of local clippings to maximum value
157 * min_pre_clip <-- minimum values prior to clipping
158 * max_pre_clip <-- maximum values prior to clipping
159 */
160/*----------------------------------------------------------------------------*/
161
162void
163cs_log_iteration_clipping(const char *name,
164 int dim,
165 cs_lnum_t n_clip_min,
166 cs_lnum_t n_clip_max,
167 const cs_real_t min_pre_clip[],
168 const cs_real_t max_pre_clip[]);
169
170/*----------------------------------------------------------------------------
171 * Add or update clipping info for a field.
172 *
173 * parameters:
174 * f_id <-- associated field id
175 * n_clip_min <-- number of local clippings to minimum value
176 * n_clip_max <-- number of local clippings to maximum value
177 * min_pre_clip <-- minimum values prior to clipping
178 * max_pre_clip <-- maximum values prior to clipping
179 */
180/*----------------------------------------------------------------------------*/
181
182void
184 cs_lnum_t n_clip_min,
185 cs_lnum_t n_clip_max,
186 const cs_real_t min_pre_clip[],
187 const cs_real_t max_pre_clip[],
188 cs_lnum_t n_clip_min_comp[],
189 cs_lnum_t n_clip_max_comp[]);
190
191/*----------------------------------------------------------------------------*/
195/*----------------------------------------------------------------------------*/
196
197void
199
200/*----------------------------------------------------------------------------
201 * Log L2 time residual for variable fields.
202 *----------------------------------------------------------------------------*/
203
204void
206
207/*----------------------------------------------------------------------------
208 * Print default log per iteration options to setup.log.
209 *----------------------------------------------------------------------------*/
210
211void
213
214/*----------------------------------------------------------------------------*/
215
216#endif /* CS_LOG_ITERATION_H */
Definition: cs_time_control.h:92
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
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.cpp:1953
void cs_log_iteration_set_interval(int n)
Set interval for "per time step" logging information.
Definition: cs_log_iteration.cpp:1937
void cs_log_iteration(void)
Log field and other array statistics for the current time step.
Definition: cs_log_iteration.cpp:1681
void cs_log_iteration_destroy_all(void)
Free arrays possible used by logging of array statistics.
Definition: cs_log_iteration.cpp:1641
void cs_log_iteration_prepare(void)
Initialize structures used for logging for new iteration.
Definition: cs_log_iteration.cpp:2191
void cs_log_equation_convergence_info_write(void)
Default function for equation convergence log info.
Definition: cs_log_iteration.cpp:1723
void cs_log_iteration_set_automatic(int n)
Set adaptive interval for "per time step" logging information.
Definition: cs_log_iteration.cpp:1917
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.cpp:2169
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.cpp:2135
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.cpp:1976
cs_time_control_t * cs_log_iteration_get_time_control(void)
Retrieve the time control associated to the iteration logging.
Definition: cs_log_iteration.cpp:1711
void cs_log_iteration_l2residual(void)
Log L2 time residual for variable fields.
Definition: cs_log_iteration.cpp:2214
void cs_log_iteration_log_setup(void)
Print default log per iteration options to setup.log.
Definition: cs_log_iteration.cpp:2291
cs_mesh_location_type_t
Definition: cs_mesh_location.h:60