diff --git a/docs/user/modules/python/nav.adoc b/docs/user/modules/python/nav.adoc index 0dd13684d..98d61b648 100644 --- a/docs/user/modules/python/nav.adoc +++ b/docs/user/modules/python/nav.adoc @@ -9,3 +9,6 @@ *** xref:pyfeelpptoolboxes/electric.adoc[Electrostatic] *** xref:pyfeelpptoolboxes/fluid.adoc[Fluid Mechanics] *** xref:pyfeelpptoolboxes/solid.adoc[Solid Mechanics] +** xref:pyfeelppmor/index.adoc[{pyfeelppmor}] +*** xref:pyfeelppmor/parameters.adoc[Parameters] +*** xref:pyfeelppmor/petscDouble.adoc[PETSc vector and matrix] \ No newline at end of file diff --git a/docs/user/modules/python/pages/pyfeelppmor/index.adoc b/docs/user/modules/python/pages/pyfeelppmor/index.adoc new file mode 100644 index 000000000..cef409545 --- /dev/null +++ b/docs/user/modules/python/pages/pyfeelppmor/index.adoc @@ -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. + diff --git a/docs/user/modules/python/pages/pyfeelppmor/parameters.adoc b/docs/user/modules/python/pages/pyfeelppmor/parameters.adoc new file mode 100644 index 000000000..59a9c5e63 --- /dev/null +++ b/docs/user/modules/python/pages/pyfeelppmor/parameters.adoc @@ -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 \ No newline at end of file diff --git a/docs/user/modules/python/pages/pyfeelppmor/petscDouble.adoc b/docs/user/modules/python/pages/pyfeelppmor/petscDouble.adoc new file mode 100644 index 000000000..0e3e5c9d0 --- /dev/null +++ b/docs/user/modules/python/pages/pyfeelppmor/petscDouble.adoc @@ -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 \ No newline at end of file