FEM: python base object, rename class and module

This commit is contained in:
Bernd Hahnebach
2020-05-22 01:08:10 +02:00
parent 3e34731831
commit 316891caea
23 changed files with 50 additions and 49 deletions

View File

@@ -238,6 +238,7 @@ SET(FemTools_SRCS
SET(FemObjectsScripts_SRCS
femobjects/__init__.py
femobjects/base_fempythonobject.py
femobjects/constraint_bodyheatsource.py
femobjects/constraint_electrostaticpotential.py
femobjects/constraint_flowvelocity.py
@@ -258,7 +259,6 @@ SET(FemObjectsScripts_SRCS
femobjects/mesh_result.py
femobjects/result_mechanical.py
femobjects/solver_ccxtools.py
femobjects/FemConstraint.py
)
SET(FemAllScripts

View File

@@ -1,5 +1,6 @@
# ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
@@ -21,18 +22,18 @@
# * *
# ***************************************************************************
__title__ = "FreeCAD FEM base constraint object"
__author__ = "Markus Hovorka"
__title__ = "FreeCAD FEM base python object"
__author__ = "Markus Hovorka, Bernd Hahnebach"
__url__ = "http://www.freecadweb.org"
## @package _BaseObject
## @package base_fempythonobject
# \ingroup FEM
# \brief FreeCAD _Base Object for FEM workbench
# \brief base object for FEM Python Features
class Proxy(object):
class BaseFemPythonObject(object):
BaseType = "Fem::ConstraintPython"
BaseType = "Fem::BaseFemPythonObject"
def __init__(self, obj):
# self.Object = obj # keep a ref to the DocObj for nonGui usage

View File

@@ -30,10 +30,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief constraint body heat source object
from . import FemConstraint
from . import base_fempythonobject
class ConstraintBodyHeatSource(FemConstraint.Proxy):
class ConstraintBodyHeatSource(base_fempythonobject.BaseFemPythonObject):
Type = "Fem::ConstraintBodyHeatSource"

View File

@@ -30,10 +30,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief constraint electrostatic potential object
from . import FemConstraint
from . import base_fempythonobject
class ConstraintElectrostaticPotential(FemConstraint.Proxy):
class ConstraintElectrostaticPotential(base_fempythonobject.BaseFemPythonObject):
Type = "Fem::ConstraintElectrostaticPotential"

View File

@@ -30,10 +30,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief constraint flow velocity object
from . import FemConstraint
from . import base_fempythonobject
class ConstraintFlowVelocity(FemConstraint.Proxy):
class ConstraintFlowVelocity(base_fempythonobject.BaseFemPythonObject):
Type = "Fem::ConstraintFlowVelocity"

View File

@@ -30,10 +30,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief constraint initial flow velocity object
from . import FemConstraint
from . import base_fempythonobject
class ConstraintInitialFlowVelocity(FemConstraint.Proxy):
class ConstraintInitialFlowVelocity(base_fempythonobject.BaseFemPythonObject):
Type = "Fem::ConstraintInitialFlowVelocity"

View File

@@ -29,10 +29,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief constraint self weight object
from . import FemConstraint
from . import base_fempythonobject
class ConstraintSelfWeight(FemConstraint.Proxy):
class ConstraintSelfWeight(base_fempythonobject.BaseFemPythonObject):
"""
The ConstraintSelfWeight object"
"""

View File

@@ -29,10 +29,10 @@ __url__ = "https://www.freecadweb.org"
# \ingroup FEM
# \brief constraint tie object
from . import FemConstraint
from . import base_fempythonobject
class ConstraintTie(FemConstraint.Proxy):
class ConstraintTie(base_fempythonobject.BaseFemPythonObject):
"""
The ConstraintTie object
"""

View File

@@ -31,10 +31,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief element fluid 1D object
from . import FemConstraint
from . import base_fempythonobject
class ElementFluid1D(FemConstraint.Proxy):
class ElementFluid1D(base_fempythonobject.BaseFemPythonObject):
"""
The element_fluid1D object
"""

View File

@@ -29,10 +29,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief element geometry 1D object
from . import FemConstraint
from . import base_fempythonobject
class ElementGeometry1D(FemConstraint.Proxy):
class ElementGeometry1D(base_fempythonobject.BaseFemPythonObject):
"""
The ElementGeometry1D object
"""

View File

@@ -29,10 +29,10 @@ __url__ = "https://www.freecadweb.org"
# \ingroup FEM
# \brief element geometry 2D object
from . import FemConstraint
from . import base_fempythonobject
class ElementGeometry2D(FemConstraint.Proxy):
class ElementGeometry2D(base_fempythonobject.BaseFemPythonObject):
"""
The ElementGeometry2D object
"""

View File

@@ -29,10 +29,10 @@ __url__ = "https://www.freecadweb.org"
# \ingroup FEM
# \brief element rotation 1D object
from . import FemConstraint
from . import base_fempythonobject
class ElementRotation1D(FemConstraint.Proxy):
class ElementRotation1D(base_fempythonobject.BaseFemPythonObject):
"""
The ElementRotation1D object
"""

View File

@@ -30,10 +30,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief material common object
from . import FemConstraint
from . import base_fempythonobject
class MaterialCommon(FemConstraint.Proxy):
class MaterialCommon(base_fempythonobject.BaseFemPythonObject):
"""
The MaterialCommon object
"""

View File

@@ -29,10 +29,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief nonlinear mechanical material object
from . import FemConstraint
from . import base_fempythonobject
class MaterialMechanicalNonlinear(FemConstraint.Proxy):
class MaterialMechanicalNonlinear(base_fempythonobject.BaseFemPythonObject):
"""
The MaterialMechanicalNonlinear object
"""

View File

@@ -29,10 +29,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief reinforced object
from . import FemConstraint
from . import base_fempythonobject
class MaterialReinforced(FemConstraint.Proxy):
class MaterialReinforced(base_fempythonobject.BaseFemPythonObject):
"""
The MaterialReinforced object
"""

View File

@@ -29,10 +29,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief mesh boundary layer object
from . import FemConstraint
from . import base_fempythonobject
class MeshBoundaryLayer(FemConstraint.Proxy):
class MeshBoundaryLayer(base_fempythonobject.BaseFemPythonObject):
"""
The MeshBoundaryLayer object
"""

View File

@@ -29,10 +29,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief mesh gmsh object
from . import FemConstraint
from . import base_fempythonobject
class MeshGmsh(FemConstraint.Proxy):
class MeshGmsh(base_fempythonobject.BaseFemPythonObject):
"""
A Fem::FemMeshObject python type, add Gmsh specific properties
"""

View File

@@ -29,10 +29,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief mesh group object
from . import FemConstraint
from . import base_fempythonobject
class MeshGroup(FemConstraint.Proxy):
class MeshGroup(base_fempythonobject.BaseFemPythonObject):
"""
The MeshGroup object
"""

View File

@@ -29,10 +29,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief mesh region object
from . import FemConstraint
from . import base_fempythonobject
class MeshRegion(FemConstraint.Proxy):
class MeshRegion(base_fempythonobject.BaseFemPythonObject):
"""
The FemMeshRegion object
"""

View File

@@ -29,10 +29,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief mesh result object
from . import FemConstraint
from . import base_fempythonobject
class MeshResult(FemConstraint.Proxy):
class MeshResult(base_fempythonobject.BaseFemPythonObject):
"""
The Fem::FemMeshObject's Proxy python type, add Result specific object type
"""

View File

@@ -30,10 +30,10 @@ __url__ = "http://www.freecadweb.org"
# \ingroup FEM
# \brief mechanical result object
from . import FemConstraint
from . import base_fempythonobject
class ResultMechanical(FemConstraint.Proxy):
class ResultMechanical(base_fempythonobject.BaseFemPythonObject):
"""
The Fem::ResultMechanical's Proxy python type, add result specific properties
"""

View File

@@ -31,11 +31,11 @@ __url__ = "http://www.freecadweb.org"
import FreeCAD
from . import FemConstraint
from . import base_fempythonobject
from femsolver.calculix.solver import add_attributes
class SolverCcxTools(FemConstraint.Proxy):
class SolverCcxTools(base_fempythonobject.BaseFemPythonObject):
"""The Fem::FemSolver's Proxy python type, add solver specific properties
"""

View File

@@ -361,8 +361,8 @@ class FemMigrateApp(object):
import femviewprovider.view_element_geometry2D
module._ViewProviderFemShellThickness = femviewprovider.view_element_geometry2D.VPElementGeometry2D
if module.__name__ == "MechanicalAnalysis":
import femobjects.FemConstraint
module._FemAnalysis = femobjects.FemConstraint.Proxy
import femobjects.base_fempythonobject
module._FemAnalysis = femobjects.base_fempythonobject.BaseFemPythonObject
if FreeCAD.GuiUp:
import femguiobjects.ViewProviderBaseObject
module._ViewProviderFemAnalysis = femguiobjects.ViewProviderBaseObject.ViewProxy