Kratos rom nonconverged projected residuals #12283
Draft
+250
−15
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.
Overview
This PR introduces enhancements to allow the inclusion of non-converged projected residuals for HROM training. This information is vital for ECMs to utilize details from the nonlinear iterations. Modifications have been made to the Global ROM Builder and Solver classes. Further enhancements for elemental ROM builder and solvers will be covered in a subsequent PR to maintain clarity and brevity in this submission.
Changes Made
Python Exports:
applications/RomApplication/custom_python/add_custom_strategies_to_python.cpp
: ExportedGetNonConvergedProjectedResiduals
to Python to facilitate access from Python scripts.Global ROM Builder and Solver:
applications/RomApplication/custom_strategies/global_rom_builder_and_solver.h
: ImplementedInitializeRomResidualsUtility
for initialization with right ROM basis information. AddedStoreAndAppendNonConvergedProjectedResiduals
function to handle residuals usingRomResidualsUtility->GetProjectedResidualsOntoPhi()
and includedAppendMatrixHorizontally
for dynamic matrix appending across nonlinear iterations.LSPG ROM Builder and Solver:
applications/RomApplication/custom_strategies/lspg_rom_builder_and_solver.h
: IntegratedStoreAndAppendNonConvergedProjectedResiduals
withRomResidualsUtility->GetProjectedResidualsOntoJPhi()
. AddedConvertEigenToKratos
to convert Eigen matrices to Kratos format for compatibility.Global Petrov-Galerkin ROM Builder and Solver:
applications/RomApplication/custom_strategies/global_petrov_galerkin_rom_builder_and_solver.h
: OverriddenSetUpDofSet
to initializeRomResidualsUtility
with Petrov-Galerkin specific settings. AddedInitializeRomResidualsUtility
andStoreAndAppendNonConvergedProjectedResiduals
, which usesRomResidualsUtility->GetProjectedResidualsOntoPsi()
for storing residuals.Python Scripts:
applications/RomApplication/python_scripts/hrom_training_utility.py
: Updated to retrieve non-converged projected residuals from the C++ B&S.applications/RomApplication/python_scripts/rom_analysis.py
andapplications/RomApplication/python_scripts/rom_solver.py
: Updated settings to support the new features.