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_REFINTEGRAL_H
00043 #define SUNDANCE_REFINTEGRAL_H
00044
00045 #include "SundanceDefs.hpp"
00046 #include "SundanceElementIntegral.hpp"
00047
00048
00049 namespace Sundance
00050 {
00051
00052 using namespace Teuchos;
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 class RefIntegral : public ElementIntegral
00089 {
00090 public:
00091
00092 RefIntegral(int spatialDim,
00093 const CellType& maxCellType,
00094 int dim,
00095 const CellType& cellType,
00096 const QuadratureFamily& quad_in,
00097 bool isInternalBdry,
00098 const ParametrizedCurve& globalCurve,
00099 const Mesh& mesh,
00100 int verb);
00101
00102
00103 RefIntegral(int spatialDim,
00104 const CellType& maxCellType,
00105 int dim,
00106 const CellType& cellType,
00107 const BasisFamily& testBasis,
00108 int alpha,
00109 int testDerivOrder,
00110 const QuadratureFamily& quad_in,
00111 bool isInternalBdry,
00112 const ParametrizedCurve& globalCurve,
00113 const Mesh& mesh,
00114 int verb);
00115
00116
00117 RefIntegral(int spatialDim,
00118 const CellType& maxCellType,
00119 int dim,
00120 const CellType& cellType,
00121 const BasisFamily& testBasis,
00122 int alpha,
00123 int testDerivOrder,
00124 const BasisFamily& unkBasis,
00125 int beta,
00126 int unkDerivOrder,
00127 const QuadratureFamily& quad_in,
00128 bool isInternalBdry,
00129 const ParametrizedCurve& globalCurve,
00130 const Mesh& mesh,
00131 int verb);
00132
00133
00134 virtual ~RefIntegral(){;}
00135
00136
00137 void print(std::ostream& os) const ;
00138
00139
00140 void transform(const CellJacobianBatch& JTrans,
00141 const CellJacobianBatch& JVol,
00142 const Array<int>& isLocalFlag,
00143 const Array<int>& facetNum,
00144 const RCP<Array<int> >& cellLIDs,
00145 const double& coeff,
00146 RCP<Array<double> >& A) const
00147 {
00148 if (order()==2) transformTwoForm(JTrans, JVol, facetNum, cellLIDs, coeff, A);
00149 else if (order()==1) transformOneForm(JTrans, JVol, facetNum, cellLIDs, coeff, A);
00150 else transformZeroForm(JVol, isLocalFlag, cellLIDs, coeff, A);
00151 }
00152
00153
00154 void transformTwoForm(const CellJacobianBatch& JTrans,
00155 const CellJacobianBatch& JVol,
00156 const Array<int>& facetNum,
00157 const RCP<Array<int> >& cellLIDs,
00158 const double& coeff,
00159 RCP<Array<double> >& A) const ;
00160
00161
00162 void transformOneForm(const CellJacobianBatch& JTrans,
00163 const CellJacobianBatch& JVol,
00164 const Array<int>& facetNum,
00165 const RCP<Array<int> >& cellLIDs,
00166 const double& coeff,
00167 RCP<Array<double> >& A) const ;
00168
00169
00170 void transformZeroForm(const CellJacobianBatch& JVol,
00171 const Array<int>& isLocalFlag,
00172 const RCP<Array<int> >& cellLIDs,
00173 const double& coeff,
00174 RCP<Array<double> >& A) const ;
00175
00176
00177 inline double& value(int facetCase, int testDerivDir, int testNode,
00178 int unkDerivDir, int unkNode)
00179 {return W_[facetCase][unkNode + nNodesUnk()*testNode
00180 + nNodes()*(unkDerivDir
00181 + nRefDerivUnk()*testDerivDir)];}
00182
00183
00184 inline const double& value(int facetCase,
00185 int testDerivDir, int testNode,
00186 int unkDerivDir, int unkNode) const
00187 {
00188 return W_[facetCase][unkNode + nNodesUnk()*testNode
00189 + nNodes()*(unkDerivDir
00190 + nRefDerivUnk()*testDerivDir)];
00191 }
00192
00193
00194 inline double& value(int facetCase, int testDerivDir, int testNode)
00195 {return W_[facetCase][nNodesTest()*testDerivDir + testNode];}
00196
00197
00198 inline const double& value(int facetCase,
00199 int testDerivDir, int testNode) const
00200 {return W_[facetCase][nNodesTest()*testDerivDir + testNode];}
00201
00202 static double& totalFlops() {static double rtn = 0; return rtn;}
00203
00204 protected:
00205
00206 static void addFlops(const double& flops) {totalFlops() += flops;}
00207
00208 private:
00209
00210 Array<Array<double> > W_;
00211
00212
00213
00214 Array<Array<Array<Array<double> > > > W_ACI_F1_;
00215
00216
00217
00218 Array<Array<Array<Array<Array<Array<double> > > > > > W_ACI_F2_;
00219
00220
00221 QuadratureFamily quad_;
00222
00223
00224 Array<Point> quadPts_;
00225
00226
00227 Array<double> quadWeights_;
00228 };
00229 }
00230
00231 #endif