* ECRITURE DES NOEUDS *
****************************************************************************/
+ std::vector< size_t > nodeNumByID;
+ if ( myMesh->HasNumerationHoles() )
+ nodeNumByID.resize( myMesh->MaxNodeID() + 1 );
+
+ int num;
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
- while(itNodes->more())
+ for ( num = 1; itNodes->more(); ++num )
{
const SMDS_MeshNode * node = itNodes->next();
- fprintf(aFileId, "%d %.14e %.14e %.14e\n", node->GetID(), node->X(), node->Y(), node->Z());
+ fprintf(aFileId, "%d %.14e %.14e %.14e\n", num, node->X(), node->Y(), node->Z());
+
+ if ( !nodeNumByID.empty() )
+ nodeNumByID[ node->GetID() ] = num;
}
/****************************************************************************
****************************************************************************/
/* Ecriture des connectivites, noms, numeros des mailles */
- SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
- while(itEdges->more())
+ num = 1;
+ for ( SMDS_EdgeIteratorPtr itEdges = myMesh->edgesIterator(); itEdges->more(); ++num )
{
const SMDS_MeshElement * elem = itEdges->next();
- switch (elem->NbNodes())
+ fprintf(aFileId, "%d %d ", num, 100 + elem->NbNodes());
+
+ for ( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
{
- case 2:
- fprintf(aFileId, "%d %d ", elem->GetID(), 102);
- break;
- case 3:
- fprintf(aFileId, "%d %d ", elem->GetID(), 103);
- break;
+ int nodeID = it->next()->GetID();
+ if ( !nodeNumByID.empty() )
+ nodeID = nodeNumByID[ nodeID ];
+ fprintf(aFileId, "%d ", nodeID );
}
- SMDS_ElemIteratorPtr it=elem->nodesIterator();
- while(it->more())
- fprintf(aFileId, "%d ", it->next()->GetID());
fprintf(aFileId, "\n");
}
- SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
- while(itFaces->more())
+ for ( SMDS_FaceIteratorPtr itFaces = myMesh->facesIterator(); itFaces->more(); ++num )
{
const SMDS_MeshElement * elem = itFaces->next();
- if ( elem->IsPoly() )
- fprintf(aFileId, "%d %d ", elem->GetID(), 400+elem->NbNodes());
- else
- fprintf(aFileId, "%d %d ", elem->GetID(), 200+elem->NbNodes());
- SMDS_ElemIteratorPtr it=elem->nodesIterator();
- while(it->more())
- fprintf(aFileId, "%d ", it->next()->GetID());
+
+ fprintf(aFileId, "%d %d ", num, (elem->IsPoly() ? 400 : 200 ) + elem->NbNodes() );
+
+ for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
+ {
+ int nodeID = it->next()->GetID();
+ if ( !nodeNumByID.empty() )
+ nodeID = nodeNumByID[ nodeID ];
+ fprintf(aFileId, "%d ", nodeID );
+ }
fprintf(aFileId, "\n");
}
- SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
+
const SMDS_MeshVolume* v;
- while(itVolumes->more())
+ for ( SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator(); itVolumes->more(); ++num )
{
const SMDS_MeshElement * elem = itVolumes->next();
if ( elem->IsPoly() )
{
- fprintf(aFileId, "%d %d ", elem->GetID(), 500+elem->NbNodes());
+ fprintf(aFileId, "%d %d ", num, 500 + elem->NbNodes());
if (( v = myMesh->DownCast< SMDS_MeshVolume >( elem )))
{
}
else
{
- fprintf(aFileId, "%d %d ", elem->GetID(), 300+elem->NbNodes());
+ fprintf(aFileId, "%d %d ", num, 300 + elem->NbNodes());
+ }
+
+ for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
+ {
+ int nodeID = it->next()->GetID();
+ if ( !nodeNumByID.empty() )
+ nodeID = nodeNumByID[ nodeID ];
+ fprintf(aFileId, "%d ", nodeID );
}
- SMDS_ElemIteratorPtr it=elem->nodesIterator();
- while(it->more())
- fprintf(aFileId, "%d ", it->next()->GetID());
fprintf(aFileId, "\n");
}
UNV164::Write( out_stream ); // unit system
UNV2420::Write( out_stream, myMeshName ); // Coordinate system
+ std::vector< size_t > nodeLabelByID;
+ if ( myMesh->HasNumerationHoles() )
+ nodeLabelByID.resize( myMesh->MaxNodeID() + 1 );
+
{
using namespace UNV2411;
TDataSet aDataSet2411;
+ // -----------------------------------
// Storing SMDS nodes to the UNV file
- //-----------------------------------
+ // -----------------------------------
SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
TRecord aRec;
- while ( aNodesIter->more() )
+ for ( aRec.label = 1; aNodesIter->more(); ++aRec.label )
{
const SMDS_MeshNode* aNode = aNodesIter->next();
- aRec.label = aNode->GetID();
+ // aRec.label = aNode->GetID(); -- IPAL54452
+ if ( !nodeLabelByID.empty() )
+ nodeLabelByID[ aNode->GetID() ] = aRec.label;
aRec.coord[0] = aNode->X();
aRec.coord[1] = aNode->Y();
aRec.coord[2] = aNode->Z();
}
UNV2411::Write(out_stream,aDataSet2411);
}
+
+ std::vector< size_t > elemLabelByID;
+ if ( !myGroups.empty() )
+ elemLabelByID.resize( myMesh->MaxElementID() + 1 );
+
{
using namespace UNV2412;
TDataSet aDataSet2412;
+ TRecord aRec;
+ aRec.label = 0;
+ // -------------------
// Storing SMDS Edges
- if(myMesh->NbEdges()){
+ // -------------------
+ if ( myMesh->NbEdges() )
+ {
SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
- while( anIter->more() )
+ while ( anIter->more() )
{
const SMDS_MeshEdge* anElem = anIter->next();
- int aNbNodes = anElem->NbNodes();
- TRecord aRec;
- aRec.label = anElem->GetID();
- aRec.node_labels.reserve(aNbNodes);
- if( anElem->IsQuadratic() ) {
- aRec.fe_descriptor_id = 22;
- } else {
- aRec.fe_descriptor_id = 11;
- }
+ // aRec.label = anElem->GetID(); -- IPAL54452
+ ++aRec.label;
+ if ( !elemLabelByID.empty() )
+ elemLabelByID[ anElem->GetID() ] = aRec.label;
+
+ aRec.fe_descriptor_id = anElem->IsQuadratic() ? 22 : 11;
+
SMDS_NodeIteratorPtr aNodesIter = anElem->nodesIteratorToUNV();
- while( aNodesIter->more())
+ for ( aRec.node_labels.clear(); aNodesIter->more(); )
{
const SMDS_MeshNode* aNode = aNodesIter->next();
- aRec.node_labels.push_back( aNode->GetID() );
+ if ( nodeLabelByID.empty() )
+ aRec.node_labels.push_back( aNode->GetID() );
+ else
+ aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
}
+
aDataSet2412.push_back(aRec);
}
}
+ // -------------------
+ // Storing SMDS Faces
+ // -------------------
if ( myMesh->NbFaces() )
{
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
- while ( anIter->more())
+ while ( anIter->more() )
{
const SMDS_MeshFace* anElem = anIter->next();
if ( anElem->IsPoly() ) continue;
- int aNbNodes = anElem->NbNodes();
- TRecord aRec;
- aRec.label = anElem->GetID();
- aRec.node_labels.reserve(aNbNodes);
+
SMDS_NodeIteratorPtr aNodesIter = anElem->nodesIteratorToUNV();
- while( aNodesIter->more() ) {
+ for ( aRec.node_labels.clear(); aNodesIter->more(); ) {
const SMDS_MeshNode* aNode = aNodesIter->next();
- aRec.node_labels.push_back( aNode->GetID() );
+ if ( nodeLabelByID.empty() )
+ aRec.node_labels.push_back( aNode->GetID() );
+ else
+ aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
}
- switch ( aNbNodes ) {
+ switch ( anElem->NbNodes() ) {
case 3: aRec.fe_descriptor_id = 41; break;
case 4: aRec.fe_descriptor_id = 44; break;
case 6: aRec.fe_descriptor_id = 42; break;
default:
continue;
}
+ // aRec.label = anElem->GetID(); -- IPAL54452
+ ++aRec.label;
+ if ( !elemLabelByID.empty() )
+ elemLabelByID[ anElem->GetID() ] = aRec.label;
+
aDataSet2412.push_back(aRec);
}
}
+ // ---------------------
+ // Storing SMDS Volumes
+ // ---------------------
if ( myMesh->NbVolumes() )
{
SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator();
- while ( anIter->more())
+ while ( anIter->more() )
{
const SMDS_MeshVolume* anElem = anIter->next();
if ( anElem->IsPoly() )
continue;
- int aNbNodes = anElem->NbNodes();
- int anId = -1;
- switch(aNbNodes) {
- case 4: anId = 111; break;
- case 6: anId = 112; break;
- case 8: anId = 115; break;
- case 10: anId = 118; break;
- case 13: anId = 114; break;
- case 15: anId = 113; break;
+ size_t aNbNodes = anElem->NbNodes();
+ switch( aNbNodes ) {
+ case 4: aRec.fe_descriptor_id = 111; break;
+ case 6: aRec.fe_descriptor_id = 112; break;
+ case 8: aRec.fe_descriptor_id = 115; break;
+ case 10: aRec.fe_descriptor_id = 118; break;
+ case 13: aRec.fe_descriptor_id = 114; break;
+ case 15: aRec.fe_descriptor_id = 113; break;
case 20:
- case 27: anId = 116; aNbNodes = 20; break;
+ case 27: aRec.fe_descriptor_id = 116; aNbNodes = 20; break;
default:
continue;
}
- if(anId>0){
- TRecord aRec;
- aRec.label = anElem->GetID();
- aRec.fe_descriptor_id = anId;
- aRec.node_labels.reserve(aNbNodes);
- SMDS_NodeIteratorPtr aNodesIter = anElem->nodesIteratorToUNV();
- while ( aNodesIter->more() && (int)aRec.node_labels.size() < aNbNodes )
- {
- const SMDS_MeshElement* aNode = aNodesIter->next();
- aRec.node_labels.push_back(aNode->GetID());
- }
- aDataSet2412.push_back(aRec);
+ // aRec.label = anElem->GetID(); -- IPAL54452
+ ++aRec.label;
+ if ( !elemLabelByID.empty() )
+ elemLabelByID[ anElem->GetID() ] = aRec.label;
+
+ aRec.node_labels.clear();
+ SMDS_NodeIteratorPtr aNodesIter = anElem->nodesIteratorToUNV();
+ while ( aNodesIter->more() && aRec.node_labels.size() < aNbNodes )
+ {
+ const SMDS_MeshElement* aNode = aNodesIter->next();
+ if ( nodeLabelByID.empty() )
+ aRec.node_labels.push_back( aNode->GetID() );
+ else
+ aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
}
+ aDataSet2412.push_back(aRec);
}
}
UNV2412::Write(out_stream,aDataSet2412);
}
+
+ // --------------------
+ // Storing SMDS Groups
+ // --------------------
{
using namespace UNV2417;
- if (myGroups.size() > 0) {
+ if ( myGroups.size() > 0 ) {
+ TRecord aRec;
TDataSet aDataSet2417;
TGroupList::const_iterator aIter = myGroups.begin();
- for (; aIter != myGroups.end(); aIter++) {
+ for ( ; aIter != myGroups.end(); aIter++ )
+ {
SMESHDS_GroupBase* aGroupDS = *aIter;
- TRecord aRec;
aRec.GroupName = aGroupDS->GetStoreName();
+ aRec.NodeList.clear();
+ aRec.ElementList.clear();
- int i;
SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
- if (aGroupDS->GetType() == SMDSAbs_Node) {
- aRec.NodeList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.NodeList[i] = aElem->GetID();
- i++;
+ if ( aGroupDS->GetType() == SMDSAbs_Node ) {
+ while ( aIter->more() ) {
+ const SMDS_MeshElement* aNode = aIter->next();
+ if ( nodeLabelByID.empty() )
+ aRec.NodeList.push_back( aNode->GetID() );
+ else
+ aRec.NodeList.push_back( nodeLabelByID[ aNode->GetID() ]);
}
- } else {
- aRec.ElementList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
+ }
+ else
+ {
+ while ( aIter->more() ) {
const SMDS_MeshElement* aElem = aIter->next();
- aRec.ElementList[i] = aElem->GetID();
- i++;
+ if ( elemLabelByID.empty() )
+ aRec.ElementList.push_back( aElem->GetID() );
+ else
+ aRec.ElementList.push_back( elemLabelByID[ aElem->GetID() ]);
}
}
// 0019936: EDF 794 SMESH : Export UNV : Node color and group id
myGroups.clear();
}
}
- /* {
- using namespace UNV2417;
- TDataSet aDataSet2417;
- for ( TGroupsMap::iterator it = myGroupsMap.begin(); it != myGroupsMap.end(); it++ ) {
- SMESH_Group* aGroup = it->second;
- SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
- if ( aGroupDS ) {
- TRecord aRec;
- aRec.GroupName = aGroup->GetName();
- int i;
- SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
- if (aGroupDS->GetType() == SMDSAbs_Node) {
- aRec.NodeList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.NodeList[i] = aElem->GetID();
- i++;
- }
- } else {
- aRec.ElementList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.ElementList[i] = aElem->GetID();
- i++;
- }
- }
- aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec));
- }
- }
- UNV2417::Write(out_stream,aDataSet2417);
- }*/
out_stream.flush();
out_stream.close();
namespace UNV2417{
- typedef std::vector<int> TListOfId; // Nodal connectivitiesList of Id
+ typedef std::vector<int> TListOfId; // Nodal connectivity / List of Ids
struct TRecord{
std::string GroupName;
{
this->myCompactTime = this->myModifTime;
- bool idsChange = ( myNodeFactory->CompactChangePointers() ||
- myCellFactory->CompactChangePointers() );
+ bool idsChange = HasNumerationHoles();
if ( idsChange )
{
std::set< SMDS_ElementHolder* >::iterator holder = myElemHolders.begin();
return ( this->myCompactTime == this->myModifTime );
}
+//! are there holes in elements or nodes numeration
+bool SMDS_Mesh::HasNumerationHoles()
+{
+ return ( myNodeFactory->CompactChangePointers() ||
+ myCellFactory->CompactChangePointers() );
+}
+
void SMDS_Mesh::setNbShapes( size_t nbShapes )
{
myNodeFactory->SetNbShapes( nbShapes );
// Renumber all nodes or elements.
virtual void CompactMesh();
- bool IsCompacted();
+ virtual bool IsCompacted();
+ virtual bool HasNumerationHoles();
template<class ELEMTYPE>
static const ELEMTYPE* DownCast( const SMDS_MeshElement* e )
*/
static int CheckMemory(const bool doNotRaise=false) throw (std::bad_alloc);
- int MaxNodeID() const;
- int MinNodeID() const;
- int MaxElementID() const;
- int MinElementID() const;
+ virtual int MaxNodeID() const;
+ virtual int MinNodeID() const;
+ virtual int MaxElementID() const;
+ virtual int MinElementID() const;
const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; }
initData();
const SMDS_MeshElement* elem = getMeshDS()->FindElement(ide);
- if(!elem) return false;
+ if ( !elem ) return false;
int nbn = newIDs.length();
- int i=0;
vector<const SMDS_MeshNode*> aNodes(nbn);
- int nbn1=-1;
- for(; i<nbn; i++) {
- const SMDS_MeshNode* aNode = getMeshDS()->FindNode(newIDs[i]);
- if(aNode) {
- nbn1++;
- aNodes[nbn1] = aNode;
- }
+ for ( int i = 0; i < nbn; i++ ) {
+ const SMDS_MeshNode* aNode = getMeshDS()->FindNode( newIDs[ i ]);
+ if ( !aNode )
+ return false;
+ aNodes[ i ] = aNode;
}
TPythonDump() << "isDone = " << this << ".ChangeElemNodes( "
<< ide << ", " << newIDs << " )";
- bool res = getMeshDS()->ChangeElementNodes( elem, & aNodes[0], nbn1+1 );
+ bool res = getMeshDS()->ChangeElementNodes( elem, & aNodes[0], aNodes.size() );
declareMeshModified( /*isReComputeSafe=*/ !res );
virtual const SMDS_MeshElement *FindElement(int IDelem) const;
+ virtual bool HasNumerationHoles();
+ virtual int MaxNodeID() const;
+ virtual int MinNodeID() const;
+ virtual int MaxElementID() const;
+ virtual int MinElementID() const;
+
private:
TIDSortedElemSet _elements[ SMDSAbs_NbElementTypes ];
SMESHDS_Mesh* _meshDS;
return 0;
}
// -------------------------------------------------------------------------------------
+bool SMESH_MeshPartDS::HasNumerationHoles()
+{
+ if ( _meshDS ) return _meshDS->HasNumerationHoles();
+
+ return ( MinNodeID() != 1 ||
+ MaxNodeID() != NbNodes() ||
+ MinElementID() != 1 ||
+ MaxElementID() != NbElements() );
+}
+// -------------------------------------------------------------------------------------
+int SMESH_MeshPartDS::MaxNodeID() const
+{
+ if ( _meshDS ) return _meshDS->MaxNodeID();
+ return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].rbegin())->GetID();
+}
+// -------------------------------------------------------------------------------------
+int SMESH_MeshPartDS::MinNodeID() const
+{
+ if ( _meshDS ) return _meshDS->MinNodeID();
+ return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].begin())->GetID();
+}
+// -------------------------------------------------------------------------------------
+int SMESH_MeshPartDS::MaxElementID() const
+{
+ if ( _meshDS ) return _meshDS->MaxElementID();
+ int maxID = 0;
+ for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType )
+ if ( !_elements[ iType ].empty() )
+ maxID = Max( maxID, (*_elements[ iType ].rbegin())->GetID() );
+ return maxID;
+}
+// -------------------------------------------------------------------------------------
+int SMESH_MeshPartDS::MinElementID() const
+{
+ if ( _meshDS ) return _meshDS->MinElementID();
+ int minID = 0;
+ for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType )
+ if ( !_elements[ iType ].empty() )
+ minID = Min( minID, (*_elements[ iType ].begin())->GetID() );
+ return minID;
+}
+// -------------------------------------------------------------------------------------
SMDS_ElemIteratorPtr SMESH_MeshPartDS::elementGeomIterator(SMDSAbs_GeometryType geomType) const
{
if ( _meshDS ) return _meshDS->elementGeomIterator( geomType );
Parameters:
group (SMESH.SMESH_GroupBase): group to remove
+
+ Note:
+ This operation can create gaps in numeration of nodes or elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
self.mesh.RemoveGroupWithContents(group)
Returns:
True or False
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
return self.editor.RemoveElements(IDsOfElements)
Returns:
True or False
+
+ Note:
+ This operation can create gaps in numeration of nodes.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
return self.editor.RemoveNodes(IDsOfNodes)
Returns:
number of the removed nodes
+
+ Note:
+ This operation can create gaps in numeration of nodes.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
return self.editor.RemoveOrphanNodes()
Returns:
False if proper faces were not found
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
return self.editor.DeleteDiag(NodeID1, NodeID2)
Returns:
True in case of success, False otherwise.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
MaxAngle,Parameters,hasVars = ParseAngles(MaxAngle)
Returns:
True in case of success, False otherwise.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
MaxAngle,Parameters,hasVars = ParseAngles(MaxAngle)
Returns:
True in case of success, False otherwise.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
if IDsOfElements == []:
IDsOfElements = self.GetElementsId()
Returns:
True in case of success, False otherwise.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
if ( isinstance( theObject, Mesh )):
theObject = theObject.GetMesh()
theElements: the faces to be splitted. This can be either
:class:`mesh, sub-mesh, group, filter <SMESH.SMESH_IDSource>`
or a list of face IDs. By default all quadrangles are split
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
unRegister = genObjUnRegister()
if isinstance( theElements, Mesh ):
Returns:
True in case of success, False otherwise.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
if IDsOfElements == []:
IDsOfElements = self.GetElementsId()
Returns:
True in case of success, False otherwise.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
if ( isinstance( theObject, Mesh )):
theObject = theObject.GetMesh()
* 1 if 1-3 diagonal is better,
* 2 if 2-4 diagonal is better,
* 0 if error occurs.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
return self.editor.BestSplit(IDOfQuad, self.smeshpyD.GetFunctor(theCriterion))
method: flags passing splitting method:
smesh.Hex_5Tet, smesh.Hex_6Tet, smesh.Hex_24Tet.
smesh.Hex_5Tet - to split the hexahedron into 5 tetrahedrons, etc.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
unRegister = genObjUnRegister()
if isinstance( elems, Mesh ):
Parameters:
elems: elements to split\: :class:`mesh, sub-mesh, group, filter <SMESH.SMESH_IDSource>` or element IDs;
if None (default), all bi-quadratic elements will be split
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
unRegister = genObjUnRegister()
if elems and isinstance( elems, list ) and isinstance( elems[0], int ):
allDomains: if :code:`False`, only hexahedra adjacent to one closest
to *startHexPoint* are split, else *startHexPoint*
is used to find the facet to split in all domains present in *elems*.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
# IDSource
unRegister = genObjUnRegister()
def SplitQuadsNearTriangularFacets(self):
"""
Split quadrangle faces near triangular facets of volumes
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
faces_array = self.GetElementsByType(SMESH.FACE)
for face_id in faces_array:
Returns:
True in case of success, False otherwise.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
# Pattern:
# 5.---------.6
Returns:
True in case of success, False otherwise.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
# Pattern: 5.---------.6
# /|# /|
Warning:
If *theSubMesh* is provided, the mesh can become non-conformal
+
+ Note:
+ This operation can create gaps in numeration of nodes or elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
if isinstance( theSubMesh, Mesh ):
Warning:
If *theSubMesh* is provided, the mesh can become non-conformal
+
+ Note:
+ This operation can create gaps in numeration of nodes or elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
if theSubMesh:
then the first node in the group is kept.
AvoidMakingHoles: prevent merging nodes which cause removal of elements becoming
invalid
+
+ Note:
+ This operation can create gaps in numeration of nodes or elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
self.editor.MergeNodes( GroupsOfNodes, NodesToKeep, AvoidMakingHoles )
ElementsToKeep: elements to keep in the mesh: a list of groups, sub-meshes or node IDs.
If *ElementsToKeep* does not include an element to keep for some group to merge,
then the first element in the group is kept.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
unRegister = genObjUnRegister()
def MergeEqualElements(self):
"""
Leave one element and remove all other elements built on the same nodes.
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
self.editor.MergeEqualElements()
Returns:
a number of successfully sewed groups
+
+ Note:
+ This operation can create gaps in numeration of nodes or elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
if freeBorders and isinstance( freeBorders, list ):
Returns:
:class:`error code <SMESH.SMESH_MeshEditor.Sew_Error>`
+
+ Note:
+ This operation can create gaps in numeration of nodes or elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
return self.editor.SewFreeBorders(FirstNodeID1, SecondNodeID1, LastNodeID1,
Returns:
:class:`error code <SMESH.SMESH_MeshEditor.Sew_Error>`
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
return self.editor.SewConformFreeBorders(FirstNodeID1, SecondNodeID1, LastNodeID1,
Returns:
:class:`error code <SMESH.SMESH_MeshEditor.Sew_Error>`
+
+ Note:
+ This operation can create gaps in numeration of elements.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
return self.editor.SewBorderToSide(FirstNodeIDOnFreeBorder, SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder,
Returns:
:class:`error code <SMESH.SMESH_MeshEditor.Sew_Error>`
+
+ Note:
+ This operation can create gaps in numeration of nodes.
+ Call :meth:`RenumberElements` to remove the gaps.
"""
return self.editor.SewSideElements(IDsOfSide1Elements, IDsOfSide2Elements,
def ChangeElemNodes(self, ide, newIDs):
"""
- Set new nodes for the given element.
+ Set new nodes for the given element. Number of nodes should be kept.
Parameters:
ide: the element ID