0021347: [CEA 497] Visualisation into SMESH and VISU of hexagonal prism cells (MED_OCTA12)

0021380: EDF 1937 SMESH: Take into account QUAD9 and HEXA27

In CopyMesh(), copy free nodes as well
This commit is contained in:
eap 2011-12-16 09:30:53 +00:00
parent 41b91cf1c6
commit 32a63e97ee

View File

@ -2436,12 +2436,13 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
// 3. Get elements to copy // 3. Get elements to copy
SMDS_ElemIteratorPtr srcElemIt; SMDS_ElemIteratorPtr srcElemIt; SMDS_NodeIteratorPtr srcNodeIt;
TIDSortedElemSet srcElems; TIDSortedElemSet srcElems;
SMESH::array_of_ElementType_var srcElemTypes = meshPart->GetTypes(); SMESH::array_of_ElementType_var srcElemTypes = meshPart->GetTypes();
if ( SMESH::DownCast<SMESH_Mesh_i*>( meshPart )) if ( SMESH::DownCast<SMESH_Mesh_i*>( meshPart ))
{ {
srcElemIt = srcMeshDS->elementsIterator(); srcElemIt = srcMeshDS->elementsIterator();
srcNodeIt = srcMeshDS->nodesIterator();
} }
else else
{ {
@ -2515,6 +2516,23 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
} }
} }
// 4(b). Copy free nodes
if ( srcNodeIt && srcMeshDS->NbNodes() != newMeshDS->NbNodes() )
{
while ( srcNodeIt->more() )
{
nSrc = srcNodeIt->next();
if ( nSrc->NbInverseElements() == 0 )
{
if ( toKeepIDs )
nTgt = newMeshDS->AddNodeWithID( nSrc->X(), nSrc->Y(), nSrc->Z(), nSrc->GetID());
else
n2nMap[ nSrc ] = newMeshDS->AddNode( nSrc->X(), nSrc->Y(), nSrc->Z() );
}
}
}
// 5. Copy groups // 5. Copy groups
int nbNewGroups = 0; int nbNewGroups = 0;