Salome HOME
+ StdMeshers_CompositeHexa_3D.cxx \
authoreap <eap@opencascade.com>
Wed, 20 May 2009 15:43:35 +0000 (15:43 +0000)
committereap <eap@opencascade.com>
Wed, 20 May 2009 15:43:35 +0000 (15:43 +0000)
src/StdMeshers/Makefile.am
src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
src/StdMeshers/StdMeshers_Hexa_3D.cxx

index 50e728f2f2f503e668415d37de5990806fc5e3a3..86a4894921d8a24ecdae88e52caa2348a22ae2ff 100644 (file)
@@ -64,6 +64,7 @@ salomeinclude_HEADERS = \
        StdMeshers_CompositeSegment_1D.hxx \
        StdMeshers_UseExisting_1D2D.hxx \
        StdMeshers_QuadToTriaAdaptor.hxx \
+       StdMeshers_CompositeHexa_3D.hxx \
        SMESH_StdMeshers.hxx \
        StdMeshers_TrianglePreference.hxx
 
@@ -108,6 +109,7 @@ dist_libStdMeshers_la_SOURCES = \
        StdMeshers_CompositeSegment_1D.cxx \
        StdMeshers_UseExisting_1D2D.cxx \
        StdMeshers_QuadToTriaAdaptor.cxx \
+       StdMeshers_CompositeHexa_3D.cxx \
        StdMeshers_TrianglePreference.cxx
 
 
index 42acee19ef87647e07c4c15b2cd38d153a9b7920..8254219d2c21fb05ed471bae5ca3b112dd223365 100644 (file)
@@ -33,7 +33,6 @@
 #include "SMESH_Comment.hxx"
 #include "SMESH_ComputeError.hxx"
 #include "SMESH_Mesh.hxx"
-#include "SMESH_MeshEditor.hxx"
 #include "SMESH_MesherHelper.hxx"
 #include "SMESH_subMesh.hxx"
 
@@ -815,7 +814,7 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
     TIDSortedElemSet emptySet, avoidSet;
     avoidSet.insert( firstQuad );
     firstQuad = SMESH_MeshEditor::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
-    if ( firstQuad && !faceSubMesh->Contains( firstQuad )) {
+    while ( firstQuad && !faceSubMesh->Contains( firstQuad )) {
       avoidSet.insert( firstQuad );
       firstQuad = SMESH_MeshEditor::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
     }
index 60be202f2ca29783e3d31c35f1e336a993e02bb7..3320a4ee94809eb43fc31c7cbed4f4527c8ace49 100644 (file)
 //           Moved here from SMESH_Hexa_3D.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//  $Header$
 //
 #include "StdMeshers_Hexa_3D.hxx"
-#include "StdMeshers_Quadrangle_2D.hxx"
+#include "StdMeshers_CompositeHexa_3D.hxx"
 #include "StdMeshers_FaceSide.hxx"
 #include "StdMeshers_Penta_3D.hxx"
 #include "StdMeshers_Prism_3D.hxx"
+#include "StdMeshers_Quadrangle_2D.hxx"
 
 #include "SMESH_Gen.hxx"
 #include "SMESH_Mesh.hxx"
@@ -214,7 +214,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
   //Unexpect aCatch(SalomeException);
   MESSAGE("StdMeshers_Hexa_3D::Compute");
   SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
-  
+
   // 0.  - shape and face mesh verification
   // 0.1 - shape must be a solid (or a shell) with 6 faces
 
@@ -224,8 +224,13 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     ASSERT(aSubMesh);
     meshFaces.push_back(aSubMesh);
   }
-  if (meshFaces.size() != 6)
-    return error(COMPERR_BAD_SHAPE, TComm(meshFaces.size())<<" instead of 6 faces in a block");
+  if (meshFaces.size() != 6) {
+    //return error(COMPERR_BAD_SHAPE, TComm(meshFaces.size())<<" instead of 6 faces in a block");
+    static StdMeshers_CompositeHexa_3D compositeHexa(-10, 0, aMesh.GetGen());
+    if ( !compositeHexa.Compute( aMesh, aShape ))
+      return error( compositeHexa.GetComputeError() );
+    return true;
+  }
 
   // 0.2 - is each face meshed with Quadrangle_2D? (so, with a wire of 4 edges)