Go to the documentation of this file.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_ELEMENTINTEGRAL_H
00043 #define SUNDANCE_ELEMENTINTEGRAL_H
00044
00045 #include "SundanceDefs.hpp"
00046 #include "SundanceCellJacobianBatch.hpp"
00047 #include "SundanceQuadratureFamily.hpp"
00048 #include "SundanceBasisFamily.hpp"
00049 #include "SundanceParametrizedCurve.hpp"
00050 #include "SundanceMesh.hpp"
00051 #include "Teuchos_Array.hpp"
00052
00053
00054 namespace Sundance
00055 {
00056 using namespace Sundance;
00057 using namespace Teuchos;
00058
00059
00060
00061
00062
00063 class ElementIntegral
00064 {
00065 public:
00066
00067 ElementIntegral(int spatialDim,
00068 const CellType& maxCellType,
00069 int dim,
00070 const CellType& cellType,
00071 bool isInternalBdry,
00072 const ParametrizedCurve& globalCurve,
00073 const Mesh& mesh,
00074 int verb);
00075
00076
00077 ElementIntegral(int spatialDim,
00078 const CellType& maxCellType,
00079 int dim,
00080 const CellType& cellType,
00081 const BasisFamily& testBasis,
00082 int alpha,
00083 int testDerivOrder,
00084 bool isInternalBdry,
00085 const ParametrizedCurve& globalCurve,
00086 const Mesh& mesh,
00087 int verb);
00088
00089
00090 ElementIntegral(int spatialDim,
00091 const CellType& maxCellType,
00092 int dim,
00093 const CellType& cellType,
00094 const BasisFamily& testBasis,
00095 int alpha,
00096 int testDerivOrder,
00097 const BasisFamily& unkBasis,
00098 int beta,
00099 int unkDerivOrder,
00100 bool isInternalBdry,
00101 const ParametrizedCurve& globalCurve,
00102 const Mesh& mesh,
00103 int verb);
00104
00105
00106 virtual ~ElementIntegral(){;}
00107
00108
00109
00110 int order() const {return order_;}
00111
00112
00113 int nNodesTest() const {return nNodesTest_;}
00114
00115
00116 int nNodesUnk() const {return nNodesUnk_;}
00117
00118
00119
00120 int nNodes() const {return nNodes_;}
00121
00122
00123
00124
00125 int nFacetCases() const {return nFacetCases_;}
00126
00127
00128 bool isInternalBdry() const {return isInternalBdry_;}
00129
00130
00131 static bool& alwaysUseCofacets();
00132
00133
00134 void setVerb(
00135 int integrationVerb,
00136 int transformVerb);
00137
00138
00139 int setupVerb() const {return setupVerb_;}
00140
00141
00142 int integrationVerb() const {return integrationVerb_;}
00143
00144
00145 int transformVerb() const {return transformVerb_;}
00146
00147
00148 void describe(std::ostream& os) const ;
00149
00150
00151 static int& transformationMatrixIsValid(int alpha);
00152
00153
00154
00155 static int& transformationMatrixIsValid(int alpha, int beta);
00156
00157
00158 static void invalidateTransformationMatrices();
00159
00160
00161 static double& totalFlops() {static double rtn = 0; return rtn;}
00162
00163 BasisFamily &getTestBasis() { return testBasis_; }
00164 BasisFamily &getUnknownBasis() { return unkBasis_; }
00165
00166 protected:
00167
00168
00169 void assertBilinearForm() const ;
00170
00171
00172 void assertLinearForm() const ;
00173
00174
00175 static void addFlops(const double& flops) {totalFlops() += flops;}
00176
00177
00178 int dim() const {return dim_;}
00179
00180
00181 int spatialDim() const {return spatialDim_;}
00182
00183
00184
00185
00186 int nRefDerivTest() const {return nRefDerivTest_;}
00187
00188
00189
00190
00191 int nRefDerivUnk() const {return nRefDerivUnk_;}
00192
00193
00194
00195 int testDerivOrder() const {return testDerivOrder_;}
00196
00197
00198
00199 int unkDerivOrder() const {return unkDerivOrder_;}
00200
00201
00202 int alpha() const {return alpha_;}
00203
00204
00205 int beta() const {return beta_;}
00206
00207
00208 const CellType& cellType() const {return cellType_;}
00209
00210
00211 const CellType& maxCellType() const {return maxCellType_;}
00212
00213
00214 const CellType& evalCellType() const {return evalCellType_;}
00215
00216
00217 const BasisFamily& testBasis() const {return testBasis_;}
00218
00219
00220 const BasisFamily& unkBasis() const {return unkBasis_;}
00221
00222
00223 static Array<double>& G(int gamma) ;
00224
00225
00226 static Array<double>& G(int gamma, int delta) ;
00227
00228
00229 static int ipow(int base, int power);
00230
00231
00232 static double chopVal() {static double rtn=1.0e-14; return rtn;}
00233
00234
00235
00236 static double chop(const double& x)
00237 {
00238 if (::fabs(x) > chopVal()) return x;
00239 else return 0.0;
00240 }
00241
00242
00243 void getQuad(const QuadratureFamily& quad, int evalCase,
00244 Array<Point>& quadPts, Array<double>& quadWeights) const ;
00245
00246
00247 void createTwoFormTransformationMatrix(const CellJacobianBatch& JTrans,
00248 const CellJacobianBatch& JVol) const;
00249
00250 void createOneFormTransformationMatrix(const CellJacobianBatch& JTrans,
00251 const CellJacobianBatch& JVol) const;
00252
00253
00254 const Mesh& mesh() const {return mesh_;}
00255
00256
00257 const ParametrizedCurve& globalCurve() const {return globalCurve_;}
00258
00259 private:
00260
00261 int setupVerb_;
00262 int integrationVerb_;
00263 int transformVerb_;
00264
00265 int spatialDim_;
00266
00267 int dim_;
00268
00269 bool isInternalBdry_;
00270
00271 int nFacetCases_;
00272
00273 int testDerivOrder_;
00274
00275 int nRefDerivTest_;
00276
00277 int nNodesTest_;
00278
00279 int unkDerivOrder_;
00280
00281 int nRefDerivUnk_;
00282
00283 int nNodesUnk_;
00284
00285 int nNodes_;
00286
00287 int order_;
00288
00289 int alpha_;
00290
00291 int beta_;
00292
00293 CellType cellType_;
00294
00295 CellType maxCellType_;
00296
00297 CellType evalCellType_;
00298
00299 BasisFamily testBasis_;
00300
00301 BasisFamily unkBasis_;
00302
00303
00304 const ParametrizedCurve globalCurve_;
00305
00306
00307 const Mesh mesh_;
00308
00309 };
00310 }
00311
00312
00313 #endif