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_MAXIMALQUADRATUREINTEGRAL_H
00032 #define SUNDANCE_MAXIMALQUADRATUREINTEGRAL_H
00033
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceQuadratureIntegralBase.hpp"
00036
00037 namespace Sundance
00038 {
00039
00040 using namespace Teuchos;
00041
00042
00043
00044
00045 class MaximalQuadratureIntegral : public ElementIntegral
00046 {
00047 public:
00048
00049 MaximalQuadratureIntegral(
00050 const CellType& maxCellType,
00051 const QuadratureFamily& quad,
00052 const ParametrizedCurve& globalCurve,
00053 const Mesh& mesh,
00054 int verb);
00055
00056
00057 MaximalQuadratureIntegral(
00058 const CellType& maxCellType,
00059 const BasisFamily& testBasis,
00060 int alpha,
00061 int testDerivOrder,
00062 const QuadratureFamily& quad,
00063 const ParametrizedCurve& globalCurve,
00064 const Mesh& mesh,
00065 int verb);
00066
00067
00068 MaximalQuadratureIntegral(
00069 const CellType& maxCellType,
00070 const BasisFamily& testBasis,
00071 int alpha,
00072 int testDerivOrder,
00073 const BasisFamily& unkBasis,
00074 int beta,
00075 int unkDerivOrder,
00076 const QuadratureFamily& quad,
00077 const ParametrizedCurve& globalCurve,
00078 const Mesh& mesh,
00079 int verb);
00080
00081
00082 virtual ~MaximalQuadratureIntegral(){;}
00083
00084
00085 virtual void transform(const CellJacobianBatch& JTrans,
00086 const CellJacobianBatch& JVol,
00087 const Array<int>& isLocalFlag,
00088 const Array<int>& facetNum,
00089 const RCP<Array<int> >& cellLIDs,
00090 const double* const coeff,
00091 RCP<Array<double> >& A) const
00092 {
00093 if (order()==2) transformTwoForm(JTrans, JVol, facetNum, cellLIDs,coeff, A);
00094 else if (order()==1) transformOneForm(JTrans, JVol, facetNum, cellLIDs,coeff, A);
00095 else transformZeroForm(JTrans, JVol, isLocalFlag, facetNum, cellLIDs,coeff, A);
00096 }
00097
00098
00099 virtual void transformZeroForm(const CellJacobianBatch& JTrans,
00100 const CellJacobianBatch& JVol,
00101 const Array<int>& isLocalFlag,
00102 const Array<int>& facetIndex,
00103 const RCP<Array<int> >& cellLIDs,
00104 const double* const coeff,
00105 RCP<Array<double> >& A) const ;
00106
00107
00108 virtual void transformTwoForm(const CellJacobianBatch& JTrans,
00109 const CellJacobianBatch& JVol,
00110 const Array<int>& facetIndex,
00111 const RCP<Array<int> >& cellLIDs,
00112 const double* const coeff,
00113 RCP<Array<double> >& A) const ;
00114
00115
00116 void transformOneForm(const CellJacobianBatch& JTrans,
00117 const CellJacobianBatch& JVol,
00118 const Array<int>& facetIndex,
00119 const RCP<Array<int> >& cellLIDs,
00120 const double* const coeff,
00121 RCP<Array<double> >& A) const ;
00122
00123 private:
00124
00125
00126
00127 void transformSummingFirst(int nCells,
00128 const Array<int>& facetIndex,
00129 const RCP<Array<int> >& cellLIDs,
00130 const double* const GPtr,
00131 const double* const coeff,
00132 RCP<Array<double> >& A) const ;
00133
00134
00135
00136 void transformSummingLast(int nCells,
00137 const Array<int>& facetIndex,
00138 const RCP<Array<int> >& cellLIDs,
00139 const double* const GPtr,
00140 const double* const coeff,
00141 RCP<Array<double> >& A) const ;
00142
00143
00144
00145 bool useSumFirstMethod() const {return useSumFirstMethod_;}
00146
00147
00148 inline double& wValue(int q, int testDerivDir, int testNode,
00149 int unkDerivDir, int unkNode)
00150 {return W_[unkNode
00151 + nNodesUnk()
00152 *(testNode + nNodesTest()
00153 *(unkDerivDir + nRefDerivUnk()
00154 *(testDerivDir + nRefDerivTest()*q)))];}
00155
00156
00157
00158
00159 inline const double& wValue(int facetCase,
00160 int q,
00161 int testDerivDir, int testNode,
00162 int unkDerivDir, int unkNode) const
00163 {
00164 return W_[unkNode
00165 + nNodesUnk()
00166 *(testNode + nNodesTest()
00167 *(unkDerivDir + nRefDerivUnk()
00168 *(testDerivDir + nRefDerivTest()*q)))];
00169 }
00170
00171
00172 inline double& wValue(int q, int testDerivDir, int testNode)
00173 {return W_[testNode + nNodesTest()*(testDerivDir + nRefDerivTest()*q)];}
00174
00175
00176
00177 inline const double& wValue(int q, int testDerivDir, int testNode) const
00178 {return W_[testNode + nNodesTest()*(testDerivDir + nRefDerivTest()*q)];}
00179
00180
00181 Array<double> W_;
00182
00183
00184 bool useSumFirstMethod_;
00185
00186
00187
00188 Array<Array<Array<double> > > W_ACI_F1_;
00189
00190
00191
00192 Array<Array<Array<Array<Array<double> > > > > W_ACI_F2_;
00193
00194
00195 QuadratureFamily quad_;
00196
00197
00198 Array<Point> quadPts_;
00199
00200
00201 Array<double> quadWeights_;
00202 };
00203 }
00204
00205
00206 #endif