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

Add another assertion

parent dd940d9f
No related branches found
No related tags found
No related merge requests found
......@@ -187,6 +187,25 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
// -grad is needed for Newton step
linearization.b *= -1.0;
// b should be a descent direction
{
VectorType const direction = linearization.b;
VectorType tmp = linearization.b; // b
linearization.A.mmv(u, tmp); // b-Au
double const localA = tmp * direction; // <b-Au,v>
linearization.A.mv(direction, tmp); // Av
double const localb = tmp * direction; // <Av,v>
MyDirectionalConvexFunction<Dune::GlobalNonlinearity<block_size>> const
psi(localA, localb, problem.phi, u, direction);
Interval<double> D;
psi.subDiff(0, D);
if (!isnan(D[1]))
assert(D[1] <= 0);
}
// apply truncation to system
for (size_t row = 0; row < linearization.A.N(); ++row) {
auto const end = linearization.A[row].end();
......
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