// ============================================================================ // == == // == AMDiS - Adaptive multidimensional simulations == // == == // ============================================================================ // == == // == TU Dresden == // == == // == Institut für Wissenschaftliches Rechnen == // == Zellescher Weg 12-14 == // == 01069 Dresden == // == germany == // == == // ============================================================================ // == == // == https://gforge.zih.tu-dresden.de/projects/amdis/ == // == == // ============================================================================ /** \file RosenbrockStationary.h */ #ifndef AMDIS_ROSENBROCKSTATIONARY_H #define AMDIS_ROSENBROCKSTATIONARY_H #include "AMDiS_fwd.h" #include "ProblemVec.h" #include "SystemVector.h" #include "time/RosenbrockMethod.h" namespace AMDiS { class RosenbrockStationary : public ProblemVec { public: class IdFunc : public AbstractFunction { public: IdFunc() : AbstractFunction(1) {} double operator()(const double& u) const { return u; } }; RosenbrockStationary(std::string name) : ProblemVec(name), first(true), minusOne(-1.0), tauPtr(NULL), tauGamma(NULL) {} DOFVector* getUnVec(int i) { return unVec->getDOFVector(i); } DOFVector* getStageSolution(int i) { return stageSolution->getDOFVector(i); } void acceptTimestep(); void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag, bool asmMatrix, bool asmVector); void solve(AdaptInfo *adaptInfo, bool fixedMatrix); void setRosenbrockMethod(RosenbrockMethod *method) { rm = method; init(); } void addOperator(Operator &op, int row, int col, double *factor = NULL, double *estFactor = NULL); void addJacobianOperator(Operator &op, int row, int col, double *factor = NULL, double *estFactor = NULL); void addTimeOperator(int i, int j); void setTau(double *ptr) { tauPtr = ptr; } void setTauGamma(double *ptr) { tauGamma = ptr; } protected: void init(); protected: RosenbrockMethod *rm; SystemVector *stageSolution, *unVec, *newUn, *tmp, *lowSol; std::vector stageSolutions; DOFVector *phiSum, *tmpDof; bool first; double minusOne; double *tauPtr; double *tauGamma; }; } #endif // AMDIS_ROSENBROCKSTATIONARY_H