[FEM] don't add CCX solver by default for new analyses

- if there are other solvers found, we should handle all solvers equally
- also reduce amount of console output on every analysis run
This commit is contained in:
Uwe
2023-03-24 02:40:49 +01:00
parent 474eddf4b6
commit e69ddeb036
2 changed files with 11 additions and 8 deletions

View File

@@ -34,6 +34,7 @@ import FreeCADGui
from FreeCAD import Qt
from .manager import CommandManager
from femsolver import settings
from femtools.femutils import is_of_type
@@ -67,12 +68,16 @@ class _Analysis(CommandManager):
FreeCADGui.addModule("ObjectsFem")
FreeCADGui.doCommand("ObjectsFem.makeAnalysis(FreeCAD.ActiveDocument, 'Analysis')")
FreeCADGui.doCommand("FemGui.setActiveAnalysis(FreeCAD.ActiveDocument.ActiveObject)")
# create a CalculiX ccx tools solver for any new analysis
# to be on the safe side for new users
FreeCADGui.doCommand("ObjectsFem.makeSolverCalculixCcxTools(FreeCAD.ActiveDocument)")
FreeCADGui.doCommand(
"FemGui.getActiveAnalysis().addObject(FreeCAD.ActiveDocument.ActiveObject)"
)
# if there is no Elmer or Z88 binary create a CalculiX ccx tools solver for
# new analysis to be on the safe side for new users
binary = settings.get_binary("ElmerSolver")
if binary is None:
binary = settings.get_binary("Z88")
if binary is None:
FreeCADGui.doCommand("ObjectsFem.makeSolverCalculixCcxTools(FreeCAD.ActiveDocument)")
FreeCADGui.doCommand(
"FemGui.getActiveAnalysis().addObject(FreeCAD.ActiveDocument.ActiveObject)"
)
FreeCAD.ActiveDocument.recompute()

View File

@@ -95,8 +95,6 @@ def get_binary(name):
"""
if name in _SOLVER_PARAM:
binary = _SOLVER_PARAM[name].get_binary()
if binary is not None:
FreeCAD.Console.PrintMessage('Solver binary path: {} \n'.format(binary))
return binary
else:
FreeCAD.Console.PrintError(