Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Oct 15, 2021
2 parents 04c1b8f + af1bd25 commit 5762d17
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 30 deletions.
3 changes: 1 addition & 2 deletions docs/html/md_pages_rom_galerkin_default_explicit.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ <h1>
<span class="k">const</span> <span class="n">scalar_t</span> <span class="n">dt</span> <span class="o">=</span> <span class="mf">1.</span><span class="p">;</span>
<span class="k">const</span> <span class="kt">int</span> <span class="n">num_steps</span> <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>
<span class="n">Observer</span> <span class="n">obs</span><span class="p">;</span>
<span class="n">pressio</span><span class="o">::</span><span class="n">ode</span><span class="o">::</span><span class="n">advance_n_steps_and_observe</span><span class="p">(</span>
<span class="n">problem</span><span class="p">.</span><span class="n">stepper</span><span class="p">(),</span> <span class="n">romState</span><span class="p">,</span> <span class="mf">0.</span><span class="p">,</span> <span class="n">dt</span><span class="p">,</span> <span class="n">num_steps</span><span class="p">,</span> <span class="n">obs</span><span class="p">);</span>
<span class="n">pressio</span><span class="o">::</span><span class="n">ode</span><span class="o">::</span><span class="n">advance_n_steps_and_observe</span><span class="p">(</span><span class="n">problem</span><span class="p">,</span> <span class="n">romState</span><span class="p">,</span> <span class="mf">0.</span><span class="p">,</span> <span class="n">dt</span><span class="p">,</span> <span class="n">num_steps</span><span class="p">,</span> <span class="n">obs</span><span class="p">);</span>

<span class="n">pressio</span><span class="o">::</span><span class="n">log</span><span class="o">::</span><span class="n">finalize</span><span class="p">();</span>
<span class="p">}</span></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ <h1>
<span class="k">const</span> <span class="n">scalar_t</span> <span class="n">dt</span> <span class="o">=</span> <span class="mf">1.</span><span class="p">;</span>
<span class="k">const</span> <span class="kt">int</span> <span class="n">num_steps</span> <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>
<span class="n">Observer</span> <span class="n">obs</span><span class="p">;</span>
<span class="n">pressio</span><span class="o">::</span><span class="n">ode</span><span class="o">::</span><span class="n">advance_n_steps_and_observe</span><span class="p">(</span>
<span class="n">problem</span><span class="p">.</span><span class="n">stepper</span><span class="p">(),</span> <span class="n">romState</span><span class="p">,</span> <span class="mf">0.</span><span class="p">,</span> <span class="n">dt</span><span class="p">,</span> <span class="n">num_steps</span><span class="p">,</span> <span class="n">obs</span><span class="p">);</span>
<span class="n">pressio</span><span class="o">::</span><span class="n">ode</span><span class="o">::</span><span class="n">advance_n_steps_and_observe</span><span class="p">(</span><span class="n">problem</span><span class="p">,</span> <span class="n">romState</span><span class="p">,</span> <span class="mf">0.</span><span class="p">,</span> <span class="n">dt</span><span class="p">,</span> <span class="n">num_steps</span><span class="p">,</span> <span class="n">obs</span><span class="p">);</span>

<span class="n">pressio</span><span class="o">::</span><span class="n">log</span><span class="o">::</span><span class="n">finalize</span><span class="p">();</span></pre></section>
<span class="n">pressio</span><span class="o">::</span><span class="n">log</span><span class="o">::</span><span class="n">finalize</span><span class="p">();</span>
<span class="p">}</span></pre></section>
</div>
</div>
</div>
Expand Down
5 changes: 2 additions & 3 deletions docs/html/md_pages_rom_galerkin_default_implicit.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,15 @@ <h1>
<span class="k">auto</span> <span class="n">problem</span> <span class="o">=</span> <span class="n">pressio</span><span class="o">::</span><span class="n">rom</span><span class="o">::</span><span class="n">galerkin</span><span class="o">::</span><span class="n">create_default_implicit_problem</span>
<span class="p">(</span><span class="n">odescheme</span><span class="p">,</span> <span class="n">fomSystem</span><span class="p">,</span> <span class="n">decoder</span><span class="p">,</span> <span class="n">romState</span><span class="p">,</span> <span class="n">fomReferenceState</span><span class="p">);</span>
<span class="k">using</span> <span class="n">problem_t</span> <span class="o">=</span> <span class="k">decltype</span><span class="p">(</span><span class="n">problem</span><span class="p">);</span>
<span class="k">auto</span> <span class="o">&amp;</span> <span class="n">stepperObj</span> <span class="o">=</span> <span class="n">problem</span><span class="p">.</span><span class="n">stepper</span><span class="p">();</span>

