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

AbstractFunctionSpace.h

Go to the documentation of this file.
00001 #ifndef ABSTRACTFUNCTIONSPACE_H
00002 #define ABSTRACTFUNCTIONSPACE_H
00003 
00004 #include "TSFDefs.h"
00005 #include "CellSet.h"
00006 #include "Expr.h"
00007 #include "Mesh.h"
00008 #include "BasisFamily.h"
00009 #include "TSFHashSet.h"
00010 #include "TSFVectorSpace.h"
00011 #include "TSFVectorType.h"
00012 #include "DistributedDOFMap.h"
00013 #include <string>
00014 
00015 namespace Sundance
00016 {
00017   using namespace TSF;
00018 
00019   using std::string;
00020 
00021   /** \ingroup LowLevelFE
00022    * An AbstractFunctionSpace describes a discretized function space
00023    * without reference to the vector type in which the values will be
00024    * stored. The createSpace() method can produce a type-specific
00025    * TSFVectorSpace object given a TSFVectorType.
00026    *
00027    */
00028 
00029   class AbstractFunctionSpace
00030     {
00031     public:
00032       /** empty ctor for use in container classes */
00033       AbstractFunctionSpace(){;}
00034 
00035       /** */
00036       AbstractFunctionSpace(const Mesh& mesh, const Expr& functions,
00037                             const TSFArray<TSFNonDupArray<CellSet> >& domains);
00038 
00039       /** */
00040       AbstractFunctionSpace(const Mesh& mesh, const BasisFamily& basis);
00041 
00042       /** */
00043       AbstractFunctionSpace(const Mesh& mesh, const CellSet& cellSet,
00044                             const BasisFamily& basis);
00045 
00046       /** */
00047       AbstractFunctionSpace(const Mesh& mesh, const TSFArray<BasisFamily>& basis);
00048 
00049       /** */
00050       AbstractFunctionSpace(const Mesh& mesh,
00051                             const TSFArray<BasisFamily>& basis,
00052                             const TSFArray<TSFNonDupArray<CellSet> >& domains);
00053 
00054       /** */
00055       AbstractFunctionSpace(const Mesh& mesh,
00056                             const TSFArray<BasisFamily>& basis,
00057                             const TSFArray<CellSet>& domains);
00058 
00059       /** */
00060       AbstractFunctionSpace(const Mesh& mesh, const CellSet& cellSet,
00061                             const TSFArray<BasisFamily>& basis);
00062 
00063       /** create a vector space object with a specified vector type */
00064       TSFVectorSpace createConcreteSpace(const TSFVectorType& vectorType) const ;
00065       /** create a vector space object with a specified vector type */
00066       TSFVectorSpace createSundanceSpace(const TSFVectorType& vectorType) const ;
00067 
00068       /** test equality */
00069       bool operator==(const AbstractFunctionSpace& other) const ;
00070 
00071       /** return the mesh */
00072       const Mesh& mesh() const {return mesh_;}
00073 
00074       /** return the basis family used by the f-th function */
00075       const BasisFamily& basis(int f) const {return basis_[f];}
00076 
00077       /** return the list of cell sets on which the f-th function
00078        * is defined */
00079       const TSFNonDupArray<CellSet>& domains(int f) const {return domains_[f];}
00080 
00081       /** return the DOF map for this space */
00082       const TSFSmartPtr<DOFMapBase>& map() const {return map_;}
00083 
00084       /** write to XML */
00085       XMLObject toXML() const ;
00086 
00087       /** return a hash code for the space */
00088       int hashCode() const ;
00089 
00090       /** write to a string */
00091       string toString() const {return "AbstractFunctionSpace";}
00092 
00093       /** return the number of functions */
00094       int nFunc() const {return basis_.length();}
00095     private:
00096 
00097       /** */
00098       void createMap();
00099 
00100       /* */
00101       int id_;
00102       /* */
00103       Mesh mesh_;
00104       /* */
00105       TSFArray<BasisFamily> basis_;
00106       /* */
00107       TSFArray<TSFNonDupArray<CellSet> > domains_;
00108       /* */
00109       TSFSmartPtr<DOFMapBase> map_;
00110 
00111       /* */
00112       static TSFHashtable<AbstractFunctionSpace, TSFSmartPtr<DOFMapBase> >& existingMaps();
00113 
00114       static int idCounter();
00115     };
00116 
00117 }
00118 
00119 namespace TSF
00120 {
00121   /** \relates AbstractFunctionSpace return hash code for an
00122    * AbstractFunctionSpace */
00123   inline int hashCode(const Sundance::AbstractFunctionSpace& space)
00124     {
00125       return space.hashCode();
00126     }
00127 
00128   /** \relates AbstractFunctionSpace write to string */
00129   inline string toString(const Sundance::AbstractFunctionSpace& space)
00130     {
00131       return space.toString();
00132     }
00133 }
00134 #endif

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


Documentation generated by