Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
pymor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
pyMOR
pymor
Commits
bdd8e891
Commit
bdd8e891
authored
Oct 09, 2020
by
Stephan Rave
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tutorials] update projection tutorial to account for new compute method
parent
524cfcbd
Pipeline
#65753
passed with stages
in 60 minutes and 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
docs/source/tutorial_projection.rst
docs/source/tutorial_projection.rst
+16
-9
No files found.
docs/source/tutorial_projection.rst
View file @
bdd8e891
...
...
@@ -78,7 +78,7 @@ Solving the Model
Now that we have our FOM and a reduced space :math:`V_N` spanned by `basis`, we can project
the |Model|. However, before doing so, we need to understand how actually
solving the FOM works. Let's take a look at what
:meth:`~pymor.models.interface.Model.solve`
actually
does:
:meth:`~pymor.models.interface.Model.solve` does:
.. jupyter-execute::
...
...
@@ -86,19 +86,26 @@ solving the FOM works. Let's take a look at what
print_source(fom.solve)
This does not look too interesting. Actually, :meth:`~pymor.models.interface.Model.solve`
is just a
thin wrapper around the `_solve` method, which performs the actual
computations. All that :meth:`~pymor.models.interface.Model.solve` does is
checking the input |parameter values| `mu` and :mod:`caching <pymor.core.cache>`
the results. So let's take a look at `_solve`:
is just a
convenience method around :meth:`~pymor.models.interface.Model.compute` which
handles the actual computation of the solution and various other associated values like
outputs or error estimates. Next, we take a look at the implemenation of
:meth:`~pymor.models.interface.Model.compute`:
.. jupyter-execute::
print_source(fom.
_solv
e)
print_source(fom.
comput
e)
There is some code related to logging and the computation of an output functional.
The interesting line is::
What we see is a default implementation from :class:`~pymor.models.interface.Model` that
takes care of :mod:`caching <pymor.core.cache>` and :mod:`logging <pymor.core.logger>`,
but defers the actual computations to further private methods. Implementors can directly implement
:meth:`~pymor.models.interface.Model._compute` to compute multiple return values
at once in an optimized way. Our given model, however, just implements
:meth:`~pymor.models.interface.Model._compute_solution` where we can find the
actual code:
U = self.operator.apply_inverse(self.rhs.as_range_array(mu), mu=mu)
.. jupyter-execute::
print_source(fom._compute_solution)
What does this mean? If we look at the type of `fom`,
...
...
René Fritze
@r_milk01
mentioned in commit
d4120f36
·
Oct 09, 2020
mentioned in commit
d4120f36
mentioned in commit d4120f36817d0eaff582ecde5f46fe0a8d408575
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment