COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Shared.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
8 
10 
11 namespace cf3 {
12 namespace mesh {
13 namespace tecplot {
14 
16 
17 const Uint Shared::m_nodes_in_tp_elem[nb_tp_types] = { 0, 2, 3, 4, 4, 8, 6, 5, 3, 6, 9,
18  10, 27, 18, 14, 1, 8, 20, 15, 13, 9,
19  10, 12, 15, 15, 21, 4, 5, 6, 20, 35,
20  56, 34, 52, 0, 0, 16 };
21 
25  DIM_3D, DIM_3D, DIM_3D, DIM_3D, DIM_2D, DIM_3D, DIM_2D };
26 
27 const Uint Shared::m_tp_elem_order[nb_tp_types] = { 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
28  2, 2, 2, 2, 1, 2, 2, 2, 2, 3,
29  3, 4, 4, 5, 5, 3, 4, 5, 3, 4,
30  5, 4, 5, 0, 0, 3 };
31 
32 const std::string Shared::tp_elem_geo_name[nb_tp_types] = { "Empty", "Line" , "Triag" , "Quad" , "Tetra" ,
33  "Hexa" , "Prism", "Pyramid", "Line" , "Triag" ,
34  "Quad" , "Tetra", "Hexa" , "Prism", "Pyramid",
35  "Point", "Quad" , "Hexa" , "Prism", "Pyramid",
36  "Triag", "Triag", "Triag" , "Triag", "Triag" ,
37  "Triag", "Line" , "Line" , "Line" , "Tetra" ,
38  "Tetra", "Tetra", "Tetra" , "Tetra", "Polyg" ,
39  "Polyh", "Quad"
40  };
41 
42 const std::string Shared::dim_name[4] = { "0D", "1D", "2D", "3D" };
43 
44 
45 const std::string Shared::order_name[10] = { "P0", "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8", "P9" };
46 
47 
48 
49 
51 
53  m_nodes_cf_to_tp(nb_tp_types),
54  m_nodes_tp_to_cf(nb_tp_types)
55 {
56  m_supported_types.reserve(20);
57  m_supported_types.push_back("cf3.mesh.LagrangeP1.Line1D");
58  m_supported_types.push_back("cf3.mesh.LagrangeP1.Line2D");
59  m_supported_types.push_back("cf3.mesh.LagrangeP2.Line2D");
60  m_supported_types.push_back("cf3.mesh.LagrangeP3.Line2D");
61  m_supported_types.push_back("cf3.mesh.LagrangeP1.Line3D");
62  m_supported_types.push_back("cf3.mesh.LagrangeP1.Quad2D");
63  m_supported_types.push_back("cf3.mesh.LagrangeP2.Quad2D");
64  m_supported_types.push_back("cf3.mesh.LagrangeP3.Quad2D");
65  m_supported_types.push_back("cf3.mesh.LagrangeP1.Quad3D");
66  m_supported_types.push_back("cf3.mesh.LagrangeP1.Triag2D");
67  m_supported_types.push_back("cf3.mesh.LagrangeP2.Triag2D");
68  m_supported_types.push_back("cf3.mesh.LagrangeP3.Triag2D");
69  m_supported_types.push_back("cf3.mesh.LagrangeP1.Triag3D");
70  m_supported_types.push_back("cf3.mesh.LagrangeP1.Hexa3D");
71  m_supported_types.push_back("cf3.mesh.LagrangeP1.Tetra3D");
72  m_supported_types.push_back("cf3.mesh.LagrangeP0.Point1D");
73  m_supported_types.push_back("cf3.mesh.LagrangeP0.Point2D");
74  m_supported_types.push_back("cf3.mesh.LagrangeP0.Point3D");
75 
82 
83  // --------------------------------------------------- NODES
84 
85  // P1 line
86  m_nodes_cf_to_tp[P1LINE].resize(2);
89 
90  m_nodes_tp_to_cf[P1LINE].resize(2);
93 
94  // P1 quad
95  m_nodes_cf_to_tp[P1QUAD].resize(4);
100 
101  m_nodes_tp_to_cf[P1QUAD].resize(4);
102  m_nodes_tp_to_cf[P1QUAD][0]=0;
103  m_nodes_tp_to_cf[P1QUAD][1]=1;
104  m_nodes_tp_to_cf[P1QUAD][2]=2;
105  m_nodes_tp_to_cf[P1QUAD][3]=3;
106 
107  // P1 triag
108  m_nodes_cf_to_tp[P1TRIAG].resize(3);
112 
113  m_nodes_tp_to_cf[P1TRIAG].resize(3);
117 
118 
119  // P1 tetra
120  m_nodes_cf_to_tp[P1TETRA].resize(4);
125 
126  m_nodes_tp_to_cf[P1TETRA].resize(4);
131 
132 
133  // P1 hexa
134  m_nodes_cf_to_tp[P1HEXA].resize(8);
135  m_nodes_cf_to_tp[P1HEXA][0]=4;
136  m_nodes_cf_to_tp[P1HEXA][1]=5;
137  m_nodes_cf_to_tp[P1HEXA][2]=1;
138  m_nodes_cf_to_tp[P1HEXA][3]=0;
139  m_nodes_cf_to_tp[P1HEXA][4]=6;
140  m_nodes_cf_to_tp[P1HEXA][5]=7;
141  m_nodes_cf_to_tp[P1HEXA][6]=3;
142  m_nodes_cf_to_tp[P1HEXA][7]=2;
143 
144  m_nodes_tp_to_cf[P1HEXA].resize(8);
145  m_nodes_tp_to_cf[P1HEXA][0]=3;
146  m_nodes_tp_to_cf[P1HEXA][1]=2;
147  m_nodes_tp_to_cf[P1HEXA][2]=7;
148  m_nodes_tp_to_cf[P1HEXA][3]=6;
149  m_nodes_tp_to_cf[P1HEXA][4]=0;
150  m_nodes_tp_to_cf[P1HEXA][5]=1;
151  m_nodes_tp_to_cf[P1HEXA][6]=4;
152  m_nodes_tp_to_cf[P1HEXA][7]=5;
153 
154  // P2 line
155  m_nodes_cf_to_tp[P2LINE].resize(3);
156  m_nodes_cf_to_tp[P2LINE][0]=0;
157  m_nodes_cf_to_tp[P2LINE][1]=1;
158  m_nodes_cf_to_tp[P2LINE][2]=2;
159 
160  m_nodes_tp_to_cf[P2LINE].resize(3);
161  m_nodes_tp_to_cf[P2LINE][0]=0;
162  m_nodes_tp_to_cf[P2LINE][1]=1;
163  m_nodes_tp_to_cf[P2LINE][2]=2;
164 
165  // P2 quad
166  m_nodes_cf_to_tp[P2QUAD].resize(9);
167  m_nodes_cf_to_tp[P2QUAD][0]=0;
168  m_nodes_cf_to_tp[P2QUAD][1]=1;
169  m_nodes_cf_to_tp[P2QUAD][2]=2;
170  m_nodes_cf_to_tp[P2QUAD][3]=3;
171  m_nodes_cf_to_tp[P2QUAD][4]=4;
172  m_nodes_cf_to_tp[P2QUAD][5]=5;
173  m_nodes_cf_to_tp[P2QUAD][6]=6;
174  m_nodes_cf_to_tp[P2QUAD][7]=7;
175  m_nodes_cf_to_tp[P2QUAD][8]=8;
176 
177 
178  m_nodes_tp_to_cf[P2QUAD].resize(9);
179  m_nodes_tp_to_cf[P2QUAD][0]=0;
180  m_nodes_tp_to_cf[P2QUAD][1]=1;
181  m_nodes_tp_to_cf[P2QUAD][2]=2;
182  m_nodes_tp_to_cf[P2QUAD][3]=3;
183  m_nodes_tp_to_cf[P2QUAD][4]=4;
184  m_nodes_tp_to_cf[P2QUAD][5]=5;
185  m_nodes_tp_to_cf[P2QUAD][6]=6;
186  m_nodes_tp_to_cf[P2QUAD][7]=7;
187  m_nodes_tp_to_cf[P2QUAD][8]=8;
188 
189 
190  // P2 triag
191  m_nodes_cf_to_tp[P2TRIAG].resize(6);
198 
199  m_nodes_tp_to_cf[P2TRIAG].resize(6);
206 
207 
208  // P2 tetra
209  m_nodes_cf_to_tp[P2TETRA].resize(10);
220 
221  m_nodes_tp_to_cf[P2TETRA].resize(10);
232 
233 
234  // P2 hexa
235  m_nodes_cf_to_tp[P2HEXA].resize(27);
236  m_nodes_cf_to_tp[P2HEXA][0]=0;
237  m_nodes_cf_to_tp[P2HEXA][1]=1;
238  m_nodes_cf_to_tp[P2HEXA][2]=2;
239  m_nodes_cf_to_tp[P2HEXA][3]=3;
240  m_nodes_cf_to_tp[P2HEXA][4]=4;
241  m_nodes_cf_to_tp[P2HEXA][5]=5;
242  m_nodes_cf_to_tp[P2HEXA][6]=6;
243  m_nodes_cf_to_tp[P2HEXA][7]=7;
244  m_nodes_cf_to_tp[P2HEXA][8]=8;
245  m_nodes_cf_to_tp[P2HEXA][9]=9;
246  m_nodes_cf_to_tp[P2HEXA][10]=10;
247  m_nodes_cf_to_tp[P2HEXA][11]=11;
248  m_nodes_cf_to_tp[P2HEXA][12]=12;
249  m_nodes_cf_to_tp[P2HEXA][13]=13;
250  m_nodes_cf_to_tp[P2HEXA][14]=14;
251  m_nodes_cf_to_tp[P2HEXA][15]=15;
252  m_nodes_cf_to_tp[P2HEXA][16]=16;
253  m_nodes_cf_to_tp[P2HEXA][17]=17;
254  m_nodes_cf_to_tp[P2HEXA][18]=18;
255  m_nodes_cf_to_tp[P2HEXA][19]=19;
256  m_nodes_cf_to_tp[P2HEXA][20]=20;
257  m_nodes_cf_to_tp[P2HEXA][21]=21;
258  m_nodes_cf_to_tp[P2HEXA][22]=22;
259  m_nodes_cf_to_tp[P2HEXA][23]=23;
260  m_nodes_cf_to_tp[P2HEXA][24]=24;
261  m_nodes_cf_to_tp[P2HEXA][25]=25;
262  m_nodes_cf_to_tp[P2HEXA][26]=26;
263 
264  m_nodes_tp_to_cf[P2HEXA].resize(27);
265  m_nodes_tp_to_cf[P2HEXA][0]=0;
266  m_nodes_tp_to_cf[P2HEXA][1]=1;
267  m_nodes_tp_to_cf[P2HEXA][2]=2;
268  m_nodes_tp_to_cf[P2HEXA][3]=3;
269  m_nodes_tp_to_cf[P2HEXA][4]=4;
270  m_nodes_tp_to_cf[P2HEXA][5]=5;
271  m_nodes_tp_to_cf[P2HEXA][6]=6;
272  m_nodes_tp_to_cf[P2HEXA][7]=7;
273  m_nodes_tp_to_cf[P2HEXA][8]=8;
274  m_nodes_tp_to_cf[P2HEXA][9]=9;
275  m_nodes_tp_to_cf[P2HEXA][10]=10;
276  m_nodes_tp_to_cf[P2HEXA][11]=11;
277  m_nodes_tp_to_cf[P2HEXA][12]=12;
278  m_nodes_tp_to_cf[P2HEXA][13]=13;
279  m_nodes_tp_to_cf[P2HEXA][14]=14;
280  m_nodes_tp_to_cf[P2HEXA][15]=15;
281  m_nodes_tp_to_cf[P2HEXA][16]=16;
282  m_nodes_tp_to_cf[P2HEXA][17]=17;
283  m_nodes_tp_to_cf[P2HEXA][18]=18;
284  m_nodes_tp_to_cf[P2HEXA][19]=19;
285  m_nodes_tp_to_cf[P2HEXA][20]=20;
286  m_nodes_tp_to_cf[P2HEXA][21]=21;
287  m_nodes_tp_to_cf[P2HEXA][22]=22;
288  m_nodes_tp_to_cf[P2HEXA][23]=23;
289  m_nodes_tp_to_cf[P2HEXA][24]=24;
290  m_nodes_tp_to_cf[P2HEXA][25]=25;
291  m_nodes_tp_to_cf[P2HEXA][26]=26;
292 
293  //Point
294  m_nodes_tp_to_cf[P1POINT].resize(1);
296 
297  //P3 triag
298  m_nodes_cf_to_tp[P3TRIAG].resize(10);
299  m_nodes_cf_to_tp[P3TRIAG][0] = 0;
300  m_nodes_cf_to_tp[P3TRIAG][1] = 1;
301  m_nodes_cf_to_tp[P3TRIAG][2] = 2;
302  m_nodes_cf_to_tp[P3TRIAG][3] = 3;
303  m_nodes_cf_to_tp[P3TRIAG][4] = 4;
304  m_nodes_cf_to_tp[P3TRIAG][5] = 5;
305  m_nodes_cf_to_tp[P3TRIAG][6] = 6;
306  m_nodes_cf_to_tp[P3TRIAG][7] = 7;
307  m_nodes_cf_to_tp[P3TRIAG][8] = 8;
308  m_nodes_cf_to_tp[P3TRIAG][9] = 9;
309 
310 
311  m_nodes_tp_to_cf[P3TRIAG].resize(10);
312  m_nodes_tp_to_cf[P3TRIAG][0] = 0;
313  m_nodes_tp_to_cf[P3TRIAG][1] = 1;
314  m_nodes_tp_to_cf[P3TRIAG][2] = 2;
315  m_nodes_tp_to_cf[P3TRIAG][3] = 3;
316  m_nodes_tp_to_cf[P3TRIAG][4] = 4;
317  m_nodes_tp_to_cf[P3TRIAG][5] = 5;
318  m_nodes_tp_to_cf[P3TRIAG][6] = 6;
319  m_nodes_tp_to_cf[P3TRIAG][7] = 7;
320  m_nodes_tp_to_cf[P3TRIAG][8] = 8;
321  m_nodes_tp_to_cf[P3TRIAG][9] = 9;
322 
323  //P3 line
324  m_nodes_cf_to_tp[P3LINE].resize(4);
325  m_nodes_cf_to_tp[P3LINE][0] = 0;
326  m_nodes_cf_to_tp[P3LINE][1] = 1;
327  m_nodes_cf_to_tp[P3LINE][2] = 2;
328  m_nodes_cf_to_tp[P3LINE][3] = 3;
329 
330  m_nodes_tp_to_cf[P3LINE].resize(4);
331  m_nodes_tp_to_cf[P3LINE][0] = 0;
332  m_nodes_tp_to_cf[P3LINE][1] = 1;
333  m_nodes_tp_to_cf[P3LINE][2] = 2;
334  m_nodes_tp_to_cf[P3LINE][3] = 3;
335 
336  //P3 quad (16 nodes)
337  m_nodes_cf_to_tp[P3QUAD].resize(16);
338  m_nodes_cf_to_tp[P3QUAD][0] = 0;
339  m_nodes_cf_to_tp[P3QUAD][1] = 1;
340  m_nodes_cf_to_tp[P3QUAD][2] = 2;
341  m_nodes_cf_to_tp[P3QUAD][3] = 3;
342  m_nodes_cf_to_tp[P3QUAD][4] = 4;
343  m_nodes_cf_to_tp[P3QUAD][5] = 5;
344  m_nodes_cf_to_tp[P3QUAD][6] = 6;
345  m_nodes_cf_to_tp[P3QUAD][7] = 7;
346  m_nodes_cf_to_tp[P3QUAD][8] = 8;
347  m_nodes_cf_to_tp[P3QUAD][9] = 9;
348  m_nodes_cf_to_tp[P3QUAD][10] = 10;
349  m_nodes_cf_to_tp[P3QUAD][11] = 11;
350  m_nodes_cf_to_tp[P3QUAD][12] = 12;
351  m_nodes_cf_to_tp[P3QUAD][13] = 13;
352  m_nodes_cf_to_tp[P3QUAD][14] = 14;
353  m_nodes_cf_to_tp[P3QUAD][15] = 15;
354 
355  m_nodes_tp_to_cf[P3QUAD].resize(16);
356  m_nodes_tp_to_cf[P3QUAD][0] = 0;
357  m_nodes_tp_to_cf[P3QUAD][1] = 1;
358  m_nodes_tp_to_cf[P3QUAD][2] = 2;
359  m_nodes_tp_to_cf[P3QUAD][3] = 3;
360  m_nodes_tp_to_cf[P3QUAD][4] = 4;
361  m_nodes_tp_to_cf[P3QUAD][5] = 5;
362  m_nodes_tp_to_cf[P3QUAD][6] = 6;
363  m_nodes_tp_to_cf[P3QUAD][7] = 7;
364  m_nodes_tp_to_cf[P3QUAD][8] = 8;
365  m_nodes_tp_to_cf[P3QUAD][9] = 9;
366  m_nodes_tp_to_cf[P3QUAD][10] = 10;
367  m_nodes_tp_to_cf[P3QUAD][11] = 11;
368  m_nodes_tp_to_cf[P3QUAD][12] = 12;
369  m_nodes_tp_to_cf[P3QUAD][13] = 13;
370  m_nodes_tp_to_cf[P3QUAD][14] = 14;
371  m_nodes_tp_to_cf[P3QUAD][15] = 15;
372 
373 }
374 
375 
377 
378 std::string Shared::tp_name_to_cf_name(const Uint dim, const Uint tp_type)
379 {
380  //Compose the name of the form "cf3.mesh.LagrangeP1.Line1D"
381  const Uint order = m_tp_elem_order[tp_type];
382  std::string name = "cf3.mesh.Lagrange"+order_name[order]+"." + tp_elem_geo_name[tp_type] + dim_name[dim];
383  return name;
384 }
385 
387 
388 } // tecplot
389 } // mesh
390 } // cf3
std::string name(ComponentWrapper &self)
Shared()
constructor
Definition: Shared.cpp:52
std::vector< std::vector< Uint > > m_nodes_tp_to_cf
Definition: Shared.hpp:63
std::vector< std::string > m_supported_types
Definition: Shared.hpp:56
static const std::string order_name[10]
Definition: Shared.hpp:49
static const Uint m_tp_elem_dim[nb_tp_types]
Definition: Shared.hpp:45
static const std::string dim_name[4]
Definition: Shared.hpp:48
static std::string tp_name_to_cf_name(const Uint dim, const Uint tp_type)
Definition: Shared.cpp:378
Top-level namespace for coolfluid.
Definition: Action.cpp:18
static const Uint m_nodes_in_tp_elem[nb_tp_types]
Definition: Shared.hpp:44
static const std::string tp_elem_geo_name[nb_tp_types]
Definition: Shared.hpp:47
static const Uint m_tp_elem_order[nb_tp_types]
Definition: Shared.hpp:46
unsigned int Uint
typedef for unsigned int
Definition: CF.hpp:90
std::map< GeoShape::Type, Uint > m_element_cf_to_tp
Definition: Shared.hpp:55
std::vector< std::vector< Uint > > m_nodes_cf_to_tp
Faces are not defined in tp format.
Definition: Shared.hpp:62
Send comments to:
COOLFluiD Web Admin