Salome HOME
PAL16229 (Issue in order to mesh with Hexahedron algorithms)
authoreap <eap@opencascade.com>
Wed, 8 Aug 2007 13:29:22 +0000 (13:29 +0000)
committereap <eap@opencascade.com>
Wed, 8 Aug 2007 13:29:22 +0000 (13:29 +0000)
     do not check shape topology in CheckHypothesis()

src/StdMeshers/StdMeshers_Hexa_3D.cxx
src/StdMeshers/StdMeshers_Prism_3D.cxx
src/StdMeshers/StdMeshers_Projection_3D.cxx
src/StdMeshers/StdMeshers_RadialPrism_3D.cxx

index c5a57cdba064c5087c9fa76945fd0c9d65234920..d1567ae0852aad64a8450b6cc68077878e719f15 100644 (file)
@@ -118,6 +118,7 @@ bool StdMeshers_Hexa_3D::CheckHypothesis
                           SMESH_Hypothesis::Hypothesis_Status& aStatus)
 {
   // check nb of faces in the shape
+/*  PAL16229
   aStatus = SMESH_Hypothesis::HYP_BAD_GEOMETRY;
   int nbFaces = 0;
   for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next())
@@ -125,7 +126,7 @@ bool StdMeshers_Hexa_3D::CheckHypothesis
       break;
   if ( nbFaces != 6 )
     return false;
-
+*/
   aStatus = SMESH_Hypothesis::HYP_OK;
   return true;
 }
@@ -193,7 +194,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     meshFaces.push_back(aSubMesh);
   }
   if (meshFaces.size() != 6)
-    return error(COMPERR_BAD_SHAPE, TComm(meshFaces.size())<<" instead of 6 faces in block");
+    return error(COMPERR_BAD_SHAPE, TComm(meshFaces.size())<<" instead of 6 faces in block");
 
   // 0.2 - is each face meshed with Quadrangle_2D? (so, with a wire of 4 edges)
 
index 267f0033f1c21f22ea527f2bae4171bbd0944347..6d28721e3246bbfd1dd45bb366f8a4ebca28a134 100644 (file)
@@ -185,7 +185,7 @@ bool StdMeshers_Prism_3D::CheckHypothesis(SMESH_Mesh&                          a
                                           SMESH_Hypothesis::Hypothesis_Status& aStatus)
 {
   // Check shape geometry
-
+/*  PAL16229
   aStatus = SMESH_Hypothesis::HYP_BAD_GEOMETRY;
 
   // find not quadrangle faces
@@ -216,7 +216,7 @@ bool StdMeshers_Prism_3D::CheckHypothesis(SMESH_Mesh&                          a
     if ( nbFace != nbEdge + 2 )
       RETURN_BAD_RESULT("Bad nb of faces: " << nbFace << " but must be " << nbEdge + 2);
   }
-
+*/
   // no hypothesis
   aStatus = SMESH_Hypothesis::HYP_OK;
   return true;
@@ -553,8 +553,8 @@ bool StdMeshers_Prism_3D::assocOrProjBottom2Top()
         paramHint = prevTNode.GetParams();
       if ( !myBlock.ComputeParameters( bN.GetCoords(), bN.ChangeParams(),
                                        ID_BOT_FACE, paramHint ))
-        return error(TCom("Can't compute normalized parameters ")
-                     << "for node " << botNode->GetID() << " on the face #"<< botSM->GetId() );
+        return error(TCom("Can't compute normalized parameters for node ")
+                     << botNode->GetID() << " on the face #"<< botSM->GetId() );
       prevTNode = bN;
     }
     // create node column
@@ -608,8 +608,8 @@ bool StdMeshers_Prism_3D::projectBottomToTop()
       paramHint = prevTNode.GetParams();
     if ( !myBlock.ComputeParameters( bN.GetCoords(), bN.ChangeParams(),
                                      ID_BOT_FACE, paramHint ))
-      return error(TCom("Can't compute normalized parameters ")
-                   << "for node " << botNode->GetID() << " on the face #"<< botSM->GetId() );
+      return error(TCom("Can't compute normalized parameters for node ")
+                   << botNode->GetID() << " on the face #"<< botSM->GetId() );
     prevTNode = bN;
     // compute top node coords
     gp_XYZ topXYZ; gp_XY topUV;
@@ -875,11 +875,11 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper,
   // detect bad cases
   if ( nbNotQuad > 0 && nbNotQuad != 2 )
     return error(COMPERR_BAD_SHAPE,
-                 TCom("More than 2 not quadrilateral faces ")
+                 TCom("More than 2 not quadrilateral faces: ")
                  <<nbNotQuad);
   if ( nbNotQuadMeshed > 2 )
     return error(COMPERR_BAD_INPUT_MESH,
-                 TCom("More than 2 faces meshed with not quadrangle elements ")
+                 TCom("More than 2 faces with not quadrangle elements: ")
                  <<nbNotQuadMeshed);
 
   // get found submeshes
