Updated for NPAL15716.
This commit is contained in:
parent
3dcb2645a2
commit
0a178ce702
@ -38,6 +38,7 @@
|
|||||||
#include "SMESH_Gen.hxx"
|
#include "SMESH_Gen.hxx"
|
||||||
#include "SMESH_Mesh.hxx"
|
#include "SMESH_Mesh.hxx"
|
||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
|
#include "StdMeshers_QuadToTriaAdaptor.hxx"
|
||||||
|
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
@ -179,6 +180,9 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
|
|||||||
map< int, int* >::iterator shId_ngId;
|
map< int, int* >::iterator shId_ngId;
|
||||||
list< int > degenNgIds;
|
list< int > degenNgIds;
|
||||||
|
|
||||||
|
StdMeshers_QuadToTriaAdaptor Adaptor;
|
||||||
|
Adaptor.Compute(aMesh,aShape);
|
||||||
|
|
||||||
for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next())
|
for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next())
|
||||||
{
|
{
|
||||||
const TopoDS_Shape& aShapeFace = exp.Current();
|
const TopoDS_Shape& aShapeFace = exp.Current();
|
||||||
@ -195,9 +199,31 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
|
|||||||
if ( !elem )
|
if ( !elem )
|
||||||
return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
|
return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
|
||||||
bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
|
bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
|
||||||
if ( !isTraingle )
|
if ( !isTraingle ) {
|
||||||
|
//return error( COMPERR_BAD_INPUT_MESH,
|
||||||
|
// SMESH_Comment("Not triangle element ")<<elem->GetID());
|
||||||
|
// using adaptor
|
||||||
|
std::list<const SMDS_FaceOfNodes*> faces = Adaptor.GetTriangles(elem);
|
||||||
|
if(faces.size()==0) {
|
||||||
return error( COMPERR_BAD_INPUT_MESH,
|
return error( COMPERR_BAD_INPUT_MESH,
|
||||||
SMESH_Comment("Not triangle element ")<<elem->GetID());
|
SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID());
|
||||||
|
}
|
||||||
|
std::list<const SMDS_FaceOfNodes*>::iterator itf = faces.begin();
|
||||||
|
for(; itf!=faces.end(); itf++ ) {
|
||||||
|
triangles.push_back( (*itf) );
|
||||||
|
isReversed.push_back( isRev );
|
||||||
|
// put triange's nodes to nodeToNetgenID map
|
||||||
|
SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator();
|
||||||
|
while ( triangleNodesIt->more() ) {
|
||||||
|
const SMDS_MeshNode * node =
|
||||||
|
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
|
||||||
|
if(myTool->IsMedium(node))
|
||||||
|
continue;
|
||||||
|
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
// keep a triangle
|
// keep a triangle
|
||||||
triangles.push_back( elem );
|
triangles.push_back( elem );
|
||||||
isReversed.push_back( isRev );
|
isReversed.push_back( isRev );
|
||||||
@ -210,6 +236,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
|
|||||||
continue;
|
continue;
|
||||||
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
|
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
// check if a trainge is degenerated
|
// check if a trainge is degenerated
|
||||||
areaControl.GetPoints( elem, nodesCoords );
|
areaControl.GetPoints( elem, nodesCoords );
|
||||||
@ -413,19 +440,40 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
|
|||||||
else if (MeshType == SMESH_MesherHelper::QUADRATIC)
|
else if (MeshType == SMESH_MesherHelper::QUADRATIC)
|
||||||
_quadraticMesh = true;
|
_quadraticMesh = true;
|
||||||
|
|
||||||
SMDS_FaceIteratorPtr iteratorFace = MeshDS->facesIterator();
|
StdMeshers_QuadToTriaAdaptor Adaptor;
|
||||||
|
Adaptor.Compute(aMesh);
|
||||||
|
|
||||||
while(iteratorFace->more())
|
SMDS_FaceIteratorPtr iteratorFace = MeshDS->facesIterator();
|
||||||
{
|
while(iteratorFace->more()) {
|
||||||
// check element
|
// check element
|
||||||
const SMDS_MeshElement* elem = iteratorFace->next();
|
const SMDS_MeshElement* elem = iteratorFace->next();
|
||||||
if ( !elem )
|
if ( !elem )
|
||||||
return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
|
return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
|
||||||
bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
|
bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
|
||||||
if ( !isTraingle )
|
if ( !isTraingle ) {
|
||||||
|
//return error( COMPERR_BAD_INPUT_MESH,
|
||||||
|
// SMESH_Comment("Not triangle element ")<<elem->GetID());
|
||||||
|
// using adaptor
|
||||||
|
std::list<const SMDS_FaceOfNodes*> faces = Adaptor.GetTriangles(elem);
|
||||||
|
if(faces.size()==0) {
|
||||||
return error( COMPERR_BAD_INPUT_MESH,
|
return error( COMPERR_BAD_INPUT_MESH,
|
||||||
SMESH_Comment("Not triangle element ")<<elem->GetID());
|
SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID());
|
||||||
|
}
|
||||||
|
std::list<const SMDS_FaceOfNodes*>::iterator itf = faces.begin();
|
||||||
|
for(; itf!=faces.end(); itf++ ) {
|
||||||
|
triangles.push_back( (*itf) );
|
||||||
|
// put triange's nodes to nodeToNetgenID map
|
||||||
|
SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator();
|
||||||
|
while ( triangleNodesIt->more() ) {
|
||||||
|
const SMDS_MeshNode * node =
|
||||||
|
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
|
||||||
|
if(aHelper->IsMedium(node))
|
||||||
|
continue;
|
||||||
|
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
// keep a triangle
|
// keep a triangle
|
||||||
triangles.push_back( elem );
|
triangles.push_back( elem );
|
||||||
// put elem nodes to nodeToNetgenID map
|
// put elem nodes to nodeToNetgenID map
|
||||||
@ -435,10 +483,10 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
|
|||||||
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
|
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
|
||||||
if(aHelper->IsMedium(node))
|
if(aHelper->IsMedium(node))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
|
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
// Feed the Netgen with surface mesh
|
// Feed the Netgen with surface mesh
|
||||||
|
Loading…
Reference in New Issue
Block a user