KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.02k stars 245 forks source link

[Core] Adding a method to fetch the non-converged solutions from the NewtonRaphson strategy #12375

Closed Rbravo555 closed 4 months ago

Rbravo555 commented 4 months ago

📝 Description

This PR adds the possibility to store all nonconvereged solutions during the iterative procedure. After either convergence has been achieved or the maximum number of iterations has been reached, one can fetch a Kratos Matrix containing the nonconvereged solutions. The relevant method also returns the dof set in case the matrix should be treated.

If the Setup method is not called, no overhead is introduced.

🆕 Changelog

rubenzorrilla commented 4 months ago

Shouldn't we add this to the base implicit strategy?

Rbravo555 commented 4 months ago

Shouldn't we add this to the base implicit strategy?

The base class does not implement iterations. By adding this here, we ensure that non-converged solutions are collected for both the Newton-Raphson and Line Search strategies. Many applications do not re-implement this method in derived strategies, so we thought implementing it here is the most suitable approach.

matekelemen commented 4 months ago

Eeeh honestly this seems to me like a hack. I like the idea, but I'd rather add infrastructure to allow hooking output processes into the strategy base class. Is something like that possible?

RiccardoRossi commented 4 months ago

Eeeh honestly this seems to me like a hack. I like the idea, but I'd rather add infrastructure to allow hooking output processes into the strategy base class. Is something like that possible?

Well this would be a major change. As we discussed we should definitely do a redesign of the strategies etc and we could think about your proposal as a part of that, nevertheless this is a small, completely backward compatible, change. My proposal would be to accept it "as is" and discuss your proposal in the context of a "strategy v2", for example during your stay in BCN in 10 days from now

matekelemen commented 4 months ago

Fine by me.

RiccardoRossi commented 4 months ago

then i am approving