gemseo / algos / linear_solvers

linear_solvers_factory module

A factory to instantiate linear solvers from their class names.

Classes:

LinearSolversFactory()

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

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

Attributes:

algo_names_to_libraries

algorithms

Lists the available algorithms names in the present configuration.

libraries

Lists the available library names in the present configuration.

linear_solvers

Return the available classes names.

Methods:

create(name)

Factory method to create a DriverLib subclass from algo identifier or a library identifier.

execute(problem, algo_name, **options)

Execute the driver.

is_available(solver_name)

Check the availability of a LinearSolver.

Return type

None

property algo_names_to_libraries
property algorithms

Lists the available algorithms names in the present configuration.

Returns

the list of algorithms as a string list

create(name)

Factory method to create a DriverLib subclass from algo identifier or a library identifier.

Parameters

name (string) – library or algorithm name

Returns

library according to context (optimization or DOE for instance)

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 – The options for the algorithm, see associated JSON file.

  • **options (Any) –

Returns

The solution.

Return type

numpy.ndarray

is_available(solver_name)[source]

Check the availability of a LinearSolver.

Parameters

solver_name – The name of the LinearSolver.

Returns

Whether the LinearSolver is available.

property libraries

Lists the available library names in the present configuration.

Returns

the list of libraries as a string list

property linear_solvers

Return the available classes names.

Returns

The names of the classes.