galerkin()#

abstract _NonparametricOperator.galerkin(Vr, Wr, func)[source]#

Get the (Petrov-)Galerkin projection of this operator.

Subclasses may implement this function as follows:

@utils.requires("entries")
def galerkin(self, Vr, Wr=None):
    '''Docstring'''
    return _NonparametricOperator.galerkin(self, Vr, Wr,
        lambda A, V, W:  # compute Galerkin projection of A.
    )
Parameters
Vr(n, r) ndarray

Basis for the trial space.

Wr(n, r) ndarray or None

Basis for the test space. If None, defaults to Vr.

funccallable

Function of the operator entries, Vr, and Wr that returns the entries of the Galerkin projection of the operator.

Returns
opoperator

New object of the same class as self.