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: 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.

create(name)

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

Parameters:

name (str) – The name of a library or algorithm.

Returns:

The driver library.

Return type:

DriverLib

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 (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:

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: dict[str, str]

The mapping from the algorithm names to the libraries.

property algorithms: list[str]

The available algorithms names.

property libraries: list[str]

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.