long NbBiQuadQuadrangles()
raises (SALOME::SALOME_Exception);
- long NbPolygons(in ElementOrder order)
+ long NbPolygons()
+ raises (SALOME::SALOME_Exception);
+
+ long NbPolygonsOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
long NbVolumes()
SMDS_MeshCell::interlacedSmdsOrder( elem->GetEntityType(), nbn );
SMDS_MeshCell::applyInterlaceRev( interlace, nodeVec );
- if ( const SMDS_MeshElement* face = AddElement( nodeVec, anyFace.Init( elem )))
- myLastCreatedElems.Append( face );
+ AddElement( nodeVec, anyFace.Init( elem ));
while ( srcElements.Length() < myLastCreatedElems.Length() )
srcElements.Append( elem );
typedef vector<const SMDS_MeshNode*> TConnectivity;
TConnectivity tgtNodes;
- ElemFeatures elemKind( missType );
+ ElemFeatures elemKind( missType ), elemToCopy;
SMDS_ElemIteratorPtr eIt;
if (elements.empty()) eIt = aMesh->elementsIterator(elemType);
for ( int i = 0; i < nbFaceNodes; i += 1+iQuad)
{
for ( int j = 0; j < nodes.size(); ++j )
- nodes[j] =nn[i+j];
+ nodes[j] = nn[ i+j ];
if ( const SMDS_MeshElement* edge =
- aMesh->FindElement(nodes,SMDSAbs_Edge,/*noMedium=*/false))
+ aMesh->FindElement( nodes, SMDSAbs_Edge, /*noMedium=*/false ))
presentBndElems.push_back( edge );
else
missingBndElems.push_back( nodes );
tgtNodes.resize( e->NbNodes() );
for ( inode = 0; inode < nodes.size(); ++inode )
tgtNodes[inode] = getNodeWithSameID( tgtMeshDS, e->GetNode(inode) );
- presentEditor->AddElement( tgtNodes, elemKind.Init( e ));
+ presentEditor->AddElement( tgtNodes, elemToCopy.Init( e ));
}
else // store present elements to add them to a group
for ( int i = 0 ; i < presentBndElems.size(); ++i )
tgtNodes.resize( elem->NbNodes() );
for ( inode = 0; inode < tgtNodes.size(); ++inode )
tgtNodes[inode] = getNodeWithSameID( tgtMeshDS, elem->GetNode(inode) );
- tgtEditor.AddElement( tgtNodes, elemKind.Init( elem ));
+ tgtEditor.AddElement( tgtNodes, elemToCopy.Init( elem ));
tgtEditor.myLastCreatedElems.Clear();
}
THROW_SALOME_CORBA_EXCEPTION("Invalid boundary dimension", SALOME::BAD_PARAM);
// separate groups belonging to this and other mesh
- SMESH::ListOfIDSources_var groupsOfThisMesh = new SMESH::ListOfIDSources;
+ SMESH::ListOfIDSources_var groupsOfThisMesh = new SMESH::ListOfIDSources;
SMESH::ListOfIDSources_var groupsOfOtherMesh = new SMESH::ListOfIDSources;
- groupsOfThisMesh->length( groups.length() );
+ groupsOfThisMesh ->length( groups.length() );
groupsOfOtherMesh->length( groups.length() );
int nbGroups = 0, nbGroupsOfOtherMesh = 0;
for ( int i = 0; i < groups.length(); ++i )
return _impl->NbBiQuadQuadrangles();
}
-CORBA::Long SMESH_Mesh_i::NbPolygons(SMESH::ElementOrder order) throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbPolygons() throw(SALOME::SALOME_Exception)
+{
+ Unexpect aCatch(SALOME_SalomeException);
+ if ( _preMeshInfo )
+ return _preMeshInfo->NbPolygons();
+
+ return _impl->NbPolygons();
+}
+
+CORBA::Long SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order) throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
CORBA::Long NbBiQuadQuadrangles()
throw (SALOME::SALOME_Exception);
- CORBA::Long NbPolygons(SMESH::ElementOrder order=SMESH::ORDER_ANY)
+ CORBA::Long NbPolygons()
+ throw (SALOME::SALOME_Exception);
+
+ CORBA::Long NbPolygonsOfOrder(SMESH::ElementOrder order=SMESH::ORDER_ANY)
throw (SALOME::SALOME_Exception);
CORBA::Long NbVolumes()
# @return an integer value
# @ingroup l1_meshinfo
def NbPolygons(self, elementOrder = SMESH.ORDER_ANY):
- return self.mesh.NbPolygons(elementOrder)
+ return self.mesh.NbPolygonsOfOrder(elementOrder)
## Returns the number of volumes in the mesh
# @return an integer value
if len( args ) == 1:
return SMESH._objref_SMESH_MeshEditor.FindCoincidentNodes( self, args[0], False )
return SMESH._objref_SMESH_MeshEditor.FindCoincidentNodes( self, *args )
+ def FindCoincidentNodesOnPart(self,*args): # a 3d arg added (SeparateCornerAndMediumNodes)
+ if len( args ) == 2:
+ args += False,
+ return SMESH._objref_SMESH_MeshEditor.FindCoincidentNodesOnPart( self, *args )
def MergeNodes(self,*args): # a 2nd arg added (NodesToKeep)
if len( args ) == 1:
return SMESH._objref_SMESH_MeshEditor.MergeNodes( self, args[0], [] )
*/
//================================================================================
- void getInternalEdges( SMESH_Mesh& mesh,
+ bool getInternalEdges( SMESH_Mesh& mesh,
const TopoDS_Shape& shape,
const TopTools_MapOfShape& cornerVV,
TopTools_MapOfShape& internEE)
ridgeE = TopoDS::Edge( nextRidgeE );
V0 = V1;
+ if ( ridgeE.IsNull() )
+ return false;
} // check EDGEs around the last VERTEX of ridgeE
} // loop on ridge EDGEs around a corner VERTEX
} // loop on on corner VERTEXes
- return;
+ return true;
} // getInternalEdges()
} // namespace
TopTools_MapOfShape cornerVertices;
getBlockCorners( mesh, shape, cornerVertices );
if ( cornerVertices.Extent() != 8 )
- return false;
+ return error( COMPERR_BAD_INPUT_MESH, "Can't find 8 corners of a block" );
TopTools_MapOfShape internalEdges;
- getInternalEdges( mesh, shape, cornerVertices, internalEdges );
+ if ( !getInternalEdges( mesh, shape, cornerVertices, internalEdges ))
+ return error( COMPERR_BAD_INPUT_MESH, "2D mesh is not suitable for i,j,k hexa meshing" );
list< _QuadFaceGrid >::iterator boxFace;
TopExp_Explorer exp;