pymor.reductors.basic

Module Contents

class pymor.reductors.basic.DelayLTIPGReductor(fom, W, V, E_biorthonormal=False)[source]

Bases: ProjectionBasedReductor

Petrov-Galerkin projection of an LinearDelayModel.

Parameters:
  • fom – The full order Model to reduce.

  • W – The basis of the test space.

  • V – The basis of the ansatz space.

  • E_biorthonormal – If True, no E matrix will be assembled for the reduced Model. Set to True if W and V are biorthonormal w.r.t. fom.E.

Methods

build_rom

extend_basis

Extend a reduced basis with new vectors.

project_operators

project_operators_to_subbasis

reconstruct

Reconstruct high-dimensional vector from reduced vector u.

build_rom(projected_operators, error_estimator)[source]
abstract extend_basis(**kwargs)[source]

Extend a reduced basis with new vectors.

Keyword arguments left as None fall back to extension_params and anything not set there uses the defaults of extend_basis.

project_operators()[source]
project_operators_to_subbasis(dims)[source]
reconstruct(u, basis='V')[source]

Reconstruct high-dimensional vector from reduced vector u.

class pymor.reductors.basic.InstationaryRBReductor(fom, RB=None, product=None, initial_data_product=None, product_is_mass=False, check_orthonormality=None, check_tol=None, extension_params=None)[source]

Bases: ProjectionBasedReductor

Galerkin projection of an InstationaryModel.

Parameters:
  • fom – The full order Model to reduce.

  • RB – The basis of the reduced space onto which to project. If None an empty basis is used.

  • product – Inner product Operator w.r.t. which RB is orthonormalized. If None, the the Euclidean inner product is used.

  • initial_data_product – Inner product Operator w.r.t. which the initial_data of fom is orthogonally projected. If None, the Euclidean inner product is used.

  • product_is_mass – If True, no mass matrix for the reduced Model is assembled. Set to True if RB is orthonormal w.r.t. the mass matrix of fom.

  • check_orthonormality – See ProjectionBasedReductor.

  • check_tol – See ProjectionBasedReductor.

  • extension_params – See ProjectionBasedReductor.

build_rom(projected_operators, error_estimator)[source]
project_operators()[source]
project_operators_to_subbasis(dims)[source]
class pymor.reductors.basic.LTIPGReductor(fom, W, V, E_biorthonormal=False)[source]

Bases: ProjectionBasedReductor

Petrov-Galerkin projection of an LTIModel.

Parameters:
  • fom – The full order Model to reduce.

  • W – The basis of the test space.

  • V – The basis of the ansatz space.

  • E_biorthonormal – If True, no E matrix will be assembled for the reduced Model. Set to True if W and V are biorthonormal w.r.t. fom.E.

Methods

build_rom

extend_basis

Extend a reduced basis with new vectors.

project_operators

project_operators_to_subbasis

reconstruct

Reconstruct high-dimensional vector from reduced vector u.

build_rom(projected_operators, error_estimator)[source]
abstract extend_basis(**kwargs)[source]

Extend a reduced basis with new vectors.

Keyword arguments left as None fall back to extension_params and anything not set there uses the defaults of extend_basis.

project_operators()[source]
project_operators_to_subbasis(dims)[source]
reconstruct(u, basis='V')[source]

Reconstruct high-dimensional vector from reduced vector u.

class pymor.reductors.basic.ProjectionBasedReductor(fom, bases, products={}, check_orthonormality=True, check_tol=0.001, extension_params=None)[source]

Bases: pymor.core.base.BasicObject

Generic projection based reductor.

Parameters:
  • fom – The full order Model to reduce.

  • bases – A dict of VectorArrays of basis vectors.

  • products – A dict of inner product Operators w.r.t. which the corresponding bases are orthonormalized. A value of None corresponds to orthonormalization of the basis w.r.t. the Euclidean inner product.

  • check_orthonormality – If True, check if bases which have a corresponding entry in the products dict are orthonormal w.r.t. the given inner product. After each basis extension, orthonormality is checked again.

  • check_tol – If check_orthonormality is True, the numerical tolerance with which the checks are performed.

  • extension_params – Dict of default keyword arguments for extend_basis.

Methods

adapt

Adapt the ROM to new FOM solutions or to an updated FOM.

assemble_error_estimator

assemble_error_estimator_for_subbasis

build_rom

extend_basis

Extend a reduced basis with new vectors.

project_operators

project_operators_to_subbasis

reconstruct

Reconstruct high-dimensional vector from reduced vector u.

reduce

adapt(mu, new_fom=None, fom_solution=None, fom_output=None)[source]

Adapt the ROM to new FOM solutions or to an updated FOM.

