-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyfeelpp documentation #222
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c8b4d4b
write doc about :
thomas-saigre 47c647c
add documentation about parameters
thomas-saigre 249542e
add documentation about ModelProperties in python #151
thomas-saigre 942996d
Merge branch 'develop' into saigre/pyfeelpp
thomas-saigre c327629
add documentation about functions wrapped in feelpp/feelpp@84a845d8a6…
thomas-saigre 4c09045
up doc about `feelpp.mor._mor.ParameterSpace.New`
thomas-saigre b460eea
update doc according to feelpp/feelpp@2f3b94aca6062ed6dd334795d677ba1…
thomas-saigre 0824530
write documentation about online / offline usage
thomas-saigre 7ef95b8
add title to the page
thomas-saigre 3df3b6f
write doc about last modifications
thomas-saigre 7c4f04d
move modelproperties to right directory
thomas-saigre 43ab3a9
add details for `generate_basis`
thomas-saigre 48d2190
fix nav to display rbm
thomas-saigre 27605b3
doc : complete documentation about `reducedbasis` :
thomas-saigre 6957d20
Update reducedbasis_online.adoc
thomas-saigre 03dee45
Merge remote-tracking branch 'origin/develop' into saigre/pyfeelpp
thomas-saigre 5593f0f
add more details about reducedbasis in python #219 #151
thomas-saigre 461646a
fixes of some typos and remove files in double
thomas-saigre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add
to generate a notebook