# sfepy.solvers.solvers module

Base (abstract) solver classes.

class sfepy.solvers.solvers.EigenvalueSolver(conf, mtx_a=None, mtx_b=None, n_eigs=None, eigenvectors=None, status=None, context=None, **kwargs)

  Abstract eigenvalue solver class.

class sfepy.solvers.solvers.LinearSolver(conf, mtx=None, status=None, context=None, **kwargs)

  Abstract linear solver class.

  clear()
  get_tolerance()

    Return tuple (eps_a, eps_r) of absolute and relative tolerance settings. Either value can be None, meaning that the solver does not use that setting.

  presolve(mtx)

class sfepy.solvers.solvers.NonlinearSolver(conf, fun=None, fun_grad=None, lin_solver=None, iter_hook=None, status=None, context=None, **kwargs)

  Abstract nonlinear solver class.

class sfepy.solvers.solvers.OptimizationSolver(conf, obj_fun=None, obj_fun_grad=None, status=None, obj_args=None, context=None, **kwargs)

  Abstract optimization solver class.

class sfepy.solvers.solvers.QuadraticEVPSolver(conf, mtx_m=None, mtx_d=None, mtx_k=None, n_eigs=None, eigenvectors=None, status=None, context=None, **kwargs)

  Abstract quadratic eigenvalue problem solver class.

class sfepy.solvers.solvers.Solver(conf=None, context=None, **kwargs)

  Base class for all solver kinds. Takes care of processing of common configuration options.

  The factory method any_from_conf() can be used to create an instance of any subclass.

  The subclasses have to reimplement __init__() and __call__().

  All solvers use the following configuration parameters:

  Parameters:
    name str

      The name referred to in problem description options.

    kind str

      The solver kind, as given by the name class attribute of the Solver subclasses.

    report_status bool (default: False)

      If True, the solver can report the solution status.

    verbose bool (default: False)

      If True, the solver can print more information about the solution.

  static any_from_conf(conf, **kwargs)

    Create an instance of a solver class according to the configuration.

  build_solver_kwargs(conf)

    Build the kwargs dict for the underlying solver function using the extra options (marked by ‘*’ in `_parameters`) in conf. The declared parameters are omitted.

  classmethod process_conf(conf, kwargs)

    Process configuration parameters.

  set_field_split(field_ranges, **kwargs)

class sfepy.solvers.solvers.SolverMeta(name, bases, ndict)

  Metaclass for solver classes that automatically adds configuration parameters to the solver class docstring from the `_parameters` class attribute.

class sfepy.solvers.solvers.TimeStepController(conf, **kwargs)

  Abstract time step controller class.

  get_initial_dt(ts, vec, **kwargs)

class sfepy.solvers.solvers.TimeSteppingSolver(conf, nls=None, status=None, tsc=None, context=None, **kwargs)

  Abstract time stepping solver class.

  set_dof_info(di)

sfepy.solvers.solvers.format_next(text, new_text, pos, can_newline, width, ispaces)

sfepy.solvers.solvers.make_get_conf(conf, kwargs)

sfepy.solvers.solvers.make_option_docstring(name, kind, default, required, doc)

sfepy.solvers.solvers.typeset_to_indent(txt, indent, width)

sfepy.solvers.solvers.use_first_available(solver_list, context=None, **kwargs)

  Use the first available solver from solver_list.

  Parameters:
    solver_list list of str or Struct

      The list of solver names or configuration objects.

    context object, optional

      An optional solver context to pass to the solver.

    **kwargs keyword arguments

      Additional solver options, see the particular __init__() methods.

  Returns:
    out Solver

      The first available solver.