<span class="k">using</span> <span class="n">galerkin_jacobian_t</span> <span class="o">=</span> <span class="k">typename</span> <span class="nc">pressio</span><span class="o">::</span><span class="n">Traits</span><span class="o">&lt;</span><span class="n">problem_t</span><span class="o">&gt;::</span><span class="n">galerkin_jacobian_type</span><span class="p">;</span>
<span class="k">using</span> <span class="n">lin_solver_t</span> <span class="o">=</span> <span class="n">pls</span><span class="o">::</span><span class="n">Solver</span><span class="o">&lt;</span><span class="n">pls</span><span class="o">::</span><span class="n">iterative</span><span class="o">::</span><span class="n">LSCG</span><span class="p">,</span> <span class="n">galerkin_jacobian_t</span><span class="o">&gt;</span><span class="p">;</span>
<span class="n">lin_solver_t</span> <span class="n">linearSolverObj</span><span class="p">;</span>
<span class="k">auto</span> <span class="n">nonLinSolver</span> <span class="o">=</span> <span class="n">pnonls</span><span class="o">::</span><span class="n">create_newton_raphson</span><span class="p">(</span><span class="n">stepperObj</span><span class="p">,</span> <span class="n">romState</span><span class="p">,</span> <span class="n">linearSolverObj</span><span class="p">);</span>
<span class="k">auto</span> <span class="n">nonLinSolver</span> <span class="o">=</span> <span class="n">pnonls</span><span class="o">::</span><span class="n">create_newton_raphson</span><span class="p">(</span><span class="n">problem</span><span class="p">,</span> <span class="n">romState</span><span class="p">,</span> <span class="n">linearSolverObj</span><span class="p">);</span>
<span class="n">nonLinSolver</span><span class="p">.</span><span class="n">setMaxIterations</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>

