From 6c3099626c7617f2ef4cb5951ac104aa6fee26b6 Mon Sep 17 00:00:00 2001 From: podlesny <podlesny@mi.fu-berlin.de> Date: Mon, 22 Jul 2019 16:25:43 +0200 Subject: [PATCH] . --- src/data-structures/contactnetwork.cc | 2 +- src/multi-body-problem-2D.cfg | 2 +- src/multi-body-problem-data/bc.hh | 5 ++++- src/spatial-solving/tnnmg/linearcorrection.hh | 6 +++--- src/spatial-solving/tnnmg/tnnmgstep.hh | 6 +++--- src/time-stepping/adaptivetimestepper.cc | 9 ++++----- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/data-structures/contactnetwork.cc b/src/data-structures/contactnetwork.cc index 1a54dda9..a25f7e49 100644 --- a/src/data-structures/contactnetwork.cc +++ b/src/data-structures/contactnetwork.cc @@ -26,7 +26,7 @@ ContactNetwork<HostGridType, VectorType>::ContactNetwork( couplings_(nCouplings), frictionBoundaries_(nBodies), stateEnergyNorms_(nBodies), - nBodyAssembler_(nBodies, nCouplings, false, 0.0) + nBodyAssembler_(nBodies, nCouplings) //, false, 0.0) {} template <class HostGridType, class VectorType> diff --git a/src/multi-body-problem-2D.cfg b/src/multi-body-problem-2D.cfg index 676d1a40..9112827c 100644 --- a/src/multi-body-problem-2D.cfg +++ b/src/multi-body-problem-2D.cfg @@ -1,6 +1,6 @@ # -*- mode:conf -*- [boundary.friction] -smallestDiameter = 0.5 # 2e-3 [m] +smallestDiameter = 0.1 # 2e-3 [m] [timeSteps] refinementTolerance = 1e-5 # 1e-5 diff --git a/src/multi-body-problem-data/bc.hh b/src/multi-body-problem-data/bc.hh index 82ccdaac..1b574cd6 100644 --- a/src/multi-body-problem-data/bc.hh +++ b/src/multi-body-problem-data/bc.hh @@ -7,7 +7,8 @@ class VelocityDirichletCondition : public Dune::VirtualFunction<double, double> { void evaluate(double const &relativeTime, double &y) const { // Assumed to vanish at time zero - double const finalVelocity = -5e-5; + /* + double const finalVelocity = -5e-5; std::cout << "VelocityDirichletCondition::evaluate()" << std::endl; @@ -19,6 +20,8 @@ class VelocityDirichletCondition y = (relativeTime <= 0.1) ? finalVelocity * (1.0 - std::cos(relativeTime * M_PI / 0.1)) / 2.0 : finalVelocity; + */ + y = relativeTime; } }; diff --git a/src/spatial-solving/tnnmg/linearcorrection.hh b/src/spatial-solving/tnnmg/linearcorrection.hh index d06155e5..c26f13df 100644 --- a/src/spatial-solving/tnnmg/linearcorrection.hh +++ b/src/spatial-solving/tnnmg/linearcorrection.hh @@ -76,8 +76,8 @@ makeLinearCorrection(std::shared_ptr< Dune::Solvers::IterativeSolver<Vector> > i directSolver->preprocess(); directSolver->solve(); - //x = directX; - using LinearIterationStep = Dune::Solvers::LinearIterationStep<Matrix, Vector>; + x = directX; + /*using LinearIterationStep = Dune::Solvers::LinearIterationStep<Matrix, Vector>; auto linearIterationStep = dynamic_cast<LinearIterationStep*>(&iterativeSolver->getIterationStep()); if (not linearIterationStep) @@ -94,7 +94,7 @@ makeLinearCorrection(std::shared_ptr< Dune::Solvers::IterativeSolver<Vector> > i const auto& norm = iterativeSolver->getErrorNorm(); auto error = norm.diff(linearIterationStep->getSol(), directX); - std::cout << "Linear solver iterations: " << iterativeSolver->getResult().iterations << " Error: " << error << std::endl; + std::cout << "Linear solver iterations: " << iterativeSolver->getResult().iterations << " Error: " << error << std::endl;*/ }; } diff --git a/src/spatial-solving/tnnmg/tnnmgstep.hh b/src/spatial-solving/tnnmg/tnnmgstep.hh index 844f0137..44979dcf 100644 --- a/src/spatial-solving/tnnmg/tnnmgstep.hh +++ b/src/spatial-solving/tnnmg/tnnmgstep.hh @@ -19,8 +19,8 @@ #include "localproblem.hh" -//#include "linearcorrection.hh" -#include <dune/tnnmg/iterationsteps/linearcorrection.hh> +#include "linearcorrection.hh" +//#include <dune/tnnmg/iterationsteps/linearcorrection.hh> #include <dune/tectonic/../../src/utils/debugutils.hh> @@ -192,7 +192,7 @@ class TNNMGStep : //DUNE_THROW(Dune::Exception, "TNNMGStep: Just need to terminate here!"); - linearCorrection_(A, constrainedCorrection_, r); + linearCorrection_(A, constrainedCorrection_, r, ignore); //std::cout << "- linear correction: success" << std::endl; diff --git a/src/time-stepping/adaptivetimestepper.cc b/src/time-stepping/adaptivetimestepper.cc index 3a349a7a..96aa6ecc 100644 --- a/src/time-stepping/adaptivetimestepper.cc +++ b/src/time-stepping/adaptivetimestepper.cc @@ -67,10 +67,9 @@ IterationRegister AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNo std::cout << "AdaptiveTimeStepper Step 1" << std::endl; -/* bool didCoarsen = false; iterationRegister_.reset(); - UpdatersWithCount R2; + UpdatersWithCount R2; /* UpdatersWithCount C; while (relativeTime_ + relativeTau_ <= 1.0) { R2 = step(R1_.updaters, relativeTime_ + relativeTau_, relativeTau_); @@ -112,9 +111,9 @@ IterationRegister AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNo relativeTime_ += relativeTau_; current_ = R1_.updaters; - UpdatersWithCount emptyR1; - R1_ = emptyR1; - //R1_ = R2; + //UpdatersWithCount emptyR1; + //R1_ = emptyR1; + R1_ = R2; std::cout << " done" << std::endl; -- GitLab