FEM: element fluid 1D, rename class and module

This commit is contained in:
Bernd Hahnebach
2020-05-22 01:07:41 +02:00
parent 8bfad3aec5
commit 43d3d6a3a7
6 changed files with 47 additions and 35 deletions

View File

@@ -244,7 +244,7 @@ SET(FemObjectsScripts_SRCS
femobjects/constraint_initialflowvelocity.py
femobjects/constraint_selfweight.py
femobjects/constraint_tie.py
femobjects/_FemElementFluid1D.py
femobjects/element_fluid1D.py
femobjects/_FemElementGeometry1D.py
femobjects/_FemElementGeometry2D.py
femobjects/_FemElementRotation1D.py
@@ -327,11 +327,11 @@ SET(FemGuiViewObjects_SRCS
femviewprovider/view_constraint_initialflowvelocity.py
femviewprovider/view_constraint_selfweight.py
femviewprovider/view_constraint_tie.py
femviewprovider/view_element_fluid1D.py
)
SET(FemGuiScripts_SRCS
femguiobjects/__init__.py
femguiobjects/_ViewProviderFemElementFluid1D.py
femguiobjects/_ViewProviderFemElementGeometry1D.py
femguiobjects/_ViewProviderFemElementGeometry2D.py
femguiobjects/_ViewProviderFemElementRotation1D.py

View File

@@ -291,11 +291,11 @@ def makeElementFluid1D(
"""makeElementFluid1D(document, [name]):
creates an 1D fluid element object to define 1D flow"""
obj = doc.addObject("Fem::FeaturePython", name)
from femobjects import _FemElementFluid1D
_FemElementFluid1D._FemElementFluid1D(obj)
from femobjects import element_fluid1D
element_fluid1D.ElementFluid1D(obj)
if FreeCAD.GuiUp:
from femguiobjects import _ViewProviderFemElementFluid1D
_ViewProviderFemElementFluid1D._ViewProviderFemElementFluid1D(obj.ViewObject)
from femviewprovider import view_element_fluid1D
view_element_fluid1D.VPElementFluid1D(obj.ViewObject)
return obj

View File

@@ -27,16 +27,16 @@ __title__ = "FreeCAD FEM _element fluid 1D document object"
__author__ = "Ofentse Kgoa"
__url__ = "http://www.freecadweb.org"
## @package FemElementFluid1D
## @package element_fluid1D
# \ingroup FEM
# \brief FreeCAD FEM _FemElementFluid1D
# \brief element fluid 1D object
from . import FemConstraint
class _FemElementFluid1D(FemConstraint.Proxy):
class ElementFluid1D(FemConstraint.Proxy):
"""
The FemElementFluid1D object
The element_fluid1D object
"""
Type = "Fem::ElementFluid1D"
@@ -61,7 +61,7 @@ class _FemElementFluid1D(FemConstraint.Proxy):
known_channel_types = ["NONE"]
def __init__(self, obj):
super(_FemElementFluid1D, self).__init__(obj)
super(ElementFluid1D, self).__init__(obj)
obj.addProperty(
"App::PropertyLinkSubList",
@@ -315,13 +315,13 @@ class _FemElementFluid1D(FemConstraint.Proxy):
)
# set property default values
obj.SectionType = _FemElementFluid1D.known_fluid_types
obj.SectionType = ElementFluid1D.known_fluid_types
obj.SectionType = "Liquid"
obj.LiquidSectionType = _FemElementFluid1D.known_liquid_types
obj.LiquidSectionType = ElementFluid1D.known_liquid_types
obj.LiquidSectionType = "PIPE INLET"
obj.GasSectionType = _FemElementFluid1D.known_gas_types
obj.GasSectionType = ElementFluid1D.known_gas_types
obj.GasSectionType = "NONE"
obj.ChannelSectionType = _FemElementFluid1D.known_channel_types
obj.ChannelSectionType = ElementFluid1D.known_channel_types
obj.ChannelSectionType = "NONE"
obj.ManningArea = 10.0
obj.ManningRadius = 1.0

View File

@@ -51,6 +51,8 @@ class FemMigrateApp(object):
return self
if fullname == "femobjects._FemConstraintTie":
return self
if fullname == "femobjects._FemElementFluid1D":
return self
if fullname == "PyObjects":
return self
@@ -166,6 +168,9 @@ class FemMigrateApp(object):
if module.__name__ == "femobjects._FemConstraintTie":
import femobjects.constraint_tie
module._FemConstraintTie = femobjects.constraint_tie.ConstraintTie
if module.__name__ == "femobjects._FemElementFluid1D":
import femobjects.element_fluid1D
module._FemElementFluid1D = femobjects.element_fluid1D.ElementFluid1D
if module.__name__ == "PyObjects":
module.__path__ = "PyObjects"
@@ -185,8 +190,8 @@ class FemMigrateApp(object):
import femobjects.constraint_selfweight
module._FemConstraintSelfWeight = femobjects.constraint_selfweight.ConstraintSelfWeight
if module.__name__ == "PyObjects._FemElementFluid1D":
import femobjects._FemElementFluid1D
module._FemElementFluid1D = femobjects._FemElementFluid1D._FemElementFluid1D
import femobjects.element_fluid1D
module._FemElementFluid1D = femobjects.element_fluid1D.ElementFluid1D
if module.__name__ == "PyObjects._FemElementGeometry1D":
import femobjects._FemElementGeometry1D
module._FemElementGeometry1D = femobjects._FemElementGeometry1D._FemElementGeometry1D
@@ -228,8 +233,8 @@ class FemMigrateApp(object):
import femobjects._FemElementGeometry1D
module._FemBeamSection = femobjects._FemElementGeometry1D._FemElementGeometry1D
if module.__name__ == "PyObjects._FemFluidSection":
import femobjects._FemElementFluid1D
module._FemFluidSection = femobjects._FemElementFluid1D._FemElementFluid1D
import femobjects.element_fluid1D
module._FemFluidSection = femobjects.element_fluid1D.ElementFluid1D
if module.__name__ == "PyObjects._FemShellThickness":
import femobjects._FemElementGeometry2D
module._FemShellThickness = femobjects._FemElementGeometry2D._FemElementGeometry2D
@@ -318,6 +323,7 @@ module="femobjects._FemConstraintFlowVelocity"
module="femobjects._FemConstraintInitialFlowVelocity"
module="femobjects._FemConstraintSelfWeight"
module="femobjects._FemConstraintTie"
module="femobjects._FemElementFluid1D"
third big moving
from PyObjects to femobjects, following the parent commit

View File

@@ -49,6 +49,8 @@ class FemMigrateGui(object):
return self
if fullname == "femguiobjects._ViewProviderFemConstraintTie":
return self
if fullname == "femguiobjects._ViewProviderFemElementFluid1D":
return self
if fullname == "PyGui":
return self
@@ -154,7 +156,10 @@ class FemMigrateGui(object):
if module.__name__ == "femguiobjects._ViewProviderFemConstraintTie":
import femviewprovider.view_constraint_tie
module._ViewProviderFemConstraintTie = femviewprovider.view_constraint_tie.VPConstraintTie
if module.__name__ == "femguiobjects._ViewProviderFemElementFluid1D":
import femviewprovider.view_element_fluid1D
module._ViewProviderFemElementFluid1D = femviewprovider.view_element_fluid1D.VPElementFluid1D
if module.__name__ == "PyGui":
module.__path__ = "PyGui"
if module.__name__ == "PyGui._ViewProviderFemConstraintBodyHeatSource":
@@ -173,8 +178,8 @@ class FemMigrateGui(object):
import femviewprovider.view_constraint_selfweight
module._ViewProviderFemConstraintSelfWeight = femviewprovider.view_constraint_selfweight.VPConstraintSelfWeight
if module.__name__ == "PyGui._ViewProviderFemElementFluid1D":
import femguiobjects._ViewProviderFemElementFluid1D
module._ViewProviderFemElementFluid1D = femguiobjects._ViewProviderFemElementFluid1D._ViewProviderFemElementFluid1D
import femviewprovider.view_element_fluid1D
module._ViewProviderFemElementFluid1D = femviewprovider.view_element_fluid1D.VPElementFluid1D
if module.__name__ == "PyGui._ViewProviderFemElementGeometry1D":
import femguiobjects._ViewProviderFemElementGeometry1D
module._ViewProviderFemElementGeometry1D = femguiobjects._ViewProviderFemElementGeometry1D._ViewProviderFemElementGeometry1D
@@ -216,8 +221,8 @@ class FemMigrateGui(object):
import femguiobjects._ViewProviderFemElementGeometry1D
module._ViewProviderFemBeamSection = femguiobjects._ViewProviderFemElementGeometry1D._ViewProviderFemElementGeometry1D
if module.__name__ == "PyGui._ViewProviderFemFluidSection":
import femguiobjects._ViewProviderFemElementFluid1D
module._ViewProviderFemFluidSection = femguiobjects._ViewProviderFemElementFluid1D._ViewProviderFemElementFluid1D
import femviewprovider.view_element_fluid1D
module._ViewProviderFemFluidSection = femviewprovider.view_element_fluid1D.VPElementFluid1D
if module.__name__ == "PyGui._ViewProviderFemShellThickness":
import femguiobjects._ViewProviderFemElementGeometry2D
module._ViewProviderFemShellThickness = femguiobjects._ViewProviderFemElementGeometry2D._ViewProviderFemElementGeometry2D
@@ -282,6 +287,7 @@ module="femguiobjects._ViewProviderFemConstraintFlowVelocity"
module="femguiobjects._ViewProviderFemConstraintInitialFlowVelocity"
module="femguiobjects._ViewProviderFemConstraintSelfWeight"
module="femguiobjects._ViewProviderFemConstraintTie"
module="femguiobjects._ViewProviderFemElementFluid1D"
third big moving
from PyGui to femguiobjects, following the parent commit

View File

@@ -27,9 +27,9 @@ __title__ = "FreeCAD FEM element fluid 1D ViewProvider for the document object"
__author__ = "Ofentse Kgoa, Bernd Hahnebach"
__url__ = "http://www.freecadweb.org"
## @package ViewProviderFemElementFluid1D
## @package view_element_fluid1D
# \ingroup FEM
# \brief FreeCAD ViewProviderFemElementFluid1D
# \brief view provider for element fluid 1D object
from PySide import QtCore
from PySide import QtGui
@@ -38,13 +38,13 @@ import FreeCAD
import FreeCADGui
from femguiutils import selection_widgets
from . import ViewProviderFemConstraint
from femobjects import _FemElementFluid1D
from femguiobjects import ViewProviderFemConstraint
from femobjects import element_fluid1D
class _ViewProviderFemElementFluid1D(ViewProviderFemConstraint.ViewProxy):
class VPElementFluid1D(ViewProviderFemConstraint.ViewProxy):
"""
A View Provider for the FemElementFluid1D object
A View Provider for the ElementFluid1D object
"""
def setEdit(self, vobj, mode=0):
@@ -58,7 +58,7 @@ class _ViewProviderFemElementFluid1D(ViewProviderFemConstraint.ViewProxy):
class _TaskPanel:
"""
The TaskPanel for editing References property of FemElementFluid1D objects
The TaskPanel for editing References property of ElementFluid1D objects
"""
def __init__(self, obj):
@@ -231,16 +231,16 @@ class _TaskPanel:
)
# some fluid types deactivated since they are not implemented in ccx writer
self.parameterWidget.cb_section_type.addItems(
_FemElementFluid1D._FemElementFluid1D.known_fluid_types
element_fluid1D.ElementFluid1D.known_fluid_types
)
self.parameterWidget.cb_liquid_section_type.addItems(
_FemElementFluid1D._FemElementFluid1D.known_liquid_types
element_fluid1D.ElementFluid1D.known_liquid_types
)
self.parameterWidget.cb_gas_section_type.addItems(
_FemElementFluid1D._FemElementFluid1D.known_gas_types
element_fluid1D.ElementFluid1D.known_gas_types
)
self.parameterWidget.cb_channel_section_type.addItems(
_FemElementFluid1D._FemElementFluid1D.known_channel_types
element_fluid1D.ElementFluid1D.known_channel_types
)
self.get_fluidsection_props()
self.updateParameterWidget()