<span class="n">scalar_t</span> <span class="n">dt</span> <span class="o">=</span> <span class="mf">2.</span><span class="p">;</span>
<span class="n">pressio</span><span class="o">::</span><span class="n">ode</span><span class="o">::</span><span class="n">advance_n_steps</span><span class="p">(</span><span class="n">stepperObj</span><span class="p">,</span> <span class="n">romState</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="n">dt</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">nonLinSolver</span><span class="p">);</span>
<span class="n">pressio</span><span class="o">::</span><span class="n">ode</span><span class="o">::</span><span class="n">advance_n_steps</span><span class="p">(</span><span class="n">problem</span><span class="p">,</span> <span class="n">romState</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="n">dt</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">nonLinSolver</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">romState</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>

<span class="n">pressio</span><span class="o">::</span><span class="n">log</span><span class="o">::</span><span class="n">finalize</span><span class="p">();</span>
Expand Down
3 changes: 1 addition & 2 deletions docs/latex/md_pages_rom_galerkin_default_explicit.tex
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@
\DoxyCodeLine{ \textcolor{keyword}{const} scalar\_t dt = 1.;}
\DoxyCodeLine{ \textcolor{keyword}{const} \textcolor{keywordtype}{int} num\_steps = 3;}
\DoxyCodeLine{ Observer obs;}
\DoxyCodeLine{ pressio::ode::advance\_n\_steps\_and\_observe(}
\DoxyCodeLine{ problem.stepper(), romState, 0., dt, num\_steps, obs);}
\DoxyCodeLine{ pressio::ode::advance\_n\_steps\_and\_observe(problem, romState, 0., dt, num\_steps, obs);}
\DoxyCodeLine{}
\DoxyCodeLine{ pressio::log::finalize();}
\DoxyCodeLine{\}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@
\DoxyCodeLine{ \textcolor{keyword}{const} scalar\_t dt = 1.;}
\DoxyCodeLine{ \textcolor{keyword}{const} \textcolor{keywordtype}{int} num\_steps = 3;}
\DoxyCodeLine{ Observer obs;}
\DoxyCodeLine{ pressio::ode::advance\_n\_steps\_and\_observe(}
\DoxyCodeLine{ problem.stepper(), romState, 0., dt, num\_steps, obs);}
\DoxyCodeLine{ pressio::ode::advance\_n\_steps\_and\_observe(problem, romState, 0., dt, num\_steps, obs);}
\DoxyCodeLine{}
\DoxyCodeLine{ pressio::log::finalize();}
\DoxyCodeLine{\}}

\end{DoxyCode}

5 changes: 2 additions & 3 deletions docs/latex/md_pages_rom_galerkin_default_implicit.tex
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,15 @@
\DoxyCodeLine{ \textcolor{keyword}{auto} problem = pressio::rom::galerkin::create\_default\_implicit\_problem}
\DoxyCodeLine{ (odescheme, fomSystem, decoder, romState, fomReferenceState);}
\DoxyCodeLine{ \textcolor{keyword}{using} problem\_t = decltype(problem);}
\DoxyCodeLine{ \textcolor{keyword}{auto} \& stepperObj = problem.stepper();}
\DoxyCodeLine{}
\DoxyCodeLine{ \textcolor{keyword}{using} galerkin\_jacobian\_t = \textcolor{keyword}{typename} pressio::Traits<problem\_t>::galerkin\_jacobian\_type;}
\DoxyCodeLine{ \textcolor{keyword}{using} lin\_solver\_t = pls::Solver<pls::iterative::LSCG, galerkin\_jacobian\_t>;}
\DoxyCodeLine{ lin\_solver\_t linearSolverObj;}
\DoxyCodeLine{ \textcolor{keyword}{auto} nonLinSolver = pnonls::create\_newton\_raphson(stepperObj, romState, linearSolverObj);}
\DoxyCodeLine{ \textcolor{keyword}{auto} nonLinSolver = pnonls::create\_newton\_raphson(problem, romState, linearSolverObj);}
\DoxyCodeLine{ nonLinSolver.setMaxIterations(1);}
\DoxyCodeLine{}
\DoxyCodeLine{ scalar\_t dt = 2.;}
\DoxyCodeLine{ pressio::ode::advance\_n\_steps(stepperObj, romState, 0.0, dt, 1, nonLinSolver);}
\DoxyCodeLine{ pressio::ode::advance\_n\_steps(problem, romState, 0.0, dt, 1, nonLinSolver);}
\DoxyCodeLine{ std::cout << romState << std::endl;}
\DoxyCodeLine{}
\DoxyCodeLine{ pressio::log::finalize();}
Expand Down
Binary file modified docs/m.math.cache
Binary file not shown.
3 changes: 1 addition & 2 deletions docs/xml/md_pages_rom_galerkin_default_explicit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>scalar_t<sp/>dt<sp/>=<sp/>1.;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>num_steps<sp/>=<sp/>3;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>Observer<sp/>obs;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pressio::ode::advance_n_steps_and_observe(</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>problem.stepper(),<sp/>romState,<sp/>0.,<sp/>dt,<sp/>num_steps,<sp/>obs);</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pressio::ode::advance_n_steps_and_observe(problem,<sp/>romState,<sp/>0.,<sp/>dt,<sp/>num_steps,<sp/>obs);</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pressio::log::finalize();</highlight></codeline>
<codeline><highlight class="normal">}</highlight></codeline>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>scalar_t<sp/>dt<sp/>=<sp/>1.;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>num_steps<sp/>=<sp/>3;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>Observer<sp/>obs;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pressio::ode::advance_n_steps_and_observe(</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>problem.stepper(),<sp/>romState,<sp/>0.,<sp/>dt,<sp/>num_steps,<sp/>obs);</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pressio::ode::advance_n_steps_and_observe(problem,<sp/>romState,<sp/>0.,<sp/>dt,<sp/>num_steps,<sp/>obs);</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pressio::log::finalize();</highlight></codeline>
<codeline><highlight class="normal">}</highlight></codeline>
</programlisting> </para>
</sect1>
</detaileddescription>
Expand Down
5 changes: 2 additions & 3 deletions docs/xml/md_pages_rom_galerkin_default_implicit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,15 @@
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>problem<sp/>=<sp/>pressio::rom::galerkin::create_default_implicit_problem</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/><sp/><sp/>(odescheme,<sp/>fomSystem,<sp/>decoder,<sp/>romState,<sp/>fomReferenceState);</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/>problem_t<sp/>=<sp/>decltype(problem);</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>&amp;<sp/>stepperObj<sp/>=<sp/>problem.stepper();</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/>galerkin_jacobian_t<sp/>=<sp/></highlight><highlight class="keyword">typename</highlight><highlight class="normal"><sp/>pressio::Traits&lt;problem_t&gt;::galerkin_jacobian_type;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">using</highlight><highlight class="normal"><sp/>lin_solver_t<sp/>=<sp/>pls::Solver&lt;pls::iterative::LSCG,<sp/>galerkin_jacobian_t&gt;;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>lin_solver_t<sp/>linearSolverObj;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>nonLinSolver<sp/>=<sp/>pnonls::create_newton_raphson(stepperObj,<sp/>romState,<sp/>linearSolverObj);</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>nonLinSolver<sp/>=<sp/>pnonls::create_newton_raphson(problem,<sp/>romState,<sp/>linearSolverObj);</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>nonLinSolver.setMaxIterations(1);</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>scalar_t<sp/>dt<sp/>=<sp/>2.;</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pressio::ode::advance_n_steps(stepperObj,<sp/>romState,<sp/>0.0,<sp/>dt,<sp/>1,<sp/>nonLinSolver);</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pressio::ode::advance_n_steps(problem,<sp/>romState,<sp/>0.0,<sp/>dt,<sp/>1,<sp/>nonLinSolver);</highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>std::cout<sp/>&lt;&lt;<sp/>romState<sp/>&lt;&lt;<sp/>std::endl;</highlight></codeline>
<codeline><highlight class="normal"></highlight></codeline>
<codeline><highlight class="normal"><sp/><sp/>pressio::log::finalize();</highlight></codeline>
Expand Down
2 changes: 1 addition & 1 deletion tpls/pressio
Submodule pressio updated 237 files
3 changes: 1 addition & 2 deletions tutorials/rom_default_explicit_galerkin_custom_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ int main(int argc, char *argv[])
const scalar_t dt = 1.;
const int num_steps = 3;
Observer obs;
pressio::ode::advance_n_steps_and_observe(
problem.stepper(), romState, 0., dt, num_steps, obs);
pressio::ode::advance_n_steps_and_observe(problem, romState, 0., dt, num_steps, obs);

pressio::log::finalize();
}
3 changes: 1 addition & 2 deletions tutorials/rom_default_explicit_galerkin_eigen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ int main(int argc, char *argv[])
const scalar_t dt = 1.;
const int num_steps = 3;
Observer obs;
pressio::ode::advance_n_steps_and_observe(
problem.stepper(), romState, 0., dt, num_steps, obs);
pressio::ode::advance_n_steps_and_observe(problem, romState, 0., dt, num_steps, obs);

pressio::log::finalize();
}
5 changes: 2 additions & 3 deletions tutorials/rom_default_implicit_galerkin_eigen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,15 @@ int main(int argc, char *argv[])
auto problem = pressio::rom::galerkin::create_default_implicit_problem
(odescheme, fomSystem, decoder, romState, fomReferenceState);
using problem_t = decltype(problem);
auto & stepperObj = problem.stepper();

using galerkin_jacobian_t = typename pressio::Traits<problem_t>::galerkin_jacobian_type;
using lin_solver_t = pls::Solver<pls::iterative::LSCG, galerkin_jacobian_t>;
lin_solver_t linearSolverObj;
auto nonLinSolver = pnonls::create_newton_raphson(stepperObj, romState, linearSolverObj);
auto nonLinSolver = pnonls::create_newton_raphson(problem, romState, linearSolverObj);
nonLinSolver.setMaxIterations(1);

scalar_t dt = 2.;
pressio::ode::advance_n_steps(stepperObj, romState, 0.0, dt, 1, nonLinSolver);
pressio::ode::advance_n_steps(problem, romState, 0.0, dt, 1, nonLinSolver);
std::cout << romState << std::endl;

pressio::log::finalize();
Expand Down

0 comments on commit 5762d17

Please sign in to comment.