From 639e0bd9d19268521cce47810557f52f54c72f15 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Wed, 17 Jul 2013 13:52:53 +0200
Subject: [PATCH] [Cleanup] Rename: B -> M

---
 src/one-body-sample.cc      |  6 +++---
 src/timestepping/newmark.cc | 30 +++++++++++++++---------------
 src/timestepping/newmark.hh |  4 ++--
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc
index 1d35f35f..c2116512 100644
--- a/src/one-body-sample.cc
+++ b/src/one-body-sample.cc
@@ -444,13 +444,13 @@ int main(int argc, char *argv[]) {
       double const time = tau * run;
       createRHS(time, ell);
 
-      MatrixType problem_AB;
+      MatrixType problem_AM;
       VectorType problem_rhs(finestSize);
       VectorType problem_iterate(finestSize);
 
       stateUpdater->setup(tau);
       timeSteppingScheme->setup(ell, tau, time, problem_rhs, problem_iterate,
-                                problem_AB);
+                                problem_AM);
 
       LoopSolver<VectorType> velocityProblemSolver(
           multigridStep, parset.get<size_t>("solver.tnnmg.maxiterations"),
@@ -465,7 +465,7 @@ int main(int argc, char *argv[]) {
         using ConvexProblemType = ConvexProblem<
             Dune::GlobalNonlinearity<MatrixType, VectorType>, MatrixType>;
         // FIXME: Do we really need to pass u here?
-        ConvexProblemType const myConvexProblem(1.0, problem_AB,
+        ConvexProblemType const myConvexProblem(1.0, problem_AM,
                                                 *myGlobalNonlinearity,
                                                 problem_rhs, _problem_iterate);
         MyBlockProblem<ConvexProblemType> velocityProblem(parset,
diff --git a/src/timestepping/newmark.cc b/src/timestepping/newmark.cc
index 7ccb02ad..22d8dcdc 100644
--- a/src/timestepping/newmark.cc
+++ b/src/timestepping/newmark.cc
@@ -1,11 +1,11 @@
 template <class VectorType, class MatrixType, class FunctionType, int dim>
 Newmark<VectorType, MatrixType, FunctionType, dim>::Newmark(
-    MatrixType const &_A, MatrixType const &_B, VectorType const &_u_initial,
+    MatrixType const &_A, MatrixType const &_M, VectorType const &_u_initial,
     VectorType const &_v_initial, VectorType const &_a_initial,
     Dune::BitSetVector<dim> const &_dirichletNodes,
     FunctionType const &_dirichletFunction)
     : A(_A),
-      B(_B),
+      M(_M),
       u(_u_initial),
       v(_v_initial),
       a(_a_initial),
@@ -22,14 +22,14 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() {
 template <class VectorType, class MatrixType, class FunctionType, int dim>
 void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
     VectorType const &ell, double _tau, double time, VectorType &problem_rhs,
-    VectorType &problem_iterate, MatrixType &problem_AB) {
+    VectorType &problem_iterate, MatrixType &problem_AM) {
   postProcessCalled = false;
 
   tau = _tau;
 
   /* We start out with the formulation
 
-       B a + A u = ell
+       M a + A u = ell
 
      Newmark means
 
@@ -38,14 +38,14 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
 
      in summary, we get at time t=1
 
-       B [2/tau ( u1 - u0 ) - a0]
+       M [2/tau ( u1 - u0 ) - a0]
        + A [tau/2 ( v1 + v0 ) + u0] = ell
 
      or
 
-       2/tau B v1 + tau/2 A v1
-       = [2/tau B + tau/2 A] v1
-       = ell + 2/tau B v0 + B a0
+       2/tau M v1 + tau/2 A v1
+       = [2/tau M + tau/2 A] v1
+       = ell + 2/tau M v0 + M a0
        - tau/2 A v0 - A u0
   */
 
@@ -53,18 +53,18 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
   {
     Dune::MatrixIndexSet indices(A.N(), A.M());
     indices.import(A);
-    indices.import(B);
-    indices.exportIdx(problem_AB);
+    indices.import(M);
+    indices.exportIdx(problem_AM);
   }
-  problem_AB = 0.0;
-  Arithmetic::addProduct(problem_AB, 2.0 / tau, B);
-  Arithmetic::addProduct(problem_AB, tau / 2.0, A);
+  problem_AM = 0.0;
+  Arithmetic::addProduct(problem_AM, 2.0 / tau, M);
+  Arithmetic::addProduct(problem_AM, tau / 2.0, A);
 
   // set up RHS
   {
     problem_rhs = ell;
-    Arithmetic::addProduct(problem_rhs, 2.0 / tau, B, v_o);
-    Arithmetic::addProduct(problem_rhs, B, a_o);
+    Arithmetic::addProduct(problem_rhs, 2.0 / tau, M, v_o);
+    Arithmetic::addProduct(problem_rhs, M, a_o);
     Arithmetic::subtractProduct(problem_rhs, tau / 2.0, A, v_o);
     Arithmetic::subtractProduct(problem_rhs, A, u_o);
   }
diff --git a/src/timestepping/newmark.hh b/src/timestepping/newmark.hh
index f576d1d7..ff707a7e 100644
--- a/src/timestepping/newmark.hh
+++ b/src/timestepping/newmark.hh
@@ -5,7 +5,7 @@ template <class VectorType, class MatrixType, class FunctionType, int dim>
 class Newmark
     : public TimeSteppingScheme<VectorType, MatrixType, FunctionType, dim> {
 public:
-  Newmark(MatrixType const &_A, MatrixType const &_B,
+  Newmark(MatrixType const &_A, MatrixType const &_M,
           VectorType const &_u_initial, VectorType const &_v_initial,
           VectorType const &_a_initial,
           Dune::BitSetVector<dim> const &_dirichletNodes,
@@ -20,7 +20,7 @@ class Newmark
 
 private:
   MatrixType const &A;
-  MatrixType const &B;
+  MatrixType const &M;
   VectorType u;
   VectorType v;
   VectorType a;
-- 
GitLab