00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
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
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
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
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
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