Extends the reduced basis using a more accurate solution and returns the newly reduced model. Only implemented for reductors with a single 'RB' basis.

Parameters:
  • muParameter value for which to adapt. Only used to compute fom_solution if it is not provided.

  • new_fom – A more accurate model (one level above in the hierarchy) to adapt from. If given, the reference model of this reductor is replaced by new_fom and the existing basis is embedded into its (enlarged) solution space by zero-padding.

  • fom_solution – More accurate solution used as training data. Computed from mu if not provided.

  • fom_output – Corresponding more accurate output (ignored).

Returns:

new_rom – The reduced model obtained after adaptation.

assemble_error_estimator()[source]
assemble_error_estimator_for_subbasis(dims)[source]
abstract build_rom(projected_operators, error_estimator)[source]
extend_basis(U, basis='RB', method=None, pod_modes=None, pod_orthonormalize=None, copy_U=None)[source]

Extend a reduced basis with new vectors.

Keyword arguments left as None fall back to extension_params and anything not set there uses the defaults of extend_basis.

abstract project_operators()[source]
abstract project_operators_to_subbasis(dims)[source]
reconstruct(u, basis='RB')[source]

Reconstruct high-dimensional vector from reduced vector u.

reduce(dims=None)[source]
class pymor.reductors.basic.ProxyEstimator(fom, reductor=None)[source]

Bases: pymor.core.base.ImmutableObject

Estimate error using the FOM’s error estimator.

This error estimator reconstructs the given ROM solution and then evaluates the error estimator of the FOM for the reconstructed solution.

Note

This approach assumes that the FOM error estimator yields appropriate estimates for arbitrary vectors from the FOM’s solution_space. While this is typically true for residual-based ROM error estimators, most FEM error estimators only yield reliable estimates for the actual finite-element solution.

Parameters:
  • fom – The full-order Model which is used to estimate the error. Must have an error_estimator attribute.

  • reductor – The reductor used for reconstructing the solution vector. When None, it is assumed that both models have the same solution_space.

estimate_error(U, mu, m)[source]
estimate_output_error(U, mu, m)[source]
class pymor.reductors.basic.SOLTIPGReductor(fom, W, V, M_biorthonormal=False)[source]

Bases: ProjectionBasedReductor

Petrov-Galerkin projection of an SecondOrderModel.

Parameters:
  • fom – The full order Model to reduce.

  • W – The basis of the test space.

  • V – The basis of the ansatz space.

  • E_biorthonormal – If True, no E matrix will be assembled for the reduced Model. Set to True if W and V are biorthonormal w.r.t. fom.E.

Methods

build_rom

extend_basis

Extend a reduced basis with new vectors.

project_operators

project_operators_to_subbasis

reconstruct

Reconstruct high-dimensional vector from reduced vector u.

build_rom(projected_operators, error_estimator)[source]
abstract extend_basis(**kwargs)[source]

Extend a reduced basis with new vectors.

Keyword arguments left as None fall back to extension_params and anything not set there uses the defaults of extend_basis.

project_operators()[source]
project_operators_to_subbasis(dims)[source]
reconstruct(u, basis='V')[source]

Reconstruct high-dimensional vector from reduced vector u.

class pymor.reductors.basic.StationaryLSRBReductor(fom, RB=None, product=None, use_normal_equations=False, check_orthonormality=None, check_tol=None)[source]

Bases: ProjectionBasedReductor

Least-squares Petrov-Galerkin projection based reductor for stationary problems.

This reductor solves a least-squares problem either by Galerkin projection of the normal equations (use_normal_equations = True) or by Petrov-Galerkin projection of the least-squares residual.

Parameters:
  • fom – The full order Model to reduce.

  • RB – The basis of the reduced space onto which to project. If None, an empty basis is used.

  • product – Inner product Operator w.r.t. which RB is orthonormalized. If None, the Euclidean inner product is used.

  • use_normal_equations – If True, projects the normal equation instead of using a least-squares solver. If False, equip the operator with a least-squares solver.

  • check_orthonormality – See ProjectionBasedReductor.

  • check_tol – See ProjectionBasedReductor.

build_rom(projected_operators, error_estimator)[source]
project_operators()[source]
project_operators_to_subbasis(dims)[source]
class pymor.reductors.basic.StationaryRBReductor(fom, RB=None, product=None, check_orthonormality=None, check_tol=None, extension_params=None)[source]

Bases: ProjectionBasedReductor

Galerkin projection of a StationaryModel.

Parameters:
build_rom(projected_operators, error_estimator)[source]
project_operators()[source]
project_operators_to_subbasis(dims)[source]
pymor.reductors.basic.extend_basis(U, basis, product=None, method='gram_schmidt', pod_modes=1, pod_orthonormalize=True, copy_U=True)[source]