Skip to content

[RomApp] RomParameters V2.0 - #14831

Draft
Rbravo555 wants to merge 1 commit into
masterfrom
rom/rom_parameters_generalization
Draft

Rbravo555 wants to merge 1 commit into
masterfrom
rom/rom_parameters_generalization

Conversation

@Rbravo555

Copy link
Copy Markdown
Member

📝 Description

While adding planned features to the RomApplication, it became clear that RomParameters.json is too rigid. The file controls too many things at once. It describes the trained ROM (basis, HROM weights, solver settings), and it also drives the workflow through flags (run_hrom, train_hrom, rom_manager) that the RomManager rewrites before every stage. This makes the file hard to extend to coupled physics. It is also not ready for the functionality planned for the near future, such as local ROMs (as opposed to global ones) and other nonlinear ROM methods.

This PR is the first step towards a standalone, composable description of a trained ROM (a "version 2" layout). No behaviour changes: files are still written in the current layout.

  • A new module, rom_parameters.py, is now the single owner of the format. Every Python read and write of RomParameters.json goes through it.
  • Files in either layout can be read, so a version 2 file already works with all the existing readers.
  • The version 2 layout organises the file into typed blocks:
    • deployment: default deployment options, replacing the flags.
    • components: one per solver, each with its `projecti
    • coupling: an optional block for coupled solvers.
    • hyper_reduction: the HROM data.
  • Numpy files are referenced explicitly instead of being found by naming convention.
  • The manifold separates two independent axes, so future changing the existing ones:
    • manifold.type: global (a single decoder) or local (a selector plus clusters, each with its own decoder).
    • decoder.type: linear or ann_enhanced today (the same values as the RomManager's type_of_decoder). New nonlinearrbf are added as new decoder types.
  • The conversion also covers the keys introduced by the open PRs [RomApp] coupled fluid-thermal & thermo-mechanical complete rom hrom workflow with rom manager #14826 (coupled_solvers) and [RomApp] HROM for ANN Enhanced ROMs #14785 (galerkin_ann/lspg_ann).
    Next steps (separate PRs):
  • Write version 2 files and stop rewriting flags from the RomManager.
  • Express coupled solvers as components.
  • Support segregated coupled bases (C++).
  • Make ANN-enhanced ROMs deployable standalone, then add local and other nonlinear decoders.
    Note: the C++ HromVisualizationMeshModeler still parses RomParameters.json directly. It must be updated before version 2

🆕 Changelog - Added rom_parameters.py: loader/writer for `RomParameversion between the current layout and the new version 2layout.

  • Moved all reads and writes of RomParameters.json onto rom_parameters.py: rom_analysis, RomManager._ChangeRomFlags, CalculateRomBasisOutputProcess, HRomTrainingUtility ality`.
  • Added test_rom_parameters.py to the small suite. It covers:
    • the conversion to version 2 and back for every committed test file;
    • coupled-solver and ANN-enhanced cases;
    • reading and writing files;
    • local manifolds and non-ANN nonlinear decoders, which cannot be written in the current layout.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant