pymor.reductors.residual¶
Module Contents¶
Classes¶
Generic reduced basis residual reductor. |
|
Instantiated by |
|
Instantiated by |
|
Reduced basis residual reductor with mass operator for implicit Euler timestepping. |
|
Instantiated by |
|
Instantiated by |
- class pymor.reductors.residual.ResidualReductor(RB, operator, rhs=None, product=None, riesz_representatives=False)[source]¶
Bases:
pymor.core.base.BasicObjectGeneric 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
RBof a subspace of the source space ofoperator, this reductor usesestimate_image_hierarchicalto determine a low-dimensional subspace containing the image of the subspace underresidual(resp.riesz_residual), computes an orthonormal basisresidual_rangefor 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
reconstructmethod is provided such thatresidual_reductor.reconstruct(projected_residual.apply(u, mu)) == residual.apply(RB.lincomb(u), mu)
Parameters
- RB
VectorArraycontaining 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
Operatorw.r.t. which to orthonormalize and w.r.t. which to compute the Riesz representatives in caseoperatormaps to functionals.- riesz_representatives
If
Truecompute the Riesz representative of the residual.
- class pymor.reductors.residual.ResidualOperator(operator, rhs, name=None)[source]¶
Bases:
pymor.operators.interface.OperatorInstantiated by
ResidualReductor.- apply(self, U, mu=None)[source]¶
Apply the operator to a
VectorArray.Parameters
- U
VectorArrayof vectors to which the operator is applied.- mu
The
parameter valuesfor which to evaluate the operator.
Returns
VectorArrayof the operator evaluations.
- class pymor.reductors.residual.NonProjectedResidualOperator(operator, rhs, riesz_representatives, product)[source]¶
Bases:
ResidualOperatorInstantiated by
ResidualReductor.Not to be used directly.
- apply(self, U, mu=None)[source]¶
Apply the operator to a
VectorArray.Parameters
- U
VectorArrayof vectors to which the operator is applied.- mu
The
parameter valuesfor which to evaluate the operator.
Returns
VectorArrayof the operator evaluations.
- class pymor.reductors.residual.ImplicitEulerResidualReductor(RB, operator, mass, dt, rhs=None, product=None)[source]¶
Bases:
pymor.core.base.BasicObjectReduced 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_residualusingestimate_image_hierarchical, computes an orthonormal basisresidual_rangeof 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_residualoperator. Given reduced basis coefficient vectorsuandu_old, the dual norm of the residual can then be computed asprojected_riesz_residual.apply(u, u_old, mu).norm()
Moreover, a
reconstructmethod 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
VectorArraycontaining a basis of the reduced space onto which to project.- product
Inner product
Operatorw.r.t. which to compute the Riesz representatives.
- class pymor.reductors.residual.ImplicitEulerResidualOperator(operator, mass, rhs, dt, name=None)[source]¶
Bases:
pymor.operators.interface.OperatorInstantiated by
ImplicitEulerResidualReductor.- apply(self, U, U_old, mu=None)[source]¶
Apply the operator to a
VectorArray.Parameters
- U
VectorArrayof vectors to which the operator is applied.- mu
The
parameter valuesfor which to evaluate the operator.
Returns
VectorArrayof the operator evaluations.
- class pymor.reductors.residual.NonProjectedImplicitEulerResidualOperator(operator, mass, rhs, dt, product)[source]¶
Bases:
ImplicitEulerResidualOperatorInstantiated by
ImplicitEulerResidualReductor.Not to be used directly.
- apply(self, U, U_old, mu=None)[source]¶
Apply the operator to a
VectorArray.Parameters
- U
VectorArrayof vectors to which the operator is applied.- mu
The
parameter valuesfor which to evaluate the operator.
Returns
VectorArrayof the operator evaluations.