FEM: result mesh, change obj type

This commit is contained in:
Bernd Hahnebach
2020-03-22 11:25:16 +01:00
parent ff6829522b
commit d953828d30
7 changed files with 10 additions and 10 deletions

View File

@@ -166,7 +166,7 @@ class CommandManager(object):
result_mesh = False
analysis_members = FemGui.getActiveAnalysis().Group
for o in analysis_members:
if is_of_type(o, "Fem::FemMeshResult"):
if is_of_type(o, "Fem::MeshResult"):
result_mesh = True
return result_mesh

View File

@@ -37,7 +37,7 @@ class _FemMeshResult(FemConstraint.Proxy):
The Fem::FemMeshObject's Proxy python type, add Result specific object type
"""
Type = "Fem::FemMeshResult"
Type = "Fem::MeshResult"
def __init__(self, obj):
super(_FemMeshResult, self).__init__(obj)

View File

@@ -45,7 +45,7 @@ def purge_results(analysis):
for m in analysis.Group:
if m.isDerivedFrom("Fem::FemResultObject"):
if m.Mesh and is_of_type(m.Mesh, "Fem::FemMeshResult"):
if m.Mesh and is_of_type(m.Mesh, "Fem::MeshResult"):
analysis.Document.removeObject(m.Mesh.Name)
analysis.Document.removeObject(m.Name)
analysis.Document.recompute()
@@ -54,7 +54,7 @@ def purge_results(analysis):
# we could run into trouble in one loop because
# we will delete objects and try to access them later
for m in analysis.Group:
if is_of_type(m, "Fem::FemMeshResult"):
if is_of_type(m, "Fem::MeshResult"):
analysis.Document.removeObject(m.Name)
analysis.Document.recompute()

View File

@@ -115,7 +115,7 @@ class Results(run.Results):
def purge_results(self):
for m in membertools.get_member(self.analysis, "Fem::FemResultObject"):
if femutils.is_of_type(m.Mesh, "Fem::FemMeshResult"):
if femutils.is_of_type(m.Mesh, "Fem::MeshResult"):
self.analysis.Document.removeObject(m.Mesh.Name)
self.analysis.Document.removeObject(m.Name)
self.analysis.Document.recompute()

View File

@@ -116,7 +116,7 @@ class Results(run.Results):
def purge_results(self):
for m in membertools.get_member(self.analysis, "Fem::FemResultObject"):
if femutils.is_of_type(m.Mesh, "Fem::FemMeshResult"):
if femutils.is_of_type(m.Mesh, "Fem::MeshResult"):
self.analysis.Document.removeObject(m.Mesh.Name)
self.analysis.Document.removeObject(m.Name)
self.analysis.Document.recompute()

View File

@@ -314,7 +314,7 @@ class TestObjectType(unittest.TestCase):
type_of_obj(ObjectsFem.makeMeshNetgen(doc))
)
self.assertEqual(
"Fem::FemMeshResult",
"Fem::MeshResult",
type_of_obj(ObjectsFem.makeMeshResult(doc))
)
self.assertEqual(
@@ -514,7 +514,7 @@ class TestObjectType(unittest.TestCase):
))
self.assertTrue(is_of_type(
ObjectsFem.makeMeshResult(doc),
"Fem::FemMeshResult"
"Fem::MeshResult"
))
self.assertTrue(is_of_type(
ObjectsFem.makeResultMechanical(doc),
@@ -1089,7 +1089,7 @@ class TestObjectType(unittest.TestCase):
))
self.assertTrue(is_derived_from(
mesh_result,
"Fem::FemMeshResult"
"Fem::MeshResult"
))
# FemResultMechanical

View File

@@ -142,7 +142,7 @@ def get_mesh_to_solve(analysis):
if (
m.isDerivedFrom("Fem::FemMeshObject")
# the next line should not be needed as the result mesh is not a analysis member
and not femutils.is_of_type(m, "Fem::FemMeshResult")
and not femutils.is_of_type(m, "Fem::MeshResult")
):
if not mesh_to_solve:
mesh_to_solve = m