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