[FEM] Elmer: add support to turn off solvers

- with this property the linear solver is turned off. As consequence one can this way also disable the execution of an equation without the need to delete the equation object

- also add missing preconditioners
This commit is contained in:
Uwe
2022-08-13 05:51:26 +02:00
parent 278598083d
commit 2edf6abb2f
2 changed files with 25 additions and 1 deletions

View File

@@ -46,15 +46,17 @@ LINEAR_ITERATIVE = [
"TFQMR",
"GMRES",
"GCR",
"Idrs"
]
LINEAR_PRECONDITIONING = [
"None",
"Diagonal",
"ILUT",
"ILU0",
"ILU1",
"ILU2",
"ILU3",
"ILU4",
"ILU4"
]
@@ -118,6 +120,16 @@ class Proxy(equation.Proxy):
""
)
obj.LinearIterations = 500
obj.addProperty(
"App::PropertyBool",
"LinearSystemSolverDisabled",
"Linear System",
(
"Disable the linear system.\n"
"Only use for special cases\n"
"and consult the Elmer docs."
)
)
obj.addProperty(
"App::PropertyFloat",
"SteadyStateTolerance",

View File

@@ -1489,6 +1489,17 @@ class Writer(object):
equation.setExpression("SteadyStateTolerance", str(equation.SteadyStateTolerance))
if equation.BiCGstablDegree == 0:
equation.BiCGstablDegree = 2
if not hasattr(equation, "LinearSystemSolverDisabled"):
equation.addProperty(
"App::PropertyBool",
"LinearSystemSolverDisabled",
"Linear System",
(
"Disable the linear system.\n"
"Only use for special cases\n"
"and consult the Elmer docs."
)
)
def _createLinearSolver(self, equation):
# first check if we have to update
@@ -1497,6 +1508,7 @@ class Writer(object):
s = sifio.createSection(sifio.SOLVER)
s.priority = equation.Priority
s["Linear System Solver"] = equation.LinearSolverType
s["Linear System Solver Disabled"] = equation.LinearSystemSolverDisabled
if equation.LinearSolverType == "Direct":
s["Linear System Direct Method"] = \
equation.LinearDirectMethod