[FEM] fix broken Z88 part 1: don't hardcode solver

- especially don't hardcode the choly solver that fails quickly for finer meshes
- setting sorcg as default since it shows the best performance with the cantilever tests
This commit is contained in:
Uwe
2022-03-25 16:49:03 +01:00
parent 7734017cd6
commit d035bbc1ca
3 changed files with 180 additions and 109 deletions

View File

@@ -42,6 +42,7 @@ from femmesh import meshsetsgetter
from femtools import femutils
from femtools import membertools
SOLVER_TYPES = ["sorcg", "siccg", "choly"]
class Check(run.Check):
@@ -102,6 +103,12 @@ class Solve(run.Solve):
binary = settings.get_binary("Z88")
if binary is None:
self.fail() # a print has been made in settings module
prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Z88")
solver = SOLVER_TYPES
solver = prefs.GetInt("Solver", 0)
solver = SOLVER_TYPES[solver]
self.pushStatus("used solver: " + solver + "\n")
# run solver test mode
# AFAIK: z88r needs to be run twice
@@ -111,7 +118,7 @@ class Solve(run.Solve):
# may be compare with the used ones
self.pushStatus("Executing solver in test mode...\n")
self._process = subprocess.Popen(
[binary, "-t", "-choly"],
[binary, "-t", "-" + solver],
cwd=self.directory,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
@@ -123,7 +130,7 @@ class Solve(run.Solve):
self.pushStatus("Executing solver in real mode...\n")
binary = settings.get_binary("Z88")
self._process = subprocess.Popen(
[binary, "-c", "-choly"],
[binary, "-c", "-" + solver],
cwd=self.directory,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)