FEM: solver calculix object, move make def into make objects FEM module
This commit is contained in:
parent
6ffbac3e6b
commit
4f0f3aa4fa
|
@ -133,7 +133,6 @@ SET(FemScripts_SRCS
|
|||
FemMeshGroup.py
|
||||
FemMeshRegion.py
|
||||
FemMeshTools.py
|
||||
FemSolverCalculix.py
|
||||
FemSolverZ88.py
|
||||
FemTools.py
|
||||
FemToolsCcx.py
|
||||
|
|
|
@ -108,7 +108,6 @@ INSTALL(
|
|||
importCcxFrdResults.py
|
||||
FemInputWriterCcx.py
|
||||
FemToolsCcx.py
|
||||
FemSolverCalculix.py
|
||||
_FemSolverCalculix.py
|
||||
_ViewProviderFemSolverCalculix.py
|
||||
_CommandSolverCalculix.py
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2015 - Bernd Hahnebach <bernd@bimstatik.org> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "FemSolverCalculix"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## \addtogroup FEM
|
||||
# @{
|
||||
|
||||
import FreeCAD
|
||||
import _FemSolverCalculix
|
||||
|
||||
|
||||
def makeFemSolverCalculix(name="CalculiX"):
|
||||
'''makeSolverCalculix(name): makes a Calculix solver object'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Fem::FemSolverObjectPython", name)
|
||||
_FemSolverCalculix._FemSolverCalculix(obj)
|
||||
if FreeCAD.GuiUp:
|
||||
import _ViewProviderFemSolverCalculix
|
||||
_ViewProviderFemSolverCalculix._ViewProviderFemSolverCalculix(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
# @}
|
|
@ -37,6 +37,18 @@ def makeAnalysis(name):
|
|||
return obj
|
||||
|
||||
|
||||
########## solvers ##########
|
||||
def makeSolverCalculix(name="CalculiX"):
|
||||
'''makeSolverCalculix(name): makes a Calculix solver object'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Fem::FemSolverObjectPython", name)
|
||||
import _FemSolverCalculix
|
||||
_FemSolverCalculix._FemSolverCalculix(obj)
|
||||
if FreeCAD.GuiUp:
|
||||
import _ViewProviderFemSolverCalculix
|
||||
_ViewProviderFemSolverCalculix._ViewProviderFemSolverCalculix(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
|
||||
########## element geometry definitions ##########
|
||||
def makeBeamSection(sectiontype='Rectangular', width=10.0, height=25.0, name="BeamSection"):
|
||||
'''makeBeamSection([width], [height], [name]): creates an beamsection object to define a cross section'''
|
||||
|
|
|
@ -28,7 +28,6 @@ import Fem
|
|||
import FemToolsCcx
|
||||
import FreeCAD
|
||||
import ObjectsFem
|
||||
import FemSolverCalculix
|
||||
import FemMaterial
|
||||
import csv
|
||||
import tempfile
|
||||
|
@ -86,7 +85,7 @@ class FemTest(unittest.TestCase):
|
|||
self.active_doc.recompute()
|
||||
|
||||
def create_new_solver(self):
|
||||
self.solver_object = FemSolverCalculix.makeFemSolverCalculix('CalculiX')
|
||||
self.solver_object = ObjectsFem.makeSolverCalculix('CalculiX')
|
||||
self.solver_object.GeometricalNonlinearity = 'linear'
|
||||
self.solver_object.ThermoMechSteadyState = False
|
||||
self.solver_object.MatrixSolverType = 'default'
|
||||
|
@ -308,7 +307,7 @@ class TherMechFemTest(unittest.TestCase):
|
|||
self.active_doc.recompute()
|
||||
|
||||
def create_new_solver(self):
|
||||
self.solver_object = FemSolverCalculix.makeFemSolverCalculix('CalculiX')
|
||||
self.solver_object = ObjectsFem.makeSolverCalculix('CalculiX')
|
||||
self.solver_object.AnalysisType = 'thermomech'
|
||||
self.solver_object.GeometricalNonlinearity = 'linear'
|
||||
self.solver_object.ThermoMechSteadyState = True
|
||||
|
|
|
@ -47,10 +47,9 @@ class _CommandAnalysis(FemCommands):
|
|||
FreeCAD.ActiveDocument.openTransaction("Create Analysis")
|
||||
FreeCADGui.addModule("FemGui")
|
||||
FreeCADGui.addModule("ObjectsFem")
|
||||
FreeCADGui.addModule("FemSolverCalculix")
|
||||
FreeCADGui.doCommand("ObjectsFem.makeAnalysis('Analysis')")
|
||||
FreeCADGui.doCommand("FemGui.setActiveAnalysis(App.activeDocument().ActiveObject)")
|
||||
FreeCADGui.doCommand("FemSolverCalculix.makeFemSolverCalculix('CalculiX')")
|
||||
FreeCADGui.doCommand("ObjectsFem.makeSolverCalculix('CalculiX')")
|
||||
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [App.activeDocument().ActiveObject]")
|
||||
sel = FreeCADGui.Selection.getSelection()
|
||||
if (len(sel) == 1):
|
||||
|
|
|
@ -50,13 +50,13 @@ class _CommandSolverCalculix(FemCommands):
|
|||
if hasattr(m, "Proxy") and m.Proxy.Type == "FemMaterialMechanicalNonlinear":
|
||||
has_nonlinear_material_obj = True
|
||||
FreeCAD.ActiveDocument.openTransaction("Create SolverCalculix")
|
||||
FreeCADGui.addModule("FemSolverCalculix")
|
||||
FreeCADGui.addModule("ObjectsFem")
|
||||
if has_nonlinear_material_obj:
|
||||
FreeCADGui.doCommand("solver = FemSolverCalculix.makeFemSolverCalculix()")
|
||||
FreeCADGui.doCommand("solver = ObjectsFem.makeSolverCalculix()")
|
||||
FreeCADGui.doCommand("solver.MaterialNonlinearity = 'nonlinear'")
|
||||
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [solver]")
|
||||
else:
|
||||
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [FemSolverCalculix.makeFemSolverCalculix()]")
|
||||
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [ObjectsFem.makeSolverCalculix()]")
|
||||
|
||||
|
||||
FreeCADGui.addCommand('Fem_SolverCalculix', _CommandSolverCalculix())
|
||||
|
|
Loading…
Reference in New Issue
Block a user