pymor.algorithms.projection¶
Module Contents¶
Classes¶
|
Functions¶
Petrov-Galerkin projection of a given |
|
Project already projected |
- pymor.algorithms.projection.project(op, range_basis, source_basis, product=None)[source]¶
Petrov-Galerkin projection of a given
Operator.Given an inner product
( ⋅, ⋅), source vectorsb_1, ..., b_Nand range vectorsc_1, ..., c_M, the projectionop_projofopis defined by[ op_proj(e_j) ]_i = ( c_i, op(b_j) )
for all i,j, where
e_jdenotes the j-th canonical basis vector of R^N.In particular, if the
c_iare orthonormal w.r.t. the given product, thenop_projis the coordinate representation w.r.t. theb_i/c_ibases of the restriction ofoptospan(b_i)concatenated with the orthogonal projection ontospan(c_i).From another point of view, if
opis viewed as a bilinear form (seeapply2) and( ⋅, ⋅ )is the Euclidean inner product, thenop_projrepresents the matrix of the bilinear form restricted tospan(b_i) / span(c_i)(w.r.t. theb_i/c_ibases).How the projection is realized will depend on the given
Operator. While a projectedNumpyMatrixOperatorwill again be aNumpyMatrixOperator, only a genericProjectedOperatorcan be returned in general. The exact algorithm is specified inProjectRules.Parameters
- range_basis
The vectors
c_1, ..., c_Mas aVectorArray. IfNone, no projection in the range space is performed.- source_basis
The vectors
b_1, ..., b_Nas aVectorArrayorNone. IfNone, no restriction of the source space is performed.- product
An
Operatorrepresenting the inner product. IfNone, the Euclidean inner product is chosen.
Returns
The projected
Operatorop_proj.
- class pymor.algorithms.projection.ProjectRules(range_basis, source_basis)[source]¶
- pymor.algorithms.projection.project_to_subbasis(op, dim_range=None, dim_source=None)[source]¶
Project already projected
Operatorto a subbasis.The purpose of this method is to further project an operator that has been obtained through
projectto 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
NumpyMatrixOperatorthis 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.
- class pymor.algorithms.projection.ProjectToSubbasisRules(dim_range, dim_source)[source]¶
Bases:
pymor.algorithms.rules.RuleTableRuleTablefor theproject_to_subbasisalgorithm.