diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index e25b11c3b1970b24f00c3d75bd511b11903928d2..64916565afe242c8254b8c64bac059097975f29d 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -332,6 +332,8 @@ int main(int argc, char *argv[]) { ; std::fstream iteration_writer("iterations", std::fstream::out); ; + std::fstream damping_writer("damping", std::fstream::out); + ; auto timeSteppingScheme = initTimeStepper(parset.get<Config::scheme>("timeSteppingScheme"), @@ -411,11 +413,13 @@ int main(int argc, char *argv[]) { stateUpdater->extractState(computed_state); double const correction = diff_two_norm(computed_state, alpha); if (state_fpi <= 2 // Let the first two steps pass through unchanged - || correction < minimalCorrectionReduction * lastCorrection) + || correction < minimalCorrectionReduction * lastCorrection) { alpha = computed_state; - else { + damping_writer << "N "; + } else { alpha *= damping; alpha.axpy(1.0 - damping, computed_state); + damping_writer << "Y "; } lastCorrection = correction; } @@ -463,6 +467,7 @@ int main(int argc, char *argv[]) { velocity_writer << std::endl; coefficient_writer << std::endl; iteration_writer << std::endl; + damping_writer << std::endl; if (parset.get<bool>("writeVTK")) { SingletonVectorType vonMisesStress; @@ -488,6 +493,7 @@ int main(int argc, char *argv[]) { velocity_writer.close(); coefficient_writer.close(); iteration_writer.close(); + damping_writer.close(); Python::stop(); }