Merged
Conversation
Rbravo555
reviewed
Sep 22, 2023
Member
Rbravo555
left a comment
There was a problem hiding this comment.
Preliminary review looking good. Just two comments that could well be added as TODOs for future PRs
Member
|
what is missing here? |
Member
|
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
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
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:
SetUpDofSetSetUpDofSetto introduce the complementary mesh elements.FindNeighbouringElementsAndConditions(rModelPart).BuildWithComplementaryMeshAndApplyDirichletConditionsInitializeSelectedDofsmSelectedDofsset 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.ZeroOutUnselectedComplementaryMeshRowsmSelectedDofsset to determine which rows should remain non-zero.BuildWithComplementaryMeshSummary of other Changes:
applications/RomApplication/custom_python/add_custom_utilities_to_python.cppapplications/RomApplication/custom_utilities/rom_auxiliary_utilities.cpp&applications/RomApplication/custom_utilities/rom_auxiliary_utilities.hSetHRomComputingModelPartWithNeighboursto set the HROM model part, including neighboring entities based on nodal weights.GetJPhiElementalfunction to obtain the JPhi elemental matrix for a particular element.applications/RomApplication/custom_utilities/rom_residuals_utility.hGetProjectedResidualsOntoJPhifor obtaining projected residuals.applications/RomApplication/python_scripts/hrom_training_utility.pyapplications/RomApplication/python_scripts/petrov_galerkin_training_utility.pyGetRightRomBasistoGetRightROMBasis.applications/RomApplication/python_scripts/rom_manager.pytrainHROMLSPGandrunHROMLSPGoptions within theself._ChangeRomFlagsmethod to accommodate HROM LSPG simulations.Test-related changes:
applications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/ExpectedOutputLSPGHROM.npyapplications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/ProjectParametersHROM.jsonapplications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/couette_flow_testHROM.mdpaapplications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/rom_data/HROM_ConditionIds.npyapplications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/rom_data/HROM_ConditionWeights.npyapplications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/rom_data/HROM_ElementIds.npyapplications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/rom_data/HROM_ElementWeights.npyapplications/RomApplication/tests/fluid_dynamics_test_files/LSPGHROM/rom_data/RomParameters.jsonapplications/RomApplication/tests/test_fluid_lspg_rom.py