Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

BasisFamily.h

Go to the documentation of this file.
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    * \ingroup UserLevelFE
00020    * Handle class for basis function families. You'll probably never use
00021    * this class or any of it's methods
00022    * directly; you'll instantiate one of the BasisFamilyBase subclasses
00023    * and pass it to somebody's constructor.
00024    */
00025   class BasisFamily
00026     {
00027     public:
00028       /** \name Developer-only methods */
00029       //@{
00030       /** empty ctor */
00031       BasisFamily();
00032       /** construct with a pointer to a derived class */
00033       BasisFamily(BasisFamilyBase* base);
00034 
00035       /** create from an XML object */
00036       static BasisFamily createBasis(const XMLObject& xml);
00037 
00038       /** return the order of the basis function */
00039       int order() const {return ptr_->order();}
00040       /** return an identifying name for the basis */
00041       const string& name() const {return ptr_->name();}
00042 
00043       /** test equality with another basis */
00044       bool operator==(const BasisFamily& other) const ;
00045       /** test ordering with another basis. This is needed for ranking
00046        * functions */
00047       bool operator<(const BasisFamily& other) const ;
00048 
00049       /** return true if the basis functions are vector-valued */
00050       bool isVectorBasis() const {return ptr_->isVectorBasis();}
00051       /** return true if the basis functions are scalar-valued */
00052       bool isScalarBasis() const {return ptr_->isScalarBasis();}
00053 
00054       /** return true if this is an empty object */
00055       bool isNull() const {return ptr_.isNull();}
00056 
00057 
00058       /** evaluate on a set of points given in reference coordinates */
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       /** get the number of nodes on a particular cell type */
00068       int nNodes(const CellTopologyCode& cellType) const
00069         {
00070           return ptr_->nNodes(cellType);
00071         }
00072 
00073 
00074       /**
00075        * assign DOF numbers for a set of function IDs on a specified cell
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        * get the DOF numbers for a set of function IDs on a specified cell.
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        * find the DOF list for one of the facets of a specified cell
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        * Find the points at the nodes. Some points may have been processed already
00108        * and are marked as inactive with the bool array. Inactive points are not
00109        * returned.
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        * Write to XML
00120        */
00121       XMLObject toXML() const {return ptr_->toXML();}
00122 
00123       /** get a hash code */
00124       int hashCode() const {return ptr_->hashCode();}
00125 
00126       /** write to a string */
00127       string toString() const {return toXML().toString();}
00128 
00129       //@}
00130     private:
00131       TSFSmartPtr<BasisFamilyBase> ptr_;
00132     };
00133 
00134   /** \relates BasisFamily write to a stream */
00135   inline ostream& operator<<(ostream& os, const BasisFamily& basis)
00136     {
00137       return os << basis.toXML();
00138     }
00139 }
00140 
00141 namespace TSF
00142 {
00143   /** \relates BasisFamily write to a string */
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 

Contact:
Kevin Long (krlong@ca.sandia.gov)


Documentation generated by