Skip to content

Commit

Permalink
FEM: fluid section and elment fluid 1D object, make name fit in FEM n…
Browse files Browse the repository at this point in the history
…ame system
  • Loading branch information
berndhahnebach authored and yorikvanhavre committed Mar 7, 2017
1 parent 34ad6af commit 092a5da
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 58 deletions.
10 changes: 5 additions & 5 deletions src/Mod/Fem/App/CMakeLists.txt
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Mod/Fem/CMakeLists.txt
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/FemMeshTools.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/FemTools.py
Expand Up @@ -194,7 +194,7 @@ def update_objects(self):
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
Expand Down Expand Up @@ -306,7 +306,7 @@ def update_objects(self):
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)
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Fem/Gui/Workbench.cpp
Expand Up @@ -79,7 +79,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
<< "FEM_MaterialMechanicalNonlinear"
<< "FEM_ElementGeometry1D"
<< "FEM_ElementGeometry2D"
<< "FEM_FluidSection"
<< "FEM_ElementFluid1D"
<< "Separator"
<< "FEM_ConstraintFixed"
<< "FEM_ConstraintDisplacement"
Expand Down Expand Up @@ -154,7 +154,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
<< "FEM_MaterialMechanicalNonlinear"
<< "FEM_ElementGeometry1D"
<< "FEM_ElementGeometry2D"
<< "FEM_FluidSection"
<< "FEM_ElementFluid1D"
<< "Separator"
<< "FEM_ConstraintFixed"
<< "FEM_ConstraintDisplacement"
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Fem/InitGui.py
Expand Up @@ -66,7 +66,7 @@ def Initialize(self):

import PyGui._CommandFemElementGeometry2D
import PyGui._CommandFemElementGeometry1D
import PyGui._CommandFemFluidSection
import PyGui._CommandFemElementFluid1D

def GetClassName(self):
return "FemGui::Workbench"
Expand Down
12 changes: 6 additions & 6 deletions src/Mod/Fem/ObjectsFem.py
Expand Up @@ -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


Expand Down
Expand Up @@ -21,11 +21,11 @@
# * *
# ***************************************************************************

__title__ = "_CommandFluidSection"
__title__ = "_CommandElementFluid1D"
__author__ = "Ofentse Kgoa"
__url__ = "http://www.freecadweb.org"

## @package CommandFemFluidSection
## @package CommandFemElementFluid1D
# \ingroup FEM

import FreeCAD
Expand All @@ -34,20 +34,20 @@
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())
Expand Up @@ -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)
Expand Down Expand Up @@ -79,10 +79,10 @@ def __init__(self, obj):
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()
Expand Down
Expand Up @@ -21,20 +21,20 @@
# * *
# ***************************************************************************

__title__ = "_ViewProviderFemFluidSection"
__title__ = "_ViewProviderFemElementFluid1D"
__author__ = "Ofentse Kgoa"
__url__ = "http://www.freecadweb.org"

## @package ViewProviderFemFluidSection
## @package ViewProviderFemElementFluid1D
# \ingroup FEM

import FreeCAD
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

Expand All @@ -60,8 +60,8 @@ def onChanged(self, vobj, prop):
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
Expand Down
Expand Up @@ -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']
Expand Down Expand Up @@ -76,13 +76,13 @@ def __init__(self, obj):
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
Expand Down Expand Up @@ -116,7 +116,7 @@ def __init__(self, obj):
obj.InletFlowRateActive = False
obj.OutletFlowRateActive = False
obj.Proxy = self
self.Type = "FemFluidSection"
self.Type = "FemElementFluid1D"

def execute(self, obj):
return

0 comments on commit 092a5da

Please sign in to comment.