-
Notifications
You must be signed in to change notification settings - Fork 5
Main driver and input parsing
bin/main
is the main executable that handles the entire workflow from sample generation to ROM prediction.
Syntax:
main -i input_file -f key1=val1:key2=val2:...
bin/main
mainly takes the options from a YAML-based input file. One example of running a full order model (FOM) single prediction of Poisson equation can be found in examples/poisson
. From the built directory,
cd examples/poisson
../../bin/main -i poisson.yml
In essence, this reads a mesh file meshes/test.2x2.mesh
, refines it 5 times, and solves FOM Poisson equation with a parameterized problem poisson0
. poisson0
defines a right-hand side and a boundary condition as:
poisson.yml
file,
single_run:
poisson0:
k: 2.5
which sets the parameters as:
paraview_output
, shown as below:
It is possible to overwrite an input option in runtime, not changing the original input file. This can be done by using forced input argument. The syntax is:
main -i input_file -f key1=val1:key2=val2:...
The command above will read the option from input file
, overwrite the option key1
, key2
, ... to have a value val1
, val2
, ... respectively, then run the normal workflow. The YAML levels of key1
is specified by /
.
For example, if we want to solve the same problem as above but with a different
../../bin/main -i poisson.yml -f single_run/poisson0/k=1.5
will return a solution with
The main
category in the input file specifies the mode of main
and the type of the solver. For example, examples/poisson/poisson.yml
specifies,
main:
mode: single_run
use_rom: false
solver: poisson
that (1) it is single_run
mode, (2) FOM simulation will be run, and (3) Poisson equation will be solved.
At single_run
mode, the equation will be solved on a particular right-hand side function and boundary condition set by the parameterized problem. In examples/poisson/poisson.yml
, the type of the parameterized problem is set as:
parameterized_problem:
name: poisson0
There are a variety of parameterized problems defined for each physics solver, which can be found in the source code include/parameterized_problem.hpp.
The parameters for each parameterized problem can be set under single_run/[the name of parameterized problem]
. For example of examples/poisson/poisson.yml
, as we have seen above,
single_run:
poisson0:
k: 2.5