diff --git a/src/enum_scheme.cc b/src/enum_scheme.cc index 6c57c032f30bcbc2ec3c7c15f4a9708355df1a3b..0327b5419c15b64b890adfa5133cdfb482fc94ae 100644 --- a/src/enum_scheme.cc +++ b/src/enum_scheme.cc @@ -5,8 +5,8 @@ template <> struct StringToEnum<Config::scheme> { if (s == "newmark") return Config::Newmark; - if (s == "eulerPair") - return Config::EulerPair; + if (s == "backwardEuler") + return Config::BackwardEuler; DUNE_THROW(Dune::Exception, "failed to parse enum"); } diff --git a/src/enums.hh b/src/enums.hh index b70a0d1737ff3fe71307336995a4005c544de42f..1c8a7a85ea54be2bd0a23c8a1280194fae9386f9 100644 --- a/src/enums.hh +++ b/src/enums.hh @@ -8,7 +8,7 @@ struct Config { }; enum scheme { Newmark, - EulerPair + BackwardEuler }; }; #endif diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index 7eaf6def4006ae8401ecccef60c87f6e2fd99b3b..11ce67d854e95d5945fd47dc7681a964b310d563 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -107,9 +107,9 @@ initTimeStepper(Config::scheme scheme, Newmark<VectorType, MatrixType, FunctionType, dims>>( stiffnessMatrix, massMatrix, u_initial, v_initial, a_initial, velocityDirichletNodes, velocityDirichletFunction); - case Config::EulerPair: + case Config::BackwardEuler: return Dune::make_shared< - EulerPair<VectorType, MatrixType, FunctionType, dims>>( + BackwardEuler<VectorType, MatrixType, FunctionType, dims>>( stiffnessMatrix, massMatrix, u_initial, v_initial, velocityDirichletNodes, velocityDirichletFunction); default: diff --git a/src/timestepping.cc b/src/timestepping.cc index a0399257e119205ce4ea79f624f496eacc6363b0..0003fd227d924231da6a8ce7ce8e347519ce8e07 100644 --- a/src/timestepping.cc +++ b/src/timestepping.cc @@ -7,7 +7,7 @@ #include "timestepping.hh" -#include "timestepping/eulerpair.cc" +#include "timestepping/backward_euler.cc" #include "timestepping/newmark.cc" #include "timestepping_tmpl.cc" diff --git a/src/timestepping.hh b/src/timestepping.hh index 4b02fdb63affbfbbf8fd0ffd57113d712e761a0c..e99ea787cef3d260b9eee0d6998b9f2dab04f6db 100644 --- a/src/timestepping.hh +++ b/src/timestepping.hh @@ -17,6 +17,6 @@ class TimeSteppingScheme { }; #include "timestepping/newmark.hh" -#include "timestepping/eulerpair.hh" +#include "timestepping/backward_euler.hh" #endif diff --git a/src/timestepping/eulerpair.cc b/src/timestepping/backward_euler.cc similarity index 85% rename from src/timestepping/eulerpair.cc rename to src/timestepping/backward_euler.cc index dfef35b84305d13bff5f0897b6f19cbbb18640fd..7abd239e981bdb7fc852ffd87800e0ac8262fd2c 100644 --- a/src/timestepping/eulerpair.cc +++ b/src/timestepping/backward_euler.cc @@ -1,5 +1,5 @@ template <class VectorType, class MatrixType, class FunctionType, int dim> -EulerPair<VectorType, MatrixType, FunctionType, dim>::EulerPair( +BackwardEuler<VectorType, MatrixType, FunctionType, dim>::BackwardEuler( MatrixType const &_A, MatrixType const &_M, VectorType const &_u_initial, VectorType const &_v_initial, Dune::BitSetVector<dim> const &_dirichletNodes, @@ -12,13 +12,13 @@ EulerPair<VectorType, MatrixType, FunctionType, dim>::EulerPair( dirichletFunction(_dirichletFunction) {} template <class VectorType, class MatrixType, class FunctionType, int dim> -void EulerPair<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() { +void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() { v_o = v; u_o = u; } template <class VectorType, class MatrixType, class FunctionType, int dim> -void EulerPair<VectorType, MatrixType, FunctionType, dim>::setup( +void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup( VectorType const &ell, double _tau, double time, VectorType &problem_rhs, VectorType &problem_iterate, MatrixType &problem_AM) { postProcessCalled = false; @@ -95,7 +95,7 @@ void EulerPair<VectorType, MatrixType, FunctionType, dim>::setup( } template <class VectorType, class MatrixType, class FunctionType, int dim> -void EulerPair<VectorType, MatrixType, FunctionType, dim>::postProcess( +void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::postProcess( VectorType const &problem_iterate) { postProcessCalled = true; @@ -106,8 +106,8 @@ void EulerPair<VectorType, MatrixType, FunctionType, dim>::postProcess( } template <class VectorType, class MatrixType, class FunctionType, int dim> -void EulerPair<VectorType, MatrixType, FunctionType, dim>::extractDisplacement( - VectorType &displacement) const { +void BackwardEuler<VectorType, MatrixType, FunctionType, + dim>::extractDisplacement(VectorType &displacement) const { if (!postProcessCalled) DUNE_THROW(Dune::Exception, "It seems you forgot to call postProcess!"); @@ -115,7 +115,7 @@ void EulerPair<VectorType, MatrixType, FunctionType, dim>::extractDisplacement( } template <class VectorType, class MatrixType, class FunctionType, int dim> -void EulerPair<VectorType, MatrixType, FunctionType, dim>::extractVelocity( +void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::extractVelocity( VectorType &velocity) const { if (!postProcessCalled) DUNE_THROW(Dune::Exception, "It seems you forgot to call postProcess!"); diff --git a/src/timestepping/eulerpair.hh b/src/timestepping/backward_euler.hh similarity index 67% rename from src/timestepping/eulerpair.hh rename to src/timestepping/backward_euler.hh index 105529e19971fef6f5e3284570a740d1e8aebd2a..202c4420e32253bb3405253bb35591294b379dd7 100644 --- a/src/timestepping/eulerpair.hh +++ b/src/timestepping/backward_euler.hh @@ -1,14 +1,14 @@ -#ifndef DUNE_TECTONIC_TIMESTEPPING_EULERPAIR_HH -#define DUNE_TECTONIC_TIMESTEPPING_EULERPAIR_HH +#ifndef DUNE_TECTONIC_TIMESTEPPING_BACKWARD_EULER_HH +#define DUNE_TECTONIC_TIMESTEPPING_BACKWARD_EULER_HH template <class VectorType, class MatrixType, class FunctionType, int dim> -class EulerPair +class BackwardEuler : public TimeSteppingScheme<VectorType, MatrixType, FunctionType, dim> { public: - EulerPair(MatrixType const &_A, MatrixType const &_M, - VectorType const &_u_initial, VectorType const &_v_initial, - Dune::BitSetVector<dim> const &_dirichletNodes, - FunctionType const &_dirichletFunction); + BackwardEuler(MatrixType const &_A, MatrixType const &_M, + 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 &, diff --git a/src/timestepping_tmpl.cc b/src/timestepping_tmpl.cc index 3a6156fc2ff4c7b1cbc660390641a81173da74de..9a8a2a3d6215b6984a691c6a410f9367347e5ff5 100644 --- a/src/timestepping_tmpl.cc +++ b/src/timestepping_tmpl.cc @@ -15,4 +15,4 @@ using VectorType = Dune::BlockVector<SmallVector>; using FunctionType = Dune::VirtualFunction<double, double>; template class Newmark<VectorType, MatrixType, FunctionType, DIM>; -template class EulerPair<VectorType, MatrixType, FunctionType, DIM>; +template class BackwardEuler<VectorType, MatrixType, FunctionType, DIM>;