Revamp "builder_and_solver_settings" for StructuralMechanicsAnalysis#13272
Revamp "builder_and_solver_settings" for StructuralMechanicsAnalysis#13272matekelemen merged 4 commits intomasterfrom
"builder_and_solver_settings" for StructuralMechanicsAnalysis#13272Conversation
|
I would agree if the @KratosMultiphysics/technical-committee agrees, specially if @KratosMultiphysics/fluid-dynamics in order to be consistent |
|
Honestly I'd avoid this considering that we're getting rid of the B&S soon. Instead, I'd discuss the I/O for the new building settings. |
|
Without this PR, however I try to add my B&S from #13276 will be a massive hack. I'd prefer transitioning to the new strategies from a cleaner state rather than an ugly one. |
There was a problem hiding this comment.
my problem with this is that it destroys the backward compatibility.
we need to have a mechanism that if someone has a old file using the old mechanism it still works
on the line of:
if(parameters.Has(block_builder_and_solver) :
throw watning
type = block
else
...
JSONs ( |
|
By the way, our approach to deprecation is completely broken. The deprecated settings you see in Relying on the due diligence of downstream developers to update their code is clearly not working if there is no threat of their code eventually breaking one day. |
The other day I removed the mesh_id of the processes. I understand the concerns. Maybe we need something to properly manage consistently the deprecation, I will think about it. |
For example adding special tags in the parameters and a method to specifically validate parameters including deprecated ones, I need to think about it. |
|
Having dealt with this particular problem a frustratingly high number of times, my recommendation is to go ahead with this PR and continue to adapt it for future developments when the need arises. Otherwise, as @matekelemen states, this is a big blocker for progress/developments |
|
I need a review on this PR @KratosMultiphysics/structural-mechanics.
@RiccardoRossi I'm not sure whether I got my point across last time: I'm already doing this. |
philbucher
left a comment
There was a problem hiding this comment.
Makes sense to me, proper cleanup 👍🏻
| for old_setting in old_unused_settings: | ||
| if settings.Has(old_setting): | ||
| KratosMultiphysics.Logger.PrintWarning("::[MechanicalSolver]:: ", 'Settings contain no longer used setting, please remove it: "{}"'.format(old_setting)) | ||
| settings.RemoveValue(old_setting) |
There was a problem hiding this comment.
I think its time to issue an error. This has been deprecated for years
|
ok, this makes sense also for me. @KratosMultiphysics/technical-committee has the final decision ... (and also should take a look at the deprecation comment) |
maybe we also need to update our GiD interface... |
|
we should, nevertheless the old version should still work |
RiccardoRossi
left a comment
There was a problem hiding this comment.
@KratosMultiphysics/technical-committee agrees provided that backward compatibility is guaranteed (which i understand is the case).
I will open a separate issue to decide what to do about "historically deprecated" stuff
|
@matekelemen why you did not merge this finally? |
Changes
Choosing and configuring a
BuilderAndSolverin a solver is weird and inconsistent with other types of settings such as configuring aSolvingStrategy.This PR refactors what
StructuralMechanicsSolverexpects in"builder_and_solver_settings"... "builder_and_solver_settings" : { + "type" : "block", - "use_block_builder" : true, - "use_lagrange_BS" : false, "advanced_settings" : {} } ...Now
"type"is the only parameter that decides whichBuilderAndSolverto use. Current options are"block"refers toResidualbasedBlockBuilderAndSolver"block_lagrange"refers toResidualbasedBlockBuilderAndSolverWithLagrangeMultiplier"elimination"refers to eitherResidualBasedEliminationBuilderAndSolverorResidualBasedEliminationBuilderAndSolverWithConstraints, depending on whether the system has constraintsThis makes it much easier and cleaner to integrate more
BuilderAndSolvertypes. The current system is still supported, but will issue a deprecation warning.Notes
The
"block_builder"flag in the solver's settings has been deprecated for 5 years. I tried removing it but saw that most downstream apps, as well as test cases still heavily use this setting, and even add new code using it. Please don't ignore deprecation warnings.A quick grep shows the following applications using this deprecated setting:
@KratosMultiphysics/dem @KratosMultiphysics/geomechanics @KratosMultiphysics/nurbs-breps @KratosMultiphysics/mpm @KratosMultiphysics/pfem @KratosMultiphysics/poromechanics @trilinos