Skip to content

Commit

Permalink
Use it
Browse files Browse the repository at this point in the history
  • Loading branch information
loumalouomega committed May 6, 2024
1 parent b6959d0 commit 4bcc373
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions kratos/python_scripts/python_linear_solver_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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):
Expand All @@ -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."):
Expand All @@ -57,5 +51,4 @@ def __GetSolverTypeAndImportApplication(solver_type):
solver_type = splitted_name[1]
import_module("KratosMultiphysics." + app_name)

return solver_type

return solver_type

0 comments on commit 4bcc373

Please sign in to comment.