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

Cleanup

parent 3df076f6
No related branches found
No related tags found
No related merge requests found
...@@ -25,8 +25,8 @@ template <int dim> class EllipticEnergy { ...@@ -25,8 +25,8 @@ template <int dim> class EllipticEnergy {
double operator()(SmallVector const &v) const { double operator()(SmallVector const &v) const {
SmallVector y(0); SmallVector y(0);
Arithmetic::addProduct(y, 0.5, A, v); Arithmetic::addProduct(y, 0.5, A, v);
y -= b; // 1/2 Av - b y -= b;
return y * v + (*phi)(v); // <1/2 Av - b,v> + H(|v|) return y * v + (*phi)(v);
} }
SmallMatrix const &A; SmallMatrix const &A;
......
...@@ -29,7 +29,7 @@ class GlobalRuinaNonlinearity ...@@ -29,7 +29,7 @@ class GlobalRuinaNonlinearity
auto trivialNonlinearity = make_shared<LocalFriction<dim> const>( auto trivialNonlinearity = make_shared<LocalFriction<dim> const>(
make_shared<TrivialFunction const>()); make_shared<TrivialFunction const>());
for (size_t i = 0; i < restrictions.size(); ++i) { for (size_t i = 0; i < restrictions.size(); ++i) {
restrictions[i] = nodalIntegrals[i] == 0 restrictions[i] = (nodalIntegrals[i] == 0)
? trivialNonlinearity ? trivialNonlinearity
: make_shared<LocalFriction<dim> const>( : make_shared<LocalFriction<dim> const>(
make_shared<FrictionPotential const>( make_shared<FrictionPotential const>(
......
...@@ -315,15 +315,13 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { ...@@ -315,15 +315,13 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
if (j == m) if (j == m)
localA = &(*it); // localA = A[m][m] localA = &(*it); // localA = A[m][m]
else else
Arithmetic::addProduct(localb, -1.0, *it, u[j]); // b-Au Arithmetic::addProduct(localb, -1.0, *it, u[j]);
} }
assert(localA != nullptr); assert(localA != nullptr);
auto const phi = problem.phi.restriction(m); auto const phi = problem.phi.restriction(m);
Dune::EllipticEnergy<block_size> localJ(*localA, localb, phi, Dune::EllipticEnergy<block_size> localJ(*localA, localb, phi,
ignore_component); ignore_component);
LocalVectorType correction;
Dune::minimise(localJ, ui, localsteps, bisection); Dune::minimise(localJ, ui, localsteps, bisection);
} }
} }
......
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