From b1c2034eb639b0bec4aad758016fcf88b8639ae4 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Sun, 14 Jul 2013 21:21:45 +0200 Subject: [PATCH] [Cleanup] _old -> _o --- src/state/dieterichstateupdater.hh | 6 +++--- src/state/ruinastateupdater.hh | 6 +++--- src/timestepping/eulerpair.cc | 14 +++++++------- src/timestepping/eulerpair.hh | 4 ++-- src/timestepping/impliciteuler.cc | 12 ++++++------ src/timestepping/impliciteuler.hh | 4 ++-- src/timestepping/newmark.cc | 24 ++++++++++++------------ src/timestepping/newmark.hh | 6 +++--- 8 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/state/dieterichstateupdater.hh b/src/state/dieterichstateupdater.hh index ee8480c4..1db5cbd5 100644 --- a/src/state/dieterichstateupdater.hh +++ b/src/state/dieterichstateupdater.hh @@ -17,7 +17,7 @@ class DieterichStateUpdater virtual void extractState(SingletonVectorType &state); private: - SingletonVectorType alpha_old; + SingletonVectorType alpha_o; SingletonVectorType alpha; Dune::BitSetVector<1> const &nodes; double const L; @@ -32,7 +32,7 @@ DieterichStateUpdater<SingletonVectorType, VectorType>::DieterichStateUpdater( template <class SingletonVectorType, class VectorType> void DieterichStateUpdater<SingletonVectorType, VectorType>::nextTimeStep() { - alpha_old = alpha; + alpha_o = alpha; } template <class SingletonVectorType, class VectorType> @@ -47,7 +47,7 @@ void DieterichStateUpdater<SingletonVectorType, VectorType>::solve( for (size_t i = 0; i < nodes.size(); ++i) if (nodes[i][0]) { double const V = velocity_field[i].two_norm(); - alpha[i] = state_update_dieterich_euler(tau, V / L, alpha_old[i]); + alpha[i] = state_update_dieterich_euler(tau, V / L, alpha_o[i]); } } diff --git a/src/state/ruinastateupdater.hh b/src/state/ruinastateupdater.hh index 083d97ee..94c78361 100644 --- a/src/state/ruinastateupdater.hh +++ b/src/state/ruinastateupdater.hh @@ -16,7 +16,7 @@ class RuinaStateUpdater : public StateUpdater<SingletonVectorType, VectorType> { virtual void extractState(SingletonVectorType &state); private: - SingletonVectorType alpha_old; + SingletonVectorType alpha_o; SingletonVectorType alpha; Dune::BitSetVector<1> const &nodes; double const L; @@ -31,7 +31,7 @@ RuinaStateUpdater<SingletonVectorType, VectorType>::RuinaStateUpdater( template <class SingletonVectorType, class VectorType> void RuinaStateUpdater<SingletonVectorType, VectorType>::nextTimeStep() { - alpha_old = alpha; + alpha_o = alpha; } template <class SingletonVectorType, class VectorType> @@ -45,7 +45,7 @@ void RuinaStateUpdater<SingletonVectorType, VectorType>::solve( for (size_t i = 0; i < nodes.size(); ++i) if (nodes[i][0]) { double const V = velocity_field[i].two_norm(); - alpha[i] = state_update_ruina(tau, V * tau / L, alpha_old[i]); + alpha[i] = state_update_ruina(tau, V * tau / L, alpha_o[i]); } } diff --git a/src/timestepping/eulerpair.cc b/src/timestepping/eulerpair.cc index 480f8605..364e64fd 100644 --- a/src/timestepping/eulerpair.cc +++ b/src/timestepping/eulerpair.cc @@ -14,8 +14,8 @@ EulerPair<VectorType, MatrixType, FunctionType, dim>::EulerPair( template <class VectorType, class MatrixType, class FunctionType, int dim> void EulerPair<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() { - v_old = v; - u_old = u; + v_o = v; + u_o = u; } template <class VectorType, class MatrixType, class FunctionType, int dim> @@ -27,8 +27,8 @@ void EulerPair<VectorType, MatrixType, FunctionType, dim>::setup( tau = _tau; problem_rhs = ell; - Arithmetic::addProduct(problem_rhs, 1.0 / tau, B, v_old); - Arithmetic::subtractProduct(problem_rhs, A, u_old); + Arithmetic::addProduct(problem_rhs, 1.0 / tau, B, v_o); + Arithmetic::subtractProduct(problem_rhs, A, u_o); // For fixed tau, we'd only really have to do this once Dune::MatrixIndexSet indices(A.N(), A.M()); @@ -39,8 +39,8 @@ void EulerPair<VectorType, MatrixType, FunctionType, dim>::setup( Arithmetic::addProduct(problem_AB, tau, A); Arithmetic::addProduct(problem_AB, 1.0 / tau, B); - // v_old makes a good initial iterate; we could use anything, though - problem_iterate = v_old; + // 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()) { @@ -72,7 +72,7 @@ void EulerPair<VectorType, MatrixType, FunctionType, dim>::postProcess( v = problem_iterate; - u = u_old; + u = u_o; Arithmetic::addProduct(u, tau, v); } diff --git a/src/timestepping/eulerpair.hh b/src/timestepping/eulerpair.hh index 34e684a5..289f98d2 100644 --- a/src/timestepping/eulerpair.hh +++ b/src/timestepping/eulerpair.hh @@ -25,8 +25,8 @@ class EulerPair Dune::BitSetVector<dim> const &dirichletNodes; FunctionType const &dirichletFunction; - VectorType u_old; - VectorType v_old; + VectorType u_o; + VectorType v_o; double tau; diff --git a/src/timestepping/impliciteuler.cc b/src/timestepping/impliciteuler.cc index 753689da..2ae4991f 100644 --- a/src/timestepping/impliciteuler.cc +++ b/src/timestepping/impliciteuler.cc @@ -12,8 +12,8 @@ ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::ImplicitEuler( template <class VectorType, class MatrixType, class FunctionType, int dim> void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() { - v_old = v; - u_old = u; + v_o = v; + u_o = u; } template <class VectorType, class MatrixType, class FunctionType, int dim> @@ -25,14 +25,14 @@ void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::setup( tau = _tau; problem_rhs = ell; - Arithmetic::subtractProduct(problem_rhs, A, u_old); + 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_old makes a good initial iterate; we could use anything, though - problem_iterate = v_old; + // 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()) { @@ -64,7 +64,7 @@ void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::postProcess( v = problem_iterate; - u = u_old; + u = u_o; Arithmetic::addProduct(u, tau, v); } diff --git a/src/timestepping/impliciteuler.hh b/src/timestepping/impliciteuler.hh index 93f2d3dc..fd0a86e3 100644 --- a/src/timestepping/impliciteuler.hh +++ b/src/timestepping/impliciteuler.hh @@ -24,8 +24,8 @@ class ImplicitEuler Dune::BitSetVector<dim> const &dirichletNodes; FunctionType const &dirichletFunction; - VectorType u_old; - VectorType v_old; + VectorType u_o; + VectorType v_o; double tau; diff --git a/src/timestepping/newmark.cc b/src/timestepping/newmark.cc index 30ad548a..a08dad6b 100644 --- a/src/timestepping/newmark.cc +++ b/src/timestepping/newmark.cc @@ -14,9 +14,9 @@ Newmark<VectorType, MatrixType, FunctionType, dim>::Newmark( template <class VectorType, class MatrixType, class FunctionType, int dim> void Newmark<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() { - a_old = a; - v_old = v; - u_old = u; + a_o = a; + v_o = v; + u_o = u; } template <class VectorType, class MatrixType, class FunctionType, int dim> @@ -28,10 +28,10 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup( tau = _tau; problem_rhs = ell; - Arithmetic::addProduct(problem_rhs, 2.0 / tau, B, v_old); - Arithmetic::addProduct(problem_rhs, B, a_old); - Arithmetic::subtractProduct(problem_rhs, A, u_old); - Arithmetic::subtractProduct(problem_rhs, tau / 2.0, A, v_old); + Arithmetic::addProduct(problem_rhs, 2.0 / tau, B, v_o); + Arithmetic::addProduct(problem_rhs, B, a_o); + Arithmetic::subtractProduct(problem_rhs, A, u_o); + Arithmetic::subtractProduct(problem_rhs, tau / 2.0, A, v_o); // For fixed tau, we'd only really have to do this once Dune::MatrixIndexSet indices(A.N(), A.M()); @@ -42,7 +42,7 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup( Arithmetic::addProduct(problem_AB, tau / 2.0, A); Arithmetic::addProduct(problem_AB, 2.0 / tau, B); - // v_old makes a good initial iterate; we could use anything, though + // v_o makes a good initial iterate; we could use anything, though problem_iterate = 0.0; for (size_t i = 0; i < dirichletNodes.size(); ++i) @@ -75,14 +75,14 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::postProcess( v = problem_iterate; - u = u_old; + u = u_o; Arithmetic::addProduct(u, tau / 2.0, v); - Arithmetic::addProduct(u, tau / 2.0, v_old); + Arithmetic::addProduct(u, tau / 2.0, v_o); a = 0; Arithmetic::addProduct(a, 2.0 / tau, v); - Arithmetic::subtractProduct(a, 2.0 / tau, v_old); - Arithmetic::subtractProduct(a, 1.0, a_old); + Arithmetic::subtractProduct(a, 2.0 / tau, v_o); + Arithmetic::subtractProduct(a, 1.0, a_o); } template <class VectorType, class MatrixType, class FunctionType, int dim> diff --git a/src/timestepping/newmark.hh b/src/timestepping/newmark.hh index b9c1e91d..f576d1d7 100644 --- a/src/timestepping/newmark.hh +++ b/src/timestepping/newmark.hh @@ -27,9 +27,9 @@ class Newmark Dune::BitSetVector<dim> const &dirichletNodes; FunctionType const &dirichletFunction; - VectorType u_old; - VectorType v_old; - VectorType a_old; + VectorType u_o; + VectorType v_o; + VectorType a_o; double tau; -- GitLab