Commit 0799165b authored by Tim Keil's avatar Tim Keil
Browse files

[pymordemos] update demo

parent 8f139515
......@@ -14,7 +14,7 @@ def main(
training_samples: int = Argument(..., help='Number of samples used for training the reduced basis.')
):
"""Example script for solving linear PDE-constrained parameter optimization problems"""
fom, mu_bar = create_fom(grid_intervals)
parameter_space = fom.parameters.space(0, np.pi)
......@@ -63,7 +63,7 @@ def main(
for mu in training_set:
gradient_with_adjoint_approach = rom.output_d_mu(mu, adjoint_approach=True)
gradient_with_sensitivities = rom.output_d_mu(mu, adjoint_approach=False)
np.allclose(gradient_with_adjoint_approach, gradient_with_sensitivities)
assert np.allclose(gradient_with_adjoint_approach, gradient_with_sensitivities)
def rom_objective_functional(mu):
return rom.output(mu)
......
......@@ -44,7 +44,7 @@ DISCRETIZATION_ARGS = (
('burgers', ['--num-flux=lax_friedrichs', '0.1']),
('burgers', ['--num-flux=engquist_osher', '0.1']),
('burgers', ['--num-flux=simplified_engquist_osher', '0.1']),
('linear_optimization', [80, 25]),
('linear_optimization', [40, 20]),
('parabolic', ['heat', 1]),
('parabolic', ['heat', '--rect', 1]),
('parabolic', ['heat', '--fv', 1]),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment