Commit 3805f46f authored by Lasse Hinrichsen's avatar Lasse Hinrichsen
Browse files

Generalize quadraticfunctional's linearization

parent 363c8174
......@@ -6,6 +6,9 @@
#include <cstddef>
// The following include is only to have the truncateMatrix/-Vector functions.
// These should be in their own file at some point.
#include <dune/tnnmg/functionals/semilinearfunctionallinearization.hh>
namespace Dune {
......@@ -44,19 +47,8 @@ public:
truncationFlags_ = ignore_;
// truncate
for(std::size_t i=0; i<x.size(); ++i)
{
auto it = hessian_[i].begin();
auto end = hessian_[i].end();
for(; it!=end; ++it)
if (truncationFlags_[i].any() || truncationFlags_[it.index()].any())
*it = 0;
if (truncationFlags_[i].any())
{
negativeGradient_[i] = 0;
hessian_[i][i] = 1;
}
}
Helper::truncateVector(negativeGradient_, truncationFlags_);
Helper::truncateMatrix(hessian_, truncationFlags_, truncationFlags_);
}
void extendCorrection(ConstrainedVector& cv, Vector& v) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment