Skip to content

Commit 2c83805

Browse files
authored
Merge pull request #68 from Pressio/develop
#63: follow-up fixes
2 parents 2605be9 + 345a75d commit 2c83805

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

docs/source/tutorial/hyperreduction.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ is defined:
9191
auto trialBasis /* aka Phi */ = trialSpace.basisOfTranslatedSpace();
9292
auto hypredMatrix = /* (Phi^T rhsBasis) * pinv(sampledBasis) */;
9393
94-
// Construct hyperreducer functor
94+
/*
95+
* Construct hyperreducer functor with operator() that:
96+
* - Samples full RHS at sampleIndices
97+
* - Applies hypredMatrix to get reduced RHS
98+
*/
9599
ExplicitGalerkinHyperReducer hyperReducer(hypredMatrix, sampleIndices);
96100
97101
This code is implemented fully in the ``hyperreduction.h`` file
@@ -102,7 +106,8 @@ user-defined functor that implements an ``operator()`` method
102106
that takes in a sampled FOM RHS vector and outputs the reduced RHS vector.
103107

104108
Like with the other Pressio interfaces, you can define your
105-
hyperreducer in any way you like, as long as it meets the API requirements.
109+
hyperreducer in any way you like, as long as it meets the API requirements
110+
(namely, defining the ``operator()``).
106111

107112
Now that we have defined the hyper-reducer, we can
108113
build the ROM almost identically to before, but passing

docs/source/tutorial/understand.rst

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _top-of-page:
2+
13
How do I use Pressio to build and run a ROM?
24
============================================
35

@@ -8,12 +10,13 @@ Pressio.
810
We recommend reading this step-by-step explanation alongside
911
the source code itself, which is fully commented to provide
1012
additional context. The source code for this tutorial
11-
can be found in ``$SRC/full-tutorial/burgers.cpp``
13+
can be found in ``$SRC/full-tutorial/burgers.cpp``. It is
14+
also included :ref:`at the bottom of this page <full-source-file>` for reference.
1215

13-
Each step found below corresponds to the same-named
14-
section of the source code. After Step 0, we recommend
15-
you jump to the ``main`` function and follow along with
16-
the steps as they are explained.
16+
Each step found below (and in the Table of Contents to the right)
17+
corresponds to the same-named section of the source code.
18+
After Step 0, we recommend you jump to the ``main`` function
19+
and follow along with the steps as they are explained.
1720

1821
.. note::
1922

@@ -415,3 +418,17 @@ The plot will be saved to your current directory as
415418
You'll find that the hyper-reduced ROM does not perform quite as well
416419
as the standard ROM. But the tradeoff is that the hyper-reduced ROM
417420
is computationally cheaper to run, especially for large-scale systems.
421+
422+
:ref:`Go to top <top-of-page>`
423+
424+
.. _full-source-file:
425+
426+
Full Source File
427+
----------------
428+
429+
.. literalinclude:: ../../../full-tutorial/burgers.cpp
430+
:language: cpp
431+
:lines: 113-
432+
:linenos:
433+
434+
:ref:`Go to top <top-of-page>`

full-tutorial/burgers.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@
110110
* with minimal error (< 1%) on test cases within training range.
111111
*/
112112

113-
////////////////////////////////////////////////////////////////////////////////
114-
115113
///////////////////////////////////////////////////////////////////////////////
116114
// Step 0: Pressio Setup
117115
//////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)