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

Kratos rom nonconverged projected residuals #12283

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

SADPR
Copy link
Contributor

@SADPR SADPR commented Apr 16, 2024

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: Exported GetNonConvergedProjectedResiduals to Python to facilitate access from Python scripts.
  • Global ROM Builder and Solver:

    • applications/RomApplication/custom_strategies/global_rom_builder_and_solver.h: Implemented InitializeRomResidualsUtility for initialization with right ROM basis information. Added StoreAndAppendNonConvergedProjectedResiduals function to handle residuals using RomResidualsUtility->GetProjectedResidualsOntoPhi() and included AppendMatrixHorizontally for dynamic matrix appending across nonlinear iterations.
  • LSPG ROM Builder and Solver:

    • applications/RomApplication/custom_strategies/lspg_rom_builder_and_solver.h: Integrated StoreAndAppendNonConvergedProjectedResiduals with RomResidualsUtility->GetProjectedResidualsOntoJPhi(). Added ConvertEigenToKratos 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: Overridden SetUpDofSet to initialize RomResidualsUtility with Petrov-Galerkin specific settings. Added InitializeRomResidualsUtility and StoreAndAppendNonConvergedProjectedResiduals, which uses RomResidualsUtility->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 and applications/RomApplication/python_scripts/rom_solver.py: Updated settings to support the new features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
ROM Application Project
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

4 participants