FEM: beam sectiong and element geometry 1D object, make name fit in FEM name system

This commit is contained in:
Bernd Hahnebach 2017-03-06 09:18:47 +01:00 committed by Yorik van Havre
parent 77e4a6d20d
commit 977fd8995e
16 changed files with 57 additions and 57 deletions

View File

@ -89,7 +89,7 @@ SET(FemScripts_SRCS
SET(FemObjectsScripts_SRCS
PyObjects/__init__.py
PyObjects/_FemBeamSection.py
PyObjects/_FemElementGeometry1D.py
PyObjects/_FemConstraintSelfWeight.py
PyObjects/_FemFluidSection.py
PyObjects/_FemMaterialMechanicalNonlinear.py
@ -107,7 +107,7 @@ SET(FemGuiScripts_SRCS
PyGui/FemCommands.py
PyGui/__init__.py
PyGui/_CommandFemAnalysis.py
PyGui/_CommandFemBeamSection.py
PyGui/_CommandFemElementGeometry1D.py
PyGui/_CommandFemConstraintSelfWeight.py
PyGui/_CommandFemFluidSection.py
PyGui/_CommandFemMaterialMechanicalNonlinear.py
@ -127,7 +127,7 @@ SET(FemGuiScripts_SRCS
PyGui/_CommandFemSolverControl.py
PyGui/_CommandFemSolverRun.py
PyGui/_CommandFemSolverZ88.py
PyGui/_TaskPanelFemBeamSection.py
PyGui/_TaskPanelFemElementGeometry1D.py
PyGui/_TaskPanelFemFluidSection.py
PyGui/_TaskPanelFemMaterial.py
PyGui/_TaskPanelFemMeshGmsh.py
@ -136,7 +136,7 @@ SET(FemGuiScripts_SRCS
PyGui/_TaskPanelFemResultShow.py
PyGui/_TaskPanelFemShellThickness.py
PyGui/_TaskPanelFemSolverCalculix.py
PyGui/_ViewProviderFemBeamSection.py
PyGui/_ViewProviderFemElementGeometry1D.py
PyGui/_ViewProviderFemConstraintSelfWeight.py
PyGui/_ViewProviderFemFluidSection.py
PyGui/_ViewProviderFemMaterial.py
@ -148,7 +148,7 @@ SET(FemGuiScripts_SRCS
PyGui/_ViewProviderFemShellThickness.py
PyGui/_ViewProviderFemSolverCalculix.py
PyGui/_ViewProviderFemSolverZ88.py
PyGui/TaskPanelFemBeamSection.ui
PyGui/TaskPanelFemElementGeometry1D.ui
PyGui/TaskPanelFemFluidSection.ui
PyGui/TaskPanelFemMaterial.ui
PyGui/TaskPanelFemMeshGmsh.ui

View File

@ -47,7 +47,7 @@ INSTALL(
INSTALL(
FILES
PyObjects/__init__.py
PyObjects/_FemBeamSection.py
PyObjects/_FemElementGeometry1D.py
PyObjects/_FemConstraintSelfWeight.py
PyObjects/_FemFluidSection.py
PyObjects/_FemMaterialMechanicalNonlinear.py
@ -68,7 +68,7 @@ INSTALL(
PyGui/FemCommands.py
PyGui/__init__.py
PyGui/_CommandFemAnalysis.py
PyGui/_CommandFemBeamSection.py
PyGui/_CommandFemElementGeometry1D.py
PyGui/_CommandFemConstraintSelfWeight.py
PyGui/_CommandFemFluidSection.py
PyGui/_CommandFemMaterialMechanicalNonlinear.py
@ -88,7 +88,7 @@ INSTALL(
PyGui/_CommandFemSolverControl.py
PyGui/_CommandFemSolverRun.py
PyGui/_CommandFemSolverZ88.py
PyGui/_TaskPanelFemBeamSection.py
PyGui/_TaskPanelFemElementGeometry1D.py
PyGui/_TaskPanelFemFluidSection.py
PyGui/_TaskPanelFemMaterial.py
PyGui/_TaskPanelFemMeshGmsh.py
@ -97,7 +97,7 @@ INSTALL(
PyGui/_TaskPanelFemResultShow.py
PyGui/_TaskPanelFemShellThickness.py
PyGui/_TaskPanelFemSolverCalculix.py
PyGui/_ViewProviderFemBeamSection.py
PyGui/_ViewProviderFemElementGeometry1D.py
PyGui/_ViewProviderFemConstraintSelfWeight.py
PyGui/_ViewProviderFemFluidSection.py
PyGui/_ViewProviderFemMaterial.py
@ -109,7 +109,7 @@ INSTALL(
PyGui/_ViewProviderFemShellThickness.py
PyGui/_ViewProviderFemSolverCalculix.py
PyGui/_ViewProviderFemSolverZ88.py
PyGui/TaskPanelFemBeamSection.ui
PyGui/TaskPanelFemElementGeometry1D.ui
PyGui/TaskPanelFemFluidSection.ui
PyGui/TaskPanelFemMaterial.ui
PyGui/TaskPanelFemMeshGmsh.ui

View File

@ -404,7 +404,7 @@ def get_femelement_sets_from_group_data(femmesh, fem_objects):
def get_elset_short_name(obj, i):
if hasattr(obj, "Proxy") and obj.Proxy.Type == 'FemMaterial':
return 'Mat' + str(i)
elif hasattr(obj, "Proxy") and obj.Proxy.Type == 'FemBeamSection':
elif hasattr(obj, "Proxy") and obj.Proxy.Type == 'FemElementGeometry1D':
return 'Beam' + str(i)
elif hasattr(obj, "Proxy") and obj.Proxy.Type == 'FemFluidSection':
return 'Fluid' + str(i)
@ -1030,7 +1030,7 @@ def get_analysis_group_elements(aAnalysis, aPart):
else:
FreeCAD.Console.PrintError('Problem: more than one object with empty references.\n')
print('We gone try to get the empty material references anyway.\n')
# ShellThickness, BeamSection and FluidSection could have empty references, but on solid meshes only materials should have empty references
# ShellThickness, ElementGeometry1D and FluidSection could have empty references, but on solid meshes only materials should have empty references
for er in empty_references:
print(er.Name)
group_elements = get_anlysis_empty_references_group_elements(group_elements, aAnalysis, aPart.Shape)

View File

@ -190,7 +190,7 @@ class FemTools(QtCore.QRunnable, QtCore.QObject):
self.pressure_constraints = []
## @var beam_sections
# set of beam sections from the analysis. Updated with update_objects
# Individual beam sections are Proxy.Type "FemBeamSection"
# Individual beam sections are Proxy.Type "FemElementGeometry1D"
self.beam_sections = []
## @var fluid_sections
# set of fluid sections from the analysis. Updated with update_objects
@ -302,7 +302,7 @@ class FemTools(QtCore.QRunnable, QtCore.QObject):
transform_constraint_dict = {}
transform_constraint_dict['Object'] = m
self.transform_constraints.append(transform_constraint_dict)
elif hasattr(m, "Proxy") and m.Proxy.Type == "FemBeamSection":
elif hasattr(m, "Proxy") and m.Proxy.Type == "FemElementGeometry1D":
beam_section_dict = {}
beam_section_dict['Object'] = m
self.beam_sections.append(beam_section_dict)

View File

@ -77,7 +77,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
<< "FEM_MaterialSolid"
<< "FEM_MaterialFluid"
<< "FEM_MaterialMechanicalNonlinear"
<< "FEM_BeamSection"
<< "FEM_ElementGeometry1D"
<< "FEM_ShellThickness"
<< "FEM_FluidSection"
<< "Separator"
@ -152,7 +152,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
<< "FEM_MaterialSolid"
<< "FEM_MaterialFluid"
<< "FEM_MaterialMechanicalNonlinear"
<< "FEM_BeamSection"
<< "FEM_ElementGeometry1D"
<< "FEM_ShellThickness"
<< "FEM_FluidSection"
<< "Separator"

View File

@ -65,7 +65,7 @@ class FemWorkbench (Workbench):
import PyGui._CommandFemSolverZ88
import PyGui._CommandFemShellThickness
import PyGui._CommandFemBeamSection
import PyGui._CommandFemElementGeometry1D
import PyGui._CommandFemFluidSection
def GetClassName(self):

View File

@ -261,12 +261,12 @@ def makeSolverZ88(name="Z88"):
########## element geometry definition objects ##########
# TODO object type not yet in object name, see forum topic http://forum.freecadweb.org/viewtopic.php?f=18&t=21029
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'''
def makeElementGeometry1D(sectiontype='Rectangular', width=10.0, height=25.0, name="ElementGeometry1D"):
'''makeElementGeometry1D([width], [height], [name]): creates an 1D geometry element object to define a cross section'''
obj = FreeCAD.ActiveDocument.addObject("Fem::FeaturePython", name)
import PyObjects._FemBeamSection
PyObjects._FemBeamSection._FemBeamSection(obj)
sec_types = PyObjects._FemBeamSection._FemBeamSection.known_beam_types
import PyObjects._FemElementGeometry1D
PyObjects._FemElementGeometry1D._FemElementGeometry1D(obj)
sec_types = PyObjects._FemElementGeometry1D._FemElementGeometry1D.known_beam_types
if sectiontype not in sec_types:
FreeCAD.Console.PrintError("Section type is not known. Set to " + sec_types[0] + " \n")
obj.SectionType = sec_types[0]
@ -278,8 +278,8 @@ def makeBeamSection(sectiontype='Rectangular', width=10.0, height=25.0, name="Be
obj.PipeDiameter = height
obj.PipeThickness = width
if FreeCAD.GuiUp:
import PyGui._ViewProviderFemBeamSection
PyGui._ViewProviderFemBeamSection._ViewProviderFemBeamSection(obj.ViewObject)
import PyGui._ViewProviderFemElementGeometry1D
PyGui._ViewProviderFemElementGeometry1D._ViewProviderFemElementGeometry1D(obj.ViewObject)
return obj

View File

@ -20,11 +20,11 @@
# * *
# ***************************************************************************
__title__ = "_CommandBeamSection"
__title__ = "_CommandFemElementGeometry1D"
__author__ = "Bernd Hahnebach"
__url__ = "http://www.freecadweb.org"
## @package CommandFemBeamSection
## @package CommandFemElementGeometry1D
# \ingroup FEM
import FreeCAD
@ -33,20 +33,20 @@ import FreeCADGui
from PySide import QtCore
class _CommandFemBeamSection(FemCommands):
"The FEM_BeamSection command definition"
class _CommandFemElementGeometry1D(FemCommands):
"The Fem_ElementGeometry1D command definition"
def __init__(self):
super(_CommandFemBeamSection, self).__init__()
super(_CommandFemElementGeometry1D, self).__init__()
self.resources = {'Pixmap': 'fem-beam-section',
'MenuText': QtCore.QT_TRANSLATE_NOOP("FEM_BeamSection", "Beam cross section"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("FEM_ElementGeometry1D", "Beam cross section"),
'Accel': "C, B",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("FEM_BeamSection", "Creates a FEM beam cross section")}
'ToolTip': QtCore.QT_TRANSLATE_NOOP("FEM_ElementGeometry1D", "Creates a FEM beam cross section")}
self.is_active = 'with_analysis'
def Activated(self):
FreeCAD.ActiveDocument.openTransaction("Create FemBeamSection")
FreeCAD.ActiveDocument.openTransaction("Create FemElementGeometry1D")
FreeCADGui.addModule("ObjectsFem")
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [ObjectsFem.makeBeamSection()]")
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [ObjectsFem.makeElementGeometry1D()]")
FreeCADGui.addCommand('FEM_BeamSection', _CommandFemBeamSection())
FreeCADGui.addCommand('FEM_ElementGeometry1D', _CommandFemElementGeometry1D())

View File

@ -1,7 +1,7 @@
# ***************************************************************************
# * *
# * Copyright (c) 2016 - Ofentse Kgoa <kgoaot@eskom.co.za> *
# * Based on the FemBeamSection by Bernd Hahnebach *
# * Based on the FemElementGeometry1D by Bernd Hahnebach *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *

View File

@ -20,28 +20,28 @@
# * *
# ***************************************************************************
__title__ = "_TaskPanelFemBeamSection"
__title__ = "_TaskPanelFemElementGeometry1D"
__author__ = "Bernd Hahnebach"
__url__ = "http://www.freecadweb.org"
## @package TaskPanelFemBeamSection
## @package TaskPanelFemElementGeometry1D
# \ingroup FEM
import FreeCAD
import FreeCADGui
from PySide import QtGui
from PySide import QtCore
import PyObjects._FemBeamSection
import PyObjects._FemElementGeometry1D
class _TaskPanelFemBeamSection:
'''The TaskPanel for editing References property of FemBeamSection objects'''
class _TaskPanelFemElementGeometry1D:
'''The TaskPanel for editing References property of FemElementGeometry1D objects'''
def __init__(self, obj):
FreeCADGui.Selection.clearSelection()
self.sel_server = None
self.obj = obj
self.form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Fem/PyGui/TaskPanelFemBeamSection.ui")
self.form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Fem/PyGui/TaskPanelFemElementGeometry1D.ui")
QtCore.QObject.connect(self.form.cb_crosssectiontype, QtCore.SIGNAL("activated(int)"), self.sectiontype_changed)
QtCore.QObject.connect(self.form.if_rec_height, QtCore.SIGNAL("valueChanged(Base::Quantity)"), self.rec_height_changed)
QtCore.QObject.connect(self.form.if_rec_width, QtCore.SIGNAL("valueChanged(Base::Quantity)"), self.rec_width_changed)
@ -52,7 +52,7 @@ class _TaskPanelFemBeamSection:
self.form.list_References.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.form.list_References.connect(self.form.list_References, QtCore.SIGNAL("customContextMenuRequested(QPoint)"), self.references_list_right_clicked)
self.form.cb_crosssectiontype.addItems(PyObjects._FemBeamSection._FemBeamSection.known_beam_types) # it is inside the class thus double _FemBeamSection
self.form.cb_crosssectiontype.addItems(PyObjects._FemElementGeometry1D._FemElementGeometry1D.known_beam_types) # it is inside the class thus double _FemElementGeometry1D
self.get_beamsection_props()
self.update()

View File

@ -1,7 +1,7 @@
# ***************************************************************************
# * *
# * Copyright (c) 2016 - Ofentse Kgoa <kgoaot@eskom.co.za> *
# * Based on the FemBeamSection by Bernd Hahnebach *
# * Based on the FemElementGeometry1D by Bernd Hahnebach *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *

View File

@ -20,11 +20,11 @@
# * *
# ***************************************************************************
__title__ = "_ViewProviderFemBeamSection"
__title__ = "_ViewProviderFemElementGeometry1D"
__author__ = "Bernd Hahnebach"
__url__ = "http://www.freecadweb.org"
## @package ViewProviderFemBeamSection
## @package ViewProviderFemElementGeometry1D
# \ingroup FEM
import FreeCAD
@ -32,8 +32,8 @@ import FreeCADGui
from pivy import coin
class _ViewProviderFemBeamSection:
"A View Provider for the FemBeamSection object"
class _ViewProviderFemElementGeometry1D:
"A View Provider for the FemElementGeometry1D object"
def __init__(self, vobj):
vobj.Proxy = self
@ -59,8 +59,8 @@ class _ViewProviderFemBeamSection:
return
def setEdit(self, vobj, mode=0):
import PyGui._TaskPanelFemBeamSection
taskd = PyGui._TaskPanelFemBeamSection._TaskPanelFemBeamSection(self.Object)
import PyGui._TaskPanelFemElementGeometry1D
taskd = PyGui._TaskPanelFemElementGeometry1D._TaskPanelFemElementGeometry1D(self.Object)
taskd.obj = vobj.Object
FreeCADGui.Control.showDialog(taskd)
return True

View File

@ -1,7 +1,7 @@
# ***************************************************************************
# * *
# * Copyright (c) 2016 - Ofentse Kgoa <kgoaot@eskom.co.za> *
# * Based on the FemBeamSection by Bernd Hahnebach *
# * Based on the FemElementGeometry1D by Bernd Hahnebach *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *

View File

@ -20,16 +20,16 @@
# * *
# ***************************************************************************
__title__ = "_FemBeamSection"
__title__ = "FemElementGeometry1D"
__author__ = "Bernd Hahnebach"
__url__ = "http://www.freecadweb.org"
## @package FemBeamSection
## @package FemElementGeometry1D
# \ingroup FEM
class _FemBeamSection:
"The FemBeamSection object"
class _FemElementGeometry1D:
"The FemElementGeometry1D object"
known_beam_types = ['Rectangular', 'Circular', 'Pipe']
@ -41,10 +41,10 @@ class _FemBeamSection:
obj.addProperty("App::PropertyLength", "PipeThickness", "PipeBeamSection", "set thickness of the pipe beam elements")
obj.addProperty("App::PropertyEnumeration", "SectionType", "BeamSection", "select beam section type")
obj.addProperty("App::PropertyLinkSubList", "References", "BeamSection", "List of beam section shapes")
obj.SectionType = _FemBeamSection.known_beam_types
obj.SectionType = _FemElementGeometry1D.known_beam_types
obj.SectionType = 'Rectangular'
obj.Proxy = self
self.Type = "FemBeamSection"
self.Type = "FemElementGeometry1D"
def execute(self, obj):
return

View File

@ -1,7 +1,7 @@
# ***************************************************************************
# * *
# * Copyright (c) 2016 - Ofentse Kgoa <kgoaot@eskom.co.za> *
# * Based on the FemBeamSection by Bernd Hahnebach *
# * Based on the FemElementGeometry1D by Bernd Hahnebach *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *