Commit 02ac555f authored by Tim Keil's avatar Tim Keil
Browse files

[models] properly cite the reference

parent 6b68d097
......@@ -92,8 +92,8 @@ Bibliography
SIAM J. Sci. Comput. 40, A3267-A3292, 2018.
.. [HPUU09] M. Hinze, R. Pinnau, M. Ulbrich, S. Ulbrich,
Optimization with PDE constraints,
Springer Netherlands, 2009
Optimization with PDE constraints,
Springer Netherlands, 2009.
.. [HU18] J. Hesthaven, S. Ubbiali,
Non-intrusive reduced order modeling of nonlinear problems using neural networks,
......
......@@ -45,8 +45,9 @@ class StationaryModel(Model):
not `None`, an `estimate_error(U, mu)` method is added to the
model which will call `error_estimator.estimate_error(U, mu, self)`.
dual_operator
The dual |Operator| L* of L such that p(μ) solves
L*(p(μ),μ) = G(μ)
The dual |Operator| L* of L such that p(μ) solves L*(p(μ),μ) = G(μ).
This equation is used for the adjoint approach to compute the gradient.
See Section 1.6.2 in [HPUU09]_ for more details.
dual_rhs
The right hand side vector G of the dual problem.
visualizer
......@@ -111,10 +112,25 @@ class StationaryModel(Model):
_compute_allowed_kwargs = frozenset({'adjoint_approach'})
def _compute_output_d_mu(self, U, mu, adjoint_approach=True):
"""compute the gradient of the output functional w.r.t. the parameters
Parameters
----------
U
Internal model state for the given |Parameter value|
mu
|Parameter value| for which to compute the gradient
adjoint_approach
Use the adjoint approach for a more efficient way of computing the gradient.
See Section 1.6.2 in [HPUU09]_ for more details.
Returns
-------
The gradient as a numpy array.
"""
if adjoint_approach is False:
return super()._compute_output_d_mu(U, mu)
else:
# Use the adjoint approach for computing the gradient, see _[HPUU09]
gradient = []
P = self.dual.solve(mu)
for (parameter, size) in self.parameters.items():
......
......@@ -118,11 +118,13 @@ class Model(CacheableObject, ParametricObject):
parameter for which to compute the sensitivity
index
parameter index for which to compute the sensitivity
solution
Internal model state for the given |Parameter value|.
mu
|Parameter value| for which to solve
Return
------
Returns
-------
The sensitivity of the solution as a |VectorArray|.
"""
raise NotImplementedError
......@@ -132,11 +134,13 @@ class Model(CacheableObject, ParametricObject):
Parameters
----------
solution
Internal model state for the given |Parameter value|.
mu
|Parameter value| for which to solve
Return
------
Returns
-------
A dict of all partial sensitivities of the solution.
"""
sensitivities = {}
......@@ -153,8 +157,14 @@ class Model(CacheableObject, ParametricObject):
Parameters
----------
solution
Internal model state for the given |Parameter value|.
mu
|Parameters value| for which to compute the gradient
Returns
-------
The gradient as a numpy array
"""
gradient = []
U_d_mus = self._compute_solution_d_mu(solution, mu)
......
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