Usage of Feelpp / Mor : Offline part
1. Usage
This part can be run in parallel.
generate_basis
script[mpirun -np <nproc>] python3 generate_basis.py
--config-file <path to cfg file>
--odir <path to export directory>
--dim <DIM>
--case <name of the case>
[--algo {0|1|2}]
[--train-size <size>]
[--tol <tol>]
[--time-dependant={True | False}]
Name | Description | Default value |
---|---|---|
|
path to config |
mandatory |
|
path to output directory, where data will be saved |
mandatory |
|
name of the case |
|
|
dimension of the case (must be |
mandatory |
|
algorithm used to generate a basis, see table below |
|
|
Size of the train set (depending on algorithm used) |
|
|
tolerance used for generating (depends on algorithm) |
|
|
time dependant case |
|
2. Algorithms
Value | Algorithm | Description |
---|---|---|
|
From sample |
Generates a basis of size \(N=\) |
|
Greedy algorithm |
Run the greedy algorithm on a train set of element of size |
|
POD generation |
Takes the largest POD modes from a basis of size |
For now, the computation of error bound is only valid when the decomposition is coercive (i.e. \(A(\mu)=\displaystyle\sum_{q}\beta_A(\mu)A^q\), with \(\beta_A(\mu)\geqslant 0\)) |
3. Exported files
Here is a description of the generated files :
-
A
JSON
file, exported inodir
directory, containing the following informations :-
Qa
: Size of the decomposition of \(A(\mu)\) -
Qf
: Size of the decomposition of \(F(\mu)\) -
QLk
: Sizes of the decompositions of \(L_k(\mu)\) for \(k\in\{1,n_\text{output}\}\), gathers in a list. -
N_output
: Number of output described in the JSON (CRBOutput
) -
output_names
: names of those outputs -
N
: Size of the reduced basis -
path
: Path whereh5
file is stored -
mubar
: Values of \(\bar{\mu}\)
-
-
A
h5
file, containing all the matrices used in the online part (of « small » size).
4. Documentation for developpers
The function to call to generate the basis is generatebasis
:
import feelpp.mor.generate_basis as g # import the module
g.generatebasis(worldcomm=worldcomm, config=config) # run the script
Where :
-
worldcomm
is a pointer to the MPI communicator. This argument is optionnal. If none (orNone
) is given, the function will get the communicaotr fromfeelpp.Environment
. -
config
is an object of typeg.generateBasisConfig
. It contains the paramters used by the script to generate the application.
config = generateBasisConfig(dim, config_file, time_dependant, odir, case, algo, size, tol)
The description and the default values of those parameters are descirbed above.
If odir
contains $name
, this expression will be replaced by the name of the case, defined by concatenation <case>-np_<nproc>
, where case
is the name of the case given in the configuration, and nproc
is the number of processors where the simulation is run.
5. Files created by Feel++
Some files are created by Feel++. The emplacement of those file is important because they are used by the online part. In the following list, <feel-dir>
represents the path to the feel
directory. If nothing has been change in ~/.feelppconfig
, the path to the <feel-dir>
is ~/feel
.
-
Model repository :
<feel-dir>/crbdb/<name>/<uuid>
, where :-
<name>
is the name of the case, defined by the option--case
. -
<uuid>
is a unique identifier of the model, computed by the toolbox. This repository contains the meshes for the EIM decomposition.
-
-
DEIM and MDEIM sampling files :
<feel-dir>/generate_basis-<name>/np_<nproc>/DmuDEim-P<dim>-Ne<size>-generated-by-master-proc
:-
<dim>
is the dimension of the parameter space. -
<size>
is the size of the train set used on the EIM algorithm. This corresponds to the optiontoolboxmor.trainset-deim-size
andtrainset-mdeim-size
in the cfg file. Those two files (one for the EIM decomposition of the matrix, and one for the EIM decomposition of the right-hand side) are generated by the toolbox, and contain the values of the parameters used to generate the basis.
-