gemseo / algos / linear_solvers

linear_solvers_factory module

A factory to instantiate linear solvers from their class names.

class gemseo.algos.linear_solvers.linear_solvers_factory.LinearSolversFactory[source]

Bases: gemseo.algos.driver_factory.DriverFactory

MDA factory to create the MDA from a name or a class.

Initializes the factory: scans the directories to search for subclasses of DriverLib.

Searches subclasses of driver_lib_class in “GEMSEO_PATH” and driver_package.

Return type

None

create(name)

Create a driver library from an algorithm name or a library name.

Parameters

name – The name of a library or algorithm.

Returns

The driver library.

execute(problem, algo_name, **options)[source]

Execute the driver.

Find the appropriate library and execute the driver on the problem to solve the linear system LHS.x = RHS.

Parameters
  • problem (gemseo.algos.linear_solvers.linear_problem.LinearProblem) – The linear equations and right hand side (lhs, rhs) that defines the linear problem. XXX is a tuple expected?

  • algo_name (str) – The algorithm name.

  • **options (Any) – The options for the algorithm, see associated JSON file.

Returns

The solution.

Return type

numpy.ndarray

is_available(solver_name)[source]

Check the availability of a LinearSolver.

Parameters

solver_name (str) – The name of the LinearSolver.

Returns

Whether the LinearSolver is available.

Return type

bool

property algo_names_to_libraries

The mapping from the algorithm names to the libraries.

property algorithms

The available algorithms names.

property libraries

List the available library names in the present configuration.

Returns

The names of the available libraries.

property linear_solvers: list[str]

The names of the available classes.