pymor.reductors.residual
¶
Module Contents¶
- class pymor.reductors.residual.ImplicitEulerResidualOperator(operator, mass, rhs, dt, name=None)[source]¶
Bases:
pymor.operators.interface.Operator
Instantiated by
ImplicitEulerResidualReductor
.Methods
Apply the operator to a
VectorArray
.- apply(U, U_old, mu=None)[source]¶
Apply the operator to a
VectorArray
.Parameters
- U
VectorArray
of vectors to which the operator is applied.- mu
The
parameter values
for which to evaluate the operator.
Returns
VectorArray
of the operator evaluations.
- class pymor.reductors.residual.ImplicitEulerResidualReductor(RB, operator, mass, dt, rhs=None, product=None)[source]¶
Bases:
pymor.core.base.BasicObject
Reduced basis residual reductor with mass operator for implicit Euler timestepping.
Given an operator, mass and a functional, the concatenation of residual operator with the Riesz isomorphism is given by:
riesz_residual.apply(U, U_old, mu) == product.apply_inverse(operator.apply(U, mu) + 1/dt*mass.apply(U, mu) - 1/dt*mass.apply(U_old, mu) - rhs.as_vector(mu))
This reductor determines a low-dimensional subspace of the image of a reduced basis space under
riesz_residual
usingestimate_image_hierarchical
, computes an orthonormal basisresidual_range
of this range space and then returns the Petrov-Galerkin projectionprojected_riesz_residual == riesz_residual.projected(range_basis=residual_range, source_basis=RB)
of the
riesz_residual
operator. Given reduced basis coefficient vectorsu
andu_old
, the dual norm of the residual can then be computed asprojected_riesz_residual.apply(u, u_old, mu).norm()
Moreover, a
reconstruct
method is provided such thatresidual_reductor.reconstruct(projected_riesz_residual.apply(u, u_old, mu)) == riesz_residual.apply(RB.lincomb(u), RB.lincomb(u_old), mu)
Parameters
- operator
See definition of
riesz_residual
.- mass
The mass operator. See definition of
riesz_residual
.- dt
The time step size. See definition of
riesz_residual
.- rhs
See definition of
riesz_residual
. IfNone
, zero right-hand side is assumed.- RB
VectorArray
containing a basis of the reduced space onto which to project.- product
Inner product
Operator
w.r.t. which to compute the Riesz representatives.
Methods
Reconstruct high-dimensional residual vector from reduced vector
u
.
- class pymor.reductors.residual.NonProjectedImplicitEulerResidualOperator(operator, mass, rhs, dt, product)[source]¶
Bases:
ImplicitEulerResidualOperator
Instantiated by
ImplicitEulerResidualReductor
.Not to be used directly.
Methods
Apply the operator to a
VectorArray
.- apply(U, U_old, mu=None)[source]¶
Apply the operator to a
VectorArray
.Parameters
- U
VectorArray
of vectors to which the operator is applied.- mu
The
parameter values
for which to evaluate the operator.
Returns
VectorArray
of the operator evaluations.
- class pymor.reductors.residual.NonProjectedResidualOperator(operator, rhs, riesz_representatives, product)[source]¶
Bases:
ResidualOperator
Instantiated by
ResidualReductor
.Not to be used directly.
Methods
Apply the operator to a
VectorArray
.- apply(U, mu=None)[source]¶
Apply the operator to a
VectorArray
.Parameters
- U
VectorArray
of vectors to which the operator is applied.- mu
The
parameter values
for which to evaluate the operator.
Returns
VectorArray
of the operator evaluations.
- class pymor.reductors.residual.ResidualOperator(operator, rhs, name=None)[source]¶
Bases:
pymor.operators.interface.Operator
Instantiated by
ResidualReductor
.Methods
Apply the operator to a
VectorArray
.- apply(U, mu=None)[source]¶
Apply the operator to a
VectorArray
.Parameters
- U
VectorArray
of vectors to which the operator is applied.- mu
The
parameter values
for which to evaluate the operator.
Returns
VectorArray
of the operator evaluations.
- class pymor.reductors.residual.ResidualReductor(RB, operator, rhs=None, product=None, riesz_representatives=False)[source]¶
Bases:
pymor.core.base.BasicObject
Generic reduced basis residual reductor.
Given an operator and a right-hand side, the residual is given by:
residual.apply(U, mu) == operator.apply(U, mu) - rhs.as_range_array(mu)
When operator maps to functionals instead of vectors, we are interested in the Riesz representative of the residual:
residual.apply(U, mu) == product.apply_inverse(operator.apply(U, mu) - rhs.as_range_array(mu))
Given a basis
RB
of a subspace of the source space ofoperator
, this reductor usesestimate_image_hierarchical
to determine a low-dimensional subspace containing the image of the subspace underresidual
(resp.riesz_residual
), computes an orthonormal basisresidual_range
for this range space and then returns the Petrov-Galerkin projectionprojected_residual == project(residual, range_basis=residual_range, source_basis=RB)
of the residual operator. Given a reduced basis coefficient vector
u
, w.r.t.RB
, the (dual) norm of the residual can then be computed asprojected_residual.apply(u, mu).norm()
Moreover, a
reconstruct
method is provided such thatresidual_reductor.reconstruct(projected_residual.apply(u, mu)) == residual.apply(RB.lincomb(u), mu)
Parameters
- RB
VectorArray
containing a basis of the reduced space onto which to project.- operator
See definition of
residual
.- rhs
See definition of
residual
. IfNone
, zero right-hand side is assumed.- product
Inner product
Operator
w.r.t. which to orthonormalize and w.r.t. which to compute the Riesz representatives in caseoperator
maps to functionals.- riesz_representatives
If
True
compute the Riesz representative of the residual.
Methods
Reconstruct high-dimensional residual vector from reduced vector
u
.