-
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.
- parameters - petsc vectors - petsc matrix Write documentation on python x feel++ modules #151 [ci skip]
- Loading branch information
1 parent
5926664
commit c8b4d4b
Showing
4 changed files
with
79 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
= {feelpp} model order reduction in Python | ||
include::{partialsdir}/header-macros.adoc[] | ||
|
||
This sections present the modules developped and the function implemented to handle {fpp} 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. | ||
|
33 changes: 33 additions & 0 deletions
33
docs/user/modules/python/pages/pyfeelppmor/parameters.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,33 @@ | ||
= Parameters | ||
|
||
Class `ParameterSpaceElement` (more precisely `feelpp.mor._mor.ParameterSpaceElement`). Contains the parameters of the problem. | ||
|
||
.Get a parameter from the model | ||
[source,python] | ||
---- | ||
Dmu = model.parameterSpace() | ||
mu = Dmu.element(True, False) | ||
---- | ||
|
||
|
||
== Methods | ||
|
||
* `__call__(i: int)` -> `float` : return the _i_-th parameter | ||
|
||
* `__str__()` : | ||
|
||
[source,python] | ||
---- | ||
>>> print("mu =", mu) | ||
mu = [4.37e+00,2.92e+00,1.17e+00,8.75e+05,5.28e+05,2.83e+01] | ||
---- | ||
|
||
* `parameterName(i: int)` -> `str` : return the named of the _i_-th parameter | ||
|
||
* `parameterNamed(name: str)` -> `float` : return the parameter named `str` | ||
|
||
* `setParameter(i: int, value: float)` : set the _i_-th to `value` | ||
|
||
* `setParameterNamed(name: str, value: float)` : set the parameter `name` to `value` | ||
|
||
* `size()` -> `int` : return the size of the parameter |
38 changes: 38 additions & 0 deletions
38
docs/user/modules/python/pages/pyfeelppmor/petscDouble.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,38 @@ | ||
== Vector PETSc Double | ||
|
||
Class `VectorPetscDouble` (`feelpp._alg.VectorPetscDouble`) | ||
|
||
|
||
=== Methods | ||
|
||
* `__init__(*args, **kwargs)` : Overloaded function. | ||
|
||
1. `__init__()`. The vector created is empty. | ||
2. `__init__(arg0: int, arg1: feelpp._core.WorldComm)`. The vector created has a size `arg0`. | ||
3. `__init__(arg0: int, arg1: int, arg2: feelpp._core.WorldComm)`. The vector created has a global size `arg0`, and a local size `arg1`. | ||
4. `__init__(arg0: feelpp._alg.DataMap, arg1: bool)` | ||
* `clear()` : clear PETSc vector | ||
* `size()` -> `int` : return PETSc Vector size | ||
* `vec()` -> `vec` : return a PETSc Vector that can be manipulated with funciton of the module https://pypi.org/project/petsc4py/[petsc4py]. The functions of this class can be found on the https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.Vec-class.html[documentation of PETSc4py]. | ||
* `zero()` : zero PETSc vector | ||
|
||
|
||
== Matrix PETSc Double | ||
|
||
Class `MatrixPetscDouble` (`feelpp._alg.MatrixPetscDouble`). The methods of this class are similar to the previous class, the apply on matrices insted of vectors. | ||
|
||
|
||
=== Methods | ||
|
||
* `__init__(*args, **kwargs)` : Overloaded function. | ||
1. `__init__(arg0: feelpp._core.WorldComm)` | ||
2. `__init__(arg0: feelpp._alg.DataMap, arg1: feelpp._alg.DataMap)` | ||
3. `__init__(arg1: feelpp._alg.DataMap, arg2: feelpp._core.WorldComm)` | ||
* `clear()` : clear PETSc matrix | ||
* `mat(...)` -> `mat` : return a PETSc sparse matrix. See https://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/petsc4py.PETSc.Mat-class.html[the documentation]. | ||
* `rowStart()` -> `int` : return PETSc Matrix row start. This method is usefull is the matrix is shared with many processors, as the following. | ||
* `rowStop()` -> `int` : return PETSc Matrix row stop | ||
* `size1()` -> `int` : return PETSc Matrix row size | ||
* `size2()` -> `int` : return PETSc Matrix column size | ||
* `shape()` -> `Tuple[int,int]` : return PETSc Matrix shape (`(row size, column size)`) | ||
* `zero()` : zero PETSc matrix |