From 48911360396d69ffe963a31e58c3592cb6570e50 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 4 Nov 2014 14:21:10 +0000 Subject: [PATCH] Add method to set trust region radius with a separate scaling for each vector block component [[Imported from SVN: r9952]] --- dune/gfe/maxnormtrustregion.hh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dune/gfe/maxnormtrustregion.hh b/dune/gfe/maxnormtrustregion.hh index ab3c2cbb..9bb4a301 100644 --- a/dune/gfe/maxnormtrustregion.hh +++ b/dune/gfe/maxnormtrustregion.hh @@ -33,6 +33,24 @@ public: } + /** \brief Set trust region radius with a separate scaling for each vector block component + */ + void set(field_type radius, const Dune::FieldVector<field_type, blocksize>& scaling) { + + radius_ = radius; + + for (size_t i=0; i<obstacles_.size(); i++) { + + for (int k=0; k<blocksize; k++) { + + obstacles_[i].lower(k) = -radius*scaling[k]; + obstacles_[i].upper(k) = radius*scaling[k]; + + } + } + + } + /** \brief Return true if the given vector is not contained in the trust region */ bool violates(const Dune::BlockVector<Dune::FieldVector<double,blocksize> >& v) const { -- GitLab