ksp_lib module¶
A PETSC KSP linear solvers library wrapper.
- class gemseo_petsc.linear_solvers.ksp_lib.PetscKSPAlgos[source]¶
Bases:
LinearSolverLib
Interface to PETSC KSP.
For further information, please read https://petsc4py.readthedocs.io/en/stable/manual/ksp/
https://petsc.org/release/docs/manualpages/KSP/KSP.html#KSP
- driver_has_option(option_name)¶
Check the existence of an option.
- execute(problem, algo_name=None, **options)¶
Execute the driver.
- filter_adapted_algorithms(problem)¶
Filter the algorithms capable of solving the problem.
- init_options_grammar(algo_name)¶
Initialize the options grammar.
- Parameters:
algo_name (str) – The name of the algorithm.
- Return type:
- static is_algorithm_suited(algorithm_description, problem)¶
Check if the algorithm is suited to the problem according to algo_dict.
- Parameters:
algorithm_description (LinearSolverDescription) – The description of the algorithm.
problem (LinearProblem) – The problem to be solved.
- Returns:
Whether the algorithm suits.
- Return type:
- solve(linear_problem, algo_name, **options)¶
Solve the linear system.
- Parameters:
linear_problem (LinearProblem) – The problem to solve.
algo_name (str) – The name of the algorithm.
**options (Any) – The algorithm options.
- Returns:
The execution result.
- Return type:
- OPTIONS_DIR: Final[str] = 'options'¶
The name of the directory containing the files of the grammars of the options.
- OPTIONS_MAP: dict[str, str] = {}¶
The names of the options in GEMSEO mapping to those in the wrapped library.
- SAVE_WHEN_FAIL = 'save_when_fail'¶
- descriptions: dict[str, AlgorithmDescription]¶
The description of the algorithms contained in the library.
- internal_algo_name: str | None¶
The internal name of the algorithm used currently.
It typically corresponds to the name of the algorithm in the wrapped library if any.
- opt_grammar: JSONGrammar | None¶
The grammar defining the options of the current algorithm.