#ifndef SRC_TIME_STEPPING_RATE_RATEUPDATER_HH #define SRC_TIME_STEPPING_RATE_RATEUPDATER_HH #include <memory> #include <dune/common/bitsetvector.hh> #include "../../matrices.hh" template <class Vector, class Matrix, class Function, size_t dim> class RateUpdater { protected: RateUpdater(const Matrices<Matrix>& _matrices, const std::vector<Vector>& _u_initial, const std::vector<Vector>& _v_initial, const std::vector<Vector>& _a_initial, const std::vector<Dune::BitSetVector<dim>>& _dirichletNodes, const std::vector<Function>& _dirichletFunctions); public: void nextTimeStep(); void virtual setup(Vector const &ell, double _tau, double relativeTime, Vector &rhs, Vector &iterate, Matrix &AB) = 0; void virtual postProcess(Vector const &iterate) = 0; void extractDisplacement(std::vector<Vector>& displacements) const; void extractVelocity(std::vector<Vector>& velocity) const; void extractOldVelocity(std::vector<Vector>& velocity) const; void extractAcceleration(std::vector<Vector>& acceleration) const; std::shared_ptr<RateUpdater<Vector, Matrix, Function, dim>> virtual clone() const = 0; protected: const Matrices<Matrix>& matrices; std::vector<Vector> u, v, a; const std::vector<Dune::BitSetVector<dim>>& dirichletNodes; const std::vector<Function>& dirichletFunctions; double dirichletValue; std::vector<Vector> u_o, v_o, a_o; double tau; bool postProcessCalled = true; }; #endif