FEM: result mesh, change obj type
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user