Skip to content
Snippets Groups Projects
Commit d12bfe57 authored by Sander, Oliver's avatar Sander, Oliver
Browse files

Implement trust-region scaling for the mixed-order Cosserat implementation

parent 0c643a03
No related branches found
No related tags found
No related merge requests found
......@@ -311,6 +311,8 @@ void MixedRiemannianTrustRegionSolver<GridType,Basis0,TargetSpace0,Basis1,Target
// \todo Use global index set instead of basis for parallel computations
MaxNormTrustRegion<blocksize0> trustRegion0(assembler_->basis0_.indexSet().size(), initialTrustRegionRadius_);
MaxNormTrustRegion<blocksize1> trustRegion1(assembler_->basis1_.indexSet().size(), initialTrustRegionRadius_);
trustRegion0.set(initialTrustRegionRadius_, std::get<0>(scaling_));
trustRegion1.set(initialTrustRegionRadius_, std::get<1>(scaling_));
std::vector<BoxConstraint<field_type,blocksize0> > trustRegionObstacles0;
std::vector<BoxConstraint<field_type,blocksize1> > trustRegionObstacles1;
......
......@@ -57,7 +57,10 @@ public:
: NumProc(NumProc::FULL),
h1SemiNorm0_(nullptr), h1SemiNorm1_(nullptr)
{}
{
std::fill(std::get<0>(scaling_).begin(), std::get<0>(scaling_).end(), 1.0);
std::fill(std::get<1>(scaling_).begin(), std::get<1>(scaling_).end(), 1.0);
}
/** \brief Set up the solver using a monotone multigrid method as the inner solver */
void setup(const GridType& grid,
......@@ -77,6 +80,16 @@ public:
int baseIterations,
double baseTolerance,
bool instrumented);
void setScaling(const Dune::FieldVector<double,blocksize0+blocksize1>& scaling)
{
for (int i=0; i<3; i++)
{
std::get<0>(scaling_)[i] = scaling[i];
std::get<1>(scaling_)[i] = scaling[i+3];
}
}
#if 0
void setIgnoreNodes(const Dune::BitSetVector<blocksize0>& ignoreNodes)
{
......@@ -114,6 +127,9 @@ protected:
/** \brief The initial trust-region radius in the maximum-norm */
double initialTrustRegionRadius_;
/** \brief Trust-region norm scaling */
std::tuple<Dune::FieldVector<double,3>, Dune::FieldVector<double,3> > scaling_;
/** \brief Maximum number of trust-region steps */
int maxTrustRegionSteps_;
......
......@@ -320,6 +320,8 @@ int main (int argc, char *argv[]) try
baseTolerance,
instrumented);
solver.setScaling(parameterSet.get<FieldVector<double,6> >("trustRegionScaling"));
////////////////////////////////////////////////////////
// Set Dirichlet values
////////////////////////////////////////////////////////
......
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