Compare commits

...

1 Commits

Author SHA1 Message Date
asozinov
ca86285740 Porting netgen 2022-10-28 10:44:41 +03:00
2 changed files with 21 additions and 1 deletions

View File

@ -31,6 +31,7 @@
#include "NETGENPlugin_Hypothesis_2D.hxx" #include "NETGENPlugin_Hypothesis_2D.hxx"
#include "NETGENPlugin_SimpleHypothesis_3D.hxx" #include "NETGENPlugin_SimpleHypothesis_3D.hxx"
#include <BRepBndLib.hxx>
#include <SMDS_FaceOfNodes.hxx> #include <SMDS_FaceOfNodes.hxx>
#include <SMDS_LinearEdge.hxx> #include <SMDS_LinearEdge.hxx>
#include <SMDS_MeshElement.hxx> #include <SMDS_MeshElement.hxx>
@ -2900,7 +2901,7 @@ bool NETGENPlugin_Mesher::Compute()
// Generate the mesh // Generate the mesh
// ------------------------- // -------------------------
_ngMesh = NULL; //_ngMesh = NULL;
NETGENPlugin_ngMeshInfo initState; // it remembers size of ng mesh equal to size of Smesh NETGENPlugin_ngMeshInfo initState; // it remembers size of ng mesh equal to size of Smesh
SMESH_Comment comment; SMESH_Comment comment;
@ -4506,10 +4507,19 @@ int NETGENPlugin_NetgenLibWrapper::GenerateMesh( netgen::OCCGeometry& occgeo,
ngMesh->SetGeometry( shared_ptr<netgen::NetgenGeometry>( &occgeo, &NOOP_Deleter )); ngMesh->SetGeometry( shared_ptr<netgen::NetgenGeometry>( &occgeo, &NOOP_Deleter ));
ofstream MyFile("D:/plug.txt");
MyFile << "Before";
occgeo.BuildFMap();
MyFile << "\nAfter";
netgen::mparam.perfstepsstart = startWith; netgen::mparam.perfstepsstart = startWith;
netgen::mparam.perfstepsend = endWith; netgen::mparam.perfstepsend = endWith;
std::shared_ptr<netgen::Mesh> meshPtr( ngMesh, &NOOP_Deleter ); std::shared_ptr<netgen::Mesh> meshPtr( ngMesh, &NOOP_Deleter );
MyFile << "\nGenMeshStart";
err = occgeo.GenerateMesh( meshPtr, netgen::mparam ); err = occgeo.GenerateMesh( meshPtr, netgen::mparam );
MyFile << "\nGenMeshEnd";
MyFile << err;
#else #else
#ifdef NETGEN_V5 #ifdef NETGEN_V5

View File

@ -26,6 +26,8 @@
#include "NETGENPlugin_Mesher.hxx" #include "NETGENPlugin_Mesher.hxx"
#include "NETGENPlugin_Hypothesis_2D.hxx" #include "NETGENPlugin_Hypothesis_2D.hxx"
#include <BRepBndLib.hxx>
#include <TopExp.hxx>
#include <SMDS_MeshElement.hxx> #include <SMDS_MeshElement.hxx>
#include <SMDS_MeshNode.hxx> #include <SMDS_MeshNode.hxx>
#include <SMESHDS_Mesh.hxx> #include <SMESHDS_Mesh.hxx>
@ -226,6 +228,9 @@ bool NETGENPlugin_NETGEN_2D_ONLY::CheckHypothesis (SMESH_Mesh& aMesh,
bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh, bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape) const TopoDS_Shape& aShape)
{ {
ofstream File("D:/2D_ONLY.txt");
File << "Compute Start\t";
netgen::multithread.terminate = 0; netgen::multithread.terminate = 0;
//netgen::multithread.task = "Surface meshing"; //netgen::multithread.task = "Surface meshing";
@ -240,6 +245,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
netgen::Mesh * ngMeshes[2] = { (netgen::Mesh*) ngLib._ngMesh, & ngMeshNoLocSize }; netgen::Mesh * ngMeshes[2] = { (netgen::Mesh*) ngLib._ngMesh, & ngMeshNoLocSize };
netgen::OCCGeometry occgeoComm; netgen::OCCGeometry occgeoComm;
File << "1";
// min / max sizes are set as follows: // min / max sizes are set as follows:
// if ( _hypParameters ) // if ( _hypParameters )
// min and max are defined by the user // min and max are defined by the user
@ -290,6 +296,8 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
#endif #endif
occgeoComm.face_maxh = netgen::mparam.maxh; occgeoComm.face_maxh = netgen::mparam.maxh;
#ifdef NETGEN_V6 #ifdef NETGEN_V6
occgeoComm.BuildFMap();
netgen::OCCParameters occparam; netgen::OCCParameters occparam;
netgen::OCCSetLocalMeshSize( occgeoComm, *ngMeshes[0], netgen::mparam, occparam ); netgen::OCCSetLocalMeshSize( occgeoComm, *ngMeshes[0], netgen::mparam, occparam );
#else #else
@ -335,6 +343,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
// Loop on all FACEs // Loop on all FACEs
// ================== // ==================
File << "2";
vector< const SMDS_MeshNode* > nodeVec; vector< const SMDS_MeshNode* > nodeVec;
TopExp_Explorer fExp( aShape, TopAbs_FACE ); TopExp_Explorer fExp( aShape, TopAbs_FACE );
@ -597,6 +606,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
} // two attempts } // two attempts
} // loop on FACEs } // loop on FACEs
File << "\tCompute End\n";
return true; return true;
} }