pymor.algorithms.projection

Module Contents

class pymor.algorithms.projection.ProjectRules(range_basis, source_basis)[source]

Bases: pymor.algorithms.rules.RuleTable

RuleTable for the project algorithm.

action_AdjointOperator(op)[source]
action_AffineOperator(op)[source]
action_BlockOperatorBase(op)[source]
action_ConcatenationOperator(op)[source]
action_ConstantOperator(op)[source]
action_EmpiricalInterpolatedOperator(op)[source]
action_LincombOperator(op)[source]
action_QuadraticFunctional(op)[source]
action_SelectionOperator(op)[source]
action_ZeroOperator(op)[source]
action_apply_basis(op)[source]
class pymor.algorithms.projection.ProjectToSubbasisRules(dim_range, dim_source)[source]

Bases: pymor.algorithms.rules.RuleTable

RuleTable for the project_to_subbasis algorithm.

action_BlockColumnOperator(op)[source]
action_BlockRowOperator(op)[source]
action_ConstantOperator(op)[source]
action_IdentityOperator(op)[source]
action_NumpyMatrixOperator(op)[source]
action_ProjectedEmpiricalInterpolatedOperator(op)[source]
action_ProjectedOperator(op)[source]
action_QuadraticFunctional(op)[source]
action_VectorArrayOperator(op)[source]
action_ZeroOperator(op)[source]
action_recurse(op)[source]
pymor.algorithms.projection.project(op, range_basis, source_basis, product=None)[source]

Petrov-Galerkin projection of a given Operator.

Given an inner product ( ⋅, ⋅), source vectors b_1, ..., b_N and range vectors c_1, ..., c_M, the projection op_proj of op is defined by

[ op_proj(e_j) ]_i = ( c_i, op(b_j) )

for all i,j, where e_j denotes the j-th canonical basis vector of R^N.

In particular, if the c_i are orthonormal w.r.t. the given product, then op_proj is the coordinate representation w.r.t. the b_i/c_i bases of the restriction of op to span(b_i) concatenated with the orthogonal projection onto span(c_i).

From another point of view, if op is viewed as a bilinear form (see apply2) and ( ⋅, ) is the Euclidean inner product, then op_proj represents the matrix of the bilinear form restricted to span(b_i) / span(c_i) (w.r.t. the b_i/c_i bases).

How the projection is realized will depend on the given Operator. While a projected NumpyMatrixOperator will again be a NumpyMatrixOperator, only a generic ProjectedOperator can be returned in general. The exact algorithm is specified in ProjectRules.

Parameters

range_basis

The vectors c_1, ..., c_M as a VectorArray. If None, no projection in the range space is performed.

source_basis

The vectors b_1, ..., b_N as a VectorArray or None. If None, no restriction of the source space is performed.

product

An Operator representing the inner product. If None, the Euclidean inner product is chosen.

Returns

The projected Operator op_proj.

pymor.algorithms.projection.project_to_subbasis(op, dim_range=None, dim_source=None)[source]

Project already projected Operator to a subbasis.

The purpose of this method is to further project an operator that has been obtained through project to subbases of the original projection bases, i.e.

project_to_subbasis(project(op, r_basis, s_basis, prod), dim_range, dim_source)

should be the same as

project(op, r_basis[:dim_range], s_basis[:dim_source], prod)

For a NumpyMatrixOperator this amounts to extracting the upper-left (dim_range, dim_source) corner of its matrix.

The subbasis projection algorithm is specified in ProjectToSubbasisRules.

Parameters

dim_range

Dimension of the range subbasis.

dim_source

Dimension of the source subbasis.

Returns

The projected Operator.