Fem: Implement getNodeElements function

This commit is contained in:
marioalexis
2023-02-19 07:48:51 -03:00
committed by Uwe
parent 4106ba71c4
commit be3718deea
4 changed files with 93 additions and 48 deletions

View File

@@ -1066,6 +1066,22 @@ std::list<int> FemMesh::getElementNodes(int id) const
for (int i = 0; i < elem->NbNodes(); i++)
result.push_back(elem->GetNode(i)->GetID());
}
return result;
}
std::list<int> FemMesh::getNodeElements(int id, SMDSAbs_ElementType type) const
{
std::list<int> result;
const SMDS_MeshNode* node = myMesh->GetMeshDS()->FindNode(id);
if (node) {
SMDS_ElemIteratorPtr it = node->GetInverseElementIterator(type);
while (it->more()) {
const SMDS_MeshElement* elem = it->next();
result.push_back(elem->GetID());
}
}
return result;
}