OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
CartesianCentering_inst.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPPL Framework
5  *
6  * This program was prepared by PSI.
7  * All rights in the program are reserved by PSI.
8  * Neither PSI nor the author(s)
9  * makes any warranty, express or implied, or assumes any liability or
10  * responsibility for the use of this software
11  *
12  * Visit www.amas.web.psi for more details
13  *
14  ***************************************************************************/
15 
16 // -*- C++ -*-
17 /***************************************************************************
18  *
19  * The IPPL Framework
20  *
21  *
22  * Visit http://people.web.psi.ch/adelmann/ for more details
23  *
24  ***************************************************************************/
25 
26 // include files
28 
29 //-----------------------------------------------------------------------------
30 // Set up the CenteringEnum arrays describing these common cartesian centerings
31 // N.B.: the name "CCCEnums" is a shortened form of the original name for this
32 // class, "CommonCartesianCenteringEnums"
33 //
34 // Storage order of these CenteringEnum arrays:
35 // Where there is more than one component, the component index varies fastest,
36 // and the dimension index varies slowest--like a 2D Fortran-order array
37 // dimensioned array(NComponents,D). With multicomponent types such as Tenzor,
38 // which intrinsically have 2 component indices (i,j), these are linearized
39 // with the 1st component index i varying fastest and the 2nd component index j
40 // varying slowest. One-dimensional symmetric tensors (SymTenzor) have one
41 // linearized component, 2D SymTenzor's have 3 linearized components, and 3D
42 // SymTenzor's have 6 linearized components; other components of SymTenzor's
43 // are by definition zero and are not stored in the SymTenzor type, and so no
44 // centering enum values are stored for them.
45 //-----------------------------------------------------------------------------
46 
47 //11111111111111111111111111111111111111111111111111111111111111111111111111111
48 // 1D fields
49 //11111111111111111111111111111111111111111111111111111111111111111111111111111
50 
51 // 1D field of scalars (or 1D vectors, or 1D tensors, or 1D sym. tensors)
52 // All components cell-centered:
54 {CELL};
55 // All components vertex-centered:
57 {VERTEX};
58 // Componentwise centering along/perpendicular to component direction:
60 {VERTEX};
62 {CELL};
63 // Face/Edge centering perpendicular to/along direction 0:
65 {VERTEX};
67 {CELL};
68 
69 
70 //22222222222222222222222222222222222222222222222222222222222222222222222222222
71 // 2D fields
72 //22222222222222222222222222222222222222222222222222222222222222222222222222222
73 
74 // 2D field of scalars (or 1D vectors, or 1D tensors, or 1D sym. tensors)
75 // All components cell-centered:
77 {CELL,
78  CELL};
79 // All components vertex-centered:
81 {VERTEX,
82  VERTEX};
83 // Face/Edge centering perpendicular to/along direction 0:
85 {VERTEX,
86  CELL};
88 {CELL,
89  VERTEX};
90 // Face/Edge centering perpendicular to/along direction 1:
92 {CELL,
93  VERTEX};
95 {VERTEX,
96  CELL};
97 
98 // 2D field of 2D vectors:
99 // All components cell-centered:
101 {CELL, CELL,
102  CELL, CELL};
103 // All components vertex-centered:
105 {VERTEX, VERTEX,
106  VERTEX, VERTEX};
107 // Componentwise centering along/perpendicular to component direction:
109 {VERTEX, CELL,
110  CELL, VERTEX};
112 {CELL, VERTEX,
113  VERTEX, CELL};
114 // Face/Edge centering perpendicular to/along direction 0:
116 {VERTEX, VERTEX,
117  CELL, CELL};
119 {CELL, CELL,
120  VERTEX, VERTEX};
121 // Face/Edge centering perpendicular to/along direction 1:
123 {CELL, CELL,
124  VERTEX, VERTEX};
126 {VERTEX, VERTEX,
127  CELL, CELL};
128 
129 // 2D field of 2D tensors:
130 // All components cell-centered:
132 {CELL, CELL, CELL, CELL,
133  CELL, CELL, CELL, CELL};
134 // All components vertex-centered:
137  VERTEX, VERTEX, VERTEX, VERTEX};
138 // Face/Edge centering perpendicular to/along direction 0:
141  CELL, CELL, CELL, CELL};
143 {CELL, CELL, CELL, CELL,
144  VERTEX, VERTEX, VERTEX, VERTEX};
145 // Face/Edge centering perpendicular to/along direction 1:
147 {CELL, CELL, CELL, CELL,
148  VERTEX, VERTEX, VERTEX, VERTEX};
151  CELL, CELL, CELL, CELL};
152 
153 // 2D field of 2D symmetric tensors:
154 // All components cell-centered:
156 {CELL, CELL, CELL,
157  CELL, CELL, CELL};
158 // All components vertex-centered:
160 {VERTEX, VERTEX, VERTEX,
161  VERTEX, VERTEX, VERTEX};
162 // Face/Edge centering perpendicular to/along direction 0:
164 {VERTEX, VERTEX, VERTEX,
165  CELL, CELL, CELL};
167 {CELL, CELL, CELL,
168  VERTEX, VERTEX, VERTEX};
169 // Face/Edge centering perpendicular to/along direction 1:
171 {CELL, CELL, CELL,
172  VERTEX, VERTEX, VERTEX};
174 {VERTEX, VERTEX, VERTEX,
175  CELL, CELL, CELL};
176 
177 
178 //33333333333333333333333333333333333333333333333333333333333333333333333333333
179 // 3D fields
180 //33333333333333333333333333333333333333333333333333333333333333333333333333333
181 
182 // 3D field of scalars (or 1D vectors, or 1D tensors, or 1D sym. tensors)
183 // All components cell-centered:
185 {CELL,
186  CELL,
187  CELL};
188 // All components vertex-centered:
190 {VERTEX,
191  VERTEX,
192  VERTEX};
193 // Face/Edge centering perpendicular to/along direction 0:
195 {VERTEX,
196  CELL,
197  CELL};
199 {CELL,
200  VERTEX,
201  VERTEX};
202 // Face/Edge centering perpendicular to/along direction 1:
204 {CELL,
205  VERTEX,
206  CELL};
208 {VERTEX,
209  CELL,
210  VERTEX};
211 // Face/Edge centering perpendicular to/along direction 2:
213 {CELL,
214  CELL,
215  VERTEX};
217 {VERTEX,
218  VERTEX,
219  CELL};
220 
221 // 3D field of 2D vectors:
222 // All components cell-centered:
224 {CELL, CELL,
225  CELL, CELL,
226  CELL, CELL};
227 // All components vertex-centered:
229 {VERTEX, VERTEX,
230  VERTEX, VERTEX,
231  VERTEX, VERTEX};
232 // Face/Edge centering perpendicular to/along direction 0:
234 {VERTEX, VERTEX,
235  CELL, CELL,
236  CELL, CELL};
238 {CELL, CELL,
239  VERTEX, VERTEX,
240  VERTEX, VERTEX};
241 // Face/Edge centering perpendicular to/along direction 1:
243 {CELL, CELL,
244  VERTEX, VERTEX,
245  CELL, CELL};
247 {VERTEX, VERTEX,
248  CELL, CELL,
249  VERTEX, VERTEX};
250 // Face/Edge centering perpendicular to/along direction 2:
252 {CELL, CELL,
253  CELL, CELL,
254  VERTEX, VERTEX};
256 {VERTEX, VERTEX,
257  VERTEX, VERTEX,
258  CELL, CELL};
259 
260 // 3D field of 3D vectors:
261 // All components cell-centered:
263 {CELL, CELL, CELL,
264  CELL, CELL, CELL,
265  CELL, CELL, CELL};
266 // All components vertex-centered:
268 {VERTEX, VERTEX, VERTEX,
269  VERTEX, VERTEX, VERTEX,
270  VERTEX, VERTEX, VERTEX};
271 // Componentwise centering along/perpendicular to component direction:
273 {VERTEX, CELL, CELL,
274  CELL, VERTEX, CELL,
275  CELL, CELL, VERTEX};
277 {CELL, VERTEX, VERTEX,
278  VERTEX, CELL, VERTEX,
279  VERTEX, VERTEX, CELL};
280 // Face/Edge centering perpendicular to/along direction 0:
282 {VERTEX, VERTEX, VERTEX,
283  CELL, CELL, CELL,
284  CELL, CELL, CELL};
286 {CELL, CELL, CELL,
287  VERTEX, VERTEX, VERTEX,
288  VERTEX, VERTEX, VERTEX};
289 // Face/Edge centering perpendicular to/along direction 1:
291 {CELL, CELL, CELL,
292  VERTEX, VERTEX, VERTEX,
293  CELL, CELL, CELL};
295 {VERTEX, VERTEX, VERTEX,
296  CELL, CELL, CELL,
297  VERTEX, VERTEX, VERTEX};
298 // Face/Edge centering perpendicular to/along direction 2:
300 {CELL, CELL, CELL,
301  CELL, CELL, CELL,
302  VERTEX, VERTEX, VERTEX};
304 {VERTEX, VERTEX, VERTEX,
305  VERTEX, VERTEX, VERTEX,
306  CELL, CELL, CELL};
307 
308 // 3D field of 3D tensors:
309 // All components cell-centered:
311 {CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL,
312  CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL,
313  CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL};
314 // All components vertex-centered:
319 // Face/Edge centering perpendicular to/along direction 0:
322  CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL,
323  CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL};
325 {CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL,
328 // Face/Edge centering perpendicular to/along direction 1:
330 {CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL,
332  CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL};
335  CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL,
337 // Face/Edge centering perpendicular to/along direction 2:
339 {CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL,
340  CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL,
345  CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL, CELL};
346 
347 // 3D field of 3D symmetric tensors:
348 // All components cell-centered:
350 {CELL, CELL, CELL, CELL, CELL, CELL,
351  CELL, CELL, CELL, CELL, CELL, CELL,
352  CELL, CELL, CELL, CELL, CELL, CELL};
353 // All components vertex-centered:
357  VERTEX, VERTEX, VERTEX, VERTEX, VERTEX, VERTEX};
358 // Face/Edge centering perpendicular to/along direction 0:
361  CELL, CELL, CELL, CELL, CELL, CELL,
362  CELL, CELL, CELL, CELL, CELL, CELL};
364 {CELL, CELL, CELL, CELL, CELL, CELL,
366  VERTEX, VERTEX, VERTEX, VERTEX, VERTEX, VERTEX};
367 // Face/Edge centering perpendicular to/along direction 1:
369 {CELL, CELL, CELL, CELL, CELL, CELL,
371  CELL, CELL, CELL, CELL, CELL, CELL};
374  CELL, CELL, CELL, CELL, CELL, CELL,
375  VERTEX, VERTEX, VERTEX, VERTEX, VERTEX, VERTEX};
376 // Face/Edge centering perpendicular to/along direction 2:
378 {CELL, CELL, CELL, CELL, CELL, CELL,
379  CELL, CELL, CELL, CELL, CELL, CELL,
380  VERTEX, VERTEX, VERTEX, VERTEX, VERTEX, VERTEX};
384  CELL, CELL, CELL, CELL, CELL, CELL};
385 
386 // Names for the centering classes:
387 // allEdge scalar:
388 template<> char*
390 CenteringName = "CartesianCentering: allEdge centering";
391 template<> char*
393 CenteringName = "CartesianCentering: allEdge centering";
394 // allCell scalar:
395 template<> char*
397 CenteringName = "CartesianCentering: allCell(1U,1U,0U) centering";
398 template<> char*
400 CenteringName = "CartesianCentering: allCell(2U,1U,0U) centering";
401 template<> char*
403 CenteringName = "CartesianCentering: allCell(3U,1U,0U) centering";
404 // allCell vector:
405 template<> char*
407 CenteringName = "CartesianCentering: allCell(2U,2U,0U) centering";
408 template<> char*
410 CenteringName = "CartesianCentering: allCell(3U,3U,0U) centering";
411 // allVertex scalar:
412 template<> char*
414 CenteringName = "CartesianCentering: allVertex(1U,1U,0U) centering";
415 template<> char*
417 CenteringName = "CartesianCentering: allVertex(2U,1U,0U) centering";
418 template<> char*
420 CenteringName = "CartesianCentering: allVertex(3U,1U,0U) centering";
421 // allVertex vector:
422 template<> char*
424 CenteringName = "CartesianCentering: allVertex(2U,2U,0U) centering";
425 template<> char*
427 CenteringName = "CartesianCentering: allVertex(3U,3U,0U) centering";
428 // vectorFace:
429 template<> char*
431 CenteringName = "CartesianCentering: vectorFace(1U,1U,0U) centering";
432 template<> char*
434 CenteringName = "CartesianCentering: vectorFace(2U,2U,0U) centering";
435 template<> char*
437 CenteringName = "CartesianCentering: vectorFace(3U,3U,0U) centering";
438 //.. fill these in more later (tjw)
439 
440 /***************************************************************************
441  * $RCSfile: CartesianCentering_inst.cpp,v $ $Author: adelmann $
442  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:28 $
443  * IPPL_VERSION_ID: $Id: CartesianCentering_inst.cpp,v 1.1.1.1 2003/01/23 07:40:28 adelmann Exp $
444  ***************************************************************************/
CenteringEnum