9.0
general documentation
Loading...
Searching...
No Matches
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-2025 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 "base/cs_base.h"
36#include "mesh/cs_mesh.h"
37#include "mesh/cs_join_set.h"
38#include "mesh/cs_join_util.h"
39#include "mesh/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
55 *===========================================================================*/
56
57/*----------------------------------------------------------------------------
58 * Define a translational periodicity
59 *
60 * parameters:
61 * sel_criteria <-- boundary face selection criteria
62 * fraction <-- value of the fraction parameter
63 * plane <-- value of the plane parameter
64 * verbosity <-- level of verbosity required
65 * visualization <-- level of visualization required
66 * trans <-- translation vector
67 *
68 * returns:
69 * number (1 to n) associated with new periodicity
70 *----------------------------------------------------------------------------*/
71
72int
73cs_join_perio_add_translation(const char *sel_criteria,
74 double fraction,
75 double plane,
76 int verbosity,
77 int visualization,
78 const double trans[3]);
79
80/*----------------------------------------------------------------------------
81 * Define a rotational periodicity
82 *
83 * parameters:
84 * sel_criteria <-- boundary face selection criteria
85 * fraction <-- value of the fraction parameter
86 * plane <-- value of the plane parameter
87 * verbosity <-- level of verbosity required
88 * visualization <-- level of visualization required
89 * theta <-- rotation angle (in degrees)
90 * axis <-- axis vector
91 * invariant <-- invariant point coordinates
92 *
93 * returns:
94 * joining number (1 to n) associated with new periodicity
95 *----------------------------------------------------------------------------*/
96
97int
98cs_join_perio_add_rotation(const char *sel_criteria,
99 double fraction,
100 double plane,
101 int verbosity,
102 int visualization,
103 double theta,
104 const double axis[3],
105 const double invariant[3]);
106
107/*----------------------------------------------------------------------------
108 * Define a periodicity using a matrix
109 *
110 * parameters:
111 * sel_criteria <-- boundary face selection criteria
112 * fraction <-- value of the fraction parameter
113 * plane <-- value of the plane parameter
114 * verbosity <-- level of verbosity required
115 * visualization <-- level of visualization required
116 * matrix <-- transformation matrix
117 *
118 * returns:
119 * joining number (1 to n) associated with new periodicity
120 *----------------------------------------------------------------------------*/
121
122int
123cs_join_perio_add_mixed(const char *sel_criteria,
124 double fraction,
125 double plane,
126 int verbosity,
127 int visualization,
128 double matrix[3][4]);
129
130/*----------------------------------------------------------------------------
131 * Add periodicity information to mesh and create or update mesh builder
132 * for a new periodic joining.
133 *
134 * parameters:
135 * this_join <-- high level join structure
136 * mesh <-> pointer to a cs_mesh_t structure
137 * builder <-> pointer to a cs_mesh_builder_t structure pointer
138 *---------------------------------------------------------------------------*/
139
140void
141cs_join_perio_init(cs_join_t *this_join,
143 cs_mesh_builder_t **builder);
144
145/*----------------------------------------------------------------------------
146 * Duplicate and apply transformation to the selected faces and also to
147 * their related vertices. Modify compact_face_gnum to take into account
148 * new periodic faces and create a periodic vertex couple list.
149 *
150 * parameters:
151 * this_join <-- high level join structure
152 * jmesh <-> local join mesh struct. to duplicate and transform
153 * mesh <-- pointer to a cs_mesh_t structure
154 *---------------------------------------------------------------------------*/
155
156void
157cs_join_perio_apply(cs_join_t *this_join,
158 cs_join_mesh_t *jmesh,
159 const cs_mesh_t *mesh);
160
161/*----------------------------------------------------------------------------
162 * Duplicate and apply transformation to the selected faces and also to
163 * their related vertices. Modify compact_face_gnum to take into account
164 * new periodic faces and create a periodic vertex couple list.
165 *
166 * parameters:
167 * this_join <-- pointer to a high level join structure
168 * jmesh <-> local join mesh struct. to duplicate and transform
169 * mesh <-- pointer to a cs_mesh_t structure
170 * p_work_jmesh <-> distributed join mesh struct. on which operations
171 * take place
172 * p_work_edges <-> join edges struct. related to work_jmesh
173 * init_max_vtx_gnum <-- initial max. global numbering for vertices
174 * n_g_new_vertices <-- global number of vertices created during the
175 * intersection of edges
176 *---------------------------------------------------------------------------*/
177
178void
179cs_join_perio_merge_back(cs_join_t *this_join,
180 cs_join_mesh_t *jmesh,
181 const cs_mesh_t *mesh,
182 cs_join_mesh_t **p_work_jmesh,
183 cs_join_edges_t **p_work_edges,
184 cs_gnum_t init_max_vtx_gnum,
185 cs_gnum_t n_g_new_vertices);
186
187/*----------------------------------------------------------------------------
188 * Duplicate and apply transformation to the selected faces and also to
189 * their related vertices. Update jmesh structure.
190 * Define a new n2o_hist.
191 *
192 * parameters:
193 * this_join <-- pointer to a high level join structure
194 * jmesh <-> local join mesh struct. to duplicate and transform
195 * mesh <-- pointer to a cs_mesh_t structure
196 * builder <-- pointer to a cs_mesh_builder_t structure
197 * o2n_hist <-- old global face -> new local face numbering
198 * p_n2o_hist <-- new global face -> old local face numbering
199 *---------------------------------------------------------------------------*/
200
201void
202cs_join_perio_split_back(cs_join_t *this_join,
203 cs_join_mesh_t *jmesh,
205 cs_mesh_builder_t *builder,
206 cs_join_gset_t *o2n_hist,
207 cs_join_gset_t **p_n2o_hist);
208
209/*----------------------------------------------------------------------------
210 * Define a list of coupled faces by periodicty in global numbering.
211 *
212 * For parallel runs:
213 * - remove isolated periodic faces in the mesh definition
214 * - define a consistent face connectivity in order to prepare the building
215 * of periodic vertex couples
216 *
217 * parameters:
218 * param <-- set of parameters for the joining operation
219 * n_ii_faces <-- initial local number of interior faces
220 * face_type <-- type of faces in join mesh (interior or border ...)
221 * jmesh <-- pointer to a cs_join_mesh_t structure
222 * mesh <-> pointer to a cs_mesh_t structure
223 * mesh_builder <-> pointer to a cs_mesh_t structure
224 *---------------------------------------------------------------------------*/
225
226void
228 cs_lnum_t n_ii_faces,
229 const cs_join_face_type_t face_type[],
230 const cs_join_mesh_t *jmesh,
232 cs_mesh_builder_t *mesh_builder);
233
234/*----------------------------------------------------------------------------
235 * Use periodic face couples in cs_glob_join_perio_builder to define
236 * cs_glob_mesh_builder
237 * Free all elements which can be freed.
238 * Transfer data to cs_glob_mesh and cs_glob_mesh_builder.
239 *---------------------------------------------------------------------------*/
240
241void
243
244/*---------------------------------------------------------------------------*/
245
247
248#endif /* __CS_JOIN_PERIO_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:542
unsigned cs_gnum_t
global mesh entity number
Definition cs_defs.h:327
#define END_C_DECLS
Definition cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:335
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:737
void cs_join_perio_init(cs_join_t *this_join, cs_mesh_t *mesh, cs_mesh_builder_t **builder)
Definition cs_join_perio.cpp:488
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:1114
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:394
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:554
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:342
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:454
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:1685
Definition mesh.f90:26
Definition cs_join_util.h:115
Definition cs_mesh_builder.h:57
Definition cs_mesh.h:85