pymor.solvers.default

Module Contents

class pymor.solvers.default.DefaultSolver(try_to_matrix=True)[source]

Bases: pymor.solvers.interface.Solver

Default Solver.

This Solver is used by apply_inverse and apply_inverse_adjoint when the Operator has no solver and no solver is specified in the method call.

DefaultSolver uses the following strategy:

  1. Try to call operator._apply_inverse.

  2. Assemble operator. Try assembled_operator._apply_inverse.

    1. If operator is linear, try to convert assembled_operator to a NumpyMatrixOperator using to_matrix and call apply_inverse on the converted operator.

    2. If operator is non-linear, use NewtonSolver.

Parameters:

try_to_matrix – If False, do not try to convert linear operators to NumpyMatrixOperator. Fail instead.