From 4bece3c2da13c461daca1fa050c697f8dd61ad86 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Sun, 21 Jul 2013 15:06:04 +0200 Subject: [PATCH] [Cleanup] Rename: problem_*-> * --- src/timestepping.hh | 5 ++-- src/timestepping/backward_euler.cc | 34 +++++++++++++------------- src/timestepping/newmark.cc | 38 +++++++++++++++--------------- 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/src/timestepping.hh b/src/timestepping.hh index e99ea787..fd247f6c 100644 --- a/src/timestepping.hh +++ b/src/timestepping.hh @@ -8,10 +8,9 @@ class TimeSteppingScheme { public: void virtual nextTimeStep() = 0; void virtual setup(VectorType const &ell, double _tau, double time, - VectorType &problem_rhs, VectorType &problem_iterate, - MatrixType &problem_AB) = 0; + VectorType &rhs, VectorType &iterate, MatrixType &AB) = 0; - void virtual postProcess(VectorType const &problem_iterate) = 0; + void virtual postProcess(VectorType const &iterate) = 0; void virtual extractDisplacement(VectorType &displacement) const = 0; void virtual extractVelocity(VectorType &velocity) const = 0; }; diff --git a/src/timestepping/backward_euler.cc b/src/timestepping/backward_euler.cc index 7abd239e..b95a0063 100644 --- a/src/timestepping/backward_euler.cc +++ b/src/timestepping/backward_euler.cc @@ -19,8 +19,8 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() { template <class VectorType, class MatrixType, class FunctionType, int dim> void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup( - VectorType const &ell, double _tau, double time, VectorType &problem_rhs, - VectorType &problem_iterate, MatrixType &problem_AM) { + VectorType const &ell, double _tau, double time, VectorType &rhs, + VectorType &iterate, MatrixType &AM) { postProcessCalled = false; tau = _tau; @@ -54,38 +54,38 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup( indices.import(A); indices.import(M); indices.import(C); - indices.exportIdx(problem_AM); + indices.exportIdx(AM); } - problem_AM = 0.0; - Arithmetic::addProduct(problem_AM, (1.0 - wc) / tau, M); - Arithmetic::addProduct(problem_AM, wc, C); - Arithmetic::addProduct(problem_AM, tau, A); + AM = 0.0; + Arithmetic::addProduct(AM, (1.0 - wc) / tau, M); + Arithmetic::addProduct(AM, wc, C); + Arithmetic::addProduct(AM, tau, A); // set up RHS { - problem_rhs = ell; - Arithmetic::addProduct(problem_rhs, (1.0 - wc) / tau, M, v_o); - Arithmetic::subtractProduct(problem_rhs, A, u_o); + rhs = ell; + Arithmetic::addProduct(rhs, (1.0 - wc) / tau, M, v_o); + Arithmetic::subtractProduct(rhs, A, u_o); } // v_o makes a good initial iterate; we could use anything, though - problem_iterate = 0.0; + iterate = 0.0; 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]); + iterate[i] = 0; + dirichletFunction.evaluate(time, iterate[i][0]); break; case 1: if (dirichletNodes[i][0]) { - dirichletFunction.evaluate(time, problem_iterate[i][0]); + dirichletFunction.evaluate(time, iterate[i][0]); break; } if (dirichletNodes[i][1]) { - problem_iterate[i][1] = 0; + iterate[i][1] = 0; break; } assert(false); @@ -96,10 +96,10 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup( template <class VectorType, class MatrixType, class FunctionType, int dim> void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::postProcess( - VectorType const &problem_iterate) { + VectorType const &iterate) { postProcessCalled = true; - v = problem_iterate; + v = iterate; u = u_o; Arithmetic::addProduct(u, tau, v); diff --git a/src/timestepping/newmark.cc b/src/timestepping/newmark.cc index 09988d95..743b660d 100644 --- a/src/timestepping/newmark.cc +++ b/src/timestepping/newmark.cc @@ -21,8 +21,8 @@ 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_AM) { + VectorType const &ell, double _tau, double time, VectorType &rhs, + VectorType &iterate, MatrixType &AM) { postProcessCalled = false; tau = _tau; @@ -57,40 +57,40 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup( indices.import(A); indices.import(M); indices.import(C); - indices.exportIdx(problem_AM); + indices.exportIdx(AM); } - problem_AM = 0.0; - Arithmetic::addProduct(problem_AM, (1.0 - wc) * 2.0 / tau, M); - Arithmetic::addProduct(problem_AM, wc, C); - Arithmetic::addProduct(problem_AM, tau / 2.0, A); + AM = 0.0; + Arithmetic::addProduct(AM, (1.0 - wc) * 2.0 / tau, M); + Arithmetic::addProduct(AM, wc, C); + Arithmetic::addProduct(AM, tau / 2.0, A); // set up RHS { - problem_rhs = ell; - Arithmetic::addProduct(problem_rhs, (1.0 - wc) * 2.0 / tau, M, v_o); - Arithmetic::addProduct(problem_rhs, 1.0 - wc, M, a_o); - Arithmetic::subtractProduct(problem_rhs, tau / 2.0, A, v_o); - Arithmetic::subtractProduct(problem_rhs, A, u_o); + rhs = ell; + Arithmetic::addProduct(rhs, (1.0 - wc) * 2.0 / tau, M, v_o); + Arithmetic::addProduct(rhs, 1.0 - wc, M, a_o); + Arithmetic::subtractProduct(rhs, tau / 2.0, A, v_o); + Arithmetic::subtractProduct(rhs, A, u_o); } // v_o makes a good initial iterate; we could use anything, though - problem_iterate = 0.0; + iterate = 0.0; 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]); + iterate[i] = 0; + dirichletFunction.evaluate(time, iterate[i][0]); break; case 1: if (dirichletNodes[i][0]) { - dirichletFunction.evaluate(time, problem_iterate[i][0]); + dirichletFunction.evaluate(time, iterate[i][0]); break; } if (dirichletNodes[i][1]) { - problem_iterate[i][1] = 0; + iterate[i][1] = 0; break; } assert(false); @@ -101,10 +101,10 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup( template <class VectorType, class MatrixType, class FunctionType, int dim> void Newmark<VectorType, MatrixType, FunctionType, dim>::postProcess( - VectorType const &problem_iterate) { + VectorType const &iterate) { postProcessCalled = true; - v = problem_iterate; + v = iterate; // u1 = tau/2 ( v1 + v0 ) + u0 u = u_o; -- GitLab