Salome HOME
IPAL53073: Hexotic Mesh is not compute
authoreap <eap@opencascade.com>
Fri, 22 Jan 2016 17:10:27 +0000 (20:10 +0300)
committereap <eap@opencascade.com>
Fri, 22 Jan 2016 17:10:27 +0000 (20:10 +0300)
doc/salome/gui/SMESH/input/extrusion.doc
doc/salome/gui/SMESH/input/extrusion_along_path.doc
src/SMDS/SMDS_Mesh.cxx
src/SMESHDS/SMESHDS_Mesh.cxx
src/SMESHDS/SMESHDS_SubMesh.cxx

index 5a603b2291732e042761dad674ff92a07cbde40e..6b07af9e1aa89d836a8adb0cb9140eb05388f725 100644 (file)
@@ -68,30 +68,30 @@ The following dialog will appear:
         the \ref filtering_elements "Selection filters" page.</li> 
     </ul>
   </li>
+
   <li>If the <b>Extrusion to Distance</b> radio button is selected
-    - specify the translation vector by which the elements will be extruded.
+    <ul>
+      <li> specify the translation vector by which the elements will
+      be extruded.</li>
+    </ul>
   </li>
-  <p><br></p>
-
-\image html extrusionalongaline2.png  
 
  <li>If the <b>Extrusion Along Vector</b> radio button is selected
+\image html extrusionalongaline2.png  
     <ul>
-      <li>specify the coordinates of the \b Vector along which the elements
+      <li>specify the components of the \b Vector along which the elements
         will be extruded, either directly or by selecting the mesh face (the
         normal to the face will define the vector),</li>
       <li>specify the \b Distance of extrusion along the vector (it can
         be negative).</li>
     </ul>
   </li>
-  <p><br></p>
 
-\image html extrusionalongaline3.png  
-  
   <li>If the <b>Extrusion By Normal</b> radio button is selected,
     every node of the selected faces is extruded along the \a average
     of the \a normal vectors to the faces sharing the node. (Nodes and
     edges cannot be extruded in this mode.)
+\image html extrusionalongaline3.png 
     <ul>
       <li>Specify the \b Distance of extrusion (it can be negative),</li>
       <li>Use <b>Along average normal</b> check-box to specify along
index 2253d08d83f1a8807d7ade8344d78277b5762df7..ca782049a01817646cd9d922ec8c12df74ccd0d6 100644 (file)
@@ -134,9 +134,11 @@ The following dialog will appear:
 <li>If the path of extrusion is curvilinear, at each iteration the
   extruded elements are rotated to keep its initial angularity to the
   curve. By default, the <b>Base Point</b> around which the elements
-  are rotated is the mass center of the elements, however, you can
-  specify any point as the <b>Base Point</b> and the elements will be
-  rotated with respect to this point.<br>
+  are rotated is the mass center of the elements (note that it can
+  differ from the gravity center computed by \a Geometry module for the
+  underlying shape), however, you can specify any point as the <b>Base
+  Point</b> and the elements will be rotated with respect to this
+  point.<br>
   Note that only the displacement of the <b>Base Point</b> exactly
   equals to the path, and all other extruded elements simply keep
   their position relatively to the <b>Base Point</b> at each
index 86524eb8d2c2d08a2135116b6a89dcd87a3b0223..72da1ad743770b5a462b3853edca2139f084452c 100644 (file)
@@ -3301,12 +3301,12 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
             }
           removedElems.push_back((*it));
           myElementIDFactory->ReleaseID(IdToRemove, vtkid);
-          if (const SMDS_VtkEdge* vtkElem = dynamic_cast<const SMDS_VtkEdge*>(*it)) {
+          if (const SMDS_VtkEdge* vtkElem = dynamic_cast<const SMDS_VtkEdge*>(*it))
             myEdgePool->destroy((SMDS_VtkEdge*) vtkElem);
+          else {
             ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
-          }
-          else
             delete (*it);
+          }
           break;
         case SMDSAbs_Face:
           if (IdToRemove >= 0)
@@ -3316,12 +3316,12 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
             }
           removedElems.push_back((*it));
           myElementIDFactory->ReleaseID(IdToRemove, vtkid);
-          if (const SMDS_VtkFace* vtkElem = dynamic_cast<const SMDS_VtkFace*>(*it)) {
+          if (const SMDS_VtkFace* vtkElem = dynamic_cast<const SMDS_VtkFace*>(*it))
             myFacePool->destroy((SMDS_VtkFace*) vtkElem);
+          else {
             ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
-          }
-          else
             delete (*it);
+          }
           break;
         case SMDSAbs_Volume:
           if (IdToRemove >= 0)
@@ -3331,12 +3331,12 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
             }
           removedElems.push_back((*it));
           myElementIDFactory->ReleaseID(IdToRemove, vtkid);
-          if (const SMDS_VtkVolume* vtkElem = dynamic_cast<const SMDS_VtkVolume*>(*it)) {
+          if (const SMDS_VtkVolume* vtkElem = dynamic_cast<const SMDS_VtkVolume*>(*it))
             myVolumePool->destroy((SMDS_VtkVolume*) vtkElem);
+          else {
             ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
-          }
-          else
             delete (*it);
+          }
           break;
         case SMDSAbs_Ball:
           if (IdToRemove >= 0)
@@ -3346,48 +3346,48 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement *        elem,
             }
           removedElems.push_back((*it));
           myElementIDFactory->ReleaseID(IdToRemove, vtkid);
