Salome HOME
23321: EDF 12916 - Meshing problem
authoreap <eap@opencascade.com>
Thu, 8 Sep 2016 16:01:15 +0000 (19:01 +0300)
committereap <eap@opencascade.com>
Thu, 8 Sep 2016 16:01:15 +0000 (19:01 +0300)
   StdMeshers_QuadToTriaAdaptor: solution for note (0021305) implemented but deactivated

StdMeshers_Projection_2d.cxx - morph deactivated for nb wires == 1

src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx
src/StdMeshers/StdMeshers_Projection_2D.cxx
src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx

index 1adb3d4f0178b5c68a78971b6725e57a43ae3fc3..cb9e5ae6f2aa451946bfd215712a7783f95e9a14 100644 (file)
@@ -302,7 +302,7 @@ SMESH_Swig::SMESH_Swig()
     }
   };
 
     }
   };
 
-  MESSAGE("Constructeur");
+  //MESSAGE("Constructeur");
 
   if(CORBA::is_nil(anORB))
     ProcessVoidEvent(new TEvent(anORB));
 
   if(CORBA::is_nil(anORB))
     ProcessVoidEvent(new TEvent(anORB));
@@ -402,7 +402,7 @@ SMESH_Swig::Init(int theStudyID)
     }
   };
 
     }
   };
 
-  MESSAGE("Init");
+  //MESSAGE("Init");
 
   ProcessVoidEvent(new TEvent(theStudyID,
                               myStudy,
 
   ProcessVoidEvent(new TEvent(theStudyID,
                               myStudy,
@@ -414,7 +414,7 @@ SMESH_Swig::Init(int theStudyID)
 //===============================================================
 SMESH_Swig::~SMESH_Swig()
 {
 //===============================================================
 SMESH_Swig::~SMESH_Swig()
 {
-  MESSAGE("Destructeur");
+  //MESSAGE("Destructeur");
 }
 
 
 }
 
 
index 8413288b8913ee001ac109dd0d310f5bb5a9a4b5..6ef4c57320b90fe5de63ab40d0d8d96109feea3c 100644 (file)
@@ -1273,6 +1273,7 @@ namespace {
               const TAssocTool::TNodeNodeMap& src2tgtNodes )
   {
     if ( srcWires.size() != tgtWires.size() ) return false;
               const TAssocTool::TNodeNodeMap& src2tgtNodes )
   {
     if ( srcWires.size() != tgtWires.size() ) return false;
+    if ( srcWires.size() == 1 ) return false; // tmp
 
     // count boundary points
     int iP = 1, nbP = 0;
 
     // count boundary points
     int iP = 1, nbP = 0;
index a03ed6a82c19a97058955131261d1797f3db6daa..9259d2e1da78a081c93fa908e9e84da2e1154cd5 100644 (file)
@@ -1012,6 +1012,8 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
       groupDS = 0;
   }
 
       groupDS = 0;
   }
 
+  const bool toFindVolumes = aMesh.NbVolumes() > 0;
+
   vector<const SMDS_MeshElement*> myPyramids;
   SMESH_MesherHelper helper(aMesh);
   helper.IsQuadraticSubMesh(aMesh.GetShapeToMesh());
   vector<const SMDS_MeshElement*> myPyramids;
   SMESH_MesherHelper helper(aMesh);
   helper.IsQuadraticSubMesh(aMesh.GetShapeToMesh());
@@ -1023,6 +1025,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
   if ( !myElemSearcher )
     myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
   SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
   if ( !myElemSearcher )
     myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
   SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
+  SMESHUtils::Deleter<SMESH_ElementSearcher>
+    volSearcher( SMESH_MeshAlgos::GetElementSearcher( *meshDS ));
+  vector< const SMDS_MeshElement* > suspectFaces, foundVolumes;
 
   TColgp_Array1OfPnt PN(1,5);
   TColgp_Array1OfVec VN(1,4);
 
   TColgp_Array1OfPnt PN(1,5);
   TColgp_Array1OfVec VN(1,4);
@@ -1042,7 +1047,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
     if ( what == NOT_QUAD )
       continue;
     if ( volumes[0] && volumes[1] )
     if ( what == NOT_QUAD )
       continue;
     if ( volumes[0] && volumes[1] )
-      continue; // face is shared by two volumes - no space for a pyramid
+      continue; // face is shared by two volumes - no room for a pyramid
 
     if ( what == DEGEN_QUAD )
     {
 
     if ( what == DEGEN_QUAD )
     {
@@ -1143,6 +1148,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
     }
 
     // Restrict pyramid height by intersection with other faces
     }
 
     // Restrict pyramid height by intersection with other faces
+
     gp_Vec tmpDir(PC,PCbest); tmpDir.Normalize();
     double tmp = PN(1).Distance(PN(3)) + PN(2).Distance(PN(4));
     // far points: in (PC, PCbest) direction and vice-versa
     gp_Vec tmpDir(PC,PCbest); tmpDir.Normalize();
     double tmp = PN(1).Distance(PN(3)) + PN(2).Distance(PN(4));
     // far points: in (PC, PCbest) direction and vice-versa
@@ -1154,8 +1160,24 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
     gp_Pnt intPnt     [2];
     int    intFaceInd [2] = { 0, 0 };
 
     gp_Pnt intPnt     [2];
     int    intFaceInd [2] = { 0, 0 };
 
+    if ( toFindVolumes && 0 ) // non-conformal mesh is not suitable for any mesher so far
+    {
+      // there are volumes in the mesh, in a non-conformal mesh an neighbor
+      // volume can be not found yet
+      for ( int isRev = 0; isRev < 2; ++isRev )
+      {
+        if ( volumes[isRev] ) continue;
+        gp_Pnt testPnt = PC.XYZ() + tmpDir.XYZ() * height * ( isRev ? -0.1: 0.1 );
+        foundVolumes.clear();
+        if ( volSearcher->FindElementsByPoint( testPnt, SMDSAbs_Volume, foundVolumes ))
+          volumes[isRev] = foundVolumes[0];
+      }
+      if ( volumes[0] && volumes[1] )
+        continue; // no room for a pyramid
+    }
+
     gp_Ax1 line( PC, tmpDir );
     gp_Ax1 line( PC, tmpDir );
-    vector< const SMDS_MeshElement* > suspectFaces;
+    suspectFaces.clear();
     searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectFaces);
 
     for ( size_t iF = 0; iF < suspectFaces.size(); ++iF )
     searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectFaces);
 
     for ( size_t iF = 0; iF < suspectFaces.size(); ++iF )