diff --git a/src/timestepping.hh b/src/timestepping.hh index fe88bcc0956b3d6f5cc6f3af52e1011a5bc5198d..f2ee1f8396389051eee223a23c7c75e72c186473 100644 --- a/src/timestepping.hh +++ b/src/timestepping.hh @@ -14,6 +14,7 @@ class TimeSteppingScheme { void virtual postProcess(Vector const &iterate) = 0; void virtual extractDisplacement(Vector &displacement) const = 0; void virtual extractVelocity(Vector &velocity) const = 0; + void virtual extractOldVelocity(Vector &velocity) const = 0; }; #include "timestepping/newmark.hh" diff --git a/src/timestepping/backward_euler.cc b/src/timestepping/backward_euler.cc index 981483c55dfcfd597183f566dd1db32c03e57ec2..6e14784a79e400e9774ba29a736dbc96e5f5bc03 100644 --- a/src/timestepping/backward_euler.cc +++ b/src/timestepping/backward_euler.cc @@ -108,3 +108,9 @@ void BackwardEuler<Vector, Matrix, Function, dim>::extractVelocity( velocity = v; } + +template <class Vector, class MatrixType, class FunctionType, size_t dim> +void BackwardEuler<Vector, MatrixType, FunctionType, dim>::extractOldVelocity( + Vector &velocity) const { + velocity = v_o; +} diff --git a/src/timestepping/backward_euler.hh b/src/timestepping/backward_euler.hh index aa80baa67e9e336ff473f422d0f8d9bdbee7c8ab..c598c8ffb75a42ef3808baa7e3ace8592c81176b 100644 --- a/src/timestepping/backward_euler.hh +++ b/src/timestepping/backward_euler.hh @@ -15,6 +15,7 @@ class BackwardEuler : public TimeSteppingScheme<Vector, Matrix, Function, dim> { void postProcess(Vector const &) override; void extractDisplacement(Vector &) const override; void extractVelocity(Vector &) const override; + void extractOldVelocity(Vector &) const override; private: Matrix const &A; diff --git a/src/timestepping/newmark.cc b/src/timestepping/newmark.cc index 91dfa0e043fccec3f7cdb729516b8b738e9ef308..b6f90e31dc3c2a9afaf62499019e68d4cdd41dea 100644 --- a/src/timestepping/newmark.cc +++ b/src/timestepping/newmark.cc @@ -123,3 +123,9 @@ void Newmark<Vector, Matrix, Function, dim>::extractVelocity(Vector &velocity) velocity = v; } + +template <class Vector, class MatrixType, class FunctionType, size_t dim> +void Newmark<Vector, MatrixType, FunctionType, dim>::extractOldVelocity( + Vector &velocity) const { + velocity = v_o; +} diff --git a/src/timestepping/newmark.hh b/src/timestepping/newmark.hh index 14a4632e5bf161033b230c8405fac8fe41041026..0d5774d6d76c324ea18951c9f336a827793ffd28 100644 --- a/src/timestepping/newmark.hh +++ b/src/timestepping/newmark.hh @@ -16,6 +16,7 @@ class Newmark : public TimeSteppingScheme<Vector, Matrix, Function, dim> { void postProcess(Vector const &) override; void extractDisplacement(Vector &) const override; void extractVelocity(Vector &) const override; + void extractOldVelocity(Vector &) const override; private: Matrix const &A;