Sierra Toolkit Version of the Day
stk_generic_mesh_traits.hpp
00001 #ifndef STK_MESH_GENERIC_MESH_TRAITS_HPP
00002 #define STK_MESH_GENERIC_MESH_TRAITS_HPP
00003 
00004 #include "stk_mesh/base/Types.hpp"
00005 #include "stk_mesh/base/BulkData.hpp"
00006 
00007 namespace stk {
00008 namespace mesh {
00009 
00010 struct Internal_STK_Relation_Descriptor_Adapter
00011 {
00012   Internal_STK_Relation_Descriptor_Adapter(Entity * e_from = NULL, Entity * e_to = NULL, RelationIdentifier rel_id = InvalidOrdinal)
00013     : m_entity_from(e_from), m_entity_to(e_to), m_relation_id(rel_id) { }
00014 
00015   Entity * m_entity_from;
00016   Entity * m_entity_to;
00017   RelationIdentifier m_relation_id;
00018 
00019 };
00020 
00021 struct Internal_STK_Generic_Mesh_Adapter
00022 {
00023 
00024   //****************************************
00025   // Generic Mesh API BEGIN
00026   //****************************************
00027 
00028   // persistant through modifications (up to change owner):
00029   //typedef typename Mesh::entity_global_id                entity_global_id;
00030 
00031   // persistant through modifications (up to change owner):
00032   typedef Entity *     entity_local_id;
00033   typedef const Entity * const_entity_local_id;
00034   // not-persistant through modifications (up to change owner):
00035   typedef Entity *     entity_descriptor;
00036   // entity_descriptor_iterator de-references to an entity_descriptor:
00037   typedef Entity *     entity_descriptor_iterator;
00038   typedef EntityId     entity_size_type;
00039 
00040 
00041   typedef Part *       part_descriptor;
00042   // part_descriptor_iterator de-references to a part_descriptor:
00043   typedef Part *       part_descriptor_iterator;
00044   typedef PartOrdinal  part_size_type; // not used yet
00045 
00046   typedef Bucket *     bucket_descriptor;
00047   // bucket_descriptor_iterator de-references to a bucket_descriptor:
00048   typedef Bucket *     bucket_descriptor_iterator;
00049   typedef Ordinal      bucket_size_type; // not used yet
00050   // potentially heavy bucket_descriptor_iterator:
00051   typedef Bucket *     selected_bucket_descriptor_iterator;
00052 
00053   // potentially heavy bucket_descriptor_iterator:
00054   typedef Bucket *     part_bucket_descriptor_iterator;
00055   typedef Ordinal      part_bucket_size_type; // not used yet
00056 
00057   // potentially heavy part_descriptor_iterator:
00058   typedef const Ordinal *    bucket_part_descriptor_iterator;
00059   typedef Ordinal      bucket_part_descriptor;
00060   typedef Ordinal      bucket_part_size_type; // not used yet
00061 
00062   // potentially heavy entity_descriptor_iterator:
00063   typedef Entity *     bucket_entity_descriptor_iterator;
00064   typedef Ordinal      bucket_entity_size_type; // not used yet
00065 
00066   typedef Internal_STK_Relation_Descriptor_Adapter    relation_descriptor;
00067   typedef Internal_STK_Relation_Descriptor_Adapter *  relation_descriptor_iterator;
00068   typedef Internal_STK_Relation_Descriptor_Adapter *  selected_relation_descriptor_iterator;
00069   typedef Ordinal           relation_size_type; // not used yet
00070 
00071   inline part_descriptor             universal_part() { return & m_bulk_data.mesh_meta_data().universal_part(); }
00072 
00073   static inline part_descriptor      null_part() { return NULL; };
00074   static inline bucket_descriptor    null_bucket() { return NULL; };
00075   static inline entity_local_id      null_entity() { return NULL; };
00076   static inline relation_descriptor  null_relation() { return relation_descriptor(); };
00077 
00078 
00079   //****************************************
00080   // Generic Mesh API END
00081   //****************************************
00082 
00083   Internal_STK_Generic_Mesh_Adapter(BulkData & bulk_data) : m_bulk_data(bulk_data) {}
00084 
00085   // Data on the struct:
00086   BulkData & m_bulk_data;
00087 };
00088 
00089 
00090 
00091 // Use the type STKGenericMesh as the mesh type for STK so we can change this in the future.
00092 typedef Internal_STK_Generic_Mesh_Adapter STKGenericMesh;
00093 
00094 
00095 } // namespace mesh
00096 } // namespace stk
00097 
00098 
00099 #endif // STK_MESH_GENERIC_MESH_TRAITS_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends