diff --git a/docs/mor/modules/ROOT/nav.adoc b/docs/mor/modules/ROOT/nav.adoc index 1ba549435..0e44a9666 100644 --- a/docs/mor/modules/ROOT/nav.adoc +++ b/docs/mor/modules/ROOT/nav.adoc @@ -7,3 +7,4 @@ ** xref:pbdw.adoc#_using_pbdw[Using PBDW] * xref:index.adoc#_cases[Cases] ** xref:opusheat:index.adoc[OpusHeat] +** xref:thermalfin:index.adoc[ThermalFin] diff --git a/docs/mor/modules/ROOT/pages/index.adoc b/docs/mor/modules/ROOT/pages/index.adoc index 765e6e31f..a243a77c1 100644 --- a/docs/mor/modules/ROOT/pages/index.adoc +++ b/docs/mor/modules/ROOT/pages/index.adoc @@ -12,3 +12,4 @@ The Parametrized Background Data Weak (xref:pbdw.adoc[PBDW]) method has also bee == Cases - xref:opusheat:index.adoc[OpusHeat] +- xref:thermalfin:index.adoc[ThermalFin] diff --git a/docs/mor/modules/thermalfin/nav.adoc b/docs/mor/modules/thermalfin/nav.adoc new file mode 100644 index 000000000..ac3c49609 --- /dev/null +++ b/docs/mor/modules/thermalfin/nav.adoc @@ -0,0 +1 @@ +* xref:index.adoc[Thermal fin] diff --git a/docs/mor/modules/thermalfin/pages/index.adoc b/docs/mor/modules/thermalfin/pages/index.adoc new file mode 100644 index 000000000..a24166dfc --- /dev/null +++ b/docs/mor/modules/thermalfin/pages/index.adoc @@ -0,0 +1,3 @@ += Thermal fin + +The redaction of this page is in progress. \ No newline at end of file diff --git a/docs/user/modules/python/pages/pyfeelppmor/reducedbasis.adoc b/docs/user/modules/python/pages/pyfeelppmor/reducedbasis.adoc index 071cdb2b2..d27f8b12c 100644 --- a/docs/user/modules/python/pages/pyfeelppmor/reducedbasis.adoc +++ b/docs/user/modules/python/pages/pyfeelppmor/reducedbasis.adoc @@ -20,19 +20,24 @@ To set the environment, those module also need to be imported : [source, python] ---- import sys, os -from feelpp.toolboxes.heat import * -import feelpp.toolboxes.core as core -from feelpp.operators import mass -import feelpp.mor as mor +from feelpp.toolboxes.heat import * <1> +import feelpp.toolboxes.core as core <2> +from feelpp.operators import mass <3> +import feelpp.mor as mor <4> import feelpp ---- +<1> The toolbox heat is used to simulate the heat equation on the case studied. +<2> The module `core` is used to set the environment. +<3> The `mass` function is needed to create the mass matrix if we work on a time-dependent case. +<4> The module `mor` is used to get the functions neededd by the toolbox mor. + == Set the environment [source, python] ---- -config = feelpp.globalRepository("reducedbasis") +config = feelpp.localRepository("reducedbasis") sys.argv = ["reducedbasis"] o = core.toolboxes_options("heat") o.add(mor.makeToolboxMorOptions()) @@ -43,22 +48,39 @@ e = feelpp.Environment(sys.argv, opts=o, config=config) == Set the model +=== Description of the model + +In this document, the cases used is `thermal-fin` in 2D, with a stem:[\mathbb{P}_1] discretization and stationnary. +This model is described in xref:mor:thermalfin:index.adoc[this page]. + +The usage would be the same for another case. + + +=== Code + Set the parameters nedded to the model : + - `config_file` : path to the cfg file - `dim` : the dimension of the case - `order` : the order of discretization (`1` for stem:[\mathbb{P}_1], `2` for stem:[\mathbb{P}_2]) -- `time_dependant` : is the case stationnary or transient ? (for now always to `False`) +- `time_depedent` : is the case stationnary or transient ? (for now always to `False`) - `name` : name of the CRB case + + [source,python] ---- config_file = "thermal-fin.cfg" dim = 2 order = 1 -time_dependant = False +time_depedent = False name = "thermalfin-2d" ---- +The configuration files for this case are available on github : https://raw.githubusercontent.com/feelpp/feelpp/develop/mor/cases/thermal-fin/2d/fin.geo[geometry file], https://raw.githubusercontent.com/feelpp/feelpp/develop/mor/cases/thermal-fin/2d/thermal-fin.cfg[cfg file], and https://raw.githubusercontent.com/feelpp/feelpp/develop/mor/cases/thermal-fin/2d/thermal-fin.json[json file]. + +Then, we can create the model : + [source,python] ---- cfg = feelpp.readCfg(config_file) @@ -118,7 +140,7 @@ default_parameter = modelParameters.toParameterValues() [source, python] ---- -model = mor.toolboxmor(name=name, dim=dim, time_dependent=time_dependant) +model = mor.toolboxmor(name=name, dim=dim, time_dependent=time_depedent) model.setFunctionSpaces( Vh=heatBox.spaceTemperature() ) def assembleDEIM(mu): @@ -305,6 +327,8 @@ rb.computeOfflineErrorRhs() rb.computeOfflineError() ---- +The script `generate_basis.py` run this offline part. See the xref:pyfeelppmor/reducedbasis_offline.adoc[dedicated page] for more details. + == Online phase [source, python] @@ -358,12 +382,3 @@ rb.getSolutionsFE(mu, k=0) The two functions `getSolutions` (resp. `getSolutionsFE`) return the solution stem:[u_N(\mu)] (resp. stem:[u(\mu)]) and the value of the output stem:[s_N^k(\mu)] (res. stem:[s^k(\mu)]). See xref:pyfeelppmor/parameters.adoc[the dedicated page] for the API of `ParameterSpaceElement`. - - -== Offline stage : - -See the xref:pyfeelppmor/reducedbasis_offline.adoc[offline stage] page. - -== Online stage : - -See the xref:pyfeelppmor/reducedbasis_online.adoc[online stage] page. diff --git a/docs/user/modules/python/pages/pyfeelppmor/toolboxmor.adoc b/docs/user/modules/python/pages/pyfeelppmor/toolboxmor.adoc index c2f23ccf4..80f4f399a 100644 --- a/docs/user/modules/python/pages/pyfeelppmor/toolboxmor.adoc +++ b/docs/user/modules/python/pages/pyfeelppmor/toolboxmor.adoc @@ -2,7 +2,8 @@ = Toolboxmor -For the configuration of the case, and the usage in a C++ application, refer to xref:mor:toolboxmor.adoc[ToolboxMor] documentation. +For the configuration of the case, and the usage in a C++ application, refer to xref:mor:ROOT:toolboxmor.adoc[ToolboxMor] documentation. +More details on the functions of the toolbox can be found in xref:pyfeelppmor/reducedbasis.adoc[this page]. == Model @@ -13,7 +14,7 @@ We assume that we have the following decompositions : [stem] ++++ \begin{align} -a(u, v; mu) &= \displaystyle\sum_{q=1}^{Q_a} \beta_A^q(\mu) a^q(u, v) \\ +a(u, v; \mu) &= \displaystyle\sum_{q=1}^{Q_a} \beta_A^q(\mu) a^q(u, v) \\ f(v; \mu) &= \displaystyle\sum_{p=1}^{Q_f} \beta_F^p(\mu) f^p(v)\\ l_i(v; \mu) &= \displaystyle\sum_{p=1}^{Q_{l_i}} \beta_{s_i}^p(\mu) l_i^p(v) \end{align} @@ -48,7 +49,7 @@ L_i(\mu) &= \displaystyle\sum_{p=1}^{Q_{l_i}} \beta_{L_i}^p(\mu) L_i^p [betaA, betaF] = model.computeBetaQm(mu) ---- -where `mu` is a `ParameterSpaceElement` (see xref:parameters.adoc[Parameters]). +where `mu` is a `ParameterSpaceElement` (see xref:pyfeelppmor/parameters.adoc[Parameters]). * `betaA` is a list of length 1, and `betaA[0]` contains the coefficients of the affine decomposition `betaA[0] = [` stem:[\beta_A^1]`,...,` stem:[\beta_A^{Q_a}] `]`. * `betaF` is a list of length stem:[1 + n_\text{outputs}] contains the coefficients of the affine decompositions of stem:[f], and stem:[s_i] :