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
00043 #ifndef SUNDANCE_SUMOFINTEGRALS_H
00044 #define SUNDANCE_SUMOFINTEGRALS_H
00045
00046 #include "SundanceDefs.hpp"
00047 #include "SundanceExpr.hpp"
00048 #include "SundanceScalarExpr.hpp"
00049 #include "SundanceQuadratureFamilyStub.hpp"
00050 #include "SundanceCellFilterStub.hpp"
00051 #include "SundanceOrderedHandle.hpp"
00052 #include "Teuchos_Array.hpp"
00053 #include "SundanceMap.hpp"
00054 #include "SundanceWatchFlag.hpp"
00055 #include "SundanceRegionQuadCombo.hpp"
00056 #include "SundanceParametrizedCurve.hpp"
00057
00058
00059 namespace Sundance
00060 {
00061 using namespace Sundance;
00062 using namespace Teuchos;
00063
00064 using Sundance::Map;
00065
00066 class SpatiallyConstantExpr;
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 class SumOfIntegrals : public ScalarExpr
00081 {
00082 public:
00083
00084 SumOfIntegrals(const RCP<CellFilterStub>& region,
00085 const Expr& expr,
00086 const RCP<QuadratureFamilyStub>& quad,
00087 const WatchFlag& watch);
00088
00089
00090 SumOfIntegrals(const RCP<CellFilterStub>& region,
00091 const Expr& expr,
00092 const RCP<QuadratureFamilyStub>& quad,
00093 const ParametrizedCurve& curve,
00094 const WatchFlag& watch);
00095
00096
00097 virtual ~SumOfIntegrals(){;}
00098
00099
00100 void addTerm(const RCP<CellFilterStub>& region,
00101 const Expr& expr,
00102 const RCP<QuadratureFamilyStub>& quad,
00103 const ParametrizedCurve& paramCurve,
00104 const WatchFlag& watch,
00105 int sign) ;
00106
00107
00108 void merge(const SumOfIntegrals* other, int sign) ;
00109
00110
00111 void multiplyByConstant(const SpatiallyConstantExpr* expr) ;
00112
00113
00114 void changeSign() ;
00115
00116
00117 int numRQC() const {return rqcToExprMap_.size();}
00118
00119
00120 const Sundance::Map<RegionQuadCombo, Expr>& rqcToExprMap() const
00121 {return rqcToExprMap_;}
00122
00123
00124
00125 Set<int> funcsOnRegion(const OrderedHandle<CellFilterStub>& d,
00126 const Set<int>& funcsSet) const ;
00127
00128
00129
00130 bool integralHasTestFunctions(const OrderedHandle<CellFilterStub>& d) const ;
00131
00132
00133
00134 RCP<CellFilterStub> nullRegion() const ;
00135
00136
00137
00138 virtual bool isIndependentOf(const Expr& u) const ;
00139
00140
00141
00142 virtual bool isLinearForm(const Expr& u) const ;
00143
00144
00145
00146 virtual bool isQuadraticForm(const Expr& u) const ;
00147
00148
00149
00150
00151 virtual bool isLinearInTests() const ;
00152
00153
00154
00155 virtual bool everyTermHasTestFunctions() const ;
00156
00157
00158
00159 virtual bool hasTestFunctions() const ;
00160
00161
00162
00163
00164 virtual std::ostream& toText(std::ostream& os, bool paren) const ;
00165
00166
00167
00168 virtual XMLObject toXML() const ;
00169
00170
00171 virtual RCP<ExprBase> getRcp() {return rcp(this);}
00172
00173
00174 virtual bool lessThan(const ScalarExpr* other) const ;
00175
00176
00177 bool hasWatchedTerm() const ;
00178
00179
00180 int eqnSetSetupVerb() const ;
00181
00182
00183 protected:
00184
00185 Expr filterSpectral(const Expr& ex) const ;
00186 private:
00187
00188 Sundance::Map<RegionQuadCombo, Expr> rqcToExprMap_;
00189 };
00190 }
00191
00192 #endif