Salome HOME
0021422: EDF 1963 SMESH: Viscous layer algorithm fails in some cases
[modules/smesh.git] / src / StdMeshers / StdMeshers_Prism_3D.hxx
index cb93867d54818e2153776dcbce627735ade86bdf..608cfba700d02927eccbde2d00d680db78e1ce64 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SMESH SMESH : implementaion of SMESH idl descriptions
 //  File   : StdMeshers_Prism_3D.hxx
 //  Module : SMESH
@@ -123,6 +124,11 @@ public:
    */
   SMESH_ComputeErrorPtr GetError() const { return myError; }
 
+  /*!
+   * \brief Free allocated memory
+   */
+  void Clear();
+
   /*!
    * \brief Return number of nodes on every vertical edge
     * \retval int - number of nodes including end nodes
@@ -142,15 +148,18 @@ public:
    * \brief Return TParam2ColumnMap for a base edge
     * \param baseEdgeID - base edge SMESHDS Index
     * \param isReverse - columns in-block orientation
-    * \retval const TParam2ColumnMap& - map
+    * \retval const TParam2ColumnMap* - map
    */
-  const TParam2ColumnMap& GetParam2ColumnMap(const int baseEdgeID,
+  const TParam2ColumnMap* GetParam2ColumnMap(const int baseEdgeID,
                                              bool &    isReverse) const
   {
-    std::pair< TParam2ColumnMap*, bool > col_frw =
-      myShapeIndex2ColumnMap.find( baseEdgeID )->second;
+    std::map< int, std::pair< TParam2ColumnMap*, bool > >::const_iterator i_mo =
+      myShapeIndex2ColumnMap.find( baseEdgeID );
+    if ( i_mo == myShapeIndex2ColumnMap.end() ) return 0;
+
+    const std::pair< TParam2ColumnMap*, bool >& col_frw = i_mo->second;
     isReverse = !col_frw.second;
-    return col_frw.first;
+    return col_frw.first;
   }
 
   /*!
@@ -224,11 +233,12 @@ public:
     * \param bottomEdges - edges bounding the bottom face
     * \param wallFaces - faces list to fill in
    */
-  static bool GetWallFaces( SMESH_Mesh*                     mesh,
-                            const TopoDS_Shape &            mainShape,
-                            const TopoDS_Shape &            bottomFace,
-                            const std::list< TopoDS_Edge >& bottomEdges,
-                            std::list< TopoDS_Face >&       wallFaces);
+  bool GetWallFaces( SMESH_Mesh*               mesh,
+                     const TopoDS_Shape &      mainShape,
+                     const TopoDS_Shape &      bottomFace,
+                     std::list< TopoDS_Edge >& bottomEdges,
+                     std::list< int > &        nbEInW,
+                     std::list< TopoDS_Face >& wallFaces);
 
 private: