SundanceBasisFamilyBase.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 // ************************************************************************
00003 // 
00004 //                              Sundance
00005 //                 Copyright (2005) Sandia Corporation
00006 // 
00007 // Copyright (year first published) Sandia Corporation.  Under the terms 
00008 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 
00009 // retains certain rights in this software.
00010 // 
00011 // This library is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Lesser General Public License as
00013 // published by the Free Software Foundation; either version 2.1 of the
00014 // License, or (at your option) any later version.
00015 //  
00016 // This library is distributed in the hope that it will be useful, but
00017 // WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 //                                                                                 
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 // USA                                                                                
00025 // Questions? Contact Kevin Long (krlong@sandia.gov), 
00026 // Sandia National Laboratories, Livermore, California, USA
00027 // 
00028 // ************************************************************************
00029 /* @HEADER@ */
00030 
00031 #ifndef SUNDANCE_BASISFAMILYBASE_H
00032 #define SUNDANCE_BASISFAMILYBASE_H
00033 
00034 #include "SundanceCellJacobianBatch.hpp"
00035 #include "SundanceDefs.hpp"
00036 #include "SundanceBasisDOFTopologyBase.hpp"
00037 #include "SundanceTensorBasisBase.hpp"
00038 #include "SundanceBasisReferenceEvaluationBase.hpp"
00039 #include "PlayaHandleable.hpp"
00040 #include "SundanceMesh.hpp"
00041 #include "PlayaPrintable.hpp"
00042 #include "SundanceObjectWithVerbosity.hpp"
00043 #include "SundanceTypeUtils.hpp"
00044 #include "Teuchos_XMLObject.hpp"
00045 
00046 namespace Sundance {
00047 
00048 using namespace Teuchos;
00049 
00050 
00051 /** 
00052  *
00053  */
00054 class BasisFamilyBase
00055   : public Playa::Handleable<BasisFamilyBase>,
00056     public Playa::Printable,
00057     public ObjectWithClassVerbosity<BasisFamilyBase>,
00058     public BasisDOFTopologyBase,
00059     public TensorBasisBase,
00060     public BasisReferenceEvaluationBase
00061 {
00062 public:
00063 
00064   /** */
00065   virtual int order() const = 0 ;
00066 
00067   /** */
00068   virtual bool lessThan(const BasisDOFTopologyBase* other) const ;
00069 
00070   /** \brief Indicates whether mapping the basis requires an additional
00071       correction */
00072   virtual bool requiresBasisTransformation() const { return false; }
00073   /** \brief Default transformation does nothing */
00074   virtual void preApplyTransformation( const CellType &maxCellType ,
00075                const Mesh &mesh,
00076                const Array<int> &cellLIDs,
00077                const CellJacobianBatch& JVol,
00078                RCP<Array<double> >& A
00079                ) const {;}
00080   /** \brief Default transformation does nothing */
00081   virtual void postApplyTransformation( const CellType &maxCellType ,
00082                const Mesh &mesh,
00083                const Array<int> &cellLIDs,
00084           const CellJacobianBatch& JVol,
00085           RCP<Array<double> >& A
00086           ) const {;}
00087   /** \brief Default transformation does nothing */
00088   virtual void preApplyTransformationTranspose( const CellType &maxCellType ,
00089             const Mesh &mesh,
00090             const Array<int> &cellLIDs,
00091             const CellJacobianBatch& JVol,
00092             Array<double>& A ) const {;}
00093 
00094 };
00095 
00096 
00097 /* ----- Subtypes of BasisFamilyBase that specify transformation type --- */
00098 
00099 /**     
00100  * Base class for scalar-valued basis families. Bases for scalar
00101  * fields living in, e.g., H1 or L2, should derive from this class. 
00102  */
00103 class ScalarBasis 
00104   : public BasisFamilyBase
00105 {
00106 public:
00107   /** Inform caller that my tensor order is zero */
00108   int tensorOrder() const {return 0;}
00109 
00110   /** Inform caller that I am a scalar basis */
00111   bool isScalarBasis() const {return true;}
00112   
00113    /** Return the dimension of the members of a scalar-valued basis  */
00114   int dim() const {return 1;}
00115 };
00116 
00117 /** */
00118 class VectorBasis
00119   : public BasisFamilyBase
00120 {
00121 public:
00122   /** */
00123   VectorBasis(int dim) : dim_(dim) {}
00124   /** Inform caller that my tensor order is one */
00125   int tensorOrder() const {return 1;}
00126 
00127    /** Return the dimension of the members of a scalar-valued basis  */
00128   int dim() const {return dim_;}
00129 
00130 private:
00131   int dim_;
00132 };
00133 
00134 
00135 /** 
00136  * Base class for bases living in H(div) 
00137  */
00138 class HDivVectorBasis
00139   : public VectorBasis
00140 {
00141 public:
00142   /** */
00143   HDivVectorBasis(int dim) : VectorBasis(dim) {}
00144   
00145   /** Inform caller that I am an H(div) basis */
00146   bool isHDivBasis() const {return true;}
00147 
00148 };
00149 
00150 /** 
00151  * Base class for bases living in H(curl) 
00152  */
00153 class HCurlVectorBasis
00154   : public VectorBasis
00155 {
00156 public:
00157   /** */
00158   HCurlVectorBasis(int dim) : VectorBasis(dim) {}
00159 
00160   /** Inform caller that I am an H(curl) basis */
00161   bool isHCurlBasis() const {return true;}
00162 
00163 };
00164 
00165 
00166 
00167 
00168 } // namespace Sundance
00169 
00170 
00171 #endif

Site Contact