Skip to content
Snippets Groups Projects
Commit b1c2034e authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

[Cleanup] _old -> _o

parent 3447481b
Branches
No related tags found
No related merge requests found
......@@ -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]);
}
}
......
......@@ -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]);
}
}
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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>
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment