Sierra Toolkit  Version of the Day
CoordinateSystems.hpp
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2010 Sandia Corporation. */
3 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
4 /* license for use of this work by or on behalf of the U.S. Government. */
5 /* Export of this program may require a license from the */
6 /* United States Government. */
7 /*------------------------------------------------------------------------*/
8 
9 
10 #ifndef stk_mesh_fem_CoordinateSystems_hpp
11 #define stk_mesh_fem_CoordinateSystems_hpp
12 
13 //----------------------------------------------------------------------
14 
15 #include <Shards_Array.hpp>
16 
17 namespace stk_classic {
18 namespace mesh {
19 
33 SHARDS_ARRAY_DIM_TAG_SIMPLE_DECLARATION( SimpleArrayTag )
34 
35 
40 struct Cartesian3d : public shards::ArrayDimTag {
41 
42  enum { Size = 3 };
43 
44  enum { X = 0 , Y = 1 , Z = 2 };
45 
46  const char * name() const ;
47  std::string to_string( size_type size , size_type index ) const ;
48  size_type to_index( size_type size , const std::string & ) const ;
49  static const Cartesian3d & tag();
50 
51 private:
52  Cartesian3d() {}
53  Cartesian3d( const Cartesian3d & );
54  Cartesian3d & operator = ( const Cartesian3d & );
55 };
56 
62 struct Cartesian2d: public shards::ArrayDimTag {
63 
64  enum { Size = 2 };
65 
66  enum { X = 0 , Y = 1 };
67 
68  const char * name() const ;
69  std::string to_string( size_type size , size_type index ) const ;
70  size_type to_index( size_type size , const std::string & ) const ;
71  static const Cartesian2d & tag();
72 
73 private:
74  Cartesian2d() {}
75  Cartesian2d( const Cartesian2d & );
76  Cartesian2d & operator = ( const Cartesian2d & );
77 };
78 
79 typedef Cartesian3d Cartesian;
86 struct Cylindrical : public shards::ArrayDimTag {
87 
88  enum { Radius = 0 , R = 0 ,
89  Angle = 1 , A = 1 ,
90  Z = 2 };
91 
92  const char * name() const ;
93  std::string to_string( size_type size , size_type index ) const ;
94  size_type to_index( size_type size , const std::string & ) const ;
95  static const Cylindrical & tag();
96 
97 private:
98  Cylindrical() {}
99  Cylindrical( const Cylindrical & );
100  Cylindrical & operator = ( const Cylindrical & );
101 };
102 
109 struct FullTensor36 : public shards::ArrayDimTag {
110 
111  enum { Size = 9 };
112 
113 /*
114  * Note on Ordering: This is the ordering as used in the old
115  * Sierra Framework and is somewhat standard in that a symmetric
116  * tensor is the first six values of a full tensor and a diagonal
117  * only tensor is the first three values of that.
118  *
119  * I think this is actually in ERROR in that (XZ,YX,ZY) SHOULD
120  * be (6,7,8) NOT (8,6,7). But backwards compatibility is useful.
121  *
122  * \todo Look at the proper ordering of a full second order tensor.
123  */
124  enum { XX = 0 , XY = 3 , XZ = 8 ,
125  YX = 6 , YY = 1 , YZ = 4 ,
126  ZX = 5 , ZY = 7 , ZZ = 2 };
127 
128  const char * name() const ;
129  std::string to_string( size_type, size_type) const ;
130  size_type to_index( size_type, const std::string & ) const ;
131  static const FullTensor36 & tag();
132 
133 private:
134  FullTensor36() {}
135  FullTensor36( const FullTensor36 & );
136  FullTensor36 & operator = ( const FullTensor36 & );
137 };
138 
139 typedef FullTensor36 FullTensor;
140 
144 struct FullTensor22 : public shards::ArrayDimTag {
145 
146  enum { Size = 4 };
147 
148  enum { XX = 0 , XY = 2 ,
149  YX = 3 , YY = 1};
150 
151  const char * name() const ;
152  std::string to_string( size_type, size_type) const ;
153  size_type to_index( size_type, const std::string & ) const ;
154  static const FullTensor22 & tag();
155 
156 private:
157  FullTensor22() {}
158  FullTensor22( const FullTensor22 & );
159  FullTensor22 & operator = ( const FullTensor22 & );
160 };
161 
162 //----------------------------------------------------------------------
163 
170 struct SymmetricTensor33 : public shards::ArrayDimTag {
171 
172  enum { Size = 6 };
173 
174  enum { XX = 0 , XY = 3, XZ = 5,
175  YX = 3 , YY = 1, YZ = 4,
176  ZX = 5 , ZY = 4, ZZ = 2};
177 
178  const char * name() const ;
179  std::string to_string( size_type, size_type) const ;
180  size_type to_index( size_type , const std::string & ) const ;
181  static const SymmetricTensor33 & tag();
182 
183 private:
184  SymmetricTensor33() {}
186  SymmetricTensor33 & operator = ( const SymmetricTensor33 & );
187 };
188 
190 
198 struct SymmetricTensor31 : public shards::ArrayDimTag {
199 
200  enum { Size = 4 };
201 
202  enum { rr = 0 , rz = 2 ,
203  zr = 3 , zz = 1};
204 
205  const char * name() const ;
206  std::string to_string( size_type, size_type) const ;
207  size_type to_index( size_type , const std::string & ) const ;
208  static const SymmetricTensor31 & tag();
209 
210 private:
211  SymmetricTensor31() {}
213  SymmetricTensor31 & operator = ( const SymmetricTensor31 & );
214 };
215 
219 struct SymmetricTensor21 : public shards::ArrayDimTag {
220 
221  enum { Size = 3 };
222 
223  enum { XX = 0 , XY = 2 ,
224  YX = 2 , YY = 1 };
225 
226  const char * name() const ;
227  std::string to_string( size_type, size_type) const ;
228  size_type to_index( size_type , const std::string & ) const ;
229  static const SymmetricTensor21 & tag();
230 
231 private:
232  SymmetricTensor21() {}
234  SymmetricTensor21 & operator = ( const SymmetricTensor21 & );
235 };
236 
246 struct AsymmetricTensor03 : public shards::ArrayDimTag {
247 
248  enum { Size = 3 };
249 
250  enum { /* XX = 0 */ XY = 0 , XZ = 2 ,
251  YX = 0 ,/* YY = 0 */ YZ = 1 ,
252  ZX = 2 , ZY = 1 /* ZZ=0 */ };
253 
254  const char * name() const ;
255  std::string to_string( size_type, size_type) const ;
256  size_type to_index( size_type , const std::string & ) const ;
257  static const AsymmetricTensor03 & tag();
258 
259 private:
260  AsymmetricTensor03() {}
262  AsymmetricTensor03 & operator = ( const AsymmetricTensor03 & );
263 };
264 
266 
270 struct Matrix22 : public shards::ArrayDimTag {
271 
272  enum { Size = 4 };
273 
274  enum { XX = 0 , XY = 2 ,
275  YX = 1, YY = 3 };
276 
277  const char * name() const ;
278  std::string to_string( size_type, size_type) const ;
279  size_type to_index( size_type , const std::string & ) const ;
280  static const Matrix22 & tag();
281 
282 private:
283  Matrix22() {}
284  Matrix22( const Matrix22 & );
285  Matrix22 & operator = ( const Matrix22 & );
286 };
287 
291 struct Matrix33 : public shards::ArrayDimTag {
292 
293  enum { Size = 9 };
294 
295  enum { XX = 0 , XY = 3 , XZ = 6 ,
296  YX = 1 , YY = 4 , YZ = 7 ,
297  ZX = 2 , ZY = 5 , ZZ = 8 };
298 
299  const char * name() const ;
300  std::string to_string( size_type, size_type) const ;
301  size_type to_index( size_type , const std::string & ) const ;
302  static const Matrix33 & tag();
303 
304 private:
305  Matrix33() {}
306  Matrix33( const Matrix33 & );
307  Matrix33 & operator = ( const Matrix33 & );
308 };
309 
310 //----------------------------------------------------------------------
311 
314 } //namespace mesh
315 } //namespace stk_classic
316 
317 #endif //stk_mesh_fem_CoordinateSystems_hpp
static const Matrix22 & tag()
Singleton.
static const SymmetricTensor33 & tag()
Singleton.
static const SymmetricTensor31 & tag()
Singleton.
Implement an shards::ArrayDimTag for AsymmetricTensor.
static const Cartesian2d & tag()
Singleton.
Implement an shards::ArrayDimTag for FullTensor.
static const SymmetricTensor21 & tag()
Singleton.
Implement an shards::ArrayDimTag for SymmetricTensor.
static const FullTensor36 & tag()
Singleton.
Implement an shards::ArrayDimTag for SymmetricTensor.
Implement an shards::ArrayDimTag for Cylindrical coordinate dimensions.
Implement an shards::ArrayDimTag for Matrix.
static const AsymmetricTensor03 & tag()
Singleton.
Implement an shards::ArrayDimTag for Cartesian coordinate dimensions.
Implement an shards::ArrayDimTag for Matrix.
Sierra Toolkit.
Implement an shards::ArrayDimTag for SymmetricTensor.
static const FullTensor22 & tag()
Singleton.
Implement an shards::ArrayDimTag for FullTensor.
Identifiers for each dimension.
static const Cylindrical & tag()
Singleton.
static const Matrix33 & tag()
Singleton.
Implement an shards::ArrayDimTag for Cartesian 2d coordinate dimensions.
std::string to_string(const T &t)
Definition: StringUtil.cpp:135