only do optimization for occ surface mesh

This commit is contained in:
Christopher Lackner 2019-09-30 12:02:08 +02:00
parent 656b0e0539
commit 5eb2ab470e
4 changed files with 26 additions and 13 deletions

View File

@ -601,7 +601,7 @@ namespace netgen
void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh, int perfstepsend,
void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh,
MeshingParameters & mparam)
{
static Timer t("OCCMeshSurface"); RegionTimer r(t);
@ -906,13 +906,16 @@ namespace netgen
// problemfile << "OK" << endl << endl;
// problemfile.close();
}
for (int i = 0; i < mesh.GetNFD(); i++)
mesh.SetBCName (i, mesh.GetFaceDescriptor(i+1).GetBCName());
multithread.task = savetask;
}
if (multithread.terminate || perfstepsend < MESHCONST_OPTSURFACE)
return;
void OCCOptimizeSurface(OCCGeometry & geom, Mesh & mesh,
MeshingParameters & mparam)
{
const char * savetask = multithread.task;
multithread.task = "Optimizing surface";
static Timer timer_opt2d("Optimization 2D");
@ -981,9 +984,6 @@ namespace netgen
timer_opt2d.Stop();
multithread.task = savetask;
for (int i = 0; i < mesh.GetNFD(); i++)
mesh.SetBCName (i, mesh.GetFaceDescriptor(i+1).GetBCName());
}
@ -1368,7 +1368,7 @@ namespace netgen
if (mparam.perfstepsstart <= MESHCONST_MESHSURFACE)
{
OCCMeshSurface (geom, *mesh, mparam.perfstepsend, mparam);
OCCMeshSurface (geom, *mesh, mparam);
if (multithread.terminate) return TCL_OK;
#ifdef LOG_STREAM
@ -1387,6 +1387,14 @@ namespace netgen
mesh->CalcSurfacesOfNode();
}
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHSURFACE)
return TCL_OK;
if (mparam.perfstepsstart <= MESHCONST_OPTSURFACE)
{
OCCOptimizeSurface(geom, *mesh, mparam);
}
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_OPTSURFACE)
return TCL_OK;

View File

@ -441,7 +441,9 @@ namespace netgen
DLL_HEADER extern void OCCSetLocalMeshSize(OCCGeometry & geom, Mesh & mesh, const MeshingParameters & mparam,
const OCCParameters& occparam);
DLL_HEADER extern void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh, int perfstepsend, MeshingParameters & mparam);
DLL_HEADER extern void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh, MeshingParameters & mparam);
DLL_HEADER extern void OCCOptimizeSurface (OCCGeometry & geom, Mesh & mesh, MeshingParameters & mparam);
DLL_HEADER extern void OCCFindEdges (OCCGeometry & geom, Mesh & mesh, const MeshingParameters & mparam);
}

View File

@ -1378,6 +1378,8 @@ namespace netgen
}
else if (mesh)
{
if(perfstepsstart > 1 && perfstepsstart < 5)
throw Exception("Need geometry for surface mesh operations!");
MeshVolume(mparam, *mesh);
OptimizeVolume(mparam, *mesh);
return 0;

View File

@ -926,7 +926,8 @@ namespace nglib
perfstepsend = MESHCONST_OPTSURFACE;
}
OCCMeshSurface(*occgeom, *me, perfstepsend, mparam);
OCCMeshSurface(*occgeom, *me, mparam);
OCCOptimizeSurface(*occgeom, *me, mparam);
me->CalcSurfacesOfNode();