8.3
general documentation
cs_join_perio.h
Go to the documentation of this file.
1#ifndef __CS_JOIN_PERIO_H__
2#define __CS_JOIN_PERIO_H__
3
4/*============================================================================
5 * Structure and function headers handling with periodicity for joining
6 * operations
7 *===========================================================================*/
8
9/*
10 This file is part of code_saturne, a general-purpose CFD tool.
11
12 Copyright (C) 1998-2024 EDF S.A.
13
14 This program is free software; you can redistribute it and/or modify it under
15 the terms of the GNU General Public License as published by the Free Software
16 Foundation; either version 2 of the License, or (at your option) any later
17 version.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22 details.
23
24 You should have received a copy of the GNU General Public License along with
25 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26 Street, Fifth Floor, Boston, MA 02110-1301, USA.
27*/
28
29/*----------------------------------------------------------------------------*/
30
31/*----------------------------------------------------------------------------
32 * Local headers
33 *---------------------------------------------------------------------------*/
34
35#include "cs_base.h"
36#include "cs_mesh.h"
37#include "cs_join_set.h"
38#include "cs_join_util.h"
39#include "cs_join_mesh.h"
40
41/*---------------------------------------------------------------------------*/
42
44
45/*============================================================================
46 * Local Macro definitions
47 *===========================================================================*/
48
49/*=============================================================================
50 * Global variables
51 *===========================================================================*/
52
53/*============================================================================
54 * Public function prototypes for Fortran API
55 *============================================================================*/
56
57/*----------------------------------------------------------------------------
58 * Check if periodic joining operations are queued.
59 *
60 * Fortran Interface:
61 *
62 * SUBROUTINE TSTJPE
63 * *****************
64 *
65 * INTEGER iperio : <-> : do we have periodicity ?
66 *----------------------------------------------------------------------------*/
67
69(
70 int *iperio
71);
72
73/*=============================================================================
74 * Public function prototypes
75 *===========================================================================*/
76
77/*----------------------------------------------------------------------------
78 * Define a translational periodicity
79 *
80 * parameters:
81 * sel_criteria <-- boundary face selection criteria
82 * fraction <-- value of the fraction parameter
83 * plane <-- value of the plane parameter
84 * verbosity <-- level of verbosity required
85 * visualization <-- level of visualization required
86 * trans <-- translation vector
87 *
88 * returns:
89 * number (1 to n) associated with new periodicity
90 *----------------------------------------------------------------------------*/
91
92int
93cs_join_perio_add_translation(const char *sel_criteria,
94 double fraction,
95 double plane,
96 int verbosity,
97 int visualization,
98 const double trans[3]);
99
100/*----------------------------------------------------------------------------
101 * Define a rotational periodicity
102 *
103 * parameters:
104 * sel_criteria <-- boundary face selection criteria
105 * fraction <-- value of the fraction parameter
106 * plane <-- value of the plane parameter
107 * verbosity <-- level of verbosity required
108 * visualization <-- level of visualization required
109 * theta <-- rotation angle (in degrees)
110 * axis <-- axis vector
111 * invariant <-- invariant point coordinates
112 *
113 * returns:
114 * joining number (1 to n) associated with new periodicity
115 *----------------------------------------------------------------------------*/
116
117int
118cs_join_perio_add_rotation(const char *sel_criteria,
119 double fraction,
120 double plane,
121 int verbosity,
122 int visualization,
123 double theta,
124 const double axis[3],
125 const double invariant[3]);
126
127/*----------------------------------------------------------------------------
128 * Define a periodicity using a matrix
129 *
130 * parameters:
131 * sel_criteria <-- boundary face selection criteria
132 * fraction <-- value of the fraction parameter
133 * plane <-- value of the plane parameter
134 * verbosity <-- level of verbosity required
135 * visualization <-- level of visualization required
136 * matrix <-- transformation matrix
137 *
138 * returns:
139 * joining number (1 to n) associated with new periodicity
140 *----------------------------------------------------------------------------*/
141
142int
143cs_join_perio_add_mixed(const char *sel_criteria,
144 double fraction,
145 double plane,
146 int verbosity,
147 int visualization,
148 double matrix[3][4]);
149
150/*----------------------------------------------------------------------------
151 * Add periodicity information to mesh and create or update mesh builder
152 * for a new periodic joining.
153 *
154 * parameters:
155 * this_join <-- high level join structure
156 * mesh <-> pointer to a cs_mesh_t structure
157 * builder <-> pointer to a cs_mesh_builder_t structure pointer
158 *---------------------------------------------------------------------------*/
159
160void
161cs_join_perio_init(cs_join_t *this_join,
163 cs_mesh_builder_t **builder);
164
165/*----------------------------------------------------------------------------
166 * Duplicate and apply transformation to the selected faces and also to
167 * their related vertices. Modify compact_face_gnum to take into account
168 * new periodic faces and create a periodic vertex couple list.
169 *
170 * parameters:
171 * this_join <-- high level join structure
172 * jmesh <-> local join mesh struct. to duplicate and transform
173 * mesh <-- pointer to a cs_mesh_t structure
174 *---------------------------------------------------------------------------*/
175
176void
177cs_join_perio_apply(cs_join_t *this_join,
178 cs_join_mesh_t *jmesh,
179 const cs_mesh_t *mesh);
180
181/*----------------------------------------------------------------------------
182 * Duplicate and apply transformation to the selected faces and also to
183 * their related vertices. Modify compact_face_gnum to take into account
184 * new periodic faces and create a periodic vertex couple list.
185 *
186 * parameters:
187 * this_join <-- pointer to a high level join structure
188 * jmesh <-> local join mesh struct. to duplicate and transform
189 * mesh <-- pointer to a cs_mesh_t structure
190 * p_work_jmesh <-> distributed join mesh struct. on which operations
191 * take place
192 * p_work_edges <-> join edges struct. related to work_jmesh
193 * init_max_vtx_gnum <-- initial max. global numbering for vertices
194 * n_g_new_vertices <-- global number of vertices created during the
195 * intersection of edges
196 *---------------------------------------------------------------------------*/
197
198void
199cs_join_perio_merge_back(cs_join_t *this_join,
200 cs_join_mesh_t *jmesh,
201 const cs_mesh_t *mesh,
202 cs_join_mesh_t **p_work_jmesh,
203 cs_join_edges_t **p_work_edges,
204 cs_gnum_t init_max_vtx_gnum,
205 cs_gnum_t n_g_new_vertices);
206
207/*----------------------------------------------------------------------------
208 * Duplicate and apply transformation to the selected faces and also to
209 * their related vertices. Update jmesh structure.
210 * Define a new n2o_hist.
211 *
212 * parameters:
213 * this_join <-- pointer to a high level join structure
214 * jmesh <-> local join mesh struct. to duplicate and transform
215 * mesh <-- pointer to a cs_mesh_t structure
216 * builder <-- pointer to a cs_mesh_builder_t structure
217 * o2n_hist <-- old global face -> new local face numbering
218 * p_n2o_hist <-- new global face -> old local face numbering
219 *---------------------------------------------------------------------------*/
220
221void
222cs_join_perio_split_back(cs_join_t *this_join,
223 cs_join_mesh_t *jmesh,
225 cs_mesh_builder_t *builder,
226 cs_join_gset_t *o2n_hist,
227 cs_join_gset_t **p_n2o_hist);
228
229/*----------------------------------------------------------------------------
230 * Define a list of coupled faces by periodicty in global numbering.
231 *
232 * For parallel runs:
233 * - remove isolated periodic faces in the mesh definition
234 * - define a consistent face connectivity in order to prepare the building
235 * of periodic vertex couples
236 *
237 * parameters:
238 * param <-- set of parameters for the joining operation
239 * n_ii_faces <-- initial local number of interior faces
240 * face_type <-- type of faces in join mesh (interior or border ...)
241 * jmesh <-- pointer to a cs_join_mesh_t structure
242 * mesh <-> pointer to a cs_mesh_t structure
243 * mesh_builder <-> pointer to a cs_mesh_t structure
244 *---------------------------------------------------------------------------*/
245
246void
248 cs_lnum_t n_ii_faces,
249 const cs_join_face_type_t face_type[],
250 const cs_join_mesh_t *jmesh,
252 cs_mesh_builder_t *mesh_builder);
253
254/*----------------------------------------------------------------------------
255 * Use periodic face couples in cs_glob_join_perio_builder to define
256 * cs_glob_mesh_builder
257 * Free all elements which can be freed.
258 * Transfer data to cs_glob_mesh and cs_glob_mesh_builder.
259 *---------------------------------------------------------------------------*/
260
261void
263
264/*---------------------------------------------------------------------------*/
265
267
268#endif /* __CS_JOIN_PERIO_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
#define CS_PROCF(x, y)
Definition: cs_defs.h:576
uint64_t cs_gnum_t
global mesh entity number
Definition: cs_defs.h:325
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
void tstjpe(int *iperio)
void cs_join_perio_merge_back(cs_join_t *this_join, cs_join_mesh_t *jmesh, const cs_mesh_t *mesh, cs_join_mesh_t **p_work_jmesh, cs_join_edges_t **p_work_edges, cs_gnum_t init_max_vtx_gnum, cs_gnum_t n_g_new_vertices)
Definition: cs_join_perio.cpp:731
void cs_join_perio_init(cs_join_t *this_join, cs_mesh_t *mesh, cs_mesh_builder_t **builder)
Definition: cs_join_perio.cpp:482
void cs_join_perio_transfer_builder(void)
void cs_join_perio_split_back(cs_join_t *this_join, cs_join_mesh_t *jmesh, cs_mesh_t *mesh, cs_mesh_builder_t *builder, cs_join_gset_t *o2n_hist, cs_join_gset_t **p_n2o_hist)
Definition: cs_join_perio.cpp:1109
int cs_join_perio_add_rotation(const char *sel_criteria, double fraction, double plane, int verbosity, int visualization, double theta, const double axis[3], const double invariant[3])
Definition: cs_join_perio.cpp:388
void cs_join_perio_apply(cs_join_t *this_join, cs_join_mesh_t *jmesh, const cs_mesh_t *mesh)
Definition: cs_join_perio.cpp:547
int cs_join_perio_add_translation(const char *sel_criteria, double fraction, double plane, int verbosity, int visualization, const double trans[3])
Definition: cs_join_perio.cpp:336
int cs_join_perio_add_mixed(const char *sel_criteria, double fraction, double plane, int verbosity, int visualization, double matrix[3][4])
Definition: cs_join_perio.cpp:448
void cs_join_perio_split_update(cs_join_param_t param, cs_lnum_t n_ii_faces, const cs_join_face_type_t face_type[], const cs_join_mesh_t *jmesh, cs_mesh_t *mesh, cs_mesh_builder_t *mesh_builder)
Definition: cs_join_perio.cpp:1681
double precision, dimension(:,:,:), allocatable theta
Definition: atimbr.f90:122
integer, save iperio
presence of periodicity.
Definition: period.f90:40
Definition: mesh.f90:26
Definition: cs_join_util.h:115
Definition: cs_mesh_builder.h:57
Definition: cs_mesh.h:85