pymor.bindings.dunegdt

Module Contents

Classes

DuneXTVector

Wraps a vector from dune-xt to make it usable with ListVectorArray.

ComplexifiedDuneXTVector

Required for DuneXTVectorSpace, Usually not to be used directly.

DuneXTVectorSpace

A VectorSpace yielding DuneXTVector

DuneXTMatrixOperator

Wraps a dune-xt matrix as an Operator.

class pymor.bindings.dunegdt.DuneXTVector(impl)[source]

Bases: pymor.vectorarrays.list.CopyOnWriteVector

Wraps a vector from dune-xt to make it usable with ListVectorArray.

Parameters

impl

The actual vector from dune.xt.la, usually IstlVector.

__radd__[source]
classmethod from_instance(cls, instance)[source]
_copy_data(self)[source]
_scal(self, alpha)[source]
_axpy(self, alpha, x)[source]
inner(self, other)[source]
norm(self)[source]
norm2(self)[source]
sup_norm(self)[source]
dofs(self, dof_indices)[source]
amax(self)[source]
__add__(self, other)[source]
__iadd__(self, other)[source]
__sub__(self, other)[source]
__isub__(self, other)[source]
__mul__(self, other)[source]
__imul__(self, other)[source]
__neg__(self)[source]
to_numpy(self, ensure_copy=False)[source]
class pymor.bindings.dunegdt.ComplexifiedDuneXTVector(real_part, imag_part)[source]

Bases: pymor.vectorarrays.list.ComplexifiedVector

Required for DuneXTVectorSpace, Usually not to be used directly.

amax(self)[source]
class pymor.bindings.dunegdt.DuneXTVectorSpace(dim, dune_vector_type=IstlVector, id='STATE')[source]

Bases: pymor.vectorarrays.list.ComplexifiedListVectorSpace

A VectorSpace yielding DuneXTVector

Parameters

dim

Dimension of the VectorSpace, i.e., length of the resulting vectors.

vector_type

Type of the actual vector from dune.xt.la, usually IstlVector.

id

Identifier of the VectorSpace.

real_vector_type[source]
vector_type[source]
__eq__(self, other)[source]

Return self==value.

__hash__(self)[source]

Return hash(self).

real_zero_vector(self)[source]
real_full_vector(self, value)[source]
real_random_vector(self, distribution, random_state, **kwargs)[source]
real_vector_from_numpy(self, data, ensure_copy=False)[source]
real_make_vector(self, obj)[source]
class pymor.bindings.dunegdt.DuneXTMatrixOperator(matrix, source_id='STATE', range_id='STATE', solver_options=None, name=None)[source]

Bases: pymor.operators.list.LinearComplexifiedListVectorArrayOperatorBase

Wraps a dune-xt matrix as an Operator.

Parameters

matrix

The actual matrix from dune.xt.la, usually IstlMatrix.

source_id

Identifier of the source VectorSpace.

range_id

Identifier of the source VectorSpace.

solver_options

If specified, either a string or a dict specifying the solver used in apply_inverse. See https://zivgitlab.uni-muenster.de/ag-ohlberger/dune-community/dune-xt/-/tree/master/dune/xt/la/solver for available options, depending on the type of matrix. E.g., for dune.xt.la.IstlSparseMatrix, (as can be queried from dune.xt.la.IstlSparseMatrixSolver via types() and options(type)): - ‘bicgstab.ssor’ - ‘bicgstab.amg.ssor’ - ‘bicgstab.amg.ilu0’ - ‘bicgstab.ilut’ - ‘bicgstab’ - ‘cg’

name

Optional name of the resulting Operator.

linear = True[source]
_real_apply_one_vector(self, u, mu=None, prepare_data=None)[source]
_apply_adjoint_one_vector(self, v, mu=None, prepare_data=None)[source]
_real_apply_inverse_one_vector(self, v, mu=None, initial_guess=None, least_squares=False, prepare_data=None)[source]
_assemble_lincomb(self, operators, coefficients, identity_shift=0.0, solver_options=None, name=None)[source]

Try to assemble a linear combination of the given operators.

Returns a new Operator which represents the sum

c_1*O_1 + ... + c_N*O_N + s*I

where O_i are Operators, c_i, s scalar coefficients and I the identity.

This method is called in the assemble method of LincombOperator on the first of its operators. If an assembly of the given linear combination is possible, e.g. the linear combination of the system matrices of the operators can be formed, then the assembled operator is returned. Otherwise, the method returns None to indicate that assembly is not possible.

Parameters

operators

List of Operators O_i whose linear combination is formed.

coefficients

List of the corresponding linear coefficients c_i.

identity_shift

The coefficient s.

solver_options

solver_options for the assembled operator.

name

Name of the assembled operator.

Returns

The assembled Operator if assembly is possible, otherwise None.