FEM: element geometry types, same name type system as Python constraints
This commit is contained in:
@@ -735,13 +735,13 @@ def get_elset_short_name(
|
||||
from femtools.femutils import is_of_type
|
||||
if is_of_type(obj, "Fem::Material"):
|
||||
return "M" + str(i)
|
||||
elif is_of_type(obj, "Fem::FemElementGeometry1D"):
|
||||
elif is_of_type(obj, "Fem::ElementGeometry1D"):
|
||||
return "B" + str(i)
|
||||
elif is_of_type(obj, "Fem::FemElementRotation1D"):
|
||||
elif is_of_type(obj, "Fem::ElementRotation1D"):
|
||||
return "R" + str(i)
|
||||
elif is_of_type(obj, "Fem::FemElementFluid1D"):
|
||||
elif is_of_type(obj, "Fem::ElementFluid1D"):
|
||||
return "F" + str(i)
|
||||
elif is_of_type(obj, "Fem::FemElementGeometry2D"):
|
||||
elif is_of_type(obj, "Fem::ElementGeometry2D"):
|
||||
return "S" + str(i)
|
||||
else:
|
||||
FreeCAD.Console.PrintError(
|
||||
|
||||
@@ -310,7 +310,7 @@ class _FemElementFluid1D:
|
||||
obj.InletFlowRateActive = False
|
||||
obj.OutletFlowRateActive = False
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::FemElementFluid1D"
|
||||
self.Type = "Fem::ElementFluid1D"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
|
||||
@@ -79,7 +79,7 @@ class _FemElementGeometry1D:
|
||||
obj.SectionType = _FemElementGeometry1D.known_beam_types
|
||||
obj.SectionType = "Rectangular"
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::FemElementGeometry1D"
|
||||
self.Type = "Fem::ElementGeometry1D"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
|
||||
@@ -44,7 +44,7 @@ class _FemElementGeometry2D:
|
||||
"List of shell thickness shapes"
|
||||
)
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::FemElementGeometry2D"
|
||||
self.Type = "Fem::ElementGeometry2D"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
|
||||
@@ -45,7 +45,7 @@ class _FemElementRotation1D:
|
||||
"List of beam rotation shapes"
|
||||
)
|
||||
obj.Proxy = self
|
||||
self.Type = "Fem::FemElementRotation1D"
|
||||
self.Type = "Fem::ElementRotation1D"
|
||||
|
||||
def execute(self, obj):
|
||||
return
|
||||
|
||||
@@ -270,19 +270,19 @@ class TestObjectType(unittest.TestCase):
|
||||
type_of_obj(ObjectsFem.makeConstraintTransform(doc))
|
||||
)
|
||||
self.assertEqual(
|
||||
"Fem::FemElementFluid1D",
|
||||
"Fem::ElementFluid1D",
|
||||
type_of_obj(ObjectsFem.makeElementFluid1D(doc))
|
||||
)
|
||||
self.assertEqual(
|
||||
"Fem::FemElementGeometry1D",
|
||||
"Fem::ElementGeometry1D",
|
||||
type_of_obj(ObjectsFem.makeElementGeometry1D(doc))
|
||||
)
|
||||
self.assertEqual(
|
||||
"Fem::FemElementGeometry2D",
|
||||
"Fem::ElementGeometry2D",
|
||||
type_of_obj(ObjectsFem.makeElementGeometry2D(doc))
|
||||
)
|
||||
self.assertEqual(
|
||||
"Fem::FemElementRotation1D",
|
||||
"Fem::ElementRotation1D",
|
||||
type_of_obj(ObjectsFem.makeElementRotation1D(doc))
|
||||
)
|
||||
materialsolid = ObjectsFem.makeMaterialSolid(doc)
|
||||
@@ -468,19 +468,19 @@ class TestObjectType(unittest.TestCase):
|
||||
))
|
||||
self.assertTrue(is_of_type(
|
||||
ObjectsFem.makeElementFluid1D(doc),
|
||||
"Fem::FemElementFluid1D"
|
||||
"Fem::ElementFluid1D"
|
||||
))
|
||||
self.assertTrue(is_of_type(
|
||||
ObjectsFem.makeElementGeometry1D(doc),
|
||||
"Fem::FemElementGeometry1D"
|
||||
"Fem::ElementGeometry1D"
|
||||
))
|
||||
self.assertTrue(is_of_type(
|
||||
ObjectsFem.makeElementGeometry2D(doc),
|
||||
"Fem::FemElementGeometry2D"
|
||||
"Fem::ElementGeometry2D"
|
||||
))
|
||||
self.assertTrue(is_of_type(
|
||||
ObjectsFem.makeElementRotation1D(doc),
|
||||
"Fem::FemElementRotation1D"
|
||||
"Fem::ElementRotation1D"
|
||||
))
|
||||
materialsolid = ObjectsFem.makeMaterialSolid(doc)
|
||||
self.assertTrue(is_of_type(
|
||||
@@ -906,7 +906,7 @@ class TestObjectType(unittest.TestCase):
|
||||
))
|
||||
self.assertTrue(is_derived_from(
|
||||
fluid1d,
|
||||
"Fem::FemElementFluid1D"
|
||||
"Fem::ElementFluid1D"
|
||||
))
|
||||
|
||||
# FemElementGeometry1D
|
||||
@@ -921,7 +921,7 @@ class TestObjectType(unittest.TestCase):
|
||||
))
|
||||
self.assertTrue(is_derived_from(
|
||||
geometry1d,
|
||||
"Fem::FemElementGeometry1D"
|
||||
"Fem::ElementGeometry1D"
|
||||
))
|
||||
|
||||
# FemElementGeometry2D
|
||||
@@ -936,7 +936,7 @@ class TestObjectType(unittest.TestCase):
|
||||
))
|
||||
self.assertTrue(is_derived_from(
|
||||
geometry2d,
|
||||
"Fem::FemElementGeometry2D"
|
||||
"Fem::ElementGeometry2D"
|
||||
))
|
||||
|
||||
# FemElementRotation1D
|
||||
@@ -951,7 +951,7 @@ class TestObjectType(unittest.TestCase):
|
||||
))
|
||||
self.assertTrue(is_derived_from(
|
||||
rotation1d,
|
||||
"Fem::FemElementRotation1D"
|
||||
"Fem::ElementRotation1D"
|
||||
))
|
||||
|
||||
# Material Fluid
|
||||
|
||||
@@ -251,16 +251,16 @@ class AnalysisMember():
|
||||
|
||||
# geometries
|
||||
self.geos_beamsection = self.get_several_member(
|
||||
"Fem::FemElementGeometry1D"
|
||||
"Fem::ElementGeometry1D"
|
||||
)
|
||||
self.geos_beamrotation = self.get_several_member(
|
||||
"Fem::FemElementRotation1D"
|
||||
"Fem::ElementRotation1D"
|
||||
)
|
||||
self.geos_fluidsection = self.get_several_member(
|
||||
"Fem::FemElementFluid1D"
|
||||
"Fem::ElementFluid1D"
|
||||
)
|
||||
self.geos_shellthickness = self.get_several_member(
|
||||
"Fem::FemElementGeometry2D"
|
||||
"Fem::ElementGeometry2D"
|
||||
)
|
||||
|
||||
# constraints
|
||||
|
||||
Reference in New Issue
Block a user