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_N
and range vectorsc_1, ..., c_M
, the projectionop_proj
ofop
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, thenop_proj
is the coordinate representation w.r.t. theb_i/c_i
bases of the restriction ofop
tospan(b_i)
concatenated with the orthogonal projection ontospan(c_i)
.From another point of view, if
op
is viewed as a bilinear form (seeapply2
) and( ⋅, ⋅ )
is the Euclidean inner product, thenop_proj
represents the matrix of the bilinear form restricted tospan(b_i) / span(c_i)
(w.r.t. theb_i/c_i
bases).How the projection is realized will depend on the given
Operator
. While a projectedNumpyMatrixOperator
will again be aNumpyMatrixOperator
, only a genericProjectedOperator
can be returned in general. The exact algorithm is specified inProjectRules
.Parameters
- range_basis
The vectors
c_1, ..., c_M
as aVectorArray
. IfNone
, no projection in the range space is performed.- source_basis
The vectors
b_1, ..., b_N
as aVectorArray
orNone
. IfNone
, no restriction of the source space is performed.- product
An
Operator
representing the inner product. IfNone
, the Euclidean inner product is chosen.
Returns
The projected
Operator
op_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
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
.
- class pymor.algorithms.projection.ProjectToSubbasisRules(dim_range, dim_source)[source]¶
Bases:
pymor.algorithms.rules.RuleTable
RuleTable
for theproject_to_subbasis
algorithm.