00001 #ifndef BASISFAMILY_H
00002 #define BASISFAMILY_H
00003
00004 #include "SundanceDefs.h"
00005
00006 #include "TSFSmartPtr.h"
00007 #include "BasisFamilyBase.h"
00008
00009
00010 namespace Sundance
00011 {
00012
00013 using namespace TSF;
00014 using std::string;
00015
00016 using std::ostream;
00017
00018
00019
00020
00021
00022
00023
00024
00025 class BasisFamily
00026 {
00027 public:
00028
00029
00030
00031 BasisFamily();
00032
00033 BasisFamily(BasisFamilyBase* base);
00034
00035
00036 static BasisFamily createBasis(const XMLObject& xml);
00037
00038
00039 int order() const {return ptr_->order();}
00040
00041 const string& name() const {return ptr_->name();}
00042
00043
00044 bool operator==(const BasisFamily& other) const ;
00045
00046
00047 bool operator<(const BasisFamily& other) const ;
00048
00049
00050 bool isVectorBasis() const {return ptr_->isVectorBasis();}
00051
00052 bool isScalarBasis() const {return ptr_->isScalarBasis();}
00053
00054
00055 bool isNull() const {return ptr_.isNull();}
00056
00057
00058
00059 void refEval(const CellTopologyCode& cellType,
00060 const TSFArray<Point>& pts,
00061 const MultiIndex& deriv,
00062 TSFArray<DenseSerialVector>& result) const
00063 {
00064 ptr_->refEval(cellType, pts, deriv, result);
00065 }
00066
00067
00068 int nNodes(const CellTopologyCode& cellType) const
00069 {
00070 return ptr_->nNodes(cellType);
00071 }
00072
00073
00074
00075
00076
00077 void setNodeNumbers(const Cell& cell,
00078 const TSFArray<int>& funcID,
00079 TemporaryMapper& tmpMap) const
00080 {
00081 ptr_->setNodeNumbers(cell, funcID, tmpMap);
00082 }
00083
00084
00085
00086
00087
00088 void getNodeNumbers(const Cell& cell,
00089 const TSFArray<int>& funcID,
00090 TemporaryMapper& tmpMap,
00091 TSFArray<TSFArray<int> >& indices) const
00092 {
00093 ptr_->getNodeNumbers(cell, funcID, tmpMap, indices);
00094 }
00095
00096
00097
00098
00099 void getFacetDOFs(const Cell& c, int facetDim, int facetIndex,
00100 const TSFArray<int>& maximalDOFs,
00101 TSFArray<int>& facetDOFs) const
00102 {
00103 ptr_->getFacetDOFs(c, facetDim, facetIndex, maximalDOFs, facetDOFs);
00104 }
00105
00106
00107
00108
00109
00110
00111 void getNodalPoints(const Cell& cell,
00112 const TSFArray<bool>& activeNodes,
00113 TSFArray<Point>& evalPoints) const
00114 {
00115 ptr_->getNodalPoints(cell, activeNodes, evalPoints);
00116 }
00117
00118
00119
00120
00121 XMLObject toXML() const {return ptr_->toXML();}
00122
00123
00124 int hashCode() const {return ptr_->hashCode();}
00125
00126
00127 string toString() const {return toXML().toString();}
00128
00129
00130 private:
00131 TSFSmartPtr<BasisFamilyBase> ptr_;
00132 };
00133
00134
00135 inline ostream& operator<<(ostream& os, const BasisFamily& basis)
00136 {
00137 return os << basis.toXML();
00138 }
00139 }
00140
00141 namespace TSF
00142 {
00143
00144 inline string toString(const Sundance::BasisFamily& basis)
00145 {
00146 return basis.toString();
00147 }
00148
00149 inline int hashCode(const Sundance::BasisFamily& basis)
00150 {
00151 return basis.hashCode();
00152 }
00153 }
00154
00155 #endif
00156
00157
00158
00159
00160
00161