FEM: nonlinear materials, core object implementation
This commit is contained in:
parent
8e11d7032c
commit
854002f08b
|
@ -78,6 +78,7 @@ SET(FemScripts_SRCS
|
|||
_CommandConstraintSelfWeight.py
|
||||
_CommandMechanicalMaterial.py
|
||||
_CommandShowResult.py
|
||||
_CommandMaterialMechanicalNonlinear.py
|
||||
_CommandMeshFromShape.py
|
||||
_CommandPurgeResults.py
|
||||
_CommandRunSolver.py
|
||||
|
@ -86,6 +87,7 @@ SET(FemScripts_SRCS
|
|||
_CommandSolverZ88.py
|
||||
_FemBeamSection.py
|
||||
_FemConstraintSelfWeight.py
|
||||
_FemMaterialMechanicalNonlinear.py
|
||||
_FemShellThickness.py
|
||||
_FemSolverCalculix.py
|
||||
_FemSolverZ88.py
|
||||
|
@ -97,6 +99,7 @@ SET(FemScripts_SRCS
|
|||
_TaskPanelShowResult.py
|
||||
_ViewProviderFemBeamSection.py
|
||||
_ViewProviderFemConstraintSelfWeight.py
|
||||
_ViewProviderFemMaterialMechanicalNonlinear.py
|
||||
_ViewProviderFemShellThickness.py
|
||||
_ViewProviderFemSolverCalculix.py
|
||||
_ViewProviderFemSolverZ88.py
|
||||
|
@ -115,6 +118,7 @@ SET(FemScripts_SRCS
|
|||
FemInputWriter.py
|
||||
FemInputWriterCcx.py
|
||||
FemInputWriterZ88.py
|
||||
FemMaterialMechanicalNonlinear.py
|
||||
FemMeshTools.py
|
||||
FemShellThickness.py
|
||||
FemSolverCalculix.py
|
||||
|
|
|
@ -59,6 +59,11 @@ INSTALL(
|
|||
_TaskPanelMechanicalMaterial.py
|
||||
TaskPanelMechanicalMaterial.ui
|
||||
|
||||
FemMaterialMechanicalNonlinear.py
|
||||
_FemMaterialMechanicalNonlinear.py
|
||||
_ViewProviderFemMaterialMechanicalNonlinear.py
|
||||
_CommandMaterialMechanicalNonlinear.py
|
||||
|
||||
# solver CalculiX ccx
|
||||
importInpMesh.py
|
||||
ccxDatReader.py
|
||||
|
|
40
src/Mod/Fem/FemMaterialMechanicalNonlinear.py
Normal file
40
src/Mod/Fem/FemMaterialMechanicalNonlinear.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2016 - 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__ = "FemMaterialMechanicalNonlinear"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
import FreeCAD
|
||||
import FemGui
|
||||
import _FemMaterialMechanicalNonlinear
|
||||
|
||||
|
||||
def makeFemMaterialMechanicalNonlinear(name="MechanicalMaterialNonlinear"):
|
||||
'''makeFemMaterialMechanicalNonlinear([name]): creates an nonlinear material object'''
|
||||
obj = FemGui.getActiveAnalysis().Document.addObject("Fem::FeaturePython", name)
|
||||
_FemMaterialMechanicalNonlinear._FemMaterialMechanicalNonlinear(obj)
|
||||
if FreeCAD.GuiUp:
|
||||
import _ViewProviderFemMaterialMechanicalNonlinear
|
||||
_ViewProviderFemMaterialMechanicalNonlinear._ViewProviderFemMaterialMechanicalNonlinear(obj.ViewObject)
|
||||
return obj
|
|
@ -60,6 +60,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
|||
// << "Fem_SolverZ88"
|
||||
<< "Fem_MeshFromShape"
|
||||
<< "Fem_MechanicalMaterial"
|
||||
<< "Fem_MaterialMechanicalNonlinear"
|
||||
<< "Fem_BeamSection"
|
||||
<< "Fem_ShellThickness"
|
||||
<< "Separator"
|
||||
|
@ -120,6 +121,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
|
|||
<< "Fem_SolverZ88"
|
||||
<< "Fem_MeshFromShape"
|
||||
<< "Fem_MechanicalMaterial"
|
||||
<< "Fem_MaterialMechanicalNonlinear"
|
||||
<< "Fem_BeamSection"
|
||||
<< "Fem_ShellThickness"
|
||||
<< "Separator"
|
||||
|
|
|
@ -56,6 +56,7 @@ class FemWorkbench (Workbench):
|
|||
import _CommandShellThickness
|
||||
import _CommandBeamSection
|
||||
import _CommandMechanicalMaterial
|
||||
import _CommandMaterialMechanicalNonlinear
|
||||
import _CommandSolverCalculix
|
||||
import _CommandSolverZ88
|
||||
import _CommandConstraintSelfWeight
|
||||
|
|
53
src/Mod/Fem/_CommandMaterialMechanicalNonlinear.py
Normal file
53
src/Mod/Fem/_CommandMaterialMechanicalNonlinear.py
Normal file
|
@ -0,0 +1,53 @@
|
|||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2016 - 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__ = "Command nonlinear mechanical material"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
import FreeCAD
|
||||
from FemCommands import FemCommands
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
import FreeCADGui
|
||||
from PySide import QtCore
|
||||
|
||||
|
||||
class _CommandMaterialMechanicalNonlinear(FemCommands):
|
||||
"The Fem_MaterialMechanicalNonlinear command definition"
|
||||
def __init__(self):
|
||||
super(_CommandMaterialMechanicalNonlinear, self).__init__()
|
||||
self.resources = {'Pixmap': 'fem-material',
|
||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_MaterialMechanicalNonlinear", "Nonlinear mechanical material"),
|
||||
'Accel': "C, W",
|
||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_MaterialMechanicalNonlinear", "Creates a nonlinear mechanical material")}
|
||||
self.is_active = 'with_analysis'
|
||||
|
||||
def Activated(self):
|
||||
FreeCAD.ActiveDocument.openTransaction("Create FemMaterialMechanicalNonlinear")
|
||||
FreeCADGui.addModule("FemMaterialMechanicalNonlinear")
|
||||
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [FemMaterialMechanicalNonlinear.makeFemMaterialMechanicalNonlinear()]")
|
||||
|
||||
|
||||
if FreeCAD.GuiUp:
|
||||
FreeCADGui.addCommand('Fem_MaterialMechanicalNonlinear', _CommandMaterialMechanicalNonlinear())
|
46
src/Mod/Fem/_FemMaterialMechanicalNonlinear.py
Normal file
46
src/Mod/Fem/_FemMaterialMechanicalNonlinear.py
Normal file
|
@ -0,0 +1,46 @@
|
|||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2016 - 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__ = "the fem nonlinear mechanical material object"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
class _FemMaterialMechanicalNonlinear:
|
||||
"The FemMaterialMechanicalNonlinear object"
|
||||
def __init__(self, obj):
|
||||
obj.Proxy = self
|
||||
self.Type = "FemMaterialMechanicalNonlinear"
|
||||
|
||||
choices_nonlinear_material_models = ["simple hardening"]
|
||||
obj.addProperty("App::PropertyEnumeration", "MaterialModelNonlinearity", "Fem", "Set the type on nonlinear material model")
|
||||
obj.MaterialModelNonlinearity = choices_nonlinear_material_models
|
||||
obj.MaterialModelNonlinearity = choices_nonlinear_material_models[0]
|
||||
|
||||
obj.addProperty("App::PropertyString", "YieldPoint1", "Fem", "Set stress and strain for yield point one, separated by a comma.")
|
||||
obj.YieldPoint1 = "235.0, 0.0"
|
||||
|
||||
obj.addProperty("App::PropertyString", "YieldPoint2", "Fem", "Set stress and strain for yield point one, separated by a comma.")
|
||||
obj.YieldPoint2 = "241.0, 0.025"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
61
src/Mod/Fem/_ViewProviderFemMaterialMechanicalNonlinear.py
Normal file
61
src/Mod/Fem/_ViewProviderFemMaterialMechanicalNonlinear.py
Normal file
|
@ -0,0 +1,61 @@
|
|||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2016 - 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__ = "_ViewProviderFemMaterialMechanicalNonlinear"
|
||||
__author__ = "Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
from pivy import coin
|
||||
|
||||
|
||||
class _ViewProviderFemMaterialMechanicalNonlinear:
|
||||
"A View Provider for the FemMaterialMechanicalNonlinear object"
|
||||
def __init__(self, vobj):
|
||||
vobj.Proxy = self
|
||||
|
||||
def getIcon(self):
|
||||
return ":/icons/fem-material.svg"
|
||||
|
||||
def attach(self, vobj):
|
||||
self.ViewObject = vobj
|
||||
self.Object = vobj.Object
|
||||
self.standard = coin.SoGroup()
|
||||
vobj.addDisplayMode(self.standard, "Standard")
|
||||
|
||||
def getDisplayModes(self, obj):
|
||||
return ["Standard"]
|
||||
|
||||
def getDefaultDisplayMode(self):
|
||||
return "Standard"
|
||||
|
||||
def updateData(self, obj, prop):
|
||||
return
|
||||
|
||||
def onChanged(self, vobj, prop):
|
||||
return
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
||||
def __setstate__(self, state):
|
||||
return None
|
Loading…
Reference in New Issue
Block a user