SundanceQuadratureIntegralBase.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_QUADRATUREINTEGRALBASE_H
00032 #define SUNDANCE_QUADRATUREINTEGRALBASE_H
00033 
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceElementIntegral.hpp"
00036 
00037 namespace Sundance
00038 {
00039 using namespace Teuchos;
00040     
00041 /** 
00042  *  
00043  *
00044  */
00045 class QuadratureIntegralBase
00046   : public ElementIntegral
00047 {
00048 public:
00049 
00050   /** Construct a zero form to be computed by quadrature */
00051   QuadratureIntegralBase(int spatialDim,
00052     const CellType& maxCellType,
00053     int dim, 
00054     const CellType& cellType,
00055     const QuadratureFamily& quad,
00056     bool isInternalBdry,
00057     const ParametrizedCurve& globalCurve,
00058     const Mesh& mesh,
00059     int verb);
00060 
00061   /** Construct a one form to be computed by quadrature */
00062   QuadratureIntegralBase(int spatialDim,
00063     const CellType& maxCellType,
00064     int dim, 
00065     const CellType& cellType,
00066     const BasisFamily& testBasis,
00067     int alpha,
00068     int testDerivOrder,
00069     const QuadratureFamily& quad,
00070     bool isInternalBdry,
00071     const ParametrizedCurve& globalCurve,
00072     const Mesh& mesh,
00073     int verb);
00074       
00075   /** Construct a two-form to be computed by quadrature */
00076   QuadratureIntegralBase(int spatialDim,
00077     const CellType& maxCellType,
00078     int dim,
00079     const CellType& cellType,
00080     const BasisFamily& testBasis,
00081     int alpha,
00082     int testDerivOrder,
00083     const BasisFamily& unkBasis,
00084     int beta,
00085     int unkDerivOrder,
00086     const QuadratureFamily& quad,
00087     bool isInternalBdry,
00088     const ParametrizedCurve& globalCurve,
00089     const Mesh& mesh,
00090     int verb);
00091       
00092   /** virtual dtor */
00093   virtual ~QuadratureIntegralBase(){;}
00094       
00095      /** */
00096   virtual void transform(const CellJacobianBatch& JTrans,
00097     const CellJacobianBatch& JVol,
00098     const Array<int>& isLocalFlag,
00099     const Array<int>& facetNum,
00100     const RCP<Array<int> >& cellLIDs,
00101     const double* const coeff,
00102     RCP<Array<double> >& A) const 
00103     {
00104       if (order()==2) transformTwoForm(JTrans, JVol, facetNum, cellLIDs,coeff, A);
00105       else if (order()==1) transformOneForm(JTrans, JVol, facetNum, cellLIDs,coeff, A);
00106       else transformZeroForm(JTrans, JVol, isLocalFlag, facetNum, cellLIDs,coeff, A);
00107     }
00108       
00109   /** */
00110   virtual void transformZeroForm(const CellJacobianBatch& JTrans,
00111     const CellJacobianBatch& JVol,
00112     const Array<int>& isLocalFlag,
00113     const Array<int>& facetIndex,
00114     const RCP<Array<int> >& cellLIDs,
00115     const double* const coeff,
00116     RCP<Array<double> >& A) const = 0;
00117       
00118   /** */
00119   virtual void transformTwoForm(const CellJacobianBatch& JTrans,
00120     const CellJacobianBatch& JVol,
00121     const Array<int>& facetIndex,
00122     const RCP<Array<int> >& cellLIDs,
00123     const double* const coeff,
00124     RCP<Array<double> >& A) const = 0;
00125       
00126   /** */
00127   virtual void transformOneForm(const CellJacobianBatch& JTrans,
00128     const CellJacobianBatch& JVol,
00129     const Array<int>& facetIndex,
00130     const RCP<Array<int> >& cellLIDs,
00131     const double* const coeff,
00132     RCP<Array<double> >& A) const = 0;
00133       
00134       
00135   /** */
00136   virtual int nQuad() const {return nQuad_;}
00137       
00138   static double& totalFlops() {static double rtn = 0; return rtn;}
00139 
00140 protected:
00141   static void addFlops(const double& flops) {totalFlops() += flops;}
00142       
00143   const QuadratureFamily& quad() const {return quad_;}
00144   /** */
00145   int nQuad_ ;
00146 
00147 private:
00148 
00149   /* */
00150   QuadratureFamily quad_;
00151       
00152 };
00153 
00154 }
00155 
00156 
00157 #endif

Site Contact