const SMDS_MeshElement* & elem1st = my1stElemNode[ ind1st( elem->GetType() )];
if ( elem1st == elem )
- elem1st = 0;
-
+ {
+ if ( myNbElements > 0 )
+ {
+ SMDS_ElemIteratorPtr it = myParent->shapeElementsIterator( myIndex, 1, elem1st );
+ if ( it->more() )
+ elem1st = it->next();
+ else
+ throw SALOME_Exception(LOCALIZED("invalid myNbElements"));
+ }
+ else
+ {
+ elem1st = 0;
+ }
+ }
return true;
}
return false;
const SMDS_MeshElement* & node1st = my1stElemNode[ ind1st( SMDSAbs_Node )];
if ( node1st == N )
- node1st = 0;
-
+ {
+ if ( myNbNodes > 0 )
+ {
+ SMDS_NodeIteratorPtr it =
+ myParent->shapeNodesIterator( myIndex, 1, static_cast< PNode >( node1st ));
+ if ( it->more() )
+ node1st = it->next();
+ else
+ throw SALOME_Exception(LOCALIZED("invalid myNbNodes"));
+ }
+ else
+ {
+ node1st = 0;
+ }
+ }
return true;
}
return false;
return SMDS_ElemIteratorPtr( new MyElemIterator( mySubMeshes ));
const SMDS_MeshElement* const * elem1st = & my1stElemNode[ ind1st( SMDSAbs_All )];
- if ( myNbElements == 1 )
+ if ( myNbElements < 2 )
{
- return boost::make_shared< EArrayIterator >( elem1st, elem1st+1 );
+ return boost::make_shared< EArrayIterator >( elem1st, elem1st + myNbElements );
}
return myParent->shapeElementsIterator( myIndex, myNbElements, *elem1st );
PNode const * node1st =
reinterpret_cast< PNode const* >( & my1stElemNode[ ind1st( SMDSAbs_Node )] );
- if ( myNbNodes == 1 )
+ if ( myNbNodes < 2 )
{
- return boost::make_shared< NArrayIterator >( node1st, node1st+1 );
+ return boost::make_shared< NArrayIterator >( node1st, node1st + myNbNodes );
}
return myParent->shapeNodesIterator( myIndex, myNbNodes, *node1st );
myNbElements = 0;
myNbNodes = 0;
my1stElemNode[0] = my1stElemNode[1] = 0;
+
if ( NbSubMeshes() > 0 )
{
SMESHDS_SubMeshIteratorPtr sub = GetSubMeshIterator();
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Close" );
// Clear study contexts data
- delete myStudyContext;
- myStudyContext = 0;
+ myStudyContext->Clear();
// remove the tmp files meshes are loaded from
SMESH_PreMeshInfo::RemoveStudyFiles_TMP_METHOD( theComponent );
hyp.SetFineness( fineness )
return hyp
- def LengthNearVertex(self, length, vertex=0, UseExisting=0):
+ def LengthNearVertex(self, length, vertex=-1, UseExisting=0):
"""
Defines "SegmentLengthAroundVertex" hypothesis
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
+import time
+t1= time.time()
+
# Geometry
# ========
-# grid compound of 17 x 17 elements
+# grid compound of 3 x 3 elements
# an element is compound of 3 concentric cylinders
# an element is centered in a square of the grid
g_rayon2 = 30
g_rayon3 = 40
-g_grid = 17
+g_grid = 3
g_trim = 1000
piece_id = geompy.addToStudy(piece, "ex12_grid17partition")
+t2= time.time()
+
# Meshing
# =======
hexa.Compute()
+t3= time.time()
+
+print ("time geom",t2-t1)
+print ("time mesh",t3-t2 )
+
# Update object browser
# ---------------------