Sierra Toolkit  Version of the Day
Types.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 #ifndef stk_mesh_Types_hpp
10 #define stk_mesh_Types_hpp
11 
12 //----------------------------------------------------------------------
13 
14 #include <stdint.h>
15 #include <limits>
16 #include <utility>
17 #include <vector>
18 
19 #include <stk_util/util/PairIter.hpp>
20 #include <stk_util/util/NamedPair.hpp>
21 
22 namespace stk_classic {
23 namespace mesh {
24 
25 //----------------------------------------------------------------------
30 class MetaData ; // Meta-data description of a mesh
31 class Part ; // Defined subset of the mesh
32 
36 typedef std::vector< Part * > PartVector ;
37 typedef std::vector< unsigned > OrdinalVector ;
38 
39 class FieldBase;
40 
41 template< typename Scalar = void ,
42  class Tag1 = void , class Tag2 = void ,
43  class Tag3 = void , class Tag4 = void ,
44  class Tag5 = void , class Tag6 = void ,
45  class Tag7 = void >
46  class Field ;
47 
52 enum { MaximumFieldDimension = 7 };
53 
54 template< typename DataType = void > class Property ;
55 
56 typedef Property< void > PropertyBase ;
57 
60 //----------------------------------------------------------------------
65 class BulkData ; // Bulk-data of a mesh
66 class Bucket ; // Homogeneous collection of mesh entitities their field data
67 class Entity ; // Individual entity within the mesh
68 class Relation ; // Relation pair of local mesh entities
69 class Ghosting ;
70 
71 typedef std::vector<Bucket *> BucketVector;
72 typedef std::vector<Entity *> EntityVector;
73 
77 enum EntityModificationLog { EntityLogNoChange = 0 ,
78  EntityLogCreated = 1 ,
79  EntityLogModified = 2 ,
80  EntityLogDeleted = 3 };
81 
82 template< class FieldType > struct EntityArray ;
83 template< class FieldType > struct BucketArray ;
84 template< class FieldType > struct FieldTraits ;
85 
86 
87 typedef unsigned Ordinal;
88 static const Ordinal InvalidOrdinal = static_cast<Ordinal>(-1); // std::numeric_limits<PartOrdinal>::max();
89 typedef Ordinal EntityRank ;
90 typedef Ordinal PartOrdinal;
91 typedef Ordinal FieldOrdinal;
92 typedef Ordinal RelationIdentifier;
93 typedef Ordinal FieldArrayRank;
94 
95 typedef uint64_t EntityId ;
96 
97 // Base Entity Rank
98 // Note: This BaseEntityRank can be considered the leaf of a tree and it
99 // represents the furthest out you can go in downward relations.
100 static const EntityRank BaseEntityRank = 0;
101 static const EntityRank InvalidEntityRank = InvalidOrdinal;
102 static const PartOrdinal InvalidPartOrdinal = InvalidOrdinal;
103 static const RelationIdentifier InvalidRelationIdentifier = InvalidOrdinal;
104 
105 //----------------------------------------------------------------------
111 typedef std::pair<Entity*,unsigned> EntityProc ;
112 typedef std::vector<EntityProc> EntityProcVec ;
113 
119 #ifndef SWIG
120  //NLM SWIG cannot handle this macro
121 
122 NAMED_PAIR( EntityCommInfo , unsigned , ghost_id , unsigned , proc )
123 
124 
129 
130 typedef std::vector<EntityCommInfo> EntityCommInfoVector;
131 #endif
132 
134 //----------------------------------------------------------------------
149 typedef int ( * relation_stencil_ptr )( unsigned from_type ,
150  unsigned to_type ,
151  unsigned identifier );
152 
153 //----------------------------------------------------------------------
161 typedef std::vector<Relation> RelationVector;
163 
164 //----------------------------------------------------------------------
165 
166 
167 } // namespace mesh
168 } // namespace stk_classic
169 
170 #endif
Field base class with an anonymous data type and anonymous multi-dimension.
Definition: FieldBase.hpp:53
std::pair< Entity *, unsigned > EntityProc
Pairing of an entity with a processor rank.
Definition: Types.hpp:111
Field with defined data type and multi-dimensions (if any)
Definition: Field.hpp:118
An application-defined subset of a problem domain.
Definition: Part.hpp:49
PairIter< std::vector< EntityProc >::const_iterator > PairIterEntityProc
Spans of a vector of entity-processor pairs are common.
Definition: Types.hpp:118
Sierra Toolkit.
int(* relation_stencil_ptr)(unsigned from_type, unsigned to_type, unsigned identifier)
A relation stencil maps entity relationships to ordinals.
Definition: Types.hpp:149
std::vector< Part *> PartVector
Collections of parts are frequently maintained as a vector of Part pointers.
Definition: Types.hpp:31
PairIter< std::vector< EntityCommInfo >::const_iterator > PairIterEntityComm
Span of ( communication-subset-ordinal , process-rank ) pairs for the communication of an entity...
Definition: Types.hpp:128
std::vector< Relation > RelationVector
Span of a sorted relations for a given domain entity.
Definition: Types.hpp:161