IPAL53011: Order of sub-mesh in meshing process does't work

fix SALOME crash: resize occgeom.facemeshstatus in FillNgMesh()

+ cosmetic changes
This commit is contained in:
eap 2016-03-22 14:31:50 +03:00
parent 043ee5d5fe
commit 0b23f6ad83

View File

@ -266,8 +266,6 @@ void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp)
// create elements of second order
mparams.secondorder = hyp->GetSecondOrder() ? 1 : 0;
// quad-dominated surface meshing
// only triangles are allowed for volumic mesh (before realizing IMP 0021676)
//if (!_isVolume)
mparams.quad = hyp->GetQuadAllowed() ? 1 : 0;
_optimize = hyp->GetOptimize();
_fineness = hyp->GetFineness();
@ -288,16 +286,13 @@ void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp)
double val = (*it).second;
// --
GEOM::GEOM_Object_var aGeomObj;
TopoDS_Shape S = TopoDS_Shape();
SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.c_str() );
if ( !aSObj->_is_nil() ) {
CORBA::Object_var obj = aSObj->GetObject();
aGeomObj = GEOM::GEOM_Object::_narrow(obj);
aSObj->UnRegister();
}
if ( !aGeomObj->_is_nil() )
S = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
// --
TopoDS_Shape S = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
SetLocalSize(S, val);
}
}
@ -961,8 +956,10 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom,
// if second oreder is required, even already meshed faces must be passed to NETGEN
int fID = occgeom.fmap.Add( geomFace );
occgeom.facemeshstatus[ fID-1 ] = netgen::FACE_MESHED_OK;
while ( fID < faceNgID ) { // geomFace is already in occgeom.fmap, add a copy
while ( fID < faceNgID ) // geomFace is already in occgeom.fmap, add a copy
{
fID = occgeom.fmap.Add( BRepBuilderAPI_Copy( geomFace, /*copyGeom=*/false ));
if ( occgeom.facemeshstatus.Size() < fID ) occgeom.facemeshstatus.SetSize( fID );
occgeom.facemeshstatus[ fID-1 ] = netgen::FACE_MESHED_OK;
}
// Problem with the second order in a quadrangular mesh remains.
@ -970,7 +967,7 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom,
// by FillSMesh() (find "AddFaceDescriptor")
// 2) Temporary triangles generated by StdMeshers_QuadToTriaAdaptor
// are on faces where quadrangles were.
// Due to these 2 points, wrong geom faces are used while conversion to qudratic
// Due to these 2 points, wrong geom faces are used while conversion to quadratic
// of the mentioned above quadrangles and triangles
// Orient the face correctly in solidID1 (issue 0020206)
@ -2141,7 +2138,7 @@ int NETGENPlugin_Mesher::FillSMesh(const netgen::OCCGeometry& occgeo,
for (i = nbInitFac+1; i <= nbFac; ++i )
{
const netgen::Element2d& elem = ngMesh.SurfaceElement(i);
int aGeomFaceInd = elem.GetIndex();
const int aGeomFaceInd = elem.GetIndex();
TopoDS_Face aFace;
if (aGeomFaceInd > 0 && aGeomFaceInd <= occgeo.fmap.Extent())
aFace = TopoDS::Face(occgeo.fmap(aGeomFaceInd));