00001 /* abstract base class for hp elements in 3D 00002 */ 00003 00004 #ifndef hpElement3d_h 00005 #define hpElement3d_h 00006 00007 #include <cstring> 00008 #include "basics/vectorsMatrices.hh" 00009 #include "geometry/connector.hh" 00010 #include "geometry/cell.hh" 00011 #include "space/element.hh" 00012 #include "space/tmatrix.hh" 00013 00014 namespace hp3D { 00015 00016 using concepts::Real; 00017 00018 // *************************************************************** Element ** 00019 00026 template<class F> 00027 class Element : public concepts::ElementWithCell<F> { 00028 public: 00034 inline Element(concepts::TColumn<Real>* T, uint p) : T_(T) { 00035 p_[0] = p_[1] = p_[2] = p; 00036 } 00037 00043 inline Element(concepts::TColumn<Real>* T, const ushort* p) : T_(T) { 00044 std::memcpy(p_, p, 3*sizeof(ushort)); 00045 } 00046 00049 inline const ushort* p() const { return p_; } 00050 00055 virtual const concepts::Connector3& support() const = 0; 00056 00057 virtual const concepts::TMatrixBase<Real>& T() const { return T_; } 00058 00060 void appendT(concepts::TColumn<Real>* T) { T_.append(T); } 00061 00066 virtual concepts::Real3d vertex(uint i) const = 0; 00067 00071 virtual const concepts::Cell3& cell() const = 0; 00072 00074 virtual bool operator<(const Element<F>& elm) const = 0; 00075 protected: 00076 virtual std::ostream& info(std::ostream& os) const; 00077 00079 concepts::TMatrix<Real> T_; 00080 private: 00082 ushort p_[3]; 00083 }; 00084 00085 } // namespace hp3d 00086 00087 #endif // hpElement3d_h