[MOAB-dev] r2693 - MOAB/trunk
pppebay at sandia.gov
pppebay at sandia.gov
Tue Mar 10 12:41:14 CDT 2009
Author: pebay
Date: 2009-03-10 12:41:14 -0500 (Tue, 10 Mar 2009)
New Revision: 2693
Modified:
MOAB/trunk/SweptElementSeq.hpp
Log:
ENH: header file for the swept elt sequence
Modified: MOAB/trunk/SweptElementSeq.hpp
===================================================================
--- MOAB/trunk/SweptElementSeq.hpp 2009-03-10 17:40:25 UTC (rev 2692)
+++ MOAB/trunk/SweptElementSeq.hpp 2009-03-10 17:41:14 UTC (rev 2693)
@@ -38,17 +38,76 @@
virtual ~SweptElementSeq();
- //! given a handle, get the corresponding parameters
- MBErrorCode get_params(const MBEntityHandle ehandle,
- int &i, int &j, int &k) const
- { }
-
- //! get connectivity of an entity given entity's parameters
- MBErrorCode get_params_connectivity(const int i, const int j, const int k,
- std::vector<MBEntityHandle>& connectivity) const
- { }
-
-
+ ScdElementData* sdata()
+ { return reinterpret_cast<ScdElementData*>(data()); }
+ ScdElementData const* sdata() const
+ { return reinterpret_cast<const ScdElementData*>(data()); }
+
+ //! get handle of vertex at i, j, k
+ MBEntityHandle get_vertex(const int i, const int j, const int k) const
+ { return get_vertex( HomCoord(i,j,k) ); }
+
+ //! get handle of vertex at homogeneous coords
+ inline MBEntityHandle get_vertex(const HomCoord &coords) const
+ { return sdata()->get_vertex(coords); }
+
+ //! get handle of element at i, j, k
+ MBEntityHandle get_element(const int i, const int j, const int k) const
+ { return sdata()->get_element( i, j, k ); }
+
+ //! get handle of element at homogeneous coords
+ MBEntityHandle get_element(const HomCoord &coords) const
+ { return sdata()->get_element( coords.i(), coords.j(), coords.k() ); }
+
+ //! get min params for this element
+ const HomCoord &min_params() const
+ { return sdata()->min_params(); }
+ void min_params(HomCoord &coords) const
+ { coords = min_params(); }
+ void min_params(int &i, int &j, int &k) const
+ { i = min_params().i(); j = min_params().j(); k = min_params().k(); }
+
+ //! get max params for this element
+ const HomCoord &max_params() const
+ { return sdata()->max_params(); }
+ void max_params(HomCoord &coords) const
+ { coords = max_params(); }
+ void max_params(int &i, int &j, int &k) const
+ { i = max_params().i(); j = max_params().j(); k = max_params().k(); }
+
+ //! get the number of vertices in each direction, inclusive
+ void param_extents(int &di, int &dj, int &dk) const
+ { sdata()->param_extents( di, dj, dk ); }
+
+ //! given a handle, get the corresponding parameters
+ MBErrorCode get_params(const MBEntityHandle ehandle,
+ int &i, int &j, int &k) const
+ { return sdata()->get_params( ehandle, i, j, k ); }
+
+ //! convenience functions for parameter extents
+ int i_min() const {return min_params().i();}
+ int j_min() const {return min_params().j();}
+ int k_min() const {return min_params().k();}
+ int i_max() const {return max_params().i();}
+ int j_max() const {return max_params().j();}
+ int k_max() const {return max_params().k();}
+
+ //! test the bounding vertex sequences and determine whether they fully
+ //! define the vertices covering this element block's parameter space
+ inline bool boundary_complete() const
+ { return sdata()->boundary_complete(); }
+
+ //! test whether this sequence contains these parameters
+ bool contains(const int i, const int j, const int k) const
+ { return sdata()->contains(HomCoord(i,j,k)); }
+ inline bool contains(const HomCoord &coords) const
+ { return sdata()->contains(coords); }
+
+ //! get connectivity of an entity given entity's parameters
+ MBErrorCode get_params_connectivity(const int i, const int j, const int k,
+ std::vector<MBEntityHandle>& connectivity) const
+ { return sdata()->get_params_connectivity( i, j, k, connectivity ); }
+
/***************** Methods from ElementSeq *****************/
virtual MBErrorCode get_connectivity( MBEntityHandle handle,
More information about the moab-dev
mailing list