Single run with ROM and the entire workflow - LLNL/scaleupROM GitHub Wiki

This last section of the tutorial covers the single run with ROM and summarizes the entire workflow.

Main workflow

While many input files have been used throughout the tutorial, here we use one single input file examples/poisson/poisson.full.yml, which specifies the options for all stages. For each stage, we only need to specify main/mode and main/use_rom at run-time command:

  1. sample generation: in this example, 5 samples are generated.
cd examples/poisson
../../bin/main -i poisson.full.yml -f main/mode=sample_generation
  1. training ROM: in this example, subdomain training mode is universal.
../../bin/main -i poisson.full.yml -f main/mode=train_rom
  1. building ROM: in this example, ROM operator is saved at component level.
../../bin/main -i poisson.full.yml -f main/mode=build_rom:main/use_rom=true
  1. single run with ROM (the input file specifies main/mode as single_run, so no need to specify it)
../../bin/main -i poisson.full.yml -f main/use_rom=true

Solver options for the single run with ROM

The input options for solving the ROM governing equation are specified under model_reduction. In the example of examples/poisson/poisson.full.yml,

model_reduction:
  linear_solver_type: direct
  linear_system_type: spd

indicates that the ROM will be solved with a direct LU solver, with the system specified as symmetric positive definite (spd). The available options are:

  • model_reduction/linear_solver_type:
    • direct: direct LU solver (using MUMPS package)
    • cg: conjugate gradient solver
    • minres: minimum-residual method
  • model_reduction/linear_system_type:
    • spd: symmetric positive definite
    • sid: symmetric indefinite
    • us: unsymmetric

NOTE: only direct solver will use the input option model_reduction/linear_system_type.

Comparison with FOM

The assembly/computation time and the relative error of the ROM can be compared with the FOM solution. In the example of examples/poisson/poisson.full.yml, the option for comparison is specified as

model_reduction:
  compare_solution:
    enabled: true

The example of the main workflow shows the comparison result as below:

Saving the comparison output to a hdf5 file

It's possible to save the assembly/computation time of both ROM and FOM and the relative error of the ROM solution. This can be specified with -o [file_name] flag on the command. For example, at the last stage of the main workflow, running

../../bin/main -i poisson.full.yml -f main/use_rom=true -o comparison.h5

will save the comparison result into comparison.h5 file: