From a2e473c5b70dd5dd5ac1fdbfee77a1741ee1a148 Mon Sep 17 00:00:00 2001 From: Uwe Date: Sun, 14 Aug 2022 01:45:34 +0200 Subject: [PATCH] [FEM] Elmer: set constraints for solver systems - set constraints according to the Elmer docs (no conversion necessary, existing properties just stay integers) --- src/Mod/Fem/femsolver/elmer/equations/linear.py | 8 ++++---- src/Mod/Fem/femsolver/elmer/equations/nonlinear.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Mod/Fem/femsolver/elmer/equations/linear.py b/src/Mod/Fem/femsolver/elmer/equations/linear.py index 3ab440ef06..a0133e4834 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/linear.py +++ b/src/Mod/Fem/femsolver/elmer/equations/linear.py @@ -66,7 +66,7 @@ class Proxy(equation.Proxy): super(Proxy, self).__init__(obj) obj.addProperty( - "App::PropertyInteger", + "App::PropertyIntegerConstraint", "BiCGstablDegree", "Linear System", "Polynom degree for iterative method 'BiCGstabl'" @@ -78,7 +78,7 @@ class Proxy(equation.Proxy): "" ) obj.addProperty( - "App::PropertyInteger", + "App::PropertyIntegerConstraint", "LinearIterations", "Linear System", "" @@ -130,9 +130,9 @@ class Proxy(equation.Proxy): "" ) - obj.BiCGstablDegree = 2 + obj.BiCGstablDegree = (2, 2, 10, 1) obj.LinearDirectMethod = LINEAR_DIRECT - obj.LinearIterations = 500 + obj.LinearIterations = (500, 1, int(1e6), 50) obj.LinearIterativeMethod = LINEAR_ITERATIVE obj.LinearIterativeMethod = "BiCGStab" obj.LinearPreconditioning = LINEAR_PRECONDITIONING diff --git a/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py b/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py index 6999b6b1e0..422a492b06 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py +++ b/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py @@ -42,13 +42,13 @@ class Proxy(linear.Proxy): super(Proxy, self).__init__(obj) obj.addProperty( - "App::PropertyInteger", + "App::PropertyIntegerConstraint", "NonlinearIterations", "Nonlinear System", "Maximum number of iterations" ) obj.addProperty( - "App::PropertyInteger", + "App::PropertyIntegerConstraint", "NonlinearNewtonAfterIterations", "Nonlinear System", "" @@ -75,8 +75,8 @@ class Proxy(linear.Proxy): ) ) - obj.NonlinearIterations = 500 - obj.NonlinearNewtonAfterIterations = 3 + obj.NonlinearIterations = (500, 1, int(1e6), 50) + obj.NonlinearNewtonAfterIterations = (3, 1, 100, 1) # for small numbers we must set an expression because we don't have a UI, # the user has to view and edit the tolerance via the property editor and # this does not yet allow to view and edit small numbers in scientific notation