00001 #ifndef QUADRATUREFAMILY_H 00002 #define QUADRATUREFAMILY_H 00003 00004 #include "SundanceDefs.h" 00005 00006 #include "QuadratureFamilyBase.h" 00007 #include "XMLObject.h" 00008 00009 00010 00011 namespace Sundance 00012 { 00013 00014 using namespace TSF; 00015 using std::string; 00016 00017 using std::ostream; 00018 00019 /** \ingroup LowLevelFE 00020 * A geometry-independent specification of a quadrature rule. 00021 */ 00022 00023 class QuadratureFamily 00024 { 00025 public: 00026 /** empty ctor for use in containers */ 00027 QuadratureFamily() : ptr_(0){;} 00028 00029 /** construct with a pointer to a derived type */ 00030 QuadratureFamily(QuadratureFamilyBase* ptr); 00031 00032 /** create from an XML specification */ 00033 static QuadratureFamily createQuadratureFamily(const XMLObject& xml); 00034 00035 /** produce quadrature points for a specified cell type */ 00036 QuadraturePoints buildQuadraturePoints(const CellTopologyCode& cellType) const 00037 {return ptr_->buildQuadraturePoints(cellType);} 00038 00039 /** test equality */ 00040 bool operator==(const QuadratureFamily& other) const ; 00041 00042 /** test ordering */ 00043 bool operator<(const QuadratureFamily& other) const ; 00044 00045 /** return polynomial order */ 00046 int polyOrder() const {return ptr_->polyOrder();} 00047 00048 /** write to XML form */ 00049 XMLObject toXML() const {return ptr_->toXML();} 00050 00051 /** write to a string*/ 00052 string toString() const {return toXML().toString();} 00053 00054 /** return a hash code */ 00055 int hashCode() const {return ptr_->hashCode();} 00056 00057 /** */ 00058 const string& typeName() const {return ptr_->typeName();} 00059 protected: 00060 TSFSmartPtr<QuadratureFamilyBase> ptr_; 00061 }; 00062 00063 /** \relates QuadratureFamily write to a stream */ 00064 inline ostream& operator<<(ostream& os, const QuadratureFamily& q) 00065 { 00066 return os << q.toXML(); 00067 } 00068 } 00069 00070 namespace TSF 00071 { 00072 /** \relates QuadratureFamily get hash code */ 00073 int hashCode(const Sundance::QuadratureFamily& q); 00074 00075 /** \relates QuadratureFamily write to a string */ 00076 string toString(const Sundance::QuadratureFamily& q); 00077 00078 } 00079 00080 #endif 00081 00082