MOAB: Mesh Oriented datABase  (version 5.4.0)
ElementSequence.hpp
Go to the documentation of this file.
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,
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 ) const = 0;
00035 
00036     virtual ErrorCode set_connectivity( EntityHandle handle, EntityHandle const* connect, int connect_length ) = 0;
00037 
00038     inline EntityHandle const* get_connectivity_array() const;
00039 
00040     virtual EntityHandle* get_connectivity_array() = 0;
00041 
00042     inline bool has_mid_edge_nodes() const;
00043     inline bool has_mid_face_nodes() const;
00044     inline bool has_mid_volume_nodes() const;
00045 
00046   protected:
00047     ElementSequence( ElementSequence& split_from, EntityHandle here )
00048         : EntitySequence( split_from, here ), nodesPerElement( split_from.nodesPerElement )
00049     {
00050     }
00051 
00052   private:
00053     unsigned nodesPerElement;
00054 };
00055 
00056 inline EntityHandle const* ElementSequence::get_connectivity_array() const
00057 {
00058     return const_cast< ElementSequence* >( this )->get_connectivity_array();
00059 }
00060 
00061 inline bool ElementSequence::has_mid_edge_nodes() const
00062 {
00063     return CN::HasMidEdgeNodes( type(), nodes_per_element() );
00064 }
00065 
00066 inline bool ElementSequence::has_mid_face_nodes() const
00067 {
00068     return CN::HasMidFaceNodes( type(), nodes_per_element() );
00069 }
00070 
00071 inline bool ElementSequence::has_mid_volume_nodes() const
00072 {
00073     return CN::HasMidRegionNodes( type(), nodes_per_element() );
00074 }
00075 
00076 }  // namespace moab
00077 
00078 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines