Salome HOME
Typo-fix by Kunda + fix user doc generation
[modules/smesh.git] / src / StdMeshers / StdMeshers_CompositeHexa_3D.cxx
index e59c60886e9b2b4a4b78638f312319d48f0e99b0..ec02f71e14d860f1e484fb12e25c100eac13df96 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -17,7 +17,7 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-//  SMESH SMESH : implementaion of SMESH idl descriptions
+//  SMESH SMESH : implementation of SMESH idl descriptions
 // File      : StdMeshers_CompositeHexa_3D.cxx
 // Module    : SMESH
 // Created   : Tue Nov 25 11:04:59 2008
@@ -28,6 +28,8 @@
 #include "SMDS_Mesh.hxx"
 #include "SMDS_MeshNode.hxx"
 #include "SMDS_SetIterator.hxx"
+#include "SMESHDS_Mesh.hxx"
+#include "SMESHDS_SubMesh.hxx"
 #include "SMESH_Block.hxx"
 #include "SMESH_Comment.hxx"
 #include "SMESH_ComputeError.hxx"
@@ -83,7 +85,7 @@ enum EAxes{ COO_X=1, COO_Y, COO_Z };
 
 //================================================================================
 /*!
- * \brief Convertor of a pair of integers to a sole index
+ * \brief Converter of a pair of integers to a sole index
  */
 struct _Indexer
 {
@@ -265,8 +267,8 @@ private:
  */
 //================================================================================
 
-StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, int studyId, SMESH_Gen* gen)
-  :SMESH_3D_Algo(hypId, studyId, gen)
+StdMeshers_CompositeHexa_3D::StdMeshers_CompositeHexa_3D(int hypId, SMESH_Gen* gen)
+  :SMESH_3D_Algo(hypId, gen)
 {
   _name = "CompositeHexa_3D";
   _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);       // 1 bit /shape type
@@ -382,12 +384,12 @@ namespace
                          const TopTools_MapOfShape& cornerVV,
                          TopTools_MapOfShape&       internEE)
   {
-    TopTools_IndexedMapOfShape subEE, subFF;
+    TopTools_IndexedMapOfShape subEE;
     TopExp::MapShapes( shape, TopAbs_EDGE, subEE );
-    TopExp::MapShapes( shape, TopAbs_FACE, subFF );
+    //TopExp::MapShapes( shape, TopAbs_FACE, subFF );
 
     TopoDS_Vertex VV[2];
-    TopTools_MapOfShape subChecked/*, ridgeEE*/;
+    TopTools_MapOfShape subChecked, ridgeEE;
     TopTools_MapIteratorOfMapOfShape vIt( cornerVV );
     for ( ; vIt.More(); vIt.Next() )
     {
@@ -401,6 +403,8 @@ namespace
         TopoDS_Edge ridgeE = TopoDS::Edge( *riE );
         while ( !ridgeE.IsNull() )
         {
+          if ( !ridgeEE.Add( ridgeE ))
+            break;
           TopExp::Vertices( ridgeE, VV[0], VV[1] );
           TopoDS_Shape V1 = VV[ V0.IsSame( VV[0] )];
           if ( cornerVV.Contains( V1 ) )
@@ -451,6 +455,11 @@ namespace
       } // loop on ridge EDGEs around a corner VERTEX
     } // loop on on corner VERTEXes
 
+    if ( subEE.Extent() > ridgeEE.Extent() + internEE.Extent() ) // PAL23269
+      for ( int i = 1; i < subEE.Extent(); ++i )
+        if ( !ridgeEE.Contains( subEE(i) ))
+          internEE.Add( subEE(i) );
+
     return true;
   } // getInternalEdges()
 } // namespace
@@ -555,7 +564,7 @@ bool StdMeshers_CompositeHexa_3D::findBoxFaces( const TopoDS_Shape&    shape,
   if ( !fTop )
     return error(COMPERR_BAD_SHAPE);
 
-  // orient bottom egde of faces along axes of the unit box
+  // orient bottom edge of faces along axes of the unit box
   fBottom->ReverseEdges();
   fBack  ->ReverseEdges();
   fLeft  ->ReverseEdges();
@@ -568,7 +577,7 @@ bool StdMeshers_CompositeHexa_3D::findBoxFaces( const TopoDS_Shape&    shape,
  * \brief Computes hexahedral mesh on a box with composite sides
  *  \param aMesh - mesh to compute
  *  \param aShape - shape to mesh
- *  \retval bool - succes sign
+ *  \retval bool - success sign
  */
 //================================================================================
 
@@ -793,7 +802,7 @@ bool StdMeshers_CompositeHexa_3D::Evaluate(SMESH_Mesh&         theMesh,
       nbSeg1 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]);
   }
 
-  // Get an 1D size of a box side ortogonal to lessComplexSide
+  // Get an 1D size of a box side orthogonal to lessComplexSide
   int nbSeg2 = 0;
   _QuadFaceGrid* ortoSide =
     lessComplexSide->FindAdjacentForSide( Q_LEFT, boxFaceContainer, B_UNDEFINED );
@@ -806,7 +815,7 @@ bool StdMeshers_CompositeHexa_3D::Evaluate(SMESH_Mesh&         theMesh,
       nbSeg2 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]);
   }
 
-  // Get an 2D size of a box side ortogonal to lessComplexSide
+  // Get an 2D size of a box side orthogonal to lessComplexSide
   int nbFaces = 0, nbQuadFace = 0;
   list< TopoDS_Face > sideFaces;
   if ( ortoSide->IsComplex() )
@@ -1149,7 +1158,7 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
 
   myGrid.resize( myIndexer.size() );
 
-  // strore nodes bound to the bottom edge
+  // store nodes bound to the bottom edge
   mySides.GetSide( Q_BOTTOM )->StoreNodes( mesh, myGrid, myReverse );
 
   // store the rest nodes row by row