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