Skip to content

Build ROM

Kevin" Seung Whan Chung edited this page Dec 17, 2023 · 3 revisions

TL;DR

In this section of the tutorial, we run the following commands:

cd examples/poisson
../../bin/main -i poisson.sample.yml
../../bin/main -i poisson.train.yml
../../bin/main -i poisson.build.yml

By "building ROM", we here refer to the Galerkin projection of the governing equation onto the ROM basis subspace that are obtained from training ROM stage. This is specified in the input file as main/mode,

main:
  mode: build_rom
  use_rom: true
  solver: poisson

Note that we need to turn on main/use_rom for this mode. Just as for train_rom mode, build_rom mode requires the list of basis tags in the input file.

In order to generate samples and perform POD over snapshots, we run the following commands (same as the previous sections of the tutorial):

cd examples/poisson
../../bin/main -i poisson.sample.yml
../../bin/main -i poisson.train.yml

Now, to build the projected ROM operator, we run the following command:

../../bin/main -i poisson.build.yml

which will return the output as below:

Screenshot 2023-12-17 at 3 16 32 PM

Saving ROM operator at different levels

The command above will save the ROM operator into a hdf5 file named rom_oper.h5. Related input options for saving ROM operator are specified as model_reduction/save_operator. In the example of examples/poisson/poisson.build.yml,

model_reduction:
  save_operator:
    level: global
    prefix: rom_oper

There are mainly two input options for saving ROM operator:

  • model_reduction/save_operator/prefix: the filename of the ROM operator. The extension .h5 will be added to the filename.
  • model_reduction/save_operator/level: the level of ROM operator that will be saved. There are two different levels:
    • global: the projection of the global, large-scale system matrix operator.
    • component: the projection of the interior/boundary/interface matrix operators of the reference components.

The difference between global and component is that the global level requires the assembly of the global matrix operator, while the component level only needs the operators of the reference components. Therefore component level of saving operator is recommended in general.

NOTE: Whether global or component level, build_rom mode requires a global configuration file (or global mesh file) so that all required interface operators can be listed out.

Visualization of POD basis

It is in this build_rom mode that we can save the visualization of the POD basis for each reference component. In examples/poisson/poisson.build.yml, the input option for ROM basis visualization is specified as basis/visualization,

basis:
  visualization:
    enabled: true
    prefix: "poisson0_basis"

When the visualization is enabled, build_rom saves the ParaView visualization of POD basis per each reference component.

empty component:

square-circle component:

square-triangle component:

square-star component: