Go to the documentation of this file.00001 #ifndef utility_hh
00002 #define utility_hh
00003
00004 #include "linDG3D/space.hh"
00005 #include "linDG3D/elementPair.hh"
00006 #include "function/vector.hh"
00007 #include "toolbox/scannerConnectors.hh"
00008 #include "operator/compositions.hh"
00009 #include "advection.hh"
00010
00011 #define DEBUG_NORM_BROL1 0
00012
00013 using concepts::Real;
00014
00015
00016
00020 class Norm
00021 {
00022 public:
00027 static Real max(const linDG3D::FvdgSpace& spc,
00028 const concepts::Vector<Real>& coeffs);
00033 static Real matrix(const concepts::Vector<Real>& coeffs,
00034 concepts::Operator<Real>& matrix);
00042 static Real broMax(const linDG3D::FvdgSpace& spc,
00043 const concepts::Vector<Real>& coeffs,
00044 concepts::Formula<Real>& frm, Real time);
00053 static Real broL1(const linDG3D::FvdgSpace& spc,
00054 const concepts::Vector<Real>& coeffs,
00055 concepts::Formula<Real>& frm, Real time);
00065 static Real broL2Grad(const linDG3D::FvdgSpace& spc,
00066 const concepts::Vector<Real>& coeffs,
00067 concepts::Formula<Real>& gradX,
00068 concepts::Formula<Real>& gradY,
00069 concepts::Formula<Real>& gradZ);
00070 private:
00072 Norm() {};
00073 };
00074
00075
00076
00080 template <typename T>
00081 class TimestepEstimator {
00082 public:
00087 TimestepEstimator(const linDG3D::FvdgSpace& spc, const Real c) :
00088 spc_(spc), fluxFct_(), c_(c) {};
00092 Real operator()(const concepts::Vector<Real>& sol) const;
00093 Real testOld(const concepts::Vector<Real>& sol) const;
00094 private:
00095 const linDG3D::FvdgSpace& spc_;
00096 const T fluxFct_;
00097 const Real c_;
00098 };
00099
00100
00101
00106 class TimestepEstimatorParabolic {
00107 public:
00111 TimestepEstimatorParabolic(const Real c) : c_(c) {};
00115 Real operator()(const linDG3D::FvdgSpace& spc) const;
00116 private:
00117 const Real c_;
00118 };
00119
00120
00121
00122 class NodalBurgerError {
00123 private:
00124 concepts::Formula<Real>& initCondition_;
00126 linDG3D::FvdgSpace& spc_;
00128 concepts::Real3d normal_;
00129 public:
00131 NodalBurgerError(concepts::Formula<Real>& initCondition,
00132 linDG3D::FvdgSpace& spc) :
00133 initCondition_(initCondition),
00134 spc_(spc),
00135 normal_(concepts::Real3d(1., 1., 1.)) {}
00136
00147 void operator() (const concepts::Vector<Real>& sol,
00148 concepts::Array<Real>& error,
00149 Real time);
00150 };
00151
00152 #endif // utility_hh