53057: NETGEN-1D2D3D issues "Ignored" warning for faces of a sub-mesh
This commit is contained in:
parent
2b188fad8a
commit
cb834de9a0
@ -83,6 +83,12 @@ namespace netgen {
|
|||||||
extern MeshingParameters mparam;
|
extern MeshingParameters mparam;
|
||||||
extern volatile multithreadt multithread;
|
extern volatile multithreadt multithread;
|
||||||
extern bool merge_solids;
|
extern bool merge_solids;
|
||||||
|
|
||||||
|
// values used for occgeo.facemeshstatus
|
||||||
|
enum EFaceMeshStatus { FACE_NOT_TREATED = 0,
|
||||||
|
FACE_FAILED = -1,
|
||||||
|
FACE_MESHED_OK = 1,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -594,6 +600,8 @@ void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo,
|
|||||||
rootSM.push_back( mesh.GetSubMesh( it.Value() ));
|
rootSM.push_back( mesh.GetSubMesh( it.Value() ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int totNbFaces = 0;
|
||||||
|
|
||||||
// add subshapes of empty submeshes
|
// add subshapes of empty submeshes
|
||||||
list< SMESH_subMesh* >::iterator rootIt = rootSM.begin(), rootEnd = rootSM.end();
|
list< SMESH_subMesh* >::iterator rootIt = rootSM.begin(), rootEnd = rootSM.end();
|
||||||
for ( ; rootIt != rootEnd; ++rootIt ) {
|
for ( ; rootIt != rootEnd; ++rootIt ) {
|
||||||
@ -605,8 +613,9 @@ void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo,
|
|||||||
TopExp::MapShapes(root->GetSubShape(), subShapes);
|
TopExp::MapShapes(root->GetSubShape(), subShapes);
|
||||||
while ( smIt->more() )
|
while ( smIt->more() )
|
||||||
{
|
{
|
||||||
SMESH_subMesh* sm = smIt->next();
|
SMESH_subMesh* sm = smIt->next();
|
||||||
TopoDS_Shape shape = sm->GetSubShape();
|
TopoDS_Shape shape = sm->GetSubShape();
|
||||||
|
totNbFaces += ( shape.ShapeType() == TopAbs_FACE );
|
||||||
if ( intern && intern->isShapeToPrecompute( shape ))
|
if ( intern && intern->isShapeToPrecompute( shape ))
|
||||||
continue;
|
continue;
|
||||||
if ( !meshedSM || sm->IsEmpty() )
|
if ( !meshedSM || sm->IsEmpty() )
|
||||||
@ -631,11 +640,11 @@ void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
occgeo.facemeshstatus.SetSize (occgeo.fmap.Extent());
|
occgeo.facemeshstatus.SetSize (totNbFaces);
|
||||||
occgeo.facemeshstatus = 0;
|
occgeo.facemeshstatus = 0;
|
||||||
occgeo.face_maxh_modified.SetSize(occgeo.fmap.Extent());
|
occgeo.face_maxh_modified.SetSize(totNbFaces);
|
||||||
occgeo.face_maxh_modified = 0;
|
occgeo.face_maxh_modified = 0;
|
||||||
occgeo.face_maxh.SetSize(occgeo.fmap.Extent());
|
occgeo.face_maxh.SetSize(totNbFaces);
|
||||||
occgeo.face_maxh = netgen::mparam.maxh;
|
occgeo.face_maxh = netgen::mparam.maxh;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -951,8 +960,11 @@ bool NETGENPlugin_Mesher::FillNgMesh(netgen::OCCGeometry& occgeom,
|
|||||||
|
|
||||||
// if second oreder is required, even already meshed faces must be passed to NETGEN
|
// if second oreder is required, even already meshed faces must be passed to NETGEN
|
||||||
int fID = occgeom.fmap.Add( geomFace );
|
int fID = occgeom.fmap.Add( geomFace );
|
||||||
while ( fID < faceNgID ) // geomFace is already in occgeom.fmap, add a copy
|
occgeom.facemeshstatus[ fID-1 ] = netgen::FACE_MESHED_OK;
|
||||||
|
while ( fID < faceNgID ) { // geomFace is already in occgeom.fmap, add a copy
|
||||||
fID = occgeom.fmap.Add( BRepBuilderAPI_Copy( geomFace, /*copyGeom=*/false ));
|
fID = occgeom.fmap.Add( BRepBuilderAPI_Copy( geomFace, /*copyGeom=*/false ));
|
||||||
|
occgeom.facemeshstatus[ fID-1 ] = netgen::FACE_MESHED_OK;
|
||||||
|
}
|
||||||
// Problem with the second order in a quadrangular mesh remains.
|
// Problem with the second order in a quadrangular mesh remains.
|
||||||
// 1) All quadrangles generated by NETGEN are moved to an inexistent face
|
// 1) All quadrangles generated by NETGEN are moved to an inexistent face
|
||||||
// by FillSMesh() (find "AddFaceDescriptor")
|
// by FillSMesh() (find "AddFaceDescriptor")
|
||||||
@ -2987,11 +2999,11 @@ bool NETGENPlugin_Mesher::Compute()
|
|||||||
bool pb2D = false, pb3D = false;
|
bool pb2D = false, pb3D = false;
|
||||||
for (int i = 1; i <= occgeo.fmap.Extent(); i++) {
|
for (int i = 1; i <= occgeo.fmap.Extent(); i++) {
|
||||||
int status = occgeo.facemeshstatus[i-1];
|
int status = occgeo.facemeshstatus[i-1];
|
||||||
if (status == 1 ) continue;
|
if (status == netgen::FACE_MESHED_OK ) continue;
|
||||||
if ( SMESH_subMesh* sm = _mesh->GetSubMeshContaining( occgeo.fmap( i ))) {
|
if ( SMESH_subMesh* sm = _mesh->GetSubMeshContaining( occgeo.fmap( i ))) {
|
||||||
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
|
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
|
||||||
if ( !smError || smError->IsOK() ) {
|
if ( !smError || smError->IsOK() ) {
|
||||||
if ( status == -1 )
|
if ( status == netgen::FACE_FAILED )
|
||||||
smError.reset( new SMESH_ComputeError( *error ));
|
smError.reset( new SMESH_ComputeError( *error ));
|
||||||
else
|
else
|
||||||
smError.reset( new SMESH_ComputeError( COMPERR_ALGO_FAILED, "Ignored" ));
|
smError.reset( new SMESH_ComputeError( COMPERR_ALGO_FAILED, "Ignored" ));
|
||||||
|
Loading…
Reference in New Issue
Block a user