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