0022401]: [CEA 992] Regression on SMESH using NETGEN 2D

Make two attempts: with and w/o MESHCONST_ANALYSE step
This commit is contained in:
eap 2013-11-19 10:30:40 +00:00
parent 4280b9f4db
commit ffc352d7cc

View File

@ -263,18 +263,27 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
// Make input netgen mesh
// -------------------------
// MESHCONST_ANALYSE step may lead to a failure, so we make an attempt
// w/o MESHCONST_ANALYSE at the second loop
int err = 1;
for ( int iLoop = 0; iLoop < 2; iLoop++ )
{
bool isMESHCONST_ANALYSE = false;
InitComputeError();
NETGENPlugin_NetgenLibWrapper ngLib;
netgen::Mesh * ngMesh = (netgen::Mesh*) ngLib._ngMesh;
ngLib._isComputeOk = false;
#ifndef NETGEN_V5
char *optstr = 0;
#endif
int startWith = MESHCONST_ANALYSE;
int endWith = MESHCONST_ANALYSE;
int err = 1;
if ( !_hypLengthFromEdges && !_hypMaxElementArea )
if ( !_hypLengthFromEdges && !_hypMaxElementArea && !iLoop == 1 )
{
isMESHCONST_ANALYSE = true;
#ifdef NETGEN_V5
err = netgen::OCCGenerateMesh(occgeo, ngMesh, netgen::mparam, startWith, endWith);
#else
@ -347,12 +356,16 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
if ( ex.GetMessageString() && strlen( ex.GetMessageString() ))
str << ": " << ex.GetMessageString();
error(str);
err = 1;
}
catch (...) {
SMESH_Comment str("Exception in netgen::OCCGenerateMesh()");
str << " at " << netgen::multithread.task;
error(str);
err = 1;
}
if ( err && isMESHCONST_ANALYSE )
continue;
// ----------------------------------------------------
// Fill the SMESHDS with the generated nodes and faces
@ -406,6 +419,10 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
}
ngLib._isComputeOk = !err;
break;
} // two attempts
return !err;
}