Sierra Toolkit Version of the Day
CoordinateSystems.hpp
00001 /*------------------------------------------------------------------------*/
00002 /*                 Copyright 2010 Sandia Corporation.                     */
00003 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00004 /*  license for use of this work by or on behalf of the U.S. Government.  */
00005 /*  Export of this program may require a license from the                 */
00006 /*  United States Government.                                             */
00007 /*------------------------------------------------------------------------*/
00008 
00009 
00010 #ifndef stk_mesh_fem_CoordinateSystems_hpp
00011 #define stk_mesh_fem_CoordinateSystems_hpp
00012 
00013 //----------------------------------------------------------------------
00014 
00015 #include <Shards_Array.hpp>
00016 
00017 namespace stk {
00018 namespace mesh {
00019 
00033 SHARDS_ARRAY_DIM_TAG_SIMPLE_DECLARATION( SimpleArrayTag )
00034 
00035 
00040 struct Cartesian3d : public shards::ArrayDimTag {
00041 
00042   enum { Size = 3 };                    
00043 
00044   enum { X = 0 , Y = 1 , Z = 2 };       
00045 
00046   const char * name() const ;
00047   std::string to_string( size_type size , size_type index ) const ;
00048   size_type    to_index(  size_type size , const std::string & ) const ;
00049   static const Cartesian3d & tag();       
00050 
00051 private:
00052   Cartesian3d() {}
00053   Cartesian3d( const Cartesian3d & );
00054   Cartesian3d & operator = ( const Cartesian3d & );
00055 };
00056 
00062 struct Cartesian2d: public shards::ArrayDimTag {
00063 
00064   enum { Size = 2 };                    
00065 
00066   enum { X = 0 , Y = 1 };       
00067 
00068   const char * name() const ;
00069   std::string to_string( size_type size , size_type index ) const ;
00070   size_type    to_index(  size_type size , const std::string & ) const ;
00071   static const Cartesian2d & tag();       
00072 
00073 private:
00074   Cartesian2d() {}
00075   Cartesian2d( const Cartesian2d & );
00076   Cartesian2d & operator = ( const Cartesian2d & );
00077 };
00078 
00079 typedef Cartesian3d Cartesian;
00086 struct Cylindrical : public shards::ArrayDimTag {
00087 
00088   enum { Radius = 0 , R = 0 ,           
00089          Angle = 1 ,  A = 1 ,
00090          Z = 2 };
00091 
00092   const char * name() const ;
00093   std::string to_string( size_type size , size_type index ) const ;
00094   size_type    to_index(  size_type size , const std::string & ) const ;
00095   static const Cylindrical & tag(); 
00096 
00097 private:
00098   Cylindrical() {}
00099   Cylindrical( const Cylindrical & );
00100   Cylindrical & operator = ( const Cylindrical & );
00101 };
00102 
00109 struct FullTensor36 : public shards::ArrayDimTag {
00110 
00111   enum { Size = 9 };
00112 
00113 /*
00114  * Note on Ordering:  This is the ordering as used in the old 
00115  * Sierra Framework and is somewhat standard in that a symmetric
00116  * tensor is the first six values of a full tensor and a diagonal
00117  * only tensor is the first three values of that.  
00118  *
00119  * I think this is actually in ERROR in that (XZ,YX,ZY) SHOULD
00120  * be (6,7,8) NOT (8,6,7).  But backwards compatibility is useful.
00121  *
00122  * \todo Look at the proper ordering of a full second order tensor.
00123  */
00124   enum { XX = 0 , XY = 3 , XZ = 8 ,
00125          YX = 6 , YY = 1 , YZ = 4 ,
00126          ZX = 5 , ZY = 7 , ZZ = 2 };
00127 
00128   const char * name() const ;
00129   std::string to_string( size_type, size_type) const  ;
00130   size_type    to_index(  size_type, const std::string & ) const  ;
00131   static const FullTensor36 & tag(); 
00132 
00133 private:
00134   FullTensor36() {}
00135   FullTensor36( const FullTensor36 & );
00136   FullTensor36 & operator = ( const FullTensor36 & );
00137 };
00138 
00139 typedef FullTensor36 FullTensor;
00140 
00144 struct FullTensor22 : public shards::ArrayDimTag {
00145 
00146   enum { Size = 4 };
00147 
00148   enum { XX = 0 , XY = 2 , 
00149          YX = 3 , YY = 1};
00150 
00151   const char * name() const ;
00152   std::string to_string( size_type, size_type) const  ;
00153   size_type    to_index(  size_type, const std::string & ) const  ;
00154   static const FullTensor22 & tag(); 
00155 
00156 private:
00157   FullTensor22() {}
00158   FullTensor22( const FullTensor22 & );
00159   FullTensor22 & operator = ( const FullTensor22 & );
00160 };
00161 
00162 //----------------------------------------------------------------------
00163 
00170 struct SymmetricTensor33 : public shards::ArrayDimTag {
00171 
00172   enum { Size = 6 };
00173 
00174   enum { XX = 0 , XY = 3,  XZ = 5,
00175          YX = 3 , YY = 1,  YZ = 4, 
00176          ZX = 5 , ZY = 4,  ZZ = 2};
00177 
00178   const char * name() const  ;
00179   std::string to_string( size_type, size_type) const  ;
00180   size_type    to_index(  size_type , const std::string & ) const ;
00181   static const SymmetricTensor33 & tag(); 
00182 
00183 private:
00184   SymmetricTensor33() {}
00185   SymmetricTensor33( const SymmetricTensor33 & );
00186   SymmetricTensor33 & operator = ( const SymmetricTensor33 & );
00187 };
00188 
00189 typedef SymmetricTensor33 SymmetricTensor;
00190 
00198 struct SymmetricTensor31 : public shards::ArrayDimTag {
00199 
00200   enum { Size = 4 };
00201 
00202   enum { rr = 0 , rz = 2 , 
00203          zr = 3 , zz = 1};
00204 
00205   const char * name() const  ;
00206   std::string to_string( size_type, size_type) const  ;
00207   size_type    to_index(  size_type , const std::string & ) const ;
00208   static const SymmetricTensor31 & tag(); 
00209 
00210 private:
00211   SymmetricTensor31() {}
00212   SymmetricTensor31( const SymmetricTensor31 & );
00213   SymmetricTensor31 & operator = ( const SymmetricTensor31 & );
00214 };
00215 
00219 struct SymmetricTensor21 : public shards::ArrayDimTag {
00220 
00221   enum { Size = 3 };
00222 
00223   enum { XX = 0 , XY = 2 , 
00224          YX = 2 , YY = 1 };
00225 
00226   const char * name() const  ;
00227   std::string to_string( size_type, size_type) const  ;
00228   size_type    to_index(  size_type , const std::string & ) const ;
00229   static const SymmetricTensor21 & tag(); 
00230 
00231 private:
00232   SymmetricTensor21() {}
00233   SymmetricTensor21( const SymmetricTensor21 & );
00234   SymmetricTensor21 & operator = ( const SymmetricTensor21 & );
00235 };
00236 
00246 struct AsymmetricTensor03 : public shards::ArrayDimTag {
00247 
00248   enum { Size = 3 };
00249 
00250   enum {  /* XX = 0 */  XY = 0 ,   XZ = 2 ,
00251              YX = 0 ,/* YY = 0 */  YZ = 1 , 
00252              ZX = 2 ,   ZY = 1  /* ZZ=0 */ };
00253 
00254   const char * name() const  ;
00255   std::string to_string( size_type, size_type) const  ;
00256   size_type    to_index(  size_type , const std::string & ) const ;
00257   static const AsymmetricTensor03 & tag(); 
00258 
00259 private:
00260   AsymmetricTensor03() {}
00261   AsymmetricTensor03( const AsymmetricTensor03 & );
00262   AsymmetricTensor03 & operator = ( const AsymmetricTensor03 & );
00263 };
00264 
00265 typedef AsymmetricTensor03 AsymmetricTensor;
00266 
00270 struct Matrix22 : public shards::ArrayDimTag {
00271 
00272   enum { Size = 4 };
00273 
00274   enum { XX = 0 , XY = 2 , 
00275          YX = 1,  YY = 3 };
00276 
00277   const char * name() const  ;
00278   std::string to_string( size_type, size_type) const  ;
00279   size_type    to_index(  size_type , const std::string & ) const ;
00280   static const Matrix22 & tag(); 
00281 
00282 private:
00283   Matrix22() {}
00284   Matrix22( const Matrix22 & );
00285   Matrix22 & operator = ( const Matrix22 & );
00286 };
00287 
00291 struct Matrix33 : public shards::ArrayDimTag {
00292 
00293   enum { Size = 9 };
00294 
00295   enum { XX = 0 , XY = 3 , XZ = 6 ,
00296          YX = 1 , YY = 4 , YZ = 7 ,
00297          ZX = 2 , ZY = 5 , ZZ = 8 };
00298 
00299   const char * name() const  ;
00300   std::string to_string( size_type, size_type) const  ;
00301   size_type    to_index(  size_type , const std::string & ) const ;
00302   static const Matrix33 & tag(); 
00303 
00304 private:
00305   Matrix33() {}
00306   Matrix33( const Matrix33 & );
00307   Matrix33 & operator = ( const Matrix33 & );
00308 };
00309 
00310 //----------------------------------------------------------------------
00311 
00314 } //namespace mesh
00315 } //namespace stk
00316 
00317 #endif //stk_mesh_fem_CoordinateSystems_hpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines