[Core] Enable analysis stage without solver#14318
Open
rubenzorrilla wants to merge 12 commits intomasterfrom
Open
[Core] Enable analysis stage without solver#14318rubenzorrilla wants to merge 12 commits intomasterfrom
rubenzorrilla wants to merge 12 commits intomasterfrom
Conversation
Member
|
CI is failing |
Member
Author
It is because I also took the chance to remove the 5 years old deprecated handling of output processes outside the corresponding |
Member
|
Once Ci passes ping me and I will approve |
…atosMultiphysics/Kratos into core/analysis-stage-wo-solver
roigcarlo
reviewed
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Description
This PR enables running
AnalysisStagewithout requiring a solver by introducing a Null Object pattern as more clean alternative to #14150.Previously,
_CreateSolver()was expected to always return a valid solver and raised an exception otherwise. This prevented the implementation of analysis stages that do not require a solver. APythonNullSolveris added and used as the default solver in the baseAnalysisStage. This allows solver calls to be executed unconditionally while safely performing no-ops when no solver is required.With this change:
AnalysisStage).if solver is not None) is introducedIn short, only change is that solver is now always present (real or "null").
Implementation details
python_null_solver.pycontainingPythonNullSolverand its singleton instancePYTHON_NULL_SOLVERto enforce statelessness and avoid allocations.AnalysisStage._CreateSolver()to returnPYTHON_NULL_SOLVERby default_GetSolver()_HasSolver()utility method to distinguish between real and null solverPythonNullSolverdynamically handles any method via__getattr__, returning a no-op callable. This enables dynamic handling of Python solver interface (just in case this changes in the future)._CreateSolver()method.Tests have been added accordingly.