diff --git a/src/enum_scheme.cc b/src/enum_scheme.cc index ce65159cb1db92bf08c9a973d441083e4c3a0e65..6c57c032f30bcbc2ec3c7c15f4a9708355df1a3b 100644 --- a/src/enum_scheme.cc +++ b/src/enum_scheme.cc @@ -2,9 +2,6 @@ template <> struct StringToEnum<Config::scheme> { static Config::scheme convert(std::string const &s) { - if (s == "implicitEuler") - return Config::ImplicitEuler; - if (s == "newmark") return Config::Newmark; diff --git a/src/enums.hh b/src/enums.hh index 79bde17dbb83b1193ae8f87ccc2520ce222438ed..b70a0d1737ff3fe71307336995a4005c544de42f 100644 --- a/src/enums.hh +++ b/src/enums.hh @@ -7,7 +7,6 @@ struct Config { Ruina }; enum scheme { - ImplicitEuler, Newmark, EulerPair }; diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index 141eb3a2bc724f06673a99995cc8f8870e351dc6..7eaf6def4006ae8401ecccef60c87f6e2fd99b3b 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -102,11 +102,6 @@ initTimeStepper(Config::scheme scheme, VectorType const &u_initial, VectorType const &v_initial, VectorType const &a_initial) { switch (scheme) { - case Config::ImplicitEuler: - return Dune::make_shared< - ImplicitEuler<VectorType, MatrixType, FunctionType, dims>>( - stiffnessMatrix, u_initial, v_initial, velocityDirichletNodes, - velocityDirichletFunction); case Config::Newmark: return Dune::make_shared< Newmark<VectorType, MatrixType, FunctionType, dims>>( diff --git a/src/timestepping.cc b/src/timestepping.cc index 42a9b679d06f75da6e578942c398b1ddea382298..a0399257e119205ce4ea79f624f496eacc6363b0 100644 --- a/src/timestepping.cc +++ b/src/timestepping.cc @@ -8,7 +8,6 @@ #include "timestepping.hh" #include "timestepping/eulerpair.cc" -#include "timestepping/impliciteuler.cc" #include "timestepping/newmark.cc" #include "timestepping_tmpl.cc" diff --git a/src/timestepping.hh b/src/timestepping.hh index b09e6b3003a67f2493be584afacca88630122e52..4b02fdb63affbfbbf8fd0ffd57113d712e761a0c 100644 --- a/src/timestepping.hh +++ b/src/timestepping.hh @@ -16,7 +16,6 @@ class TimeSteppingScheme { void virtual extractVelocity(VectorType &velocity) const = 0; }; -#include "timestepping/impliciteuler.hh" #include "timestepping/newmark.hh" #include "timestepping/eulerpair.hh" diff --git a/src/timestepping/impliciteuler.cc b/src/timestepping/impliciteuler.cc deleted file mode 100644 index 2ae4991f8611b8258cabe42cc8002fda757164d7..0000000000000000000000000000000000000000 --- a/src/timestepping/impliciteuler.cc +++ /dev/null @@ -1,87 +0,0 @@ -template <class VectorType, class MatrixType, class FunctionType, int dim> -ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::ImplicitEuler( - MatrixType const &_A, VectorType const &_u_initial, - VectorType const &_v_initial, - Dune::BitSetVector<dim> const &_dirichletNodes, - FunctionType const &_dirichletFunction) - : A(_A), - u(_u_initial), - v(_v_initial), - dirichletNodes(_dirichletNodes), - dirichletFunction(_dirichletFunction) {} - -template <class VectorType, class MatrixType, class FunctionType, int dim> -void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() { - v_o = v; - u_o = u; -} - -template <class VectorType, class MatrixType, class FunctionType, int dim> -void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::setup( - VectorType const &ell, double _tau, double time, VectorType &problem_rhs, - VectorType &problem_iterate, MatrixType &problem_AB) { - postProcessCalled = false; - - tau = _tau; - - problem_rhs = ell; - Arithmetic::subtractProduct(problem_rhs, A, u_o); - - // For fixed tau, we'd only really have to do this once - problem_AB = A; - problem_AB *= tau; - - // v_o makes a good initial iterate; we could use anything, though - problem_iterate = v_o; - - for (size_t i = 0; i < dirichletNodes.size(); ++i) - switch (dirichletNodes[i].count()) { - case 0: - continue; - case dim: - problem_iterate[i] = 0; - dirichletFunction.evaluate(time, problem_iterate[i][0]); - break; - case 1: - if (dirichletNodes[i][0]) { - dirichletFunction.evaluate(time, problem_iterate[i][0]); - break; - } - if (dirichletNodes[i][1]) { - problem_iterate[i][1] = 0; - break; - } - assert(false); - default: - assert(false); - } -} - -template <class VectorType, class MatrixType, class FunctionType, int dim> -void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::postProcess( - VectorType const &problem_iterate) { - postProcessCalled = true; - - v = problem_iterate; - - u = u_o; - Arithmetic::addProduct(u, tau, v); -} - -template <class VectorType, class MatrixType, class FunctionType, int dim> -void ImplicitEuler<VectorType, MatrixType, FunctionType, - dim>::extractDisplacement(VectorType &displacement) const { - if (!postProcessCalled) - DUNE_THROW(Dune::Exception, "It seems you forgot to call postProcess!"); - - displacement = u; -} - -template <class VectorType, class MatrixType, class FunctionType, int dim> -void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::extractVelocity( - VectorType &velocity) const { - if (!postProcessCalled) - DUNE_THROW(Dune::Exception, "It seems you forgot to call postProcess!"); - - velocity = v; -} diff --git a/src/timestepping/impliciteuler.hh b/src/timestepping/impliciteuler.hh deleted file mode 100644 index fd0a86e34cb2bf6fd454122dfa854a6e6363ed14..0000000000000000000000000000000000000000 --- a/src/timestepping/impliciteuler.hh +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef DUNE_TECTONIC_TIMESTEPPING_IMPLICITEULER_HH -#define DUNE_TECTONIC_TIMESTEPPING_IMPLICITEULER_HH - -template <class VectorType, class MatrixType, class FunctionType, int dim> -class ImplicitEuler - : public TimeSteppingScheme<VectorType, MatrixType, FunctionType, dim> { -public: - ImplicitEuler(MatrixType const &_A, VectorType const &_u_initial, - VectorType const &_v_initial, - Dune::BitSetVector<dim> const &_dirichletNodes, - FunctionType const &_dirichletFunction); - - void virtual nextTimeStep() override; - void virtual setup(VectorType const &, double, double, VectorType &, - VectorType &, MatrixType &) override; - void virtual postProcess(VectorType const &) override; - void virtual extractDisplacement(VectorType &) const override; - void virtual extractVelocity(VectorType &) const override; - -private: - MatrixType const &A; - VectorType u; - VectorType v; - Dune::BitSetVector<dim> const &dirichletNodes; - FunctionType const &dirichletFunction; - - VectorType u_o; - VectorType v_o; - - double tau; - - bool postProcessCalled = false; -}; -#endif diff --git a/src/timestepping_tmpl.cc b/src/timestepping_tmpl.cc index 60ea4faf4d0e2cd27967a65359247af64a2b4cb5..3a6156fc2ff4c7b1cbc660390641a81173da74de 100644 --- a/src/timestepping_tmpl.cc +++ b/src/timestepping_tmpl.cc @@ -14,6 +14,5 @@ using MatrixType = Dune::BCRSMatrix<SmallMatrix>; using VectorType = Dune::BlockVector<SmallVector>; using FunctionType = Dune::VirtualFunction<double, double>; -template class ImplicitEuler<VectorType, MatrixType, FunctionType, DIM>; template class Newmark<VectorType, MatrixType, FunctionType, DIM>; template class EulerPair<VectorType, MatrixType, FunctionType, DIM>;