SundanceBasisFamilyBase.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 // ************************************************************************
00003 // 
00004 //                             Sundance
00005 //                 Copyright 2011 Sandia Corporation
00006 // 
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Kevin Long (kevin.long@ttu.edu)
00038 // 
00039 
00040 /* @HEADER@ */
00041 
00042 #ifndef SUNDANCE_BASISFAMILYBASE_H
00043 #define SUNDANCE_BASISFAMILYBASE_H
00044 
00045 #include "SundanceCellJacobianBatch.hpp"
00046 #include "SundanceDefs.hpp"
00047 #include "SundanceBasisDOFTopologyBase.hpp"
00048 #include "SundanceTensorBasisBase.hpp"
00049 #include "SundanceBasisReferenceEvaluationBase.hpp"
00050 #include "PlayaHandleable.hpp"
00051 #include "SundanceMesh.hpp"
00052 #include "PlayaPrintable.hpp"
00053 #include "SundanceObjectWithVerbosity.hpp"
00054 #include "SundanceTypeUtils.hpp"
00055 #include "Teuchos_XMLObject.hpp"
00056 
00057 namespace Sundance {
00058 
00059 using namespace Teuchos;
00060 
00061 
00062 /** 
00063  *
00064  */
00065 class BasisFamilyBase
00066   : public Playa::Handleable<BasisFamilyBase>,
00067     public Playa::Printable,
00068     public ObjectWithClassVerbosity<BasisFamilyBase>,
00069     public BasisDOFTopologyBase,
00070     public TensorBasisBase,
00071     public BasisReferenceEvaluationBase
00072 {
00073 public:
00074 
00075   /** */
00076   virtual int order() const = 0 ;
00077 
00078   /** */
00079   virtual bool lessThan(const BasisDOFTopologyBase* other) const ;
00080 
00081   /** \brief Indicates whether mapping the basis requires an additional
00082       correction */
00083   virtual bool requiresBasisTransformation() const { return false; }
00084   /** \brief Default transformation does nothing */
00085   virtual void preApplyTransformation( const CellType &maxCellType ,
00086                const Mesh &mesh,
00087                const Array<int> &cellLIDs,
00088                const CellJacobianBatch& JVol,
00089                RCP<Array<double> >& A
00090                ) const {;}
00091   /** \brief Default transformation does nothing */
00092   virtual void postApplyTransformation( const CellType &maxCellType ,
00093                const Mesh &mesh,
00094                const Array<int> &cellLIDs,
00095           const CellJacobianBatch& JVol,
00096           RCP<Array<double> >& A
00097           ) const {;}
00098   /** \brief Default transformation does nothing */
00099   virtual void preApplyTransformationTranspose( const CellType &maxCellType ,
00100             const Mesh &mesh,
00101             const Array<int> &cellLIDs,
00102             const CellJacobianBatch& JVol,
00103             Array<double>& A ) const {;}
00104 
00105 };
00106 
00107 
00108 /* ----- Subtypes of BasisFamilyBase that specify transformation type --- */
00109 
00110 /**     
00111  * Base class for scalar-valued basis families. Bases for scalar
00112  * fields living in, e.g., H1 or L2, should derive from this class. 
00113  */
00114 class ScalarBasis 
00115   : public BasisFamilyBase
00116 {
00117 public:
00118   /** Inform caller that my tensor order is zero */
00119   int tensorOrder() const {return 0;}
00120 
00121   /** Inform caller that I am a scalar basis */
00122   bool isScalarBasis() const {return true;}
00123   
00124    /** Return the dimension of the members of a scalar-valued basis  */
00125   int dim() const {return 1;}
00126 };
00127 
00128 /** */
00129 class VectorBasis
00130   : public BasisFamilyBase
00131 {
00132 public:
00133   /** */
00134   VectorBasis(int dim) : dim_(dim) {}
00135   /** Inform caller that my tensor order is one */
00136   int tensorOrder() const {return 1;}
00137 
00138    /** Return the dimension of the members of a scalar-valued basis  */
00139   int dim() const {return dim_;}
00140 
00141 private:
00142   int dim_;
00143 };
00144 
00145 
00146 /** 
00147  * Base class for bases living in H(div) 
00148  */
00149 class HDivVectorBasis
00150   : public VectorBasis
00151 {
00152 public:
00153   /** */
00154   HDivVectorBasis(int dim) : VectorBasis(dim) {}
00155   
00156   /** Inform caller that I am an H(div) basis */
00157   bool isHDivBasis() const {return true;}
00158 
00159 };
00160 
00161 /** 
00162  * Base class for bases living in H(curl) 
00163  */
00164 class HCurlVectorBasis
00165   : public VectorBasis
00166 {
00167 public:
00168   /** */
00169   HCurlVectorBasis(int dim) : VectorBasis(dim) {}
00170 
00171   /** Inform caller that I am an H(curl) basis */
00172   bool isHCurlBasis() const {return true;}
00173 
00174 };
00175 
00176 
00177 
00178 
00179 } // namespace Sundance
00180 
00181 
00182 #endif

Site Contact