pymor.reductors.residual

Classes

ImplicitEulerResidualOperator

Instantiated by ImplicitEulerResidualReductor.

ImplicitEulerResidualReductor

Reduced basis residual reductor with mass operator for implicit Euler timestepping.

NonProjectedImplicitEulerResidualOperator

Instantiated by ImplicitEulerResidualReductor.

NonProjectedResidualOperator

Instantiated by ResidualReductor.

ResidualOperator

Instantiated by ResidualReductor.

ResidualReductor

Generic reduced basis residual reductor.

class pymor.reductors.residual.ImplicitEulerResidualOperator(operator, mass, rhs, dt, name=None)[source]

Bases: Operator

Instantiated by ImplicitEulerResidualReductor.

apply(U, U_old, mu=None)[source]

Apply the operator to a VectorArray.

Parameters:
Returns:

|VectorArray| of the operator evaluations.

projected_to_subbasis(dim_range=None, dim_source=None, name=None)[source]
class pymor.reductors.residual.ImplicitEulerResidualReductor(RB, operator, mass, dt, rhs=None, product=None)[source]

Bases: 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 using estimate_image_hierarchical, computes an orthonormal basis residual_range of this range space and then returns the Petrov-Galerkin projection

projected_riesz_residual
    == riesz_residual.projected(range_basis=residual_range, source_basis=RB)

of the riesz_residual operator. Given reduced basis coefficient vectors u and u_old, the dual norm of the residual can then be computed as

projected_riesz_residual.apply(u, u_old, mu).norm()

Moreover, a reconstruct method is provided such that

residual_reductor.reconstruct(projected_riesz_residual.apply(u, u_old, mu))
    == riesz_residual.apply(RB.lincomb(u.to_numpy()),
                            RB.lincomb(u_old.to_numpy()), 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. If None, 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.

reconstruct(u)[source]

Reconstruct high-dimensional residual vector from reduced vector u.

reduce()[source]
class pymor.reductors.residual.NonProjectedImplicitEulerResidualOperator(operator, mass, rhs, dt, product)[source]

Bases: ImplicitEulerResidualOperator

Instantiated by ImplicitEulerResidualReductor.

Not to be used directly.

apply(U, U_old, mu=None)[source]

Apply the operator to a VectorArray.

Parameters:
Returns:

|VectorArray| of the operator evaluations.

projected_to_subbasis(dim_range=None, dim_source=None, name=None)[source]
class pymor.reductors.residual.NonProjectedResidualOperator(operator, rhs, riesz_representatives, product)[source]

Bases: ResidualOperator

Instantiated by ResidualReductor.

Not to be used directly.

apply(U, mu=None)[source]

Apply the operator to a VectorArray.

Parameters:
Returns:

|VectorArray| of the operator evaluations.

projected_to_subbasis(dim_range=None, dim_source=None, name=None)[source]
class pymor.reductors.residual.ResidualOperator(operator, rhs, name=None)[source]

Bases: Operator

Instantiated by ResidualReductor.

apply(U, mu=None)[source]

Apply the operator to a VectorArray.

Parameters:
Returns:

|VectorArray| of the operator evaluations.

projected_to_subbasis(dim_range=None, dim_source=None, name=None)[source]
class pymor.reductors.residual.ResidualReductor(RB, operator, rhs=None, product=None, riesz_representatives=False)[source]

Bases: 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 of operator, this reductor uses estimate_image_hierarchical to determine a low-dimensional subspace containing the image of the subspace under residual (resp. riesz_residual), computes an orthonormal basis residual_range for this range space and then returns the Petrov-Galerkin projection

projected_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 as

projected_residual.apply(u, mu).norm()

Moreover, a reconstruct method is provided such that

residual_reductor.reconstruct(projected_residual.apply(u, mu))
    == residual.apply(RB.lincomb(u.to_numpy()), 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. If None, 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 case operator maps to functionals.

  • riesz_representatives – If True compute the Riesz representative of the residual.

reconstruct(u)[source]

Reconstruct high-dimensional residual vector from reduced vector u.

reduce()[source]