1
#ifndef __CS_JOIN_PERIO_H__
2
#define __CS_JOIN_PERIO_H__
4
/*============================================================================
5
* Structure and function headers handling with periodicity for joining
7
*===========================================================================*/
10
This file is part of Code_Saturne, a general-purpose CFD tool.
12
Copyright (C) 1998-2011 EDF S.A.
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
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
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.
29
/*----------------------------------------------------------------------------*/
31
/*----------------------------------------------------------------------------
33
*---------------------------------------------------------------------------*/
35
/*----------------------------------------------------------------------------
37
*---------------------------------------------------------------------------*/
41
#include "cs_join_set.h"
42
#include "cs_join_util.h"
43
#include "cs_join_mesh.h"
45
/*---------------------------------------------------------------------------*/
49
/*============================================================================
50
* Local Macro definitions
51
*===========================================================================*/
53
/*=============================================================================
55
*===========================================================================*/
57
extern int cs_glob_n_join_perio; /* Number of periodicity defined through
58
a joining operation */
60
/*============================================================================
61
* Public function prototypes for Fortran API
62
*============================================================================*/
64
/*----------------------------------------------------------------------------
65
* Check if periodic joining operations are queued.
72
* INTEGER iperio : <-> : do we have periodicity ?
73
* INTEGER iperot : <-> : do we have periodicity of rotation ?
74
*----------------------------------------------------------------------------*/
76
void CS_PROCF(tstjpe, tstjpe)
82
/*=============================================================================
83
* Public function prototypes
84
*===========================================================================*/
86
/*----------------------------------------------------------------------------
87
* Define a translational periodicity
90
* sel_criteria <-- boundary face selection criteria
91
* fraction <-- value of the fraction parameter
92
* plane <-- value of the plane parameter
93
* verbosity <-- level of verbosity required
94
* visualization <-- level of visualization required
95
* trans <-- translation vector
98
* number (1 to n) associated with new periodicity
99
*----------------------------------------------------------------------------*/
102
cs_join_perio_add_translation(const char *sel_criteria,
107
const double trans[3]);
109
/*----------------------------------------------------------------------------
110
* Define a rotational periodicity
113
* sel_criteria <-- boundary face selection criteria
114
* fraction <-- value of the fraction parameter
115
* plane <-- value of the plane parameter
116
* verbosity <-- level of verbosity required
117
* visualization <-- level of visualization required
118
* theta <-- rotation angle (in degrees)
119
* axis <-- axis vector
120
* invariant <-- invariant point coordinates
123
* joining number (1 to n) associated with new periodicity
124
*----------------------------------------------------------------------------*/
127
cs_join_perio_add_rotation(const char *sel_criteria,
133
const double axis[3],
134
const double invariant[3]);
136
/*----------------------------------------------------------------------------
137
* Define a periodicity using a matrix
140
* sel_criteria <-- boundary face selection criteria
141
* fraction <-- value of the fraction parameter
142
* plane <-- value of the plane parameter
143
* verbosity <-- level of verbosity required
144
* visualization <-- level of visualization required
145
* matrix <-- transformation matrix
148
* joining number (1 to n) associated with new periodicity
149
*----------------------------------------------------------------------------*/
152
cs_join_perio_add_mixed(const char *sel_criteria,
157
double matrix[3][4]);
159
/*----------------------------------------------------------------------------
160
* Add periodicity information to mesh and create or update mesh builder
161
* for a new periodic joining.
164
* this_join <-- high level join structure
165
* mesh <-> pointer to a cs_mesh_t structure
166
* builder <-> pointer to a cs_mesh_builder_t structure pointer
167
*---------------------------------------------------------------------------*/
170
cs_join_perio_init(cs_join_t *this_join,
172
cs_mesh_builder_t **builder);
174
/*----------------------------------------------------------------------------
175
* Duplicate and apply transformation to the selected faces and also to
176
* their related vertices. Modify compact_face_gnum to take into account
177
* new periodic faces and create a periodic vertex couple list.
180
* this_join <-- high level join structure
181
* jmesh <-> local join mesh struct. to duplicate and transform
182
* mesh <-- pointer to a cs_mesh_t structure
183
*---------------------------------------------------------------------------*/
186
cs_join_perio_apply(cs_join_t *this_join,
187
cs_join_mesh_t *jmesh,
188
const cs_mesh_t *mesh);
190
/*----------------------------------------------------------------------------
191
* Duplicate and apply transformation to the selected faces and also to
192
* their related vertices. Modify compact_face_gnum to take into account
193
* new periodic faces and create a periodic vertex couple list.
196
* this_join <-- pointer to a high level join structure
197
* jmesh <-> local join mesh struct. to duplicate and transform
198
* mesh <-- pointer to a cs_mesh_t structure
199
* p_work_jmesh <-> distributed join mesh struct. on which operations
201
* p_work_edges <-> join edges struct. related to work_jmesh
202
* init_max_vtx_gnum <-- initial max. global numbering for vertices
203
* n_g_new_vertices <-- global number of vertices created during the
204
* intersection of edges
205
*---------------------------------------------------------------------------*/
208
cs_join_perio_merge_back(cs_join_t *this_join,
209
cs_join_mesh_t *jmesh,
210
const cs_mesh_t *mesh,
211
cs_join_mesh_t **p_work_jmesh,
212
cs_join_edges_t **p_work_edges,
213
fvm_gnum_t init_max_vtx_gnum,
214
fvm_gnum_t n_g_new_vertices);
216
/*----------------------------------------------------------------------------
217
* Duplicate and apply transformation to the selected faces and also to
218
* their related vertices. Update jmesh structure.
219
* Define a new n2o_hist.
222
* this_join <-- pointer to a high level join structure
223
* jmesh <-> local join mesh struct. to duplicate and transform
224
* mesh <-- pointer to a cs_mesh_t structure
225
* builder <-- pointer to a cs_mesh_builder_t structure
226
* o2n_hist <-- old global face -> new local face numbering
227
* p_n2o_hist <-- new global face -> old local face numbering
228
*---------------------------------------------------------------------------*/
231
cs_join_perio_split_back(cs_join_t *this_join,
232
cs_join_mesh_t *jmesh,
234
cs_mesh_builder_t *builder,
235
cs_join_gset_t *o2n_hist,
236
cs_join_gset_t **p_n2o_hist);
238
/*----------------------------------------------------------------------------
239
* Define a list of coupled faces by periodicty in global numbering.
242
* - remove isolated periodic faces in the mesh definition
243
* - define a consistent face connectivity in order to prepare the building
244
* of periodic vertex couples
247
* param <-- set of parameters for the joining operation
248
* n_ii_faces <-- initial local number of interior faces
249
* face_type <-- type of faces in join mesh (interior or border ...)
250
* jmesh <-- pointer to a cs_join_mesh_t structure
251
* mesh <-> pointer to a cs_mesh_t structure
252
* mesh_builder <-> pointer to a cs_mesh_t structure
253
*---------------------------------------------------------------------------*/
256
cs_join_perio_split_update(cs_join_param_t param,
258
const cs_join_face_type_t face_type[],
259
const cs_join_mesh_t *jmesh,
261
cs_mesh_builder_t *mesh_builder);
263
/*----------------------------------------------------------------------------
264
* Use periodic face couples in cs_glob_join_perio_builder to define
265
* cs_glob_mesh_builder
266
* Free all elements which can be freed.
267
* Transfer data to cs_glob_mesh and cs_glob_mesh_builder.
268
*---------------------------------------------------------------------------*/
271
cs_join_perio_transfer_builder(void);
273
/*---------------------------------------------------------------------------*/
277
#endif /* __CS_JOIN_PERIO_H__ */