From 4c09e7d57109e02a5919f1f445683b70a6bfcfb0 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Sun, 10 Feb 2013 19:53:11 +0100
Subject: [PATCH] eulerPair need not keep track of accelerations

---
 src/one-body-sample.cc | 4 ++--
 src/timestepping.cc    | 8 +-------
 src/timestepping.hh    | 3 ---
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc
index 2aa4b751..6ed4fdd6 100644
--- a/src/one-body-sample.cc
+++ b/src/one-body-sample.cc
@@ -106,8 +106,8 @@ initTimeStepper(Config::scheme scheme, FunctionType const &dirichletFunction,
     case Config::EulerPair:
       return Dune::make_shared<
           EulerPair<VectorType, MatrixType, FunctionType, dims>>(
-          stiffnessMatrix, massMatrix, u_initial, ud_initial, udd_initial,
-          ignoreNodes, dirichletFunction);
+          stiffnessMatrix, massMatrix, u_initial, ud_initial, ignoreNodes,
+          dirichletFunction);
   }
 }
 template <class SingletonVectorType, class VectorType>
diff --git a/src/timestepping.cc b/src/timestepping.cc
index 5e7ff6f1..fd15efdd 100644
--- a/src/timestepping.cc
+++ b/src/timestepping.cc
@@ -212,20 +212,18 @@ Newmark<VectorType, MatrixType, FunctionType, dim>::clone() {
 template <class VectorType, class MatrixType, class FunctionType, int dim>
 EulerPair<VectorType, MatrixType, FunctionType, dim>::EulerPair(
     MatrixType const &_A, MatrixType const &_B, VectorType const &_u_initial,
-    VectorType const &_ud_initial, VectorType const &_udd_initial,
+    VectorType const &_ud_initial,
     Dune::BitSetVector<dim> const &_dirichletNodes,
     FunctionType const &_dirichletFunction)
     : A(_A),
       B(_B),
       u(_u_initial),
       ud(_ud_initial),
-      udd(_udd_initial),
       dirichletNodes(_dirichletNodes),
       dirichletFunction(_dirichletFunction) {}
 
 template <class VectorType, class MatrixType, class FunctionType, int dim>
 void EulerPair<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() {
-  udd_old = udd;
   ud_old = ud;
   u_old = u;
 }
@@ -286,10 +284,6 @@ void EulerPair<VectorType, MatrixType, FunctionType, dim>::postProcess(
 
   u = u_old;
   Arithmetic::addProduct(u, tau, ud);
-
-  udd = 0;
-  Arithmetic::addProduct(udd, 1.0 / tau, ud);
-  Arithmetic::addProduct(udd, -1.0 / tau, ud_old);
 }
 
 template <class VectorType, class MatrixType, class FunctionType, int dim>
diff --git a/src/timestepping.hh b/src/timestepping.hh
index 7678c27f..faf7a2f8 100644
--- a/src/timestepping.hh
+++ b/src/timestepping.hh
@@ -93,7 +93,6 @@ class EulerPair
 public:
   EulerPair(MatrixType const &_A, MatrixType const &_B,
             VectorType const &_u_initial, VectorType const &_ud_initial,
-            VectorType const &_udd_initial,
             Dune::BitSetVector<dim> const &_dirichletNodes,
             FunctionType const &_dirichletFunction);
 
@@ -112,13 +111,11 @@ class EulerPair
   MatrixType const &B;
   VectorType u;
   VectorType ud;
-  VectorType udd;
   Dune::BitSetVector<dim> const &dirichletNodes;
   FunctionType const &dirichletFunction;
 
   VectorType u_old;
   VectorType ud_old;
-  VectorType udd_old;
 
   double tau;
 
-- 
GitLab