[FEM] Elmer: fix small number property handling

- use an expression as discussed: https://forum.freecadweb.org/viewtopic.php?p=613897#p613897
This commit is contained in:
Uwe
2022-07-31 05:19:45 +02:00
parent c457f3bfbd
commit 00f1360773
2 changed files with 14 additions and 5 deletions

View File

@@ -105,7 +105,11 @@ class Proxy(equation.Proxy):
"Linear System",
""
)
obj.LinearTolerance = 1e-8
# 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-8")
obj.addProperty(
"App::PropertyInteger",
"LinearIterations",
@@ -119,7 +123,8 @@ class Proxy(equation.Proxy):
"Steady State",
""
)
obj.SteadyStateTolerance = 1e-5
# same as with LinearTolerance
obj.setExpression('SteadyStateTolerance', "1e-5")
obj.addProperty(
"App::PropertyBool",
"Stabilize",

View File

@@ -70,11 +70,15 @@ class Proxy(linear.Proxy):
"Nonlinear System",
""
)
obj.NonlinearTolerance = 1e-8
obj.NonlinearIterations = 500
obj.RelaxationFactor = 1
obj.NonlinearNewtonAfterIterations = 3
obj.NonlinearNewtonAfterTolerance = 1e-3
# 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
# forum thread: https://forum.freecadweb.org/viewtopic.php?p=613897#p613897
obj.setExpression('NonlinearTolerance', "1e-8")
obj.setExpression('NonlinearNewtonAfterTolerance', "1e-3")
obj.setExpression('RelaxationFactor', "1.0") # must often be < 1 down to 0.01
class ViewProxy(linear.ViewProxy):