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