Code_Saturne
CFD tool
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-2012 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  * FVM library headers
33  *---------------------------------------------------------------------------*/
34 
35 /*----------------------------------------------------------------------------
36  * Local headers
37  *---------------------------------------------------------------------------*/
38 
39 #include "cs_base.h"
40 #include "cs_mesh.h"
41 #include "cs_join_set.h"
42 #include "cs_join_util.h"
43 #include "cs_join_mesh.h"
44 
45 /*---------------------------------------------------------------------------*/
46 
48 
49 /*============================================================================
50  * Local Macro definitions
51  *===========================================================================*/
52 
53 /*=============================================================================
54  * Global variables
55  *===========================================================================*/
56 
57 /*============================================================================
58  * Public function prototypes for Fortran API
59  *============================================================================*/
60 
61 /*----------------------------------------------------------------------------
62  * Check if periodic joining operations are queued.
63  *
64  * Fortran Interface:
65  *
66  * SUBROUTINE TSTJPE
67  * *****************
68  *
69  * INTEGER iperio : <-> : do we have periodicity ?
70  * INTEGER iperot : <-> : do we have periodicity of rotation ?
71  *----------------------------------------------------------------------------*/
72 
73 void CS_PROCF(tstjpe, tstjpe)
74 (
77 );
78 
79 /*=============================================================================
80  * Public function prototypes
81  *===========================================================================*/
82 
83 /*----------------------------------------------------------------------------
84  * Define a translational periodicity
85  *
86  * parameters:
87  * sel_criteria <-- boundary face selection criteria
88  * fraction <-- value of the fraction parameter
89  * plane <-- value of the plane parameter
90  * verbosity <-- level of verbosity required
91  * visualization <-- level of visualization required
92  * trans <-- translation vector
93  *
94  * returns:
95  * number (1 to n) associated with new periodicity
96  *----------------------------------------------------------------------------*/
97 
98 int
99 cs_join_perio_add_translation(const char *sel_criteria,
100  double fraction,
101  double plane,
102  int verbosity,
103  int visualization,
104  const double trans[3]);
105 
106 /*----------------------------------------------------------------------------
107  * Define a rotational periodicity
108  *
109  * parameters:
110  * sel_criteria <-- boundary face selection criteria
111  * fraction <-- value of the fraction parameter
112  * plane <-- value of the plane parameter
113  * verbosity <-- level of verbosity required
114  * visualization <-- level of visualization required
115  * theta <-- rotation angle (in degrees)
116  * axis <-- axis vector
117  * invariant <-- invariant point coordinates
118  *
119  * returns:
120  * joining number (1 to n) associated with new periodicity
121  *----------------------------------------------------------------------------*/
122 
123 int
124 cs_join_perio_add_rotation(const char *sel_criteria,
125  double fraction,
126  double plane,
127  int verbosity,
128  int visualization,
129  double theta,
130  const double axis[3],
131  const double invariant[3]);
132 
133 /*----------------------------------------------------------------------------
134  * Define a periodicity using a matrix
135  *
136  * parameters:
137  * sel_criteria <-- boundary face selection criteria
138  * fraction <-- value of the fraction parameter
139  * plane <-- value of the plane parameter
140  * verbosity <-- level of verbosity required
141  * visualization <-- level of visualization required
142  * matrix <-- transformation matrix
143  *
144  * returns:
145  * joining number (1 to n) associated with new periodicity
146  *----------------------------------------------------------------------------*/
147 
148 int
149 cs_join_perio_add_mixed(const char *sel_criteria,
150  double fraction,
151  double plane,
152  int verbosity,
153  int visualization,
154  double matrix[3][4]);
155 
156 /*----------------------------------------------------------------------------
157  * Add periodicity information to mesh and create or update mesh builder
158  * for a new periodic joining.
159  *
160  * parameters:
161  * this_join <-- high level join structure
162  * mesh <-> pointer to a cs_mesh_t structure
163  * builder <-> pointer to a cs_mesh_builder_t structure pointer
164  *---------------------------------------------------------------------------*/
165 
166 void
167 cs_join_perio_init(cs_join_t *this_join,
168  cs_mesh_t *mesh,
169  cs_mesh_builder_t **builder);
170 
171 /*----------------------------------------------------------------------------
172  * Duplicate and apply transformation to the selected faces and also to
173  * their related vertices. Modify compact_face_gnum to take into account
174  * new periodic faces and create a periodic vertex couple list.
175  *
176  * parameters:
177  * this_join <-- high level join structure
178  * jmesh <-> local join mesh struct. to duplicate and transform
179  * mesh <-- pointer to a cs_mesh_t structure
180  *---------------------------------------------------------------------------*/
181 
182 void
183 cs_join_perio_apply(cs_join_t *this_join,
184  cs_join_mesh_t *jmesh,
185  const cs_mesh_t *mesh);
186 
187 /*----------------------------------------------------------------------------
188  * Duplicate and apply transformation to the selected faces and also to
189  * their related vertices. Modify compact_face_gnum to take into account
190  * new periodic faces and create a periodic vertex couple list.
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  * p_work_jmesh <-> distributed join mesh struct. on which operations
197  * take place
198  * p_work_edges <-> join edges struct. related to work_jmesh
199  * init_max_vtx_gnum <-- initial max. global numbering for vertices
200  * n_g_new_vertices <-- global number of vertices created during the
201  * intersection of edges
202  *---------------------------------------------------------------------------*/
203 
204 void
206  cs_join_mesh_t *jmesh,
207  const cs_mesh_t *mesh,
208  cs_join_mesh_t **p_work_jmesh,
209  cs_join_edges_t **p_work_edges,
210  cs_gnum_t init_max_vtx_gnum,
211  cs_gnum_t n_g_new_vertices);
212 
213 /*----------------------------------------------------------------------------
214  * Duplicate and apply transformation to the selected faces and also to
215  * their related vertices. Update jmesh structure.
216  * Define a new n2o_hist.
217  *
218  * parameters:
219  * this_join <-- pointer to a high level join structure
220  * jmesh <-> local join mesh struct. to duplicate and transform
221  * mesh <-- pointer to a cs_mesh_t structure
222  * builder <-- pointer to a cs_mesh_builder_t structure
223  * o2n_hist <-- old global face -> new local face numbering
224  * p_n2o_hist <-- new global face -> old local face numbering
225  *---------------------------------------------------------------------------*/
226 
227 void
229  cs_join_mesh_t *jmesh,
230  cs_mesh_t *mesh,
231  cs_mesh_builder_t *builder,
232  cs_join_gset_t *o2n_hist,
233  cs_join_gset_t **p_n2o_hist);
234 
235 /*----------------------------------------------------------------------------
236  * Define a list of coupled faces by periodicty in global numbering.
237  *
238  * For parallel runs:
239  * - remove isolated periodic faces in the mesh definition
240  * - define a consistent face connectivity in order to prepare the building
241  * of periodic vertex couples
242  *
243  * parameters:
244  * param <-- set of parameters for the joining operation
245  * n_ii_faces <-- initial local number of interior faces
246  * face_type <-- type of faces in join mesh (interior or border ...)
247  * jmesh <-- pointer to a cs_join_mesh_t structure
248  * mesh <-> pointer to a cs_mesh_t structure
249  * mesh_builder <-> pointer to a cs_mesh_t structure
250  *---------------------------------------------------------------------------*/
251 
252 void
254  cs_int_t n_ii_faces,
255  const cs_join_face_type_t face_type[],
256  const cs_join_mesh_t *jmesh,
257  cs_mesh_t *mesh,
258  cs_mesh_builder_t *mesh_builder);
259 
260 /*----------------------------------------------------------------------------
261  * Use periodic face couples in cs_glob_join_perio_builder to define
262  * cs_glob_mesh_builder
263  * Free all elements which can be freed.
264  * Transfer data to cs_glob_mesh and cs_glob_mesh_builder.
265  *---------------------------------------------------------------------------*/
266 
267 void
269 
270 /*---------------------------------------------------------------------------*/
271 
273 
274 #endif /* __CS_JOIN_PERIO_H__ */
Definition: cs_join_set.h:50
cs_join_face_type_t
Definition: cs_join_mesh.h:61
Definition: cs_mesh_builder.h:56
Definition: cs_join_util.h:259
void cs_join_perio_transfer_builder(void)
#define BEGIN_C_DECLS
Definition: cs_defs.h:365
Definition: cs_join_mesh.h:80
int cs_int_t
Definition: cs_defs.h:263
integer, save iperio
Definition: period.f90:38
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:1108
Definition: cs_mesh.h:62
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:730
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:335
subroutine matrix(ncelet, ncel, nfac, nfabor, iconvp, idiffp, ndircp, isym, nfecra, thetap, imucpp, ifacel, ifabor, coefbp, cofbfp, rovsdt, flumas, flumab, viscf, viscb, xcpp, da, xa)
Definition: matrix.f90:94
Definition: cs_join_mesh.h:111
unsigned cs_gnum_t
Definition: cs_defs.h:255
integer, save iperot
Definition: period.f90:38
void cs_join_perio_init(cs_join_t *this_join, cs_mesh_t *mesh, cs_mesh_builder_t **builder)
Definition: cs_join_perio.c:481
void cs_join_perio_split_update(cs_join_param_t param, cs_int_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:1684
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:387
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:546
#define END_C_DECLS
Definition: cs_defs.h:366
#define CS_PROCF(x, y)
Definition: cs_defs.h:379
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:447
Definition: cs_join_util.h:86
BEGIN_C_DECLS void tstjpe(cs_int_t *iperio, cs_int_t *iperot)
Definition: cs_join_perio.c:299
Definition: mesh.f90:25