diff --git a/dune/tectonic/spatial-solving/fixedpointiterator.cc b/dune/tectonic/spatial-solving/fixedpointiterator.cc index b3080a546dd3aa079f08ad8fde858dd9baf2be62..a36d76f2e9e2f202d9f6680d1c5b4501ea9812b1 100644 --- a/dune/tectonic/spatial-solving/fixedpointiterator.cc +++ b/dune/tectonic/spatial-solving/fixedpointiterator.cc @@ -272,7 +272,7 @@ FixedPointIterator<Factory, NBodyAssembler, Updaters, ErrorNorms>::run( //print(alpha, "alpha: "); - std::cout << "-FixedPointIteration finished with " << fixedPointIteration << " iterations, lambda " << lambda_ << "! " << std::endl; + //std::cout << "-FixedPointIteration finished with " << fixedPointIteration << " iterations, lambda " << lambda_ << "! " << std::endl; if (fixedPointIteration == fixedPointMaxIterations_) DUNE_THROW(Dune::Exception, "FPI failed to converge"); diff --git a/dune/tectonic/time-stepping/adaptivetimestepper.cc b/dune/tectonic/time-stepping/adaptivetimestepper.cc index 52997a82a68e3a89071cab0b3b5821d24b1108ff..4514cade2b38f229d6832565eec9f2efc1e5da19 100644 --- a/dune/tectonic/time-stepping/adaptivetimestepper.cc +++ b/dune/tectonic/time-stepping/adaptivetimestepper.cc @@ -50,7 +50,10 @@ AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::AdaptiveTime contactNetwork_(contactNetwork), current_(current), R1_(), - mustRefine_(mustRefine) {} + mustRefine_(mustRefine) { + + std::cout << N_THREADS << " concurrent threads are supported." << std::endl; +} template <class Factory, class ContactNetwork, class Updaters, class ErrorNorms> bool AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::reachedEnd() { @@ -71,14 +74,14 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::coarsen( const auto& currentNBodyAssembler = contactNetwork_.nBodyAssembler(); while (relativeTime_ + relativeTau_ <= 1.0) { - std::cout << "tau: " << relativeTau_ << std::endl; + //std::cout << "tau: " << relativeTau_ << std::endl; setDeformation(current_); auto C_Step = Step(stepBase_, current_, currentNBodyAssembler, relativeTime_, 2 * relativeTau_, iterationRegister_); - C_Step.run(Step::Mode::newThread); //newThread + C_Step.run(Step::Mode::sameThread); //newThread //updateReductionFactors(reductionFactors); - std::cout << "AdaptiveTimeStepper C computed!" << std::endl << std::endl; + //std::cout << "AdaptiveTimeStepper C computed!" << std::endl << std::endl; /*using ScalarVector = typename Updaters::StateUpdater::ScalarVector; std::vector<ScalarVector> cAlpha(contactNetwork_.nBodies()); @@ -89,10 +92,10 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::coarsen( //auto R2_linearSolver = makeLinearSolver(); auto&& nBodyAssembler = step(currentNBodyAssembler); auto R2_Step = Step(stepBase_, R1_.updaters, nBodyAssembler, relativeTime_ + relativeTau_, relativeTau_, iterationRegister_); - R2_Step.run(Step::Mode::newThread); //newThread + R2_Step.run(Step::Mode::sameThread); //newThread //updateReductionFactors(reductionFactors); - std::cout << "AdaptiveTimeStepper R2 computed!" << std::endl << std::endl; + //std::cout << "AdaptiveTimeStepper R2 computed!" << std::endl << std::endl; C = C_Step.get(); R2 = R2_Step.get(); @@ -137,7 +140,7 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::refine(U F1 = F1_Step.get(); //updateReductionFactors(reductionFactors); - std::cout << "AdaptiveTimeStepper F1 computed!" << std::endl << std::endl; + //std::cout << "AdaptiveTimeStepper F1 computed!" << std::endl << std::endl; setDeformation(F1.updaters); //auto F2_linearSolver = makeLinearSolver(); @@ -192,18 +195,18 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::determin setDeformation(current_); //auto C_linearSolver = makeLinearSolver(); auto C_Step = Step(stepBase_, current_, currentNBodyAssembler, relativeTime_, 2 * relativeTau_, iterationRegister_); - C_Step.run(Step::Mode::newThread); // newThread + C_Step.run(Step::Mode::sameThread); // newThread //updateReductionFactors(reductionFactors); - std::cout << "AdaptiveTimeStepper C computed!" << std::endl << std::endl; + //std::cout << "AdaptiveTimeStepper C computed!" << std::endl << std::endl; setDeformation(R1_.updaters); //auto R2_linearSolver = makeLinearSolver(); auto&& nBodyAssembler = step(currentNBodyAssembler); auto R2_Step = Step(stepBase_, R1_.updaters, nBodyAssembler, relativeTime_ + relativeTau_, relativeTau_, iterationRegister_); - R2_Step.run(Step::Mode::newThread); //newThread + R2_Step.run(Step::Mode::sameThread); //newThread //updateReductionFactors(reductionFactors); - std::cout << "AdaptiveTimeStepper R2 computed!" << std::endl << std::endl; + //std::cout << "AdaptiveTimeStepper R2 computed!" << std::endl << std::endl; if (N_THREADS < 3) { C = C_Step.get(); @@ -218,9 +221,9 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::determin setDeformation(current_); //auto F1_linearSolver = makeLinearSolver(); auto F1_Step = Step(stepBase_, current_, currentNBodyAssembler, relativeTime_, relativeTau_ / 2.0, iterationRegister_); - F1_Step.run(Step::Mode::newThread); //newThread + F1_Step.run(Step::Mode::sameThread); //newThread //updateReductionFactors(reductionFactors); - std::cout << "AdaptiveTimeStepper F1 computed!" << std::endl << std::endl; + //std::cout << "AdaptiveTimeStepper F1 computed!" << std::endl << std::endl; if (N_THREADS > 2) { C = C_Step.get(); @@ -283,8 +286,6 @@ IterationRegister AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNo using Step = Step<Factory, ContactNetwork, Updaters, ErrorNorms>; - std::cout << N_THREADS << " concurrent threads are supported." << std::endl; - if (R1_.updaters == Updaters()) { //setDeformation(current_); //auto R1_linearSolver = makeLinearSolver(); diff --git a/dune/tectonic/time-stepping/step.hh b/dune/tectonic/time-stepping/step.hh index ece7019c0e22cffa0ac12e22d887d907ee8fb057..a6433c33e6321f631ea389736dd1bbdc89c45b75 100644 --- a/dune/tectonic/time-stepping/step.hh +++ b/dune/tectonic/time-stepping/step.hh @@ -244,10 +244,10 @@ class Step : protected StepBase<Factory, ContactNetwork, Updaters, ErrorNorms> { } auto get() { - std::cout << "Step::get() called" << std::endl; + //std::cout << "Step::get() called" << std::endl; if (thread_.joinable()) { thread_.join(); - std::cout << "Thread joined " << std::endl; + //std::cout << "Thread joined " << std::endl; } return future_.get(); } diff --git a/src/strikeslip/strikeslip-2D.cfg b/src/strikeslip/strikeslip-2D.cfg index e360fd0bafce243a099595bfd3402098def46b27..26eb8519022aea5fa2188bcf21209fd42c906d68 100644 --- a/src/strikeslip/strikeslip-2D.cfg +++ b/src/strikeslip/strikeslip-2D.cfg @@ -6,7 +6,7 @@ smallestDiameter = 0.02 # 2e-3 [m] smallestDiameter = 0.02 # 2e-3 [m] [timeSteps] -refinementTolerance = 5e-6 # 1e-5 +refinementTolerance = 1e-5 # 1e-5 [u0.solver] tolerance = 1e-8 diff --git a/src/strikeslip/strikeslip.cc b/src/strikeslip/strikeslip.cc index eb17ed235d23b807c6a41d5be13da31d6f4dc5d0..850efc5d24e0c39e1ef8e111d734bf5a8bd9069b 100644 --- a/src/strikeslip/strikeslip.cc +++ b/src/strikeslip/strikeslip.cc @@ -299,8 +299,8 @@ int main(int argc, char *argv[]) { energyNorm += stateEnergyNorms[i]->diff(fineAlpha[i], coarseAlpha[i]); } - std::cout << "energy norm: " << energyNorm << " tol: " << refinementTolerance << std::endl; - std::cout << "must refine: " << (energyNorm > refinementTolerance) << std::endl; + //std::cout << "energy norm: " << energyNorm << " tol: " << refinementTolerance << std::endl; + //std::cout << "must refine: " << (energyNorm > refinementTolerance) << std::endl; return energyNorm > refinementTolerance; }; diff --git a/src/strikeslip/strikeslip.cfg b/src/strikeslip/strikeslip.cfg index bc5ed7cb383af18d030de175dff604b4a6190fde..25e4d47c86665f03c7bcf809a3973c2f7ee3ea18 100644 --- a/src/strikeslip/strikeslip.cfg +++ b/src/strikeslip/strikeslip.cfg @@ -55,7 +55,7 @@ sigmaN = 200.0 # [Pa] finalVelocity = 1e-4 # [m/s] [io] -data.write = false +data.write = true printProgress = true restarts.first = 0 restarts.spacing= 1 @@ -73,7 +73,7 @@ relativeTau = 2e-4 # 1e-6 [timeSteps] scheme = newmark -timeSteps = 5 +timeSteps = 5000 [u0.solver] maximumIterations = 100