8.3
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
66void
68
69/*----------------------------------------------------------------------------
70 * Log field and other array statistics for the current time step.
71 *----------------------------------------------------------------------------*/
72
73void
75
76/*----------------------------------------------------------------------------
77 * Log field and other array statistics for the current time step.
78 *----------------------------------------------------------------------------*/
79
80void
82
83/*----------------------------------------------------------------------------
84 * Set adaptive interval for "per time step" logging information.
85 *
86 * Logging will also occur:
87 * - Each time step for the first n absolute or restarted time steps.
88 * - Every 5 time steps between n and 5.n time steps.
89 * - Every 10 time steps between 5.n and 10.n time steps.
90 * - Every 50 time steps between 10.n and 50.n time steps.
91 * - Every 100 time steps between 50.n and 100.n time steps.
92 * - ...
93 * - At the last time step\n\n"),
94 *
95 * parameters:
96 * n <-- base interval for output.
97 *----------------------------------------------------------------------------*/
98
99void
101
102/*----------------------------------------------------------------------------
103 * Set interval for "per time step" logging information.
104 *
105 * Logging will also occur for the 10 first time steps, as well as the last one.
106 *
107 * parameters:
108 * n <-- interval between 2 output time steps.
109 *----------------------------------------------------------------------------*/
110
111void
113
114/*----------------------------------------------------------------------------*/
118/*----------------------------------------------------------------------------*/
119
120void
122
123/*----------------------------------------------------------------------------
124 * Add or update array not saved as permanent field to iteration log.
125 *
126 * parameters:
127 * name <-- array name
128 * category <-- category name
129 * loc_id <-- associated mesh location id
130 * is_intensive <-- are the matching values intensive ?
131 * dim <-- associated dimension (interleaved)
132 * val <-- associated values
133 *----------------------------------------------------------------------------*/
134
135void
136cs_log_iteration_add_array(const char *name,
137 const char *category,
138 const cs_mesh_location_type_t loc_id,
139 bool is_intensive,
140 int dim,
141 const cs_real_t val[]);
142
143/*----------------------------------------------------------------------------
144 * Add or update clipping info for a given array.
145 *
146 * parameters:
147 * name <-- array name
148 * dim <-- associated dimension
149 * n_clip_min <-- number of local clippings to minimum value
150 * n_clip_max <-- number of local clippings to maximum value
151 * min_pre_clip <-- minimum values prior to clipping
152 * max_pre_clip <-- maximum values prior to clipping
153 */
154/*----------------------------------------------------------------------------*/
155
156void
157cs_log_iteration_clipping(const char *name,
158 int dim,
159 cs_lnum_t n_clip_min,
160 cs_lnum_t n_clip_max,
161 const cs_real_t min_pre_clip[],
162 const cs_real_t max_pre_clip[]);
163
164/*----------------------------------------------------------------------------
165 * Add or update clipping info for a field.
166 *
167 * parameters:
168 * f_id <-- associated field id
169 * n_clip_min <-- number of local clippings to minimum value
170 * n_clip_max <-- number of local clippings to maximum value
171 * min_pre_clip <-- minimum values prior to clipping
172 * max_pre_clip <-- maximum values prior to clipping
173 */
174/*----------------------------------------------------------------------------*/
175
176void
178 cs_lnum_t n_clip_min,
179 cs_lnum_t n_clip_max,
180 const cs_real_t min_pre_clip[],
181 const cs_real_t max_pre_clip[],
182 cs_lnum_t n_clip_min_comp[],
183 cs_lnum_t n_clip_max_comp[]);
184
185/*----------------------------------------------------------------------------*/
189/*----------------------------------------------------------------------------*/
190
191void
193
194/*----------------------------------------------------------------------------
195 * Log L2 time residual for variable fields.
196 *----------------------------------------------------------------------------*/
197
198void
200
201/*----------------------------------------------------------------------------
202 * Print default log per iteration options to setup.log.
203 *----------------------------------------------------------------------------*/
204
205void
207
208/*----------------------------------------------------------------------------*/
209
211
212#endif /* __CS_LOG_ITERATION_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
void cs_log_iteration_set_active(void)
Activate or deactivate default log for current iteration.
Definition: cs_log_iteration.cpp:1932
void cs_log_iteration_set_interval(int n)
Set interval for "per time step" logging information.
Definition: cs_log_iteration.cpp:1914
void cs_log_iteration(void)
Log field and other array statistics for the current time step.
Definition: cs_log_iteration.cpp:1686
void cs_log_iteration_destroy_all(void)
Free arrays possible used by logging of array statistics.
Definition: cs_log_iteration.cpp:1646
void cs_log_iteration_prepare(void)
Initialize structures used for logging for new iteration.
Definition: cs_log_iteration.cpp:2166
void cs_log_equation_convergence_info_write(void)
Default function for equation convergence log info.
Definition: cs_log_iteration.cpp:1714
void cs_log_iteration_set_automatic(int n)
Set adaptive interval for "per time step" logging information.
Definition: cs_log_iteration.cpp:1892
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:2144
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:2110
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:1955
void cs_log_iteration_l2residual(void)
Log L2 time residual for variable fields.
Definition: cs_log_iteration.cpp:2189
void cs_log_iteration_log_setup(void)
Print default log per iteration options to setup.log.
Definition: cs_log_iteration.cpp:2266
cs_mesh_location_type_t
Definition: cs_mesh_location.h:60