0020682: EDF 1222 SMESH: 3D mesh from a skin mesh and with volumic cells
* Pb with internal face (StudyFiss_bugNetgen3D.hdf) + static SMESH_ComputeErrorPtr readErrors(const std::vector< const SMDS_MeshNode* >& nodeVec); which is used to show links that lead to "some edges multiple times in surface mesh" error
This commit is contained in:
parent
4d1d960c7b
commit
e6e3bb2b55
@ -30,14 +30,15 @@
|
|||||||
#include "NETGENPlugin_Hypothesis_2D.hxx"
|
#include "NETGENPlugin_Hypothesis_2D.hxx"
|
||||||
#include "NETGENPlugin_SimpleHypothesis_3D.hxx"
|
#include "NETGENPlugin_SimpleHypothesis_3D.hxx"
|
||||||
|
|
||||||
#include <SMESH_Mesh.hxx>
|
|
||||||
#include <SMESH_Comment.hxx>
|
|
||||||
#include <SMESH_ComputeError.hxx>
|
|
||||||
#include <SMESH_subMesh.hxx>
|
|
||||||
#include <SMESH_MesherHelper.hxx>
|
|
||||||
#include <SMESHDS_Mesh.hxx>
|
|
||||||
#include <SMDS_MeshElement.hxx>
|
#include <SMDS_MeshElement.hxx>
|
||||||
#include <SMDS_MeshNode.hxx>
|
#include <SMDS_MeshNode.hxx>
|
||||||
|
#include <SMESHDS_Mesh.hxx>
|
||||||
|
#include <SMESH_Comment.hxx>
|
||||||
|
#include <SMESH_ComputeError.hxx>
|
||||||
|
#include <SMESH_File.hxx>
|
||||||
|
#include <SMESH_Mesh.hxx>
|
||||||
|
#include <SMESH_MesherHelper.hxx>
|
||||||
|
#include <SMESH_subMesh.hxx>
|
||||||
#include <utilities.h>
|
#include <utilities.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -1266,22 +1267,6 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
|
||||||
/*!
|
|
||||||
* \brief remove given file
|
|
||||||
*/
|
|
||||||
//================================================================================
|
|
||||||
|
|
||||||
static void removeFile( const TCollection_AsciiString& fileName )
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
OSD_File( fileName ).Remove();
|
|
||||||
}
|
|
||||||
catch ( Standard_ProgramError ) {
|
|
||||||
MESSAGE("Can't remove file: " << fileName.ToCString() << " ; file does not exist or permission denied");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Remove "test.out" and "problemfaces" files in current directory
|
* \brief Remove "test.out" and "problemfaces" files in current directory
|
||||||
@ -1290,9 +1275,42 @@ static void removeFile( const TCollection_AsciiString& fileName )
|
|||||||
|
|
||||||
void NETGENPlugin_Mesher::RemoveTmpFiles()
|
void NETGENPlugin_Mesher::RemoveTmpFiles()
|
||||||
{
|
{
|
||||||
removeFile("test.out");
|
SMESH_File("test.out").remove();
|
||||||
removeFile("problemfaces");
|
SMESH_File("problemfaces").remove();
|
||||||
removeFile("occmesh.rep");
|
SMESH_File("occmesh.rep").remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Read mesh entities preventing successful computation from "test.out" file
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
SMESH_ComputeErrorPtr
|
||||||
|
NETGENPlugin_Mesher::readErrors(const vector<const SMDS_MeshNode* >& nodeVec)
|
||||||
|
{
|
||||||
|
SMESH_ComputeErrorPtr err = SMESH_ComputeError::New
|
||||||
|
(COMPERR_BAD_INPUT_MESH, "some edges multiple times in surface mesh");
|
||||||
|
SMESH_File file("test.out");
|
||||||
|
vector<int> edge(2);
|
||||||
|
const char* badEdgeStr = " multiple times in surface mesh";
|
||||||
|
const int badEdgeStrLen = strlen( badEdgeStr );
|
||||||
|
while( !file.eof() )
|
||||||
|
{
|
||||||
|
if ( strncmp( file, "Edge ", 5 ) == 0 &&
|
||||||
|
file.getInts( edge ) &&
|
||||||
|
strncmp( file, badEdgeStr, badEdgeStrLen ) == 0 &&
|
||||||
|
edge[0] < nodeVec.size() && edge[1] < nodeVec.size())
|
||||||
|
{
|
||||||
|
err->myBadElements.push_back( new SMDS_MeshEdge( nodeVec[ edge[0]], nodeVec[ edge[1]] ));
|
||||||
|
file += badEdgeStrLen;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
++file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "NETGENPlugin_Defs.hxx"
|
#include "NETGENPlugin_Defs.hxx"
|
||||||
#include "StdMeshers_FaceSide.hxx"
|
#include "StdMeshers_FaceSide.hxx"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class SMESH_Mesh;
|
class SMESH_Mesh;
|
||||||
class SMESH_Comment;
|
class SMESH_Comment;
|
||||||
@ -98,6 +99,8 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Mesher
|
|||||||
|
|
||||||
static void RemoveTmpFiles();
|
static void RemoveTmpFiles();
|
||||||
|
|
||||||
|
static SMESH_ComputeErrorPtr readErrors(const std::vector< const SMDS_MeshNode* >& nodeVec);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SMESH_Mesh* _mesh;
|
SMESH_Mesh* _mesh;
|
||||||
const TopoDS_Shape& _shape;
|
const TopoDS_Shape& _shape;
|
||||||
|
Loading…
Reference in New Issue
Block a user