index f634ecf2b5331c71872a433ccda0133863360866..4a3d9a63070b61c2662bd4aacfcfce09efa7a199 100644 (file)
@@ -92,6 +92,7 @@ bool StdMeshers_Projection_3D::CheckHypothesis(SMESH_Mesh&
                                                SMESH_Hypothesis::Hypothesis_Status& aStatus)
 {
   // check aShape that must be a 6 faces block
+/*  PAL16229
   if ( TAssocTool::Count( aShape, TopAbs_SHELL, 1 ) != 1 ||
        TAssocTool::Count( aShape, TopAbs_FACE , 1 ) != 6 ||
        TAssocTool::Count( aShape, TopAbs_EDGE , 1 ) != 12 ||
@@ -100,7 +101,7 @@ bool StdMeshers_Projection_3D::CheckHypothesis(SMESH_Mesh&
     aStatus = HYP_BAD_GEOMETRY;
     return false;
   }
-
+*/
   list <const SMESHDS_Hypothesis * >::const_iterator itl;
 
   const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
@@ -206,14 +207,24 @@ bool StdMeshers_Projection_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aS
     srcShell = TopoDS::Shell( exp.Current() );
   if ( nbShell != 1 )
     return error(COMPERR_BAD_SHAPE,
-                 SMESH_Comment("Shape must have 1 shell but not") << nbShell);
+                 SMESH_Comment("Source shape must have 1 shell but not ") << nbShell);
 
   exp.Init( aShape, TopAbs_SHELL );
   for ( nbShell = 0; exp.More(); exp.Next(), ++nbShell )
     tgtShell = TopoDS::Shell( exp.Current() );
   if ( nbShell != 1 )
     return error(COMPERR_BAD_SHAPE,
-                 SMESH_Comment("Shape must have 1 shell but not") << nbShell);
+                 SMESH_Comment("Target shape must have 1 shell but not ") << nbShell);
+
+  // Check that shapes are blocks
+  if ( TAssocTool::Count( tgtShell, TopAbs_FACE , 1 ) != 6 ||
+       TAssocTool::Count( tgtShell, TopAbs_EDGE , 1 ) != 12 ||
+       TAssocTool::Count( tgtShell, TopAbs_WIRE , 1 ) != 6 )
+    return error(COMPERR_BAD_SHAPE, "Target shape is not a block");
+  if ( TAssocTool::Count( srcShell, TopAbs_FACE , 1 ) != 6 ||
+       TAssocTool::Count( srcShell, TopAbs_EDGE , 1 ) != 12 ||
+       TAssocTool::Count( srcShell, TopAbs_WIRE , 1 ) != 6 )
+    return error(COMPERR_BAD_SHAPE, "Source shape is not a block");
 
   // Assure that mesh on a source shape is computed
 
index eab107c7688dc96b1e0e9cc2400d88e66eee8101..128b32077354caca976777bf214dc0ac52f87489 100644 (file)
@@ -98,13 +98,14 @@ bool StdMeshers_RadialPrism_3D::CheckHypothesis(SMESH_Mesh&
                                                 SMESH_Hypothesis::Hypothesis_Status& aStatus)
 {
   // check aShape that must have 2 shells
+/*  PAL16229
   if ( TAssocTool::Count( aShape, TopAbs_SOLID, 0 ) != 1 ||
        TAssocTool::Count( aShape, TopAbs_SHELL, 0 ) != 2 )
   {
     aStatus = HYP_BAD_GEOMETRY;
     return false;
   }
-
+*/
   myNbLayerHypo = 0;
   myDistributionHypo = 0;
 
@@ -167,7 +168,7 @@ bool StdMeshers_RadialPrism_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& a
     if ( !outerShell.IsSame( It.Value() ))
       innerShell = It.Value();
   if ( nbShells != 2 )
-    return error(COMPERR_BAD_SHAPE, SMESH_Comment("Must be 2 shells but not")<<nbShells);
+    return error(COMPERR_BAD_SHAPE, SMESH_Comment("Must be 2 shells but not ")<<nbShells);
 
   // ----------------------------------
   // Associate subshapes of the shells
@@ -328,8 +329,8 @@ public:
     TopoDS_Edge edge = BRepBuilderAPI_MakeEdge( pIn, pOut );
     SMESH_Hypothesis::Hypothesis_Status aStatus;
     if ( !StdMeshers_Regular_1D::CheckHypothesis( aMesh, edge, aStatus ))
-      return error( "StdMeshers_Regular_1D::CheckHypothesis() failed"
-                   "with LayerDistribution hypothesis");
+      return error( "StdMeshers_Regular_1D::CheckHypothesis() failed "
+                    "with LayerDistribution hypothesis");
 
     BRepAdaptor_Curve C3D(edge);
     double f = C3D.FirstParameter(), l = C3D.LastParameter();