Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ROM] Unify ROM solver #9490

Merged
merged 11 commits into from
Jan 3, 2022
Merged

[ROM] Unify ROM solver #9490

merged 11 commits into from
Jan 3, 2022

Conversation

rubenzorrilla
Copy link
Member

📝 Description
Similar to what we did in #9439 with the RomAnalysisStage, in this PR I'm unifying the ROM solvers in a new RomSolver. The dynamic inheritance mechanism is equivalent to that of #9439. In order to keep backwards compatibility I kept the old solvers (adding a deprecation warning) and created a new_python_solvers_wrapper_rom.py module. This module filters the base solver from which the ROM solver has to inherit.

In this regard I'd like to note that, if we had a unified name for all the Python solvers wrapper (e.g. python_solvers_wrapper instead of python_solvers_wrapper_fluid), the new ROM wrapper would be simplified and easier to maintain. In my opinion, it makes not so much sense to have different names for the Python solvers wrappers among applications if we follow the rule that one application should have only one "standard" wrapper (I said standard because of the adjoints). In any case this is to be discussed in an independent issue.

This requires #9467 to be merged first.

@rubenzorrilla rubenzorrilla added Duplicate Enhancement Cleanup Applications Refactor When code is moved or rewrote keeping the same behavior labels Dec 27, 2021
@rubenzorrilla rubenzorrilla self-assigned this Dec 27, 2021
@rubenzorrilla rubenzorrilla requested review from a team as code owners December 27, 2021 09:55
@sunethwarna
Copy link
Member

I have a small question regarding the GetDofsList method. If this is becoming the standard, can we use this method to correctly define the dofs rather than using model part elements to get the dofs list. So then we can simplify AddDofs method to use it?

@rubenzorrilla
Copy link
Member Author

memo Description Similar to what we did in #9439 with the RomAnalysisStage, in this PR I'm unifying the ROM solvers in a new RomSolver. The dynamic inheritance mechanism is equivalent to that of #9439. In order to keep backwards compatibility I kept the old solvers (adding a deprecation warning) and created a new_python_solvers_wrapper_rom.py module. This module filters the base solver from which the ROM solver has to inherit.

In this regard I'd like to note that, if we had a unified name for all the Python solvers wrapper (e.g. python_solvers_wrapper instead of python_solvers_wrapper_fluid), the new ROM wrapper would be simplified and easier to maintain. In my opinion, it makes not so much sense to have different names for the Python solvers wrappers among applications if we follow the rule that one application should have only one "standard" wrapper (I said standard because of the adjoints). In any case this is to be discussed in an independent issue.

This requires #9467 to be merged first.

See my last comment regarding the GetDofsList (PR #9467).

@@ -0,0 +1,61 @@
import sys
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend coming up with a better name rather than prepending with new_
remember how long we were stuck with the new_linear_solver_factory 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄 Considering that this is a small research application I don't think we'll need to change keep backwards compatibility for a very long period of time. Indeed, the plan is to remove the old stuff ASAP. I'd keep the new_ to constantly remind us to do it 😄.

rubenzorrilla and others added 4 commits December 27, 2021 13:49
making rom_analysis compatible with empty "nodal_unknowns" list in "rom_parameters"
Copy link
Member

@Rbravo555 Rbravo555 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now

applications/RomApplication/python_scripts/rom_solver.py Outdated Show resolved Hide resolved
@rubenzorrilla rubenzorrilla merged commit 52ca76a into master Jan 3, 2022
@rubenzorrilla rubenzorrilla deleted the rom/unify-rom-solver branch January 3, 2022 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Applications Cleanup Duplicate Enhancement Refactor When code is moved or rewrote keeping the same behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants