~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to src/mesh/cs_join_perio.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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-2011 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
 
 
47
BEGIN_C_DECLS
 
48
 
 
49
/*============================================================================
 
50
 * Local Macro definitions
 
51
 *===========================================================================*/
 
52
 
 
53
/*=============================================================================
 
54
 * Global variables
 
55
 *===========================================================================*/
 
56
 
 
57
extern int  cs_glob_n_join_perio;   /* Number of periodicity defined through
 
58
                                       a joining operation */
 
59
 
 
60
/*============================================================================
 
61
 *  Public function prototypes for Fortran API
 
62
 *============================================================================*/
 
63
 
 
64
/*----------------------------------------------------------------------------
 
65
 * Check if periodic joining operations are queued.
 
66
 *
 
67
 * Fortran Interface:
 
68
 *
 
69
 * SUBROUTINE TSTJPE
 
70
 * *****************
 
71
 *
 
72
 * INTEGER        iperio    : <-> : do we have periodicity ?
 
73
 * INTEGER        iperot    : <-> : do we have periodicity of rotation ?
 
74
 *----------------------------------------------------------------------------*/
 
75
 
 
76
void CS_PROCF(tstjpe, tstjpe)
 
77
(
 
78
 cs_int_t    *iperio,
 
79
 cs_int_t    *iperot
 
80
);
 
81
 
 
82
/*=============================================================================
 
83
 * Public function prototypes
 
84
 *===========================================================================*/
 
85
 
 
86
/*----------------------------------------------------------------------------
 
87
 * Define a translational periodicity
 
88
 *
 
89
 * parameters:
 
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
 
96
 *
 
97
 * returns:
 
98
 *   number (1 to n) associated with new periodicity
 
99
 *----------------------------------------------------------------------------*/
 
100
 
 
101
int
 
102
cs_join_perio_add_translation(const char    *sel_criteria,
 
103
                              double         fraction,
 
104
                              double         plane,
 
105
                              int            verbosity,
 
106
                              int            visualization,
 
107
                              const double   trans[3]);
 
108
 
 
109
/*----------------------------------------------------------------------------
 
110
 * Define a rotational periodicity
 
111
 *
 
112
 * parameters:
 
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
 
121
 *
 
122
 * returns:
 
123
 *   joining number (1 to n) associated with new periodicity
 
124
 *----------------------------------------------------------------------------*/
 
125
 
 
126
int
 
127
cs_join_perio_add_rotation(const char    *sel_criteria,
 
128
                           double         fraction,
 
129
                           double         plane,
 
130
                           int            verbosity,
 
131
                           int            visualization,
 
132
                           double         theta,
 
133
                           const double   axis[3],
 
134
                           const double   invariant[3]);
 
135
 
 
136
/*----------------------------------------------------------------------------
 
137
 * Define a periodicity using a matrix
 
138
 *
 
139
 * parameters:
 
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
 
146
 *
 
147
 * returns:
 
148
 *   joining number (1 to n) associated with new periodicity
 
149
 *----------------------------------------------------------------------------*/
 
150
 
 
151
int
 
152
cs_join_perio_add_mixed(const char    *sel_criteria,
 
153
                        double         fraction,
 
154
                        double         plane,
 
155
                        int            verbosity,
 
156
                        int            visualization,
 
157
                        double         matrix[3][4]);
 
158
 
 
159
/*----------------------------------------------------------------------------
 
160
 * Add periodicity information to mesh and create or update mesh builder
 
161
 * for a new periodic joining.
 
162
 *
 
163
 * parameters:
 
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
 *---------------------------------------------------------------------------*/
 
168
 
 
169
void
 
170
cs_join_perio_init(cs_join_t           *this_join,
 
171
                   cs_mesh_t           *mesh,
 
172
                   cs_mesh_builder_t  **builder);
 
173
 
 
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.
 
178
 *
 
179
 * parameters:
 
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
 *---------------------------------------------------------------------------*/
 
184
 
 
185
void
 
186
cs_join_perio_apply(cs_join_t          *this_join,
 
187
                    cs_join_mesh_t     *jmesh,
 
188
                    const cs_mesh_t    *mesh);
 
189
 
 
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.
 
194
 *
 
195
 * parameters:
 
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
 
200
 *                          take place
 
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
 *---------------------------------------------------------------------------*/
 
206
 
 
207
void
 
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);
 
215
 
 
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.
 
220
 *
 
221
 * parameters:
 
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
 *---------------------------------------------------------------------------*/
 
229
 
 
230
void
 
231
cs_join_perio_split_back(cs_join_t          *this_join,
 
232
                         cs_join_mesh_t     *jmesh,
 
233
                         cs_mesh_t          *mesh,
 
234
                         cs_mesh_builder_t  *builder,
 
235
                         cs_join_gset_t     *o2n_hist,
 
236
                         cs_join_gset_t    **p_n2o_hist);
 
237
 
 
238
/*----------------------------------------------------------------------------
 
239
 * Define a list of coupled faces by periodicty in global numbering.
 
240
 *
 
241
 * For parallel runs:
 
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
 
245
 *
 
246
 * parameters:
 
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
 *---------------------------------------------------------------------------*/
 
254
 
 
255
void
 
256
cs_join_perio_split_update(cs_join_param_t             param,
 
257
                           cs_int_t                    n_ii_faces,
 
258
                           const cs_join_face_type_t   face_type[],
 
259
                           const cs_join_mesh_t       *jmesh,
 
260
                           cs_mesh_t                  *mesh,
 
261
                           cs_mesh_builder_t          *mesh_builder);
 
262
 
 
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
 *---------------------------------------------------------------------------*/
 
269
 
 
270
void
 
271
cs_join_perio_transfer_builder(void);
 
272
 
 
273
/*---------------------------------------------------------------------------*/
 
274
 
 
275
END_C_DECLS
 
276
 
 
277
#endif /* __CS_JOIN_PERIO_H__ */