-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* write doc about : - parameters - petsc vectors - petsc matrix Write documentation on python x feel++ modules #151 [ci skip] * add documentation about parameters see commit feelpp/feelpp@9512e77 [ci skip] * add documentation about ModelProperties in python #151 * add documentation about functions wrapped in feelpp/feelpp@84a845d * up doc about `feelpp.mor._mor.ParameterSpace.New` [ci skip] * update doc according to feelpp/feelpp@2f3b94a * write documentation about online / offline usage * add title to the page [ci skip] * write doc about last modifications * move modelproperties to right directory * add details for `generate_basis` (and fix table of content) * fix nav to display rbm [ci skip] * doc : complete documentation about `reducedbasis` : offline and online * Update reducedbasis_online.adoc * add more details about reducedbasis in python #219 #151 /cc @prudhomm * fixes of some typos and remove files in double close #151
- Loading branch information
1 parent
a5fb45b
commit 5dffdc7
Showing
14 changed files
with
297 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* xref:index.adoc[Thermal fin] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
= Thermal fin | ||
|
||
The redaction of this page is in progress. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
= {feelpp} model order reduction in Python | ||
include::user:ROOT:partial$header-macros.adoc[] | ||
|
||
This sections present the modules developped and the function implemented to handle {feelpp} MOR objects in Python. The script link:https://github.com/feelpp/feelpp/blob/develop/mor/pyfeelpp-mor/feelpp/mor/toolboxmor.py[toolboxmor.py] presents the main features, on the case opus-heat. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 changes: 146 additions & 0 deletions
146
docs/user/modules/python/pages/pyfeelppmor/reducedbasis_offline.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
= Usage of Feelpp / Mor : Offline part | ||
|
||
:stem: latexmath | ||
|
||
== Usage | ||
|
||
This part can be run in parallel. | ||
|
||
.Usage of `generate_basis` script | ||
[source, bash] | ||
---- | ||
[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}] | ||
---- | ||
|
||
[[parameters]] | ||
.Parameters | ||
[cols="1,1,1"] | ||
|=== | ||
|Name|Description|Default value | ||
|
||
|`config-file` | ||
|path to config `cfg` file | ||
|_mandatory_ | ||
|
||
|`odir` | ||
|path to output directory, where data will be saved | ||
|_mandatory_ | ||
|
||
|`case` | ||
|name of the case | ||
|`generate_basis` | ||
|
||
|`dim` | ||
|dimension of the case (must be `2` or `3`) | ||
|_mandatory_ | ||
|
||
|`algo` | ||
|algorithm used to generate a basis, see <<Algorithms, table below>> | ||
|`1` | ||
|
||
|`train-size` | ||
|Size of the train set (depending on algorithm used) | ||
|`40` | ||
|
||
|`tol` | ||
|tolerance used for generating (depends on algorithm) | ||
|`1e-6` | ||
|
||
|`time-dependant` | ||
|time dependant case | ||
|`False` | ||
|=== | ||
|
||
|
||
|
||
[[Algorithms]] | ||
== Algorithms | ||
|
||
|
||
.Algorithms | ||
[cols='1,2,5'] | ||
|=== | ||
|Value|Algorithm|Description | ||
|
||
|`0` | ||
|From sample | ||
|Generates a basis of size stem:[N=]`train-size` elements, [log-]randomly taken in the space. | ||
|
||
|`1` | ||
|Greedy algorithm | ||
|Run the greedy algorithm on a train set of element of size `train-size`. This algorithm also stores the evolution of the maximal error bound at each step. | ||
|
||
|`2` | ||
|POD generation | ||
|Takes the largest POD modes from a basis of size `train-size`. The resulting basis will have a size stem:[N\leqslant]`train-size`. This algorithm also stores the evolution of the maximal error bound at each step. | ||
|
||
|=== | ||
|
||
WARNING: For now, the computation of error bound is only valid when the decomposition is coercive (_i.e._ stem:[A(\mu)=\displaystyle\sum_{q}\beta_A(\mu)A^q], with stem:[\beta_A(\mu)\geqslant 0]) | ||
|
||
[[offline]] | ||
== Exported files | ||
|
||
Here is a description of the generated files : | ||
|
||
1. A `JSON` file, exported in `odir` directory, containing the following informations : | ||
- `Qa` : Size of the decomposition of stem:[A(\mu)] | ||
- `Qf` : Size of the decomposition of stem:[F(\mu)] | ||
- `QLk` : Sizes of the decompositions of stem:[L_k(\mu)] for stem:[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 where `h5` file is stored | ||
- `mubar` : Values of stem:[\bar{\mu}] | ||
|
||
2. A `h5` file, containing all the matrices used in the online part (of « small » size). | ||
|
||
|
||
== Documentation for developpers | ||
|
||
The function to call to generate the basis is `generatebasis` : | ||
|
||
[source, python] | ||
---- | ||
import feelpp.mor.generate_basis as g # import the module | ||
g.generatebasis(worldcomm=worldcomm, config=config) # run the script | ||
---- | ||
|
||
Where : | ||
|
||
1. `worldcomm` is a pointer to the MPI communicator. This argument is optionnal. If none (or `None`) is given, the function will get the communicaotr from `feelpp.Environment`. | ||
|
||
2. `config` is an object of type `g.generateBasisConfig`. It contains the paramters used by the script to generate the application. | ||
|
||
[source, python] | ||
---- | ||
config = generateBasisConfig(dim, config_file, time_dependant, odir, case, algo, size, tol) | ||
---- | ||
|
||
The description and the default values of those parameters are descirbed <<parameters,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. | ||
|
||
|
||
[[files]] | ||
== Files created by {feelpp} | ||
|
||
Some files are created by {feelpp}. 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 option `toolboxmor.trainset-deim-size` and `trainset-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. |
Oops, something went wrong.