From: eap Date: Tue, 9 Feb 2010 11:21:29 +0000 (+0000) Subject: 0020682: EDF 1222 SMESH: 3D mesh from a skin mesh and with volumic cells X-Git-Tag: V5_1_4a1~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=388d346ae92bc43852dd46465e943c06e95e309f;p=plugins%2Fnetgenplugin.git 0020682: EDF 1222 SMESH: 3D mesh from a skin mesh and with volumic cells * Avoid creating nodes and tetras at place where volumic elements already exist --- diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx index 264998c..3612155 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx @@ -214,13 +214,11 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, return error( COMPERR_BAD_INPUT_MESH, "Null element encounters"); bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 )); if ( !isTraingle ) { - //return error( COMPERR_BAD_INPUT_MESH, - // SMESH_Comment("Not triangle element ")<GetID()); // using adaptor const list* faces = Adaptor.GetTriangles(elem); if(faces==0) { return error( COMPERR_BAD_INPUT_MESH, - SMESH_Comment("Not triangles in adaptor for element ")<GetID()); + SMESH_Comment("No triangles in adaptor for element ")<GetID()); } list::const_iterator itf = faces->begin(); for(; itf!=faces->end(); itf++ ) { @@ -471,13 +469,10 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, return error( COMPERR_BAD_INPUT_MESH, "Null element encounters"); bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 )); if ( !isTraingle ) { - //return error( COMPERR_BAD_INPUT_MESH, - // SMESH_Comment("Not triangle element ")<GetID()); // using adaptor const list* faces = Adaptor.GetTriangles(elem); if(faces==0) { - return error( COMPERR_BAD_INPUT_MESH, - SMESH_Comment("Not triangles in adaptor for element ")<GetID()); + continue; // Issue 0020682. There already can be 3d mesh } list::const_iterator itf = faces->begin(); for(; itf!=faces->end(); itf++ ) { @@ -537,7 +532,6 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, Netgen_point [ 2 ] = node->Z(); Ng_AddPoint(Netgen_mesh, Netgen_point); n_id->second = ++Netgen_NbOfNodes; // set netgen ID - } // set triangles @@ -554,7 +548,6 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh, Netgen_triangle[ i ] = nodeToNetgenID[ node ]; ++i; } - Ng_AddSurfaceElement(Netgen_mesh, NG_TRIG, Netgen_triangle); } @@ -708,9 +701,9 @@ bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh, double aVolume = G.Mass(); double tetrVol = 0.1179*ELen*ELen*ELen; double CoeffQuality = 0.9; - int nbVols = (int)aVolume/tetrVol/CoeffQuality; + int nbVols = int( aVolume/tetrVol/CoeffQuality ); int nb1d_f = (nbtri*3 + nbqua*4 - nb1d_e) / 2; - int nb1d_in = (int) ( nbVols*6 - nb1d_e - nb1d_f ) / 5; + int nb1d_in = (nbVols*6 - nb1d_e - nb1d_f ) / 5; std::vector aVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i