Skip to content

Commit

Permalink
sync pressio
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Oct 15, 2021
2 parents b03f5f9 + 745175b commit f70ab0c
Show file tree
Hide file tree
Showing 149 changed files with 1,593 additions and 1,502 deletions.
3 changes: 1 addition & 2 deletions demos/unsteady_default_galerkin_advdiff1d_pod/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ def __call__(self, timeStep, time, state): pass
# create problem
scheme = ode.stepscheme.ForwardEuler
problem = rom.galerkin.DefaultExplicitProblem(scheme, fomObj, linearDecoder, romState, fomReferenceState)
stepper = problem.stepper()

# create object to monitor the romState at every iteration
myObs = RomStateObserver()
# solve problem
ode.advance_n_steps_and_observe(stepper, romState, 0., dt, nsteps, myObs)
ode.advance_n_steps_and_observe(problem, romState, 0., dt, nsteps, myObs)

# after we are done, use the reconstructor object to reconstruct the fom state
# get the reconstructor object: this allows to map romState to fomState
Expand Down
5 changes: 2 additions & 3 deletions demos/unsteady_default_lspg_advdiff1d_kpca/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ def solve(self, A,b,x):
# create LSPG problem
scheme = ode.stepscheme.BDF1
problem = rom.lspg.unsteady.DefaultProblem(scheme, fomObj, customDecoder, romState, fomReferenceState)
stepper = problem.stepper()

# create the Gauss-Newton solver
nonLinSolver = solvers.create_gauss_newton(stepper, romState, MyLinSolver())
nonLinSolver = solvers.create_gauss_newton(problem, romState, MyLinSolver())
# set tolerance and convergence criteria
nlsTol, nlsMaxIt = 1e-7, 10
nonLinSolver.setMaxIterations(nlsMaxIt)
Expand All @@ -94,7 +93,7 @@ def solve(self, A,b,x):
# create object to monitor the romState at every iteration
myObs = RomStateObserver()
# solve problem
ode.advance_n_steps_and_observe(stepper, romState, 0., dt, nsteps, myObs, nonLinSolver)
ode.advance_n_steps_and_observe(problem, romState, 0., dt, nsteps, myObs, nonLinSolver)

# after we are done, use the reconstructor object to reconstruct the fom state
# get the reconstructor object: this allows to map romState to fomState
Expand Down
5 changes: 2 additions & 3 deletions demos/unsteady_default_lspg_advdiff1d_mlp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ def solve(self, A,b,x):
# create LSPG problem
scheme = ode.stepscheme.BDF1
problem = rom.lspg.unsteady.DefaultProblem(scheme, fomObj, customDecoder, romState, fomReferenceState)
stepper = problem.stepper()

# create the Gauss-Newton solver
nonLinSolver = solvers.create_gauss_newton(stepper, romState, MyLinSolver())
nonLinSolver = solvers.create_gauss_newton(problem, romState, MyLinSolver())
# set tolerance and convergence criteria
nlsTol, nlsMaxIt = 1e-7, 10
nonLinSolver.setMaxIterations(nlsMaxIt)
Expand All @@ -54,7 +53,7 @@ def solve(self, A,b,x):
# create object to monitor the romState at every iteration
myObs = RomStateObserver()
# solve problem
ode.advance_n_steps_and_observe(stepper, romState, 0., dt, nsteps, myObs, nonLinSolver)
ode.advance_n_steps_and_observe(problem, romState, 0., dt, nsteps, myObs, nonLinSolver)

# after we are done, use the reconstructor object to reconstruct the fom state
# get the reconstructor object: this allows to map romState to fomState
Expand Down
5 changes: 2 additions & 3 deletions demos/unsteady_default_lspg_advdiff1d_pod/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ def solve(self, A,b,x):
# create LSPG problem
scheme = ode.stepscheme.BDF1
problem = rom.lspg.unsteady.DefaultProblem(scheme, fomObj, linearDecoder, romState, fomReferenceState)
stepper = problem.stepper()

# create the Gauss-Newton solver
nonLinSolver = solvers.create_gauss_newton(stepper, romState, MyLinSolver())
nonLinSolver = solvers.create_gauss_newton(problem, romState, MyLinSolver())
# set tolerance and convergence criteria
nlsTol, nlsMaxIt = 1e-6, 5
nonLinSolver.setMaxIterations(nlsMaxIt)
Expand All @@ -62,7 +61,7 @@ def solve(self, A,b,x):
# create object to monitor the romState at every iteration
myObs = RomStateObserver()
# solve problem
ode.advance_n_steps_and_observe(stepper, romState, 0., dt, nsteps, myObs, nonLinSolver)
ode.advance_n_steps_and_observe(problem, romState, 0., dt, nsteps, myObs, nonLinSolver)

# after we are done, use the reconstructor object to reconstruct the fom state
# get the reconstructor object: this allows to map romState to fomState
Expand Down
3 changes: 1 addition & 2 deletions demos/unsteady_masked_galerkin_advdiff1d_pod/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ def runMaskedGalerkin(fomObj, dt, nsteps, modes, sampleMeshIndices):
problem = rom.galerkin.MaskedExplicitProblem(scheme, fomObj, linearDecoder, \
romState, fomReferenceState, \
projector, masker)
stepper = problem.stepper()

# solve problem
ode.advance_n_steps(stepper, romState, 0., dt, nsteps)
ode.advance_n_steps(problem, romState, 0., dt, nsteps)

# after we are done, use the reconstructor object to reconstruct the fom state
# NOTE: even though the Galerkin problem was run on the "masked mesh points",
Expand Down
10 changes: 4 additions & 6 deletions demos/unsteady_masked_galerkin_vs_lspg_advdiff1d_pod/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,14 @@ def runMaskedGalerkin(fomObj, dt, nsteps, modes, sampleMeshIndices):
problem = rom.galerkin.MaskedImplicitProblem(scheme, fomObj, linearDecoder, \
romState, fomReferenceState, \
projector, masker)
stepper = problem.stepper()

# linear and non linear solver
lsO = MyLinSolver()
nlsO = solvers.create_newton_raphson(stepper, romState, lsO)
nlsO = solvers.create_newton_raphson(problem, romState, lsO)
nlsO.setMaxIterations(15)

# solve the problem
ode.advance_n_steps(stepper, romState, 0., dt, nsteps, nlsO)
ode.advance_n_steps(problem, romState, 0., dt, nsteps, nlsO)

# after we are done, use the reconstructor object to reconstruct the fom state
# NOTE: even though the Galerkin problem was run on the "masked mesh points",
Expand Down Expand Up @@ -140,15 +139,14 @@ def runMaskedLspg(fomObj, dt, nsteps, modes, sampleMeshIndices):
problem = rom.lspg.unsteady.MaskedProblem(scheme, fomObj, linearDecoder,\
romState, fomReferenceState,\
masker)
stepper = problem.stepper()

# linear and non linear solver
lsO = MyLinSolver()
nlsO = solvers.create_gauss_newton(stepper, romState, lsO)
nlsO = solvers.create_gauss_newton(problem, romState, lsO)
nlsO.setMaxIterations(10)

# solve the problem
ode.advance_n_steps(stepper, romState, 0., dt, nsteps, nlsO)
ode.advance_n_steps(problem, romState, 0., dt, nsteps, nlsO)

# after we are done, use the reconstructor object to reconstruct the fom state
# NOTE: even though the Galerkin problem was run on the "masked mesh points",
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
("<a href=\"md_pages_components_rom_wls.html\"> &emsp; - WLS</a>",),
]),

("<a href=\"md_pages_ml_role.html\">Role of ML</a>", []),

("<a>Full Demos</a>", #("<a href=\"md_pages_demos.html\">Demos</a>",
[
("<a href=\"md_pages_demos_demo1.html\">1D adv-diff: Galerkin with POD modes</a>", ),
Expand All @@ -69,6 +67,8 @@
("<a href=\"md_pages_demos_demo6.html\">1D adv-diff: LSPG with nonlinear manifold (MLP) </a>", ),
]),

("<a href=\"md_pages_ml_role.html\">Role of ML</a>", []),

# # tutorials
# ("<a>Tutorials</a>", #("<a href=\"md_pages_tutorials.html\">Tutorials</a>",
# [
Expand Down
2 changes: 1 addition & 1 deletion docs/html/annotated.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
2 changes: 1 addition & 1 deletion docs/html/demo1_8md.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
2 changes: 1 addition & 1 deletion docs/html/demo2_8md.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
2 changes: 1 addition & 1 deletion docs/html/demo3_8md.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
2 changes: 1 addition & 1 deletion docs/html/demo4_8md.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
2 changes: 1 addition & 1 deletion docs/html/demo5_8md.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
2 changes: 1 addition & 1 deletion docs/html/demo6_8md.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
2 changes: 1 addition & 1 deletion docs/html/dir_208d2690607c4e3d3fabfa1d18673d36.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
2 changes: 1 addition & 1 deletion docs/html/dir_4af40c8677da60eb4c6f7c14f8103d72.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
2 changes: 1 addition & 1 deletion docs/html/dir_e3e5033bce933e9613999c4991aa42b8.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
2 changes: 1 addition & 1 deletion docs/html/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<li><a href="md_pages_components_rom_wls.html"> &emsp; - WLS</a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li>
<a>Full Demos</a>
<ol>
Expand All @@ -67,6 +66,7 @@
<li><a href="md_pages_demos_demo6.html">1D adv-diff: LSPG with nonlinear manifold (MLP) </a></li>
</ol>
</li>
<li><a href="md_pages_ml_role.html">Role of ML</a></li>
<li><a href="https://github.com/Pressio/pressio4py">Github Page</a></li>
</ol>
<ol class="m-col-t-6 m-col-m-none" start="5">
Expand Down
Loading

0 comments on commit f70ab0c

Please sign in to comment.