Sierra Toolkit  Version of the Day
FieldTraits.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 Traitss Government. */
7 /*------------------------------------------------------------------------*/
8 
9 
10 #ifndef stk_mesh_base_FieldTraits_hpp
11 #define stk_mesh_base_FieldTraits_hpp
12 
13 #include <stk_mesh/base/FieldBase.hpp>
14 #include <stk_mesh/base/Field.hpp>
15 
16 #include <Shards_Array.hpp>
17 
18 namespace stk_classic {
19 namespace mesh {
20 
30 template<>
31 struct FieldTraits<FieldBase>
32 {
33 public:
34  typedef shards::array_traits::Helper<void,shards::RankZero,
35  void,void,void,void,void,void,void,void>
36  Helper ;
37 
38  typedef void data_type ;
39  typedef void tag1 ;
40  typedef void tag2 ;
41  typedef void tag3 ;
42  typedef void tag4 ;
43  typedef void tag5 ;
44  typedef void tag6 ;
45  typedef void tag7 ;
46 
48  enum { Rank = 0 };
49 
50  static void assign_tags( const shards::ArrayDimTag ** tags ) {}
51 };
52 
53 
55 template< typename Scalar >
56 struct FieldTraits< Field<Scalar,void,void,void,void,void,void,void> >
57 {
58 public:
59  typedef shards::array_traits::Helper<Scalar,shards::RankZero,
60  void,void,void,void,void,void,void,void>
61  Helper ;
62 
63  typedef Scalar data_type ;
64  typedef void tag1 ;
65  typedef void tag2 ;
66  typedef void tag3 ;
67  typedef void tag4 ;
68  typedef void tag5 ;
69  typedef void tag6 ;
70  typedef void tag7 ;
71 
73  enum { Rank = 0 };
74 
75  static void assign_tags( const shards::ArrayDimTag ** tags ) {}
76 };
77 
79 template< typename Scalar ,
80  class Tag1 , class Tag2 , class Tag3 , class Tag4 ,
81  class Tag5 , class Tag6 , class Tag7 >
82 struct FieldTraits< Field<Scalar,Tag1,Tag2,Tag3,Tag4,Tag5,Tag6,Tag7> >
83 {
84 public:
85  typedef shards::array_traits::Helper<Scalar,shards::FortranOrder,
86  Tag1,Tag2,Tag3,Tag4,Tag5,Tag6,Tag7,void>
87  Helper ;
88 
89  typedef Scalar data_type ;
90  typedef Tag1 tag1 ;
91  typedef Tag2 tag2 ;
92  typedef Tag3 tag3 ;
93  typedef Tag4 tag4 ;
94  typedef Tag5 tag5 ;
95  typedef Tag6 tag6 ;
96  typedef Tag7 tag7 ;
97 
99  enum { Rank = Helper::Rank };
100 
101  static void assign_tags( const shards::ArrayDimTag ** tags )
102  { Helper::assign_tags( tags ); }
103 };
104 
105 
106 } //namespace mesh
107 } //namespace stk_classic
108 
109 #endif //stk_mesh_base_FieldTraits_hpp
Field base class with an anonymous data type and anonymous multi-dimension.
Definition: FieldBase.hpp:53
Field with defined data type and multi-dimensions (if any)
Definition: Field.hpp:118
void data_type
Data type of the field&#39;s members.
Definition: FieldTraits.hpp:38
Sierra Toolkit.