MOAB: Mesh Oriented datABase
(version 5.3.1)
|
00001 #ifndef ELEMENT_SEQUENCE_HPP 00002 #define ELEMENT_SEQUENCE_HPP 00003 00004 #include "EntitySequence.hpp" 00005 #include "SequenceData.hpp" 00006 #include "moab/CN.hpp" 00007 00008 namespace moab 00009 { 00010 00011 class ElementSequence : public EntitySequence 00012 { 00013 public: 00014 ElementSequence( EntityHandle start, EntityID count, unsigned int nodes_per_elem, SequenceData* dat ) 00015 : EntitySequence( start, count, dat ), nodesPerElement( nodes_per_elem ) 00016 { 00017 } 00018 00019 virtual ~ElementSequence() {} 00020 00021 inline unsigned int nodes_per_element() const 00022 { 00023 return nodesPerElement; 00024 } 00025 00026 virtual ErrorCode get_connectivity( EntityHandle handle, std::vector< EntityHandle >& connect, 00027 bool topological = false ) const = 0; 00028 00029 virtual ErrorCode get_connectivity( EntityHandle handle, EntityHandle const*& connect, int& connect_length, 00030 bool topological = false, std::vector< EntityHandle >* storage = 0 ) const = 0; 00031 00032 virtual ErrorCode set_connectivity( EntityHandle handle, EntityHandle const* connect, int connect_length ) = 0; 00033 00034 inline EntityHandle const* get_connectivity_array() const; 00035 00036 virtual EntityHandle* get_connectivity_array() = 0; 00037 00038 inline bool has_mid_edge_nodes() const; 00039 inline bool has_mid_face_nodes() const; 00040 inline bool has_mid_volume_nodes() const; 00041 00042 protected: 00043 ElementSequence( ElementSequence& split_from, EntityHandle here ) 00044 : EntitySequence( split_from, here ), nodesPerElement( split_from.nodesPerElement ) 00045 { 00046 } 00047 00048 private: 00049 unsigned nodesPerElement; 00050 }; 00051 00052 inline EntityHandle const* ElementSequence::get_connectivity_array() const 00053 { 00054 return const_cast< ElementSequence* >( this )->get_connectivity_array(); 00055 } 00056 00057 inline bool ElementSequence::has_mid_edge_nodes() const 00058 { 00059 return CN::HasMidEdgeNodes( type(), nodes_per_element() ); 00060 } 00061 00062 inline bool ElementSequence::has_mid_face_nodes() const 00063 { 00064 return CN::HasMidFaceNodes( type(), nodes_per_element() ); 00065 } 00066 00067 inline bool ElementSequence::has_mid_volume_nodes() const 00068 { 00069 return CN::HasMidRegionNodes( type(), nodes_per_element() ); 00070 } 00071 00072 } // namespace moab 00073 00074 #endif