]> SALOME platform Git repositories - plugins/netgenplugin.git/commitdiff
Salome HOME
0020693: EDF 1288 SMESH: Problem to recompute a mesh with a sub-mesh and a conversion...
authoreap <eap@opencascade.com>
Tue, 9 Mar 2010 07:17:04 +0000 (07:17 +0000)
committereap <eap@opencascade.com>
Tue, 9 Mar 2010 07:17:04 +0000 (07:17 +0000)
* Take into account all nodes on edge in case of mixed linear/quadratic mesh

src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx

index 5b2b2b83c0198027f73a4677313a8a21d1aa1a7e..eb00cc76b9b536381449e059ee22a5f7b86bad24 100644 (file)
@@ -187,7 +187,7 @@ static TError AddSegmentsToMesh(netgen::Mesh&                    ngMesh,
         (new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,
                                 SMESH_Comment("Unexpected nb of points on wire ") << iW
                                 << ": " << uvPtVec.size()<<" != "<<wire->NbPoints()));
-    nbNodes += wire->NbSegments();
+    nbNodes += wire->NbPoints(); 
   }
   nodeVec.reserve( nbNodes );
 
@@ -206,11 +206,12 @@ static TError AddSegmentsToMesh(netgen::Mesh&                    ngMesh,
   {
     StdMeshers_FaceSidePtr wire = wires[ iW ];
     const vector<UVPtStruct>& uvPtVec = wire->GetUVPtStruct();
+    const int nbSegments = wire->NbPoints() - 1;
 
     int firstPointID = ngMesh.GetNP() + 1;
     int edgeID = 1, posID = -2;
     bool isInternalEdge = false;
-    for ( int i = 0; i < wire->NbSegments(); ++i ) // loop on segments
+    for ( int i = 0; i < nbSegments; ++i ) // loop on segments
     {
       // Add the first point of a segment
       const SMDS_MeshNode * n = uvPtVec[ i ].node;