-          if (const SMDS_BallElement* vtkElem = dynamic_cast<const SMDS_BallElement*>(*it)) {
+          if (const SMDS_BallElement* vtkElem = dynamic_cast<const SMDS_BallElement*>(*it))
             myBallPool->destroy(const_cast<SMDS_BallElement*>( vtkElem ));
+          else {
             ((SMDS_MeshElement*) *it)->init( -1, -1, -1 ); // avoid reuse
-          }
-          else
             delete (*it);
+          }
           break;
 
         case SMDSAbs_All: // avoid compilation warning
         case SMDSAbs_NbElementTypes: break;
       }
       if (vtkid >= 0)
-        {
-          this->myGrid->GetCellTypesArray()->SetValue(vtkid, VTK_EMPTY_CELL);
-        }
+      {
+        this->myGrid->GetCellTypesArray()->SetValue(vtkid, VTK_EMPTY_CELL);
+      }
       it++;
     }
 
   // remove exclusive (free) nodes
   if (removenodes)
+  {
+    it = s2->begin();
+    while (it != s2->end())
     {
-      it = s2->begin();
-      while (it != s2->end())
-        {
-          int IdToRemove = (*it)->GetID();
-          if (IdToRemove >= 0)
-            {
-              myNodes[IdToRemove] = 0;
-              myInfo.myNbNodes--;
-            }
-          myNodeIDFactory->ReleaseID((*it)->GetID(), (*it)->getVtkId());
-          removedNodes.push_back((*it));
-          if (const SMDS_MeshNode* vtkElem = dynamic_cast<const SMDS_MeshNode*>(*it))
-          {
-            ((SMDS_MeshNode*)vtkElem)->SetPosition(SMDS_SpacePosition::originSpacePosition());
-            myNodePool->destroy((SMDS_MeshNode*) vtkElem);
-          }
-          else
-            delete (*it);
-          it++;
-        }
+      int IdToRemove = (*it)->GetID();
+      if (IdToRemove >= 0)
+      {
+        myNodes[IdToRemove] = 0;
+        myInfo.myNbNodes--;
+      }
+      myNodeIDFactory->ReleaseID((*it)->GetID(), (*it)->getVtkId());
+      removedNodes.push_back((*it));
+      if (const SMDS_MeshNode* vtkElem = dynamic_cast<const SMDS_MeshNode*>(*it))
+      {
+        ((SMDS_MeshNode*)vtkElem)->SetPosition(SMDS_SpacePosition::originSpacePosition());
+        myNodePool->destroy((SMDS_MeshNode*) vtkElem);
+      }
+      else
+        delete (*it);
+      it++;
     }
+  }
 
   delete s2;
   delete s1;
index a66f4482fe5a0f7c4523187dd12c57e5fa7c0815..072fcdac72fff2244320c5c19e49750c45e7c897 100644 (file)
@@ -894,16 +894,7 @@ void SMESHDS_Mesh::RemoveNode(const SMDS_MeshNode * n)
 {
   if ( n->NbInverseElements() == 0 && !(hasConstructionEdges() || hasConstructionFaces()))
   {
-    SMESHDS_SubMesh* subMesh = MeshElements( n->getshapeId() );
-    SMESHDS_SubMeshIteratorPtr subIt;
-    if ( !subMesh )
-      subIt = SubMeshes();
-    for ( ; !subMesh && subIt->more(); ) {
-      subMesh = const_cast< SMESHDS_SubMesh* >( subIt->next() );
-      if ( subMesh->IsComplexSubmesh() || !subMesh->Contains( n ))
-        subMesh = 0;
-    }
-    RemoveFreeNode( n, subMesh, true);
+    RemoveFreeNode( n, 0, true );
     return;
   }
 
index 32f89c9a62983ed7a61ef996cef37494967aec95..1e7dd6ab39c81a6925d7b1c4336c059b2b22559e 100644 (file)
@@ -117,13 +117,22 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele
 {
   if (!ME)
   {
-    MESSAGE("-----------------> Remove Null Element " << isElemDeleted);
     return false;
   }
   if (!IsComplexSubmesh())
   {
-    if ( ME->getshapeId() != myIndex )
+    if ( ME->getshapeId() != myIndex ) // elem not in a pool can loose it's data already
+    {
+      if ( isElemDeleted )
+        for ( size_t i = 0; i < myElements.size(); ++i )
+          if ( myElements[i] == ME )
+          {
+            myElements[i] = 0;
+            ++myUnusedIdElements;
+            return true;
+          }
       return false;
+    }
     int idInSubShape = ME->getIdInShape();
     SMDS_MeshElement* elem = (SMDS_MeshElement*) (ME);
     elem->setShapeId(0);
@@ -140,7 +149,6 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele
     }
     return false;
   }
-  MESSAGE("Try to remove an element from a complex submesh ");
   return false;
 }
 
@@ -182,7 +190,17 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted)
   if (!IsComplexSubmesh())
   {
     if ( N->getshapeId() != myIndex )
+    {
+      if ( isNodeDeleted )
+        for ( size_t i = 0; i < myNodes.size(); ++i )
+          if ( myNodes[i] == N )
+          {
+            myNodes[i] = 0;
+            ++myUnusedIdNodes;
+            return true;
+          }
       return false;
+    }
     int idInSubShape = N->getIdInShape();
     SMDS_MeshNode* node = (SMDS_MeshNode*) (N);
     node->setShapeId(0);
@@ -199,13 +217,12 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted)
     }
     return false;
   }
-  MESSAGE("Try to remove a node from a complex submesh");
   return false;
 }
 
 //=======================================================================
 //function : NbElements
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 int SMESHDS_SubMesh::NbElements() const