Commit 1d21458e authored by lisa_julia.nebel_at_tu-dresden.de's avatar lisa_julia.nebel_at_tu-dresden.de
Browse files

Write out steps in the TR-solver

parent f7820181
Pipeline #51188 failed with stage
in 12 minutes and 42 seconds
......@@ -435,6 +435,10 @@ void TrustRegionSolver<BasisType,VectorType>::solve()
}
const auto dim = VectorType::value_type::dimension;
Dune::BlockVector<Dune::FieldVector<double,dim> > identityDeformation(assembler_->basis_.size());
Dune::Functions::interpolate(assembler_->basis_, identityDeformation, [](Dune::FieldVector<double,dim> x){ return x; });
CorrectionType corr(rhs.size());
corr = 0;
bool solvedByInnerSolver = true;
......@@ -656,6 +660,20 @@ void TrustRegionSolver<BasisType,VectorType>::solve()
if (trustRegion.radius() < 1e-9 && this->verbosity_ == NumProc::FULL and rank==0)
std::cout << "The radius is too small to continue with a meaningful calculation!" << std::endl;
}
if (solvedByInnerSolver) {
//Print this and then we can read it back in
std::ofstream file;
std::string deformationOutput = "deformationOutput";
file.open(deformationOutput);
for (int i = 0; i < identityDeformation.size(); i++){
auto displacement_here = x_[i] - identityDeformation[i];
file << identityDeformation[i] << ":" << displacement_here << "\n";
}
file.close();
}
std::cout << "iteration took " << totalTimer.elapsed() << " sec." << std::endl;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment