From 4bcc3738a179bf3aa1dc055e53cdec3646cb67ef Mon Sep 17 00:00:00 2001 From: Vicente Mataix Ferrandiz Date: Mon, 6 May 2024 17:26:51 +0200 Subject: [PATCH] Use it --- kratos/python_scripts/python_linear_solver_factory.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/kratos/python_scripts/python_linear_solver_factory.py b/kratos/python_scripts/python_linear_solver_factory.py index 6b5a83d798ea..86f5deed8530 100644 --- a/kratos/python_scripts/python_linear_solver_factory.py +++ b/kratos/python_scripts/python_linear_solver_factory.py @@ -2,7 +2,6 @@ from KratosMultiphysics import kratos_utilities as kratos_utils from importlib import import_module - def ConstructSolver(configuration): if(type(configuration) != KM.Parameters): raise Exception("input is expected to be provided as a Kratos Parameters object") @@ -26,11 +25,7 @@ def CreateFastestAvailableDirectLinearSolver(): if kratos_utils.CheckIfApplicationsAvailable("LinearSolversApplication"): from KratosMultiphysics import LinearSolversApplication - linear_solvers_by_speed = [ - "pardiso_lu", # LinearSolversApplication (if compiled with Intel-support) - "sparse_lu", # LinearSolversApplication - "skyline_lu_factorization" # in Core, always available, but slow - ] + linear_solvers_by_speed = KM.SparseSpace.FastestDirectSolverList() for solver_name in linear_solvers_by_speed: if KM.LinearSolverFactory().Has(solver_name): @@ -41,7 +36,6 @@ def CreateFastestAvailableDirectLinearSolver(): raise Exception("Linear-Solver could not be constructed!") - def __GetSolverTypeAndImportApplication(solver_type): # remove unused "KratosMultiphysics. if solver_type.startswith("KratosMultiphysics."): @@ -57,5 +51,4 @@ def __GetSolverTypeAndImportApplication(solver_type): solver_type = splitted_name[1] import_module("KratosMultiphysics." + app_name) - return solver_type - + return solver_type \ No newline at end of file