moab
SweptElementSeq.hpp
Go to the documentation of this file.
00001 
00016 #ifndef SWEPT_ELEMENT_SEQUENCE
00017 #define SWEPT_ELEMENT_SEQUENCE
00018 
00019 //
00020 // Class: SweptElementSequence
00021 //
00022 // Purpose: represent a swept element of mesh
00023 //
00024 
00025 #include "ElementSequence.hpp"
00026 #include "ScdElementData.hpp"
00027 
00028 namespace moab {
00029 
00030 class SweptElementSeq : public ElementSequence
00031 {
00032 public:
00033 
00035   SweptElementSeq(
00036           EntityHandle start_handle,
00037           const int imin, const int jmin, const int kmin,
00038           const int imax, const int jmax, const int kmax,
00039           const int* Cq );
00040   
00041   virtual ~SweptElementSeq();
00042 
00043   ScdElementData* sdata()  
00044   { return reinterpret_cast<ScdElementData*>(data()); } 
00045   ScdElementData const* sdata() const  
00046   { return reinterpret_cast<const ScdElementData*>(data()); } 
00047  
00049   EntityHandle get_vertex(const int i, const int j, const int k) const 
00050   { return get_vertex( HomCoord(i,j,k) ); } 
00051    
00053   inline EntityHandle get_vertex(const HomCoord &coords) const 
00054   { return sdata()->get_vertex(coords); } 
00055    
00057   EntityHandle get_element(const int i, const int j, const int k) const 
00058   { return sdata()->get_element( i, j, k ); } 
00059    
00061   EntityHandle get_element(const HomCoord &coords) const 
00062   { return sdata()->get_element( coords.i(), coords.j(), coords.k() ); } 
00063    
00065   const HomCoord &min_params() const 
00066   { return sdata()->min_params(); } 
00067   void min_params(HomCoord &coords) const 
00068   { coords = min_params(); } 
00069   void min_params(int &i, int &j, int &k) const 
00070   { i = min_params().i(); j = min_params().j(); k = min_params().k(); } 
00071  
00073   const HomCoord &max_params() const 
00074   { return sdata()->max_params(); } 
00075   void max_params(HomCoord &coords) const 
00076   { coords = max_params(); } 
00077   void max_params(int &i, int &j, int &k) const 
00078   { i = max_params().i(); j = max_params().j(); k = max_params().k(); } 
00079    
00081   void param_extents(int &di, int &dj, int &dk) const 
00082   { sdata()->param_extents( di, dj, dk ); } 
00083  
00085   ErrorCode get_params(const EntityHandle ehandle, 
00086                          int &i, int &j, int &k) const 
00087   { return sdata()->get_params( ehandle, i, j, k ); } 
00088    
00090   int i_min() const {return min_params().i();} 
00091   int j_min() const {return min_params().j();} 
00092   int k_min() const {return min_params().k();} 
00093   int i_max() const {return max_params().i();} 
00094   int j_max() const {return max_params().j();} 
00095   int k_max() const {return max_params().k();} 
00096  
00099   inline bool boundary_complete() const 
00100   { return sdata()->boundary_complete(); } 
00101  
00103   bool contains(const int i, const int j, const int k) const 
00104   { return sdata()->contains(HomCoord(i,j,k)); } 
00105   inline bool contains(const HomCoord &coords) const 
00106   { return sdata()->contains(coords); } 
00107  
00109   ErrorCode get_params_connectivity(const int i, const int j, const int k, 
00110                                       std::vector<EntityHandle>& connectivity) const 
00111   { return sdata()->get_params_connectivity( i, j, k, connectivity ); } 
00112    
00113     /***************** Methods from ElementSeq *****************/
00114 
00115   virtual ErrorCode get_connectivity( EntityHandle handle,
00116                                         std::vector<EntityHandle>& connect,
00117                                         bool topological = false ) const;
00118   
00119   virtual ErrorCode get_connectivity( EntityHandle handle,
00120                                         EntityHandle const*& connect,
00121                                         int &connect_length,
00122                                         bool topological = false,
00123                                         std::vector<EntityHandle>* storage = 0
00124                                        ) const;
00125 
00126   virtual ErrorCode set_connectivity( EntityHandle handle,
00127                                         EntityHandle const* connect,
00128                                         int connect_length );
00129   
00130   virtual EntityHandle* get_connectivity_array();
00131  
00132    /***************** Methods from EntitySequence *****************/
00133 
00134     /* Replace the ElementSequence implementation of this method with
00135      * one that always returns zero, because we cannot re-use handles
00136      * that are within a ScdElementData
00137      */
00138   virtual int values_per_entity() const;
00139 
00140   virtual EntitySequence* split( EntityHandle here );
00141 
00142   virtual SequenceData* create_data_subset( EntityHandle start_handle,
00143                                             EntityHandle end_handle ) const;
00144 
00145   virtual void get_const_memory_use( unsigned long& bytes_per_entity,
00146                                      unsigned long& size_of_sequence ) const;
00147 
00148 protected:
00149   SweptElementSeq( SweptElementSeq& split_from, EntityHandle here )
00150     : ElementSequence( split_from, here )
00151     {}
00152 };
00153 
00154 } // namespace moab
00155 
00156 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines