-
Notifications
You must be signed in to change notification settings - Fork 248
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
Kratos lspg hrom #11569
Merged
Merged
Kratos lspg hrom #11569
Conversation
This file contains 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
SADPR
assigned roigcarlo, RiccardoRossi, rubenzorrilla, jtneto, Rbravo555, Marco1410 and NicolasSR
Sep 19, 2023
Rbravo555
reviewed
Sep 22, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminary review looking good. Just two comments that could well be added as TODOs for future PRs
what is missing here? |
Let us just catch whether "elemental" or "global" is requested for LSPG, and raise a warning when "elemental" is selected. Only "global" LSPG is implemented |
Rbravo555
approved these changes
Oct 19, 2023
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
The main developments for enabling the LSPG HROM involved the inclusion of a set of complementary elements and conditions corresponding to the HROM selected subset of elements and conditions.
In essence, the HROM LSPG is first assembled by iterating over the subset of HROM selected elements and multiplying them by positive weights. This results in the system:
$$J_h \Phi q = - R_h $$
$$\Psi = J_{c} \Phi $$ $J_c$ is assembled with the subset of HROM selected elements plus the complementary mesh, i.e., the neighboring nodes of this subset. After constructing $J_c$ , it's essential to zero out the degrees of freedom that are not part of the subset of HROM element's DOFs. This ensures that only the relevant DOFs contribute to the projection.
For LSPG projection, we multiply by a left Reduced Order Basis (ROB), defined as:
Here,
This gives:
$$\Psi^T J_h \Phi q = -\Psi^T R_h$$
or equivalently,
$$(J_{c} \Phi)^T J_h \Phi q = -(J_{c} \Phi)^T R_h$$
Changes in LSPG Builder and Solver:
SetUpDofSet
SetUpDofSet
to introduce the complementary mesh elements.FindNeighbouringElementsAndConditions(rModelPart)
.BuildWithComplementaryMeshAndApplyDirichletConditions
InitializeSelectedDofs
mSelectedDofs
set with the DOFs that are part of the selected elements and conditions. This set is then used to determine which rows of the system matrix should be zeroed out in subsequent time steps.ZeroOutUnselectedComplementaryMeshRows
mSelectedDofs
set to determine which rows should remain non-zero.BuildWithComplementaryMesh
Summary of other Changes:
applications/RomApplication/custom_python/add_custom_utilities_to_python.cpp
applications/RomApplication/custom_utilities/rom_auxiliary_utilities.cpp
&applications/RomApplication/custom_utilities/rom_auxiliary_utilities.h
SetHRomComputingModelPartWithNeighbours
to set the HROM model part, including neighboring entities based on nodal weights.GetJPhiElemental
function to obtain the JPhi elemental matrix for a particular element.applications/RomApplication/custom_utilities/rom_residuals_utility.h
GetProjectedResidualsOntoJPhi
for obtaining projected residuals.applications/RomApplication/python_scripts/hrom_training_utility.py
applications/RomApplication/python_scripts/petrov_galerkin_training_utility.py
GetRightRomBasis
toGetRightROMBasis
.applications/RomApplication/python_scripts/rom_manager.py
trainHROMLSPG
andrunHROMLSPG
options within theself._ChangeRomFlags
method to accommodate HROM LSPG simulations.Test-related changes:
applications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/ExpectedOutputLSPGHROM.npy
applications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/ProjectParametersHROM.json
applications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/couette_flow_testHROM.mdpa
applications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/rom_data/HROM_ConditionIds.npy
applications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/rom_data/HROM_ConditionWeights.npy
applications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/rom_data/HROM_ElementIds.npy
applications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/rom_data/HROM_ElementWeights.npy
applications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/rom_data/RomParameters.json
applications/RomApplication/tests/test_fluid_lspg_rom.py