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

[Cleanup] Use subtractProduct()

parent df5d2728
No related branches found
No related tags found
No related merge requests found
......@@ -271,7 +271,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
if (j == m)
localA = &(*it); // localA = A[m][m]
else
Arithmetic::addProduct(localb, -1.0, *it, u[j]);
Arithmetic::subtractProduct(localb, *it, u[j]);
}
assert(localA != nullptr);
......
......@@ -28,7 +28,7 @@ void EulerPair<VectorType, MatrixType, FunctionType, dim>::setup(
problem_rhs = ell;
Arithmetic::addProduct(problem_rhs, 1.0 / tau, B, v_old);
Arithmetic::addProduct(problem_rhs, -1.0, A, u_old);
Arithmetic::subtractProduct(problem_rhs, A, u_old);
// For fixed tau, we'd only really have to do this once
Dune::MatrixIndexSet indices(A.N(), A.M());
......
......@@ -25,7 +25,7 @@ void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::setup(
tau = _tau;
problem_rhs = ell;
Arithmetic::addProduct(problem_rhs, -1.0, A, u_old);
Arithmetic::subtractProduct(problem_rhs, A, u_old);
// For fixed tau, we'd only really have to do this once
problem_AB = A;
......
......@@ -30,8 +30,8 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
problem_rhs = ell;
Arithmetic::addProduct(problem_rhs, 2.0 / tau, B, v_old);
Arithmetic::addProduct(problem_rhs, B, a_old);
Arithmetic::addProduct(problem_rhs, -1.0, A, u_old);
Arithmetic::addProduct(problem_rhs, -tau / 2.0, A, v_old);
Arithmetic::subtractProduct(problem_rhs, A, u_old);
Arithmetic::subtractProduct(problem_rhs, tau / 2.0, A, v_old);
// For fixed tau, we'd only really have to do this once
Dune::MatrixIndexSet indices(A.N(), A.M());
......@@ -81,8 +81,8 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::postProcess(
a = 0;
Arithmetic::addProduct(a, 2.0 / tau, v);
Arithmetic::addProduct(a, -2.0 / tau, v_old);
Arithmetic::addProduct(a, -1.0, a_old);
Arithmetic::subtractProduct(a, 2.0 / tau, v_old);
Arithmetic::subtractProduct(a, 1.0, a_old);
}
template <class VectorType, class MatrixType, class FunctionType, int dim>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment