My Project
programmer's 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-2019 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  * INTEGER iperot : <-> : do we have periodicity of rotation ?
67  *----------------------------------------------------------------------------*/
68 
69 void CS_PROCF(tstjpe, tstjpe)
70 (
73 );
74 
75 /*=============================================================================
76  * Public function prototypes
77  *===========================================================================*/
78 
79 /*----------------------------------------------------------------------------
80  * Define a translational periodicity
81  *
82  * parameters:
83  * sel_criteria <-- boundary face selection criteria
84  * fraction <-- value of the fraction parameter
85  * plane <-- value of the plane parameter
86  * verbosity <-- level of verbosity required
87  * visualization <-- level of visualization required
88  * trans <-- translation vector
89  *
90  * returns:
91  * number (1 to n) associated with new periodicity
92  *----------------------------------------------------------------------------*/
93 
94 int
95 cs_join_perio_add_translation(const char *sel_criteria,
96  double fraction,
97  double plane,
98  int verbosity,
99  int visualization,
100  const double trans[3]);
101 
102 /*----------------------------------------------------------------------------
103  * Define a rotational periodicity
104  *
105  * parameters:
106  * sel_criteria <-- boundary face selection criteria
107  * fraction <-- value of the fraction parameter
108  * plane <-- value of the plane parameter
109  * verbosity <-- level of verbosity required
110  * visualization <-- level of visualization required
111  * theta <-- rotation angle (in degrees)
112  * axis <-- axis vector
113  * invariant <-- invariant point coordinates
114  *
115  * returns:
116  * joining number (1 to n) associated with new periodicity
117  *----------------------------------------------------------------------------*/
118 
119 int
120 cs_join_perio_add_rotation(const char *sel_criteria,
121  double fraction,
122  double plane,
123  int verbosity,
124  int visualization,
125  double theta,
126  const double axis[3],
127  const double invariant[3]);
128 
129 /*----------------------------------------------------------------------------
130  * Define a periodicity using a matrix
131  *
132  * parameters:
133  * sel_criteria <-- boundary face selection criteria
134  * fraction <-- value of the fraction parameter
135  * plane <-- value of the plane parameter
136  * verbosity <-- level of verbosity required
137  * visualization <-- level of visualization required
138  * matrix <-- transformation matrix
139  *
140  * returns:
141  * joining number (1 to n) associated with new periodicity
142  *----------------------------------------------------------------------------*/
143 
144 int
145 cs_join_perio_add_mixed(const char *sel_criteria,
146  double fraction,
147  double plane,
148  int verbosity,
149  int visualization,
150  double matrix[3][4]);
151 
152 /*----------------------------------------------------------------------------
153  * Add periodicity information to mesh and create or update mesh builder
154  * for a new periodic joining.
155  *
156  * parameters:
157  * this_join <-- high level join structure
158  * mesh <-> pointer to a cs_mesh_t structure
159  * builder <-> pointer to a cs_mesh_builder_t structure pointer
160  *---------------------------------------------------------------------------*/
161 
162 void
163 cs_join_perio_init(cs_join_t *this_join,
164  cs_mesh_t *mesh,
165  cs_mesh_builder_t **builder);
166 
167 /*----------------------------------------------------------------------------
168  * Duplicate and apply transformation to the selected faces and also to
169  * their related vertices. Modify compact_face_gnum to take into account
170  * new periodic faces and create a periodic vertex couple list.
171  *
172  * parameters:
173  * this_join <-- high level join structure
174  * jmesh <-> local join mesh struct. to duplicate and transform
175  * mesh <-- pointer to a cs_mesh_t structure
176  *---------------------------------------------------------------------------*/
177 
178 void
179 cs_join_perio_apply(cs_join_t *this_join,
180  cs_join_mesh_t *jmesh,
181  const cs_mesh_t *mesh);
182 
183 /*----------------------------------------------------------------------------
184  * Duplicate and apply transformation to the selected faces and also to
185  * their related vertices. Modify compact_face_gnum to take into account
186  * new periodic faces and create a periodic vertex couple list.
187  *
188  * parameters:
189  * this_join <-- pointer to a high level join structure
190  * jmesh <-> local join mesh struct. to duplicate and transform
191  * mesh <-- pointer to a cs_mesh_t structure
192  * p_work_jmesh <-> distributed join mesh struct. on which operations
193  * take place
194  * p_work_edges <-> join edges struct. related to work_jmesh
195  * init_max_vtx_gnum <-- initial max. global numbering for vertices
196  * n_g_new_vertices <-- global number of vertices created during the
197  * intersection of edges
198  *---------------------------------------------------------------------------*/
199 
200 void
201 cs_join_perio_merge_back(cs_join_t *this_join,
202  cs_join_mesh_t *jmesh,
203  const cs_mesh_t *mesh,
204  cs_join_mesh_t **p_work_jmesh,
205  cs_join_edges_t **p_work_edges,
206  cs_gnum_t init_max_vtx_gnum,
207  cs_gnum_t n_g_new_vertices);
208 
209 /*----------------------------------------------------------------------------
210  * Duplicate and apply transformation to the selected faces and also to
211  * their related vertices. Update jmesh structure.
212  * Define a new n2o_hist.
213  *
214  * parameters:
215  * this_join <-- pointer to a high level join structure
216  * jmesh <-> local join mesh struct. to duplicate and transform
217  * mesh <-- pointer to a cs_mesh_t structure
218  * builder <-- pointer to a cs_mesh_builder_t structure
219  * o2n_hist <-- old global face -> new local face numbering
220  * p_n2o_hist <-- new global face -> old local face numbering
221  *---------------------------------------------------------------------------*/
222 
223 void
224 cs_join_perio_split_back(cs_join_t *this_join,
225  cs_join_mesh_t *jmesh,
226  cs_mesh_t *mesh,
227  cs_mesh_builder_t *builder,
228  cs_join_gset_t *o2n_hist,
229  cs_join_gset_t **p_n2o_hist);
230 
231 /*----------------------------------------------------------------------------
232  * Define a list of coupled faces by periodicty in global numbering.
233  *
234  * For parallel runs:
235  * - remove isolated periodic faces in the mesh definition
236  * - define a consistent face connectivity in order to prepare the building
237  * of periodic vertex couples
238  *
239  * parameters:
240  * param <-- set of parameters for the joining operation
241  * n_ii_faces <-- initial local number of interior faces
242  * face_type <-- type of faces in join mesh (interior or border ...)
243  * jmesh <-- pointer to a cs_join_mesh_t structure
244  * mesh <-> pointer to a cs_mesh_t structure
245  * mesh_builder <-> pointer to a cs_mesh_t structure
246  *---------------------------------------------------------------------------*/
247 
248 void
250  cs_lnum_t n_ii_faces,
251  const cs_join_face_type_t face_type[],
252  const cs_join_mesh_t *jmesh,
253  cs_mesh_t *mesh,
254  cs_mesh_builder_t *mesh_builder);
255 
256 /*----------------------------------------------------------------------------
257  * Use periodic face couples in cs_glob_join_perio_builder to define
258  * cs_glob_mesh_builder
259  * Free all elements which can be freed.
260  * Transfer data to cs_glob_mesh and cs_glob_mesh_builder.
261  *---------------------------------------------------------------------------*/
262 
263 void
265 
266 /*---------------------------------------------------------------------------*/
267 
269 
270 #endif /* __CS_JOIN_PERIO_H__ */
cs_join_perio_add_mixed
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.c:452
cs_join_perio_transfer_builder
void cs_join_perio_transfer_builder(void)
period::iperio
integer, save iperio
presence of periodicity.
Definition: period.f90:40
cs_mesh_builder_t
Definition: cs_mesh_builder.h:57
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_join_perio_split_back
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.c:1113
cs_join_perio_apply
void cs_join_perio_apply(cs_join_t *this_join, cs_join_mesh_t *jmesh, const cs_mesh_t *mesh)
Definition: cs_join_perio.c:551
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_join_perio_add_translation
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.c:340
cs_join_util.h
mesh
Definition: mesh.f90:26
cs_mesh.h
atimbr::theta
double precision, dimension(:,:,:), allocatable theta
Definition: atimbr.f90:123
cs_gnum_t
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:286
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
iperot
void cs_int_t * iperot
Definition: cs_join_perio.h:73
cs_join_mesh.h
cs_join_param_t
Definition: cs_join_util.h:115
cs_int_t
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:301
cs_join_perio_init
void cs_join_perio_init(cs_join_t *this_join, cs_mesh_t *mesh, cs_mesh_builder_t **builder)
Definition: cs_join_perio.c:486
cs_join_perio_add_rotation
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.c:392
cs_join_set.h
CS_PROCF
void CS_PROCF(tstjpe, tstjpe)(cs_int_t *iperio
cs_join_perio_merge_back
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.c:735
cs_join_perio_split_update
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.c:1685
cs_mesh_t
Definition: cs_mesh.h:63
cs_base.h