Skip to content

[RomApp] Adding Futures to RomApplication - #14850

Open
Rbravo555 wants to merge 8 commits into
masterfrom
rom/future_rom
Open

Rbravo555 wants to merge 8 commits into
masterfrom
rom/future_rom

Conversation

@Rbravo555

@Rbravo555 Rbravo555 commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

📝 Description

This PR adds a first version of the RomApplication on top of the Kratos Future solving strategies. It needs Kratos compiled with -DKRATOS_USE_FUTURE=ON; without it nothing new is compiled and the new tests are skipped. The legacy ROM builder and solvers are not modified and remain the default. The architecture and the open questions are in the discussion #14902.

The ROM is split in three parts: a decoder u = D(q) in Python, the Future scheme for the full order system, and a C++ projector that builds, projects and solves the reduced system. The nonlinear loop on the reduced coordinates is done in Python.

At this stage it runs static problems (Future StaticScheme). Time integration schemes will be added when they are available in the core.

The fixed DOFs can be decoded in two ways, "fixed_dofs_decoding": "basis" (default, u0 + Phi q on all the DOFs) or "prescribed" (the values imposed in each step, FixedDofsDecoder, wrapping any decoder). The ROM solution is the same with both.

Current limitations:

  • Galerkin projection only (no LSPG or Petrov-Galerkin).
  • Linear decoder only, read from the rom_data folder of the RomManager.
  • No HROM yet. ImplicitScheme::Build assembles all the entities without weights, so it needs either a derived scheme in the RomApplication or a small extension of the core.
  • OpenMP only.
  • Not launched from the RomManager yet. It is used through CreateFutureRomAnalysisInstance, which wraps a standard analysis stage.

🆕 Changelog

  • future/rom_projector.h: added RomProjector (C++): BuildEffectiveSystem(), Project() (Galerkin, fixed DOFs through the basis), SolveReduced(), SetSolution()
  • custom_python/add_future_utilities_to_python.h/.cpp, rom_python_application.cpp: exported RomProjector in the new KratosROM.Future submodule
  • CMakeLists.txt: compiles the Future utilities only with KRATOS_USE_FUTURE=ON
  • python_scripts/future/rom_decoders.py: added RomDecoder (NumberOfRomDofs(), Decode(), Jacobian(), InitializeSolutionStep()), LinearDecoder and FixedDofsDecoder (fixed DOFs with the values prescribed in the step, zero rows of the Jacobian)
  • python_scripts/future/rom_future_solver.py: added FutureRomSolver (Newton loop on the reduced coordinates, with the convergence criterion of the legacy displacement criterion: ratio or absolute norm of the increment of the free DOFs, relative_tolerance and absolute_tolerance) and NumpyRomProjector (NumPy reference of RomProjector); setting "fixed_dofs_decoding" ("basis" or "prescribed")
  • python_scripts/future/future_rom_analysis.py: added CreateFutureRomAnalysisInstance() (the nonlinear settings not given take the max_iteration and, with a displacement criterion, the tolerances of the solver of the case; linear analyses in one iteration, as the legacy linear strategy; the scheme moves the mesh when the solver does, move_mesh_flag; the decoder wrapped in a FixedDofsDecoder with "prescribed")
  • test_future_rom_projector.cpp: added FutureRomProjectorGalerkin and FutureRomProjectorEquationIdPermutation (same reduced system and solution with the node ids, and so the equation ids, permuted)
  • test_future_rom.py: added testStructuralStaticRom2D, testStructuralStaticTotalLagrangianRom2D (geometrically nonlinear cantilever), testConvDiffStationaryRom2D (against the legacy ROM builder and solvers) and testConvDiffStationaryRomFixedDofsDecoding (prescribed values on the fixed DOFs, same solution as "basis")
  • tests/future_rom_test_files/TotalLagrangianROM: data of testStructuralStaticTotalLagrangianRom2D
  • test_RomApplication.py: added TestFutureRom to the small suite

🧱 Stacked PRs
PRs built on this one. Each is retargeted to the next base when its base merges.

flowchart RL
    master["master"]
    p14850["#14850 Futures in the RomApp"]
    p14903["#14903 Future HROM"]
    p14953["#14953 Future HROM training"]
    p14955["#14955 Reduced residual criterion"]
    p14911["#14911 Nonlinear decoders: base"]
    p14912["#14912 Quadratic decoder"]
    p14913["#14913 ANN-enhanced decoder"]
    p14914["#14914 RBF-enhanced decoder"]
    p14850 --> master
    p14903 --> p14850
    p14953 --> p14903
    p14955 --> p14850
    p14911 --> p14850
    p14912 --> p14911
    p14913 --> p14911
    p14914 --> p14911
    classDef ready fill:#d8f0d8,stroke:#444
    classDef draft fill:#dde7f5,stroke:#444
    classDef merged fill:#e6dcf5,stroke:#444
    class p14850,p14903,p14953,p14911,p14912,p14913,p14914,p14955 ready
Loading

Green: ready for review, blue: draft, purple: merged.

@Rbravo555
Rbravo555 marked this pull request as ready for review October 21, 2026 10:00
@Rbravo555
Rbravo555 requested a review from a team as a code owner October 21, 2026 10:00

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants