9.2
general documentation
cs_restart_map.h
Go to the documentation of this file.
1#ifndef CS_RESTART_MAP_H
2#define CS_RESTART_MAP_H
3
4/*============================================================================
5 * Checkpoint / restart extension to mapped meshes
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
30/*----------------------------------------------------------------------------
31 * Standard C library headers
32 *----------------------------------------------------------------------------*/
33
34/*----------------------------------------------------------------------------
35 * Local headers
36 *----------------------------------------------------------------------------*/
37
38#include "base/cs_defs.h"
39#include "base/cs_restart.h"
40
41/*============================================================================
42 * Macro definitions
43 *============================================================================*/
44
45
46/*============================================================================
47 * Local type definitions
48 *============================================================================*/
49
50
51/*=============================================================================
52 * Global variables
53 *============================================================================*/
54
55
56/*============================================================================
57 * Public function prototypes
58 *============================================================================*/
59
60/*----------------------------------------------------------------------------*/
61/*
62 * \brief Indicate restart files should be mapped to a given mesh input
63 *
64 * \param[in] mesh_path path to mesh input
65 */
66/*----------------------------------------------------------------------------*/
67
68void
69cs_restart_map_set_mesh_input(const char *mesh_path);
70
71/*----------------------------------------------------------------------------*/
72/*
73 * \brief Return path of mesh if a restart mapping of restart files to
74 * a different mesh has been defined, null otherwise.
75 *
76 * \return path to mapped mesh input file, or null.
77 */
78/*----------------------------------------------------------------------------*/
79
80const char *
82
83/*----------------------------------------------------------------------------*/
84/*
85 * \brief Set options relative to restart file mapping to a given mesh input.
86 *
87 * \param[in] apply_mesh_deformation apply mesh deformation from upstream
88 * computation (if present) so as to map
89 * to final, and not initial mesh shape.
90 * \param[in] tolerance_base associated base tolerance (used for
91 * bounding box check only, not for
92 * location test)
93 * \param[in] tolerance_fraction associated fraction of element bounding
94 * boxes added to tolerance
95 */
96/*----------------------------------------------------------------------------*/
97
98void
99cs_restart_map_set_options(bool apply_mesh_deformation,
100 float tolerance_base,
101 float tolerance_fraction);
102
103/*----------------------------------------------------------------------------*/
104/*
105 * \brief Indicate whether location for restart file mapping is needed at
106 * cells or vertices.
107 *
108 * By default, mapping is done for cell-based quantities, but not for
109 * vertex-based quantities.
110 *
111 * Mapping of quantities at faces or particles is not handled yet, but will
112 * use the cell-center or vertex based mappings in the future in all cases:
113 * - interior faces may not be aligned with previous faces, so some sort of
114 * cell-based interpolation will be required
115 * - boundary faces can use the boundary face / cell adjacency to avoid an
116 * additional mapping
117 * - for particles, as the previous location is stored based on cell ids,
118 * updating particle locations will require locating them in the matching
119 * cell and completing a trajectory adjustment (direct location should be
120 * avoided in case of concave boundaries).
121 *
122 * \param[in] map_cell_centers locate cell centers in the previous mesh.
123 * \param[in] map_vertices locate vertices in the previous mesh.
124 */
125/*----------------------------------------------------------------------------*/
126
127void
128cs_restart_map_set_locations(bool map_cell_centers,
129 bool map_vertices);
130
131/*----------------------------------------------------------------------------*/
132/*
133 * \brief Build mapping of restart files to different mesh if defined.
134 */
135/*----------------------------------------------------------------------------*/
136
137void
139
140/*----------------------------------------------------------------------------*/
141/*
142 * \brief Free restart file mapping to different mesh.
143 *
144 * Revert restart reading to default behavior.
145 */
146/*----------------------------------------------------------------------------*/
147
148void
150
151/*----------------------------------------------------------------------------*/
152
153#endif /* CS_RESTART_MAP_H */
void cs_restart_map_free(void)
Free restart file mapping to different mesh.
Definition: cs_restart_map.cpp:722
void cs_restart_map_build(void)
Build mapping of restart files to different mesh if defined.
Definition: cs_restart_map.cpp:557
void cs_restart_map_set_locations(bool map_cell_centers, bool map_vertices)
Indicate whether location for restart file mapping is needed at cells or vertices.
Definition: cs_restart_map.cpp:539
const char * cs_restart_map_get_mesh_input(void)
Return path of mesh if a restart mapping of restart files to a different mesh has been defined,...
Definition: cs_restart_map.cpp:483
void cs_restart_map_set_options(bool apply_mesh_deformation, float tolerance_base, float tolerance_fraction)
Set options relative to restart file mapping to a given mesh input.
Definition: cs_restart_map.cpp:504
void cs_restart_map_set_mesh_input(const char *mesh_path)
Indicate restart files should be mapped to a given mesh input.
Definition: cs_restart_map.cpp:464