FEM: fluid section and elment fluid 1D object, make name fit in FEM name system
This commit is contained in:
parent
34ad6af337
commit
092a5dae48
|
@ -91,7 +91,7 @@ SET(FemObjectsScripts_SRCS
|
|||
PyObjects/__init__.py
|
||||
PyObjects/_FemElementGeometry1D.py
|
||||
PyObjects/_FemConstraintSelfWeight.py
|
||||
PyObjects/_FemFluidSection.py
|
||||
PyObjects/_FemElementFluid1D.py
|
||||
PyObjects/_FemMaterialMechanicalNonlinear.py
|
||||
PyObjects/_FemMeshGmsh.py
|
||||
PyObjects/_FemMeshGroup.py
|
||||
|
@ -109,7 +109,7 @@ SET(FemGuiScripts_SRCS
|
|||
PyGui/_CommandFemAnalysis.py
|
||||
PyGui/_CommandFemElementGeometry1D.py
|
||||
PyGui/_CommandFemConstraintSelfWeight.py
|
||||
PyGui/_CommandFemFluidSection.py
|
||||
PyGui/_CommandFemElementFluid1D.py
|
||||
PyGui/_CommandFemMaterialMechanicalNonlinear.py
|
||||
PyGui/_CommandFemMaterialSolid.py
|
||||
PyGui/_CommandFemMaterialFluid.py
|
||||
|
@ -128,7 +128,7 @@ SET(FemGuiScripts_SRCS
|
|||
PyGui/_CommandFemSolverRun.py
|
||||
PyGui/_CommandFemSolverZ88.py
|
||||
PyGui/_TaskPanelFemElementGeometry1D.py
|
||||
PyGui/_TaskPanelFemFluidSection.py
|
||||
PyGui/_TaskPanelFemElementFluid1D.py
|
||||
PyGui/_TaskPanelFemMaterial.py
|
||||
PyGui/_TaskPanelFemMeshGmsh.py
|
||||
PyGui/_TaskPanelFemMeshGroup.py
|
||||
|
@ -138,7 +138,7 @@ SET(FemGuiScripts_SRCS
|
|||
PyGui/_TaskPanelFemSolverCalculix.py
|
||||
PyGui/_ViewProviderFemElementGeometry1D.py
|
||||
PyGui/_ViewProviderFemConstraintSelfWeight.py
|
||||
PyGui/_ViewProviderFemFluidSection.py
|
||||
PyGui/_ViewProviderFemElementFluid1D.py
|
||||
PyGui/_ViewProviderFemMaterial.py
|
||||
PyGui/_ViewProviderFemMaterialMechanicalNonlinear.py
|
||||
PyGui/_ViewProviderFemMeshGmsh.py
|
||||
|
@ -149,7 +149,7 @@ SET(FemGuiScripts_SRCS
|
|||
PyGui/_ViewProviderFemSolverCalculix.py
|
||||
PyGui/_ViewProviderFemSolverZ88.py
|
||||
PyGui/TaskPanelFemElementGeometry1D.ui
|
||||
PyGui/TaskPanelFemFluidSection.ui
|
||||
PyGui/TaskPanelFemElementFluid1D.ui
|
||||
PyGui/TaskPanelFemMaterial.ui
|
||||
PyGui/TaskPanelFemMeshGmsh.ui
|
||||
PyGui/TaskPanelFemMeshGroup.ui
|
||||
|
|
|
@ -49,7 +49,7 @@ INSTALL(
|
|||
PyObjects/__init__.py
|
||||
PyObjects/_FemElementGeometry1D.py
|
||||
PyObjects/_FemConstraintSelfWeight.py
|
||||
PyObjects/_FemFluidSection.py
|
||||
PyObjects/_FemElementFluid1D.py
|
||||
PyObjects/_FemMaterialMechanicalNonlinear.py
|
||||
PyObjects/_FemMeshGmsh.py
|
||||
PyObjects/_FemMeshGroup.py
|
||||
|
@ -70,7 +70,7 @@ INSTALL(
|
|||
PyGui/_CommandFemAnalysis.py
|
||||
PyGui/_CommandFemElementGeometry1D.py
|
||||
PyGui/_CommandFemConstraintSelfWeight.py
|
||||
PyGui/_CommandFemFluidSection.py
|
||||
PyGui/_CommandFemElementFluid1D.py
|
||||
PyGui/_CommandFemMaterialMechanicalNonlinear.py
|
||||
PyGui/_CommandFemMaterialSolid.py
|
||||
PyGui/_CommandFemMaterialFluid.py
|
||||
|
@ -89,7 +89,7 @@ INSTALL(
|
|||
PyGui/_CommandFemSolverRun.py
|
||||
PyGui/_CommandFemSolverZ88.py
|
||||
PyGui/_TaskPanelFemElementGeometry1D.py
|
||||
PyGui/_TaskPanelFemFluidSection.py
|
||||
PyGui/_TaskPanelFemElementFluid1D.py
|
||||
PyGui/_TaskPanelFemMaterial.py
|
||||
PyGui/_TaskPanelFemMeshGmsh.py
|
||||
PyGui/_TaskPanelFemMeshGroup.py
|
||||
|
@ -99,7 +99,7 @@ INSTALL(
|
|||
PyGui/_TaskPanelFemSolverCalculix.py
|
||||
PyGui/_ViewProviderFemElementGeometry1D.py
|
||||
PyGui/_ViewProviderFemConstraintSelfWeight.py
|
||||
PyGui/_ViewProviderFemFluidSection.py
|
||||
PyGui/_ViewProviderFemElementFluid1D.py
|
||||
PyGui/_ViewProviderFemMaterial.py
|
||||
PyGui/_ViewProviderFemMaterialMechanicalNonlinear.py
|
||||
PyGui/_ViewProviderFemMeshGmsh.py
|
||||
|
@ -110,7 +110,7 @@ INSTALL(
|
|||
PyGui/_ViewProviderFemSolverCalculix.py
|
||||
PyGui/_ViewProviderFemSolverZ88.py
|
||||
PyGui/TaskPanelFemElementGeometry1D.ui
|
||||
PyGui/TaskPanelFemFluidSection.ui
|
||||
PyGui/TaskPanelFemElementFluid1D.ui
|
||||
PyGui/TaskPanelFemMaterial.ui
|
||||
PyGui/TaskPanelFemMeshGmsh.ui
|
||||
PyGui/TaskPanelFemMeshGroup.ui
|
||||
|
|
|
@ -406,7 +406,7 @@ def get_elset_short_name(obj, i):
|
|||
return 'Mat' + str(i)
|
||||
elif hasattr(obj, "Proxy") and obj.Proxy.Type == 'FemElementGeometry1D':
|
||||
return 'Beam' + str(i)
|
||||
elif hasattr(obj, "Proxy") and obj.Proxy.Type == 'FemFluidSection':
|
||||
elif hasattr(obj, "Proxy") and obj.Proxy.Type == 'FemElementFluid1D':
|
||||
return 'Fluid' + str(i)
|
||||
elif hasattr(obj, "Proxy") and obj.Proxy.Type == 'FemElementGeometry2D':
|
||||
return 'Shell' + 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')
|
||||
# FemElementGeometry2D, ElementGeometry1D and FluidSection could have empty references, but on solid meshes only materials should have empty references
|
||||
# FemElementGeometry2D, ElementGeometry1D and FemElementFluid1D 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)
|
||||
|
|
|
@ -194,7 +194,7 @@ class FemTools(QtCore.QRunnable, QtCore.QObject):
|
|||
self.beam_sections = []
|
||||
## @var fluid_sections
|
||||
# set of fluid sections from the analysis. Updated with update_objects
|
||||
# Individual fluid sections are Proxy.Type "FemFluidSection"
|
||||
# Individual fluid sections are Proxy.Type "FemElementFluid1D"
|
||||
self.fluid_sections = []
|
||||
## @var shell_thicknesses
|
||||
# set of shell thicknesses from the analysis. Updated with update_objects
|
||||
|
@ -306,7 +306,7 @@ class FemTools(QtCore.QRunnable, QtCore.QObject):
|
|||
beam_section_dict = {}
|
||||
beam_section_dict['Object'] = m
|
||||
self.beam_sections.append(beam_section_dict)
|
||||
elif hasattr(m, "Proxy") and m.Proxy.Type == "FemFluidSection":
|
||||
elif hasattr(m, "Proxy") and m.Proxy.Type == "FemElementFluid1D":
|
||||
fluid_section_dict = {}
|
||||
fluid_section_dict['Object'] = m
|
||||
self.fluid_sections.append(fluid_section_dict)
|
||||
|
|
|
@ -79,7 +79,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
|||
<< "FEM_MaterialMechanicalNonlinear"
|
||||
<< "FEM_ElementGeometry1D"
|
||||
<< "FEM_ElementGeometry2D"
|
||||
<< "FEM_FluidSection"
|
||||
<< "FEM_ElementFluid1D"
|
||||
<< "Separator"
|
||||
<< "FEM_ConstraintFixed"
|
||||
<< "FEM_ConstraintDisplacement"
|
||||
|
@ -154,7 +154,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
|
|||
<< "FEM_MaterialMechanicalNonlinear"
|
||||
<< "FEM_ElementGeometry1D"
|
||||
<< "FEM_ElementGeometry2D"
|
||||
<< "FEM_FluidSection"
|
||||
<< "FEM_ElementFluid1D"
|
||||
<< "Separator"
|
||||
<< "FEM_ConstraintFixed"
|
||||
<< "FEM_ConstraintDisplacement"
|
||||
|
|
|
@ -66,7 +66,7 @@ class FemWorkbench (Workbench):
|
|||
|
||||
import PyGui._CommandFemElementGeometry2D
|
||||
import PyGui._CommandFemElementGeometry1D
|
||||
import PyGui._CommandFemFluidSection
|
||||
import PyGui._CommandFemElementFluid1D
|
||||
|
||||
def GetClassName(self):
|
||||
return "FemGui::Workbench"
|
||||
|
|
|
@ -283,14 +283,14 @@ def makeElementGeometry1D(sectiontype='Rectangular', width=10.0, height=25.0, na
|
|||
return obj
|
||||
|
||||
|
||||
def makeFemFluidSection(name="FluidSection"):
|
||||
'''makeFemFluidSection([name]): creates an Fluid section object to define 1D flow'''
|
||||
def makeElementFluid1D(name="ElementFluid1D"):
|
||||
'''makeElementFluid1D([name]): creates an 1D fluid element object to define 1D flow'''
|
||||
obj = FreeCAD.ActiveDocument.addObject("Fem::FeaturePython", name)
|
||||
import PyObjects._FemFluidSection
|
||||
PyObjects._FemFluidSection._FemFluidSection(obj)
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(obj)
|
||||
if FreeCAD.GuiUp:
|
||||
import PyGui._ViewProviderFemFluidSection
|
||||
PyGui._ViewProviderFemFluidSection._ViewProviderFemFluidSection(obj.ViewObject)
|
||||
import PyGui._ViewProviderFemElementFluid1D
|
||||
PyGui._ViewProviderFemElementFluid1D._ViewProviderFemElementFluid1D(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_CommandFluidSection"
|
||||
__title__ = "_CommandElementFluid1D"
|
||||
__author__ = "Ofentse Kgoa"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package CommandFemFluidSection
|
||||
## @package CommandFemElementFluid1D
|
||||
# \ingroup FEM
|
||||
|
||||
import FreeCAD
|
||||
|
@ -34,20 +34,20 @@ import FreeCADGui
|
|||
from PySide import QtCore
|
||||
|
||||
|
||||
class _CommandFemFluidSection(FemCommands):
|
||||
"The FEM_FluidSection command definition"
|
||||
class _CommandFemElementFluid1D(FemCommands):
|
||||
"The FEM_ElementFluid1D command definition"
|
||||
def __init__(self):
|
||||
super(_CommandFemFluidSection, self).__init__()
|
||||
super(_CommandFemElementFluid1D, self).__init__()
|
||||
self.resources = {'Pixmap': 'fem-fluid-section',
|
||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("FEM_FluidSection", "Fluid section for 1D flow"),
|
||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("FEM_ElementFluid1D", "Fluid section for 1D flow"),
|
||||
'Accel': "C, B",
|
||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("FEM_FluidSection", "Creates a FEM Fluid section for 1D flow")}
|
||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("FEM_ElementFluid1D", "Creates a FEM Fluid section for 1D flow")}
|
||||
self.is_active = 'with_analysis'
|
||||
|
||||
def Activated(self):
|
||||
FreeCAD.ActiveDocument.openTransaction("Create FemFluidSection")
|
||||
FreeCAD.ActiveDocument.openTransaction("Create FemElementFluid1D")
|
||||
FreeCADGui.addModule("ObjectsFem")
|
||||
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [ObjectsFem.makeFemFluidSection()]")
|
||||
FreeCADGui.doCommand("FemGui.getActiveAnalysis().Member = FemGui.getActiveAnalysis().Member + [ObjectsFem.makeElementFluid1D()]")
|
||||
|
||||
|
||||
FreeCADGui.addCommand('FEM_FluidSection', _CommandFemFluidSection())
|
||||
FreeCADGui.addCommand('FEM_ElementFluid1D', _CommandFemElementFluid1D())
|
|
@ -21,28 +21,28 @@
|
|||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_TaskPanelFemFluidSection"
|
||||
__title__ = "_TaskPanelFemElementFluid1D"
|
||||
__author__ = "Ofentse Kgoa"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package TaskPanelFemFluidSection
|
||||
## @package TaskPanelFemElementFluid1D
|
||||
# \ingroup FEM
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
from PySide import QtGui
|
||||
from PySide import QtCore
|
||||
import PyObjects._FemFluidSection
|
||||
import PyObjects._FemElementFluid1D
|
||||
|
||||
|
||||
class _TaskPanelFemFluidSection:
|
||||
'''The TaskPanel for editing References property of FemFluidSection objects'''
|
||||
class _TaskPanelFemElementFluid1D:
|
||||
'''The TaskPanel for editing References property of FemElementFluid1D 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/TaskPanelFemFluidSection.ui")
|
||||
self.form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Fem/PyGui/TaskPanelFemElementFluid1D.ui")
|
||||
QtCore.QObject.connect(self.form.btn_add, QtCore.SIGNAL("clicked()"), self.add_references)
|
||||
QtCore.QObject.connect(self.form.btn_remove, QtCore.SIGNAL("clicked()"), self.remove_reference)
|
||||
QtCore.QObject.connect(self.form.cb_section_type, QtCore.SIGNAL("activated(int)"), self.sectiontype_changed)
|
||||
|
@ -79,10 +79,10 @@ class _TaskPanelFemFluidSection:
|
|||
QtCore.QObject.connect(self.form.tw_pump_characteristics, QtCore.SIGNAL("cellChanged(int, int)"), self.pump_characteristics_changed)
|
||||
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_section_type.addItems(PyObjects._FemFluidSection._FemFluidSection.known_fluid_types)
|
||||
self.form.cb_liquid_section_type.addItems(PyObjects._FemFluidSection._FemFluidSection.known_liquid_types)
|
||||
self.form.cb_gas_section_type.addItems(PyObjects._FemFluidSection._FemFluidSection.known_gas_types)
|
||||
self.form.cb_channel_section_type.addItems(PyObjects._FemFluidSection._FemFluidSection.known_channel_types)
|
||||
self.form.cb_section_type.addItems(PyObjects._FemElementFluid1D._FemElementFluid1D.known_fluid_types)
|
||||
self.form.cb_liquid_section_type.addItems(PyObjects._FemElementFluid1D._FemElementFluid1D.known_liquid_types)
|
||||
self.form.cb_gas_section_type.addItems(PyObjects._FemElementFluid1D._FemElementFluid1D.known_gas_types)
|
||||
self.form.cb_channel_section_type.addItems(PyObjects._FemElementFluid1D._FemElementFluid1D.known_channel_types)
|
||||
|
||||
self.get_fluidsection_props()
|
||||
self.update()
|
|
@ -21,11 +21,11 @@
|
|||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_ViewProviderFemFluidSection"
|
||||
__title__ = "_ViewProviderFemElementFluid1D"
|
||||
__author__ = "Ofentse Kgoa"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package ViewProviderFemFluidSection
|
||||
## @package ViewProviderFemElementFluid1D
|
||||
# \ingroup FEM
|
||||
|
||||
import FreeCAD
|
||||
|
@ -33,8 +33,8 @@ import FreeCADGui
|
|||
from pivy import coin
|
||||
|
||||
|
||||
class _ViewProviderFemFluidSection:
|
||||
"A View Provider for the FemFluidSection object"
|
||||
class _ViewProviderFemElementFluid1D:
|
||||
"A View Provider for the FemElementFluid1D object"
|
||||
def __init__(self, vobj):
|
||||
vobj.Proxy = self
|
||||
|
||||
|
@ -60,8 +60,8 @@ class _ViewProviderFemFluidSection:
|
|||
return
|
||||
|
||||
def setEdit(self, vobj, mode=0):
|
||||
import PyGui._TaskPanelFemFluidSection
|
||||
taskd = PyGui._TaskPanelFemFluidSection._TaskPanelFemFluidSection(self.Object)
|
||||
import PyGui._TaskPanelFemElementFluid1D
|
||||
taskd = PyGui._TaskPanelFemElementFluid1D._TaskPanelFemElementFluid1D(self.Object)
|
||||
taskd.obj = vobj.Object
|
||||
FreeCADGui.Control.showDialog(taskd)
|
||||
return True
|
|
@ -21,16 +21,16 @@
|
|||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
__title__ = "_FemFluidSection"
|
||||
__title__ = "_FemElementFluid1D"
|
||||
__author__ = "Ofentse Kgoa"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
## @package FemFluidSection
|
||||
## @package FemElementFluid1D
|
||||
# \ingroup FEM
|
||||
|
||||
|
||||
class _FemFluidSection:
|
||||
"The FemFluidSection object"
|
||||
class _FemElementFluid1D:
|
||||
"The FemElementFluid1D object"
|
||||
|
||||
known_fluid_types = ['Liquid', 'Gas', 'Open Channel']
|
||||
known_liquid_types = ['PIPE MANNING', 'PIPE ENLARGEMENT', 'PIPE CONTRACTION', 'PIPE INLET', 'PIPE OUTLET', 'PIPE ENTRANCE', 'PIPE DIAPHRAGM', 'PIPE BEND', 'PIPE GATE VALVE', 'LIQUID PUMP', 'PIPE WHITE-COLEBROOK']
|
||||
|
@ -76,13 +76,13 @@ class _FemFluidSection:
|
|||
obj.addProperty("App::PropertyEnumeration", "ChannelSectionType", "ChannelSection", "select channel section type")
|
||||
|
||||
# set property default values
|
||||
obj.SectionType = _FemFluidSection.known_fluid_types
|
||||
obj.SectionType = _FemElementFluid1D.known_fluid_types
|
||||
obj.SectionType = 'Liquid'
|
||||
obj.LiquidSectionType = _FemFluidSection.known_liquid_types
|
||||
obj.LiquidSectionType = _FemElementFluid1D.known_liquid_types
|
||||
obj.LiquidSectionType = 'PIPE INLET'
|
||||
obj.GasSectionType = _FemFluidSection.known_gas_types
|
||||
obj.GasSectionType = _FemElementFluid1D.known_gas_types
|
||||
obj.GasSectionType = 'NONE'
|
||||
obj.ChannelSectionType = _FemFluidSection.known_channel_types
|
||||
obj.ChannelSectionType = _FemElementFluid1D.known_channel_types
|
||||
obj.ChannelSectionType = 'NONE'
|
||||
obj.ManningArea = 10.0
|
||||
obj.ManningRadius = 1.0
|
||||
|
@ -116,7 +116,7 @@ class _FemFluidSection:
|
|||
obj.InletFlowRateActive = False
|
||||
obj.OutletFlowRateActive = False
|
||||
obj.Proxy = self
|
||||
self.Type = "FemFluidSection"
|
||||
self.Type = "FemElementFluid1D"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
Loading…
Reference in New Issue
Block a user