From d985525893e0afd5f66a0ef2990eb26211287f8e Mon Sep 17 00:00:00 2001 From: Uwe Date: Sun, 14 Aug 2022 01:07:11 +0200 Subject: [PATCH] [FEM] Elmer: just sorting to keep the overview --- .../femsolver/elmer/equations/elasticity.py | 20 ++-- .../Fem/femsolver/elmer/equations/linear.py | 91 ++++++++++--------- .../femsolver/elmer/equations/nonlinear.py | 12 +-- 3 files changed, 62 insertions(+), 61 deletions(-) diff --git a/src/Mod/Fem/femsolver/elmer/equations/elasticity.py b/src/Mod/Fem/femsolver/elmer/equations/elasticity.py index e1f52ca68b..7e6aa80c9d 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/elasticity.py +++ b/src/Mod/Fem/femsolver/elmer/equations/elasticity.py @@ -56,15 +56,9 @@ class Proxy(linear.Proxy, equationbase.ElasticityProxy): obj.addProperty( "App::PropertyBool", - "CalculateStrains", + "CalculatePangle", "Elasticity", - "Compute the strain tensor" - ) - obj.addProperty( - "App::PropertyBool", - "CalculateStresses", - "Elasticity", - "Compute stress tensor and vanMises" + "Compute principal stress angles" ) obj.addProperty( "App::PropertyBool", @@ -74,9 +68,15 @@ class Proxy(linear.Proxy, equationbase.ElasticityProxy): ) obj.addProperty( "App::PropertyBool", - "CalculatePangle", + "CalculateStrains", "Elasticity", - "Compute principal stress angles" + "Compute the strain tensor" + ) + obj.addProperty( + "App::PropertyBool", + "CalculateStresses", + "Elasticity", + "Compute stress tensor and vanMises" ) obj.addProperty( "App::PropertyBool", diff --git a/src/Mod/Fem/femsolver/elmer/equations/linear.py b/src/Mod/Fem/femsolver/elmer/equations/linear.py index c48395e2c4..3ab440ef06 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/linear.py +++ b/src/Mod/Fem/femsolver/elmer/equations/linear.py @@ -64,62 +64,43 @@ class Proxy(equation.Proxy): def __init__(self, obj): super(Proxy, self).__init__(obj) - obj.addProperty( - "App::PropertyEnumeration", - "LinearSolverType", - "Linear System", - "" - ) - obj.LinearSolverType = LINEAR_SOLVER - obj.LinearSolverType = "Iterative" - obj.addProperty( - "App::PropertyEnumeration", - "LinearDirectMethod", - "Linear System", - "" - ) - obj.LinearDirectMethod = LINEAR_DIRECT - obj.addProperty( - "App::PropertyEnumeration", - "LinearIterativeMethod", - "Linear System", - "" - ) - obj.LinearIterativeMethod = LINEAR_ITERATIVE - obj.LinearIterativeMethod = "BiCGStab" + obj.addProperty( "App::PropertyInteger", "BiCGstablDegree", "Linear System", "Polynom degree for iterative method 'BiCGstabl'" ) - obj.BiCGstablDegree = 2 obj.addProperty( "App::PropertyEnumeration", - "LinearPreconditioning", + "LinearDirectMethod", "Linear System", "" ) - obj.LinearPreconditioning = LINEAR_PRECONDITIONING - obj.LinearPreconditioning = "ILU0" - obj.addProperty( - "App::PropertyFloat", - "LinearTolerance", - "Linear System", - "Linear preconditioning method" - ) - # 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 - # forum thread: https://forum.freecadweb.org/viewtopic.php?p=613897#p613897 - obj.setExpression("LinearTolerance", "1e-10") obj.addProperty( "App::PropertyInteger", "LinearIterations", "Linear System", "" ) - obj.LinearIterations = 500 + obj.addProperty( + "App::PropertyEnumeration", + "LinearIterativeMethod", + "Linear System", + "" + ) + obj.addProperty( + "App::PropertyEnumeration", + "LinearPreconditioning", + "Linear System", + "" + ) + obj.addProperty( + "App::PropertyEnumeration", + "LinearSolverType", + "Linear System", + "" + ) obj.addProperty( "App::PropertyBool", "LinearSystemSolverDisabled", @@ -132,19 +113,39 @@ class Proxy(equation.Proxy): ) obj.addProperty( "App::PropertyFloat", - "SteadyStateTolerance", - "Steady State", - "" + "LinearTolerance", + "Linear System", + "Linear preconditioning method" ) - # same as with LinearTolerance - obj.setExpression("SteadyStateTolerance", "1e-5") - obj.addProperty( "App::PropertyBool", "Stabilize", "Base", "" ) + obj.addProperty( + "App::PropertyFloat", + "SteadyStateTolerance", + "Steady State", + "" + ) + + obj.BiCGstablDegree = 2 + obj.LinearDirectMethod = LINEAR_DIRECT + obj.LinearIterations = 500 + obj.LinearIterativeMethod = LINEAR_ITERATIVE + obj.LinearIterativeMethod = "BiCGStab" + obj.LinearPreconditioning = LINEAR_PRECONDITIONING + obj.LinearPreconditioning = "ILU0" + # 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 + # forum thread: https://forum.freecadweb.org/viewtopic.php?p=613897#p613897 + obj.setExpression("LinearTolerance", "1e-10") + obj.LinearSolverType = LINEAR_SOLVER + obj.LinearSolverType = "Iterative" + # same reason to setup an expression as with LinearTolerance + obj.setExpression("SteadyStateTolerance", "1e-5") obj.Stabilize = True diff --git a/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py b/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py index eede285ff3..6999b6b1e0 100644 --- a/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py +++ b/src/Mod/Fem/femsolver/elmer/equations/nonlinear.py @@ -41,12 +41,6 @@ class Proxy(linear.Proxy): def __init__(self, obj): super(Proxy, self).__init__(obj) - obj.addProperty( - "App::PropertyFloat", - "NonlinearTolerance", - "Nonlinear System", - "" - ) obj.addProperty( "App::PropertyInteger", "NonlinearIterations", @@ -65,6 +59,12 @@ class Proxy(linear.Proxy): "Nonlinear System", "" ) + obj.addProperty( + "App::PropertyFloat", + "NonlinearTolerance", + "Nonlinear System", + "" + ) obj.addProperty( "App::PropertyFloatConstraint", "RelaxationFactor",