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_MAXIMALQUADRATUREINTEGRAL_H
00043 #define SUNDANCE_MAXIMALQUADRATUREINTEGRAL_H
00044
00045 #include "SundanceDefs.hpp"
00046 #include "SundanceQuadratureIntegralBase.hpp"
00047
00048 namespace Sundance
00049 {
00050
00051 using namespace Teuchos;
00052
00053
00054
00055
00056 class MaximalQuadratureIntegral : public ElementIntegral
00057 {
00058 public:
00059
00060 MaximalQuadratureIntegral(
00061 const CellType& maxCellType,
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 QuadratureFamily& quad,
00074 const ParametrizedCurve& globalCurve,
00075 const Mesh& mesh,
00076 int verb);
00077
00078
00079 MaximalQuadratureIntegral(
00080 const CellType& maxCellType,
00081 const BasisFamily& testBasis,
00082 int alpha,
00083 int testDerivOrder,
00084 const BasisFamily& unkBasis,
00085 int beta,
00086 int unkDerivOrder,
00087 const QuadratureFamily& quad,
00088 const ParametrizedCurve& globalCurve,
00089 const Mesh& mesh,
00090 int verb);
00091
00092
00093 virtual ~MaximalQuadratureIntegral(){;}
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 ;
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 ;
00125
00126
00127 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 ;
00133
00134 private:
00135
00136
00137
00138 void transformSummingFirst(int nCells,
00139 const Array<int>& facetIndex,
00140 const RCP<Array<int> >& cellLIDs,
00141 const double* const GPtr,
00142 const double* const coeff,
00143 RCP<Array<double> >& A) const ;
00144
00145
00146
00147 void transformSummingLast(int nCells,
00148 const Array<int>& facetIndex,
00149 const RCP<Array<int> >& cellLIDs,
00150 const double* const GPtr,
00151 const double* const coeff,
00152 RCP<Array<double> >& A) const ;
00153
00154
00155
00156 bool useSumFirstMethod() const {return useSumFirstMethod_;}
00157
00158
00159 inline double& wValue(int q, int testDerivDir, int testNode,
00160 int unkDerivDir, int unkNode)
00161 {return W_[unkNode
00162 + nNodesUnk()
00163 *(testNode + nNodesTest()
00164 *(unkDerivDir + nRefDerivUnk()
00165 *(testDerivDir + nRefDerivTest()*q)))];}
00166
00167
00168
00169
00170 inline const double& wValue(int facetCase,
00171 int q,
00172 int testDerivDir, int testNode,
00173 int unkDerivDir, int unkNode) const
00174 {
00175 return W_[unkNode
00176 + nNodesUnk()
00177 *(testNode + nNodesTest()
00178 *(unkDerivDir + nRefDerivUnk()
00179 *(testDerivDir + nRefDerivTest()*q)))];
00180 }
00181
00182
00183 inline double& wValue(int q, int testDerivDir, int testNode)
00184 {return W_[testNode + nNodesTest()*(testDerivDir + nRefDerivTest()*q)];}
00185
00186
00187
00188 inline const double& wValue(int q, int testDerivDir, int testNode) const
00189 {return W_[testNode + nNodesTest()*(testDerivDir + nRefDerivTest()*q)];}
00190
00191
00192 Array<double> W_;
00193
00194
00195 bool useSumFirstMethod_;
00196
00197
00198
00199 Array<Array<Array<double> > > W_ACI_F1_;
00200
00201
00202
00203 Array<Array<Array<Array<Array<double> > > > > W_ACI_F2_;
00204
00205
00206 QuadratureFamily quad_;
00207
00208
00209 Array<Point> quadPts_;
00210
00211
00212 Array<double> quadWeights_;
00213 };
00214 }
00215
00216
00217 #endif