Merge branch 'optimize_occ_surf_mesh' into 'master'

only do optimization for occ surface mesh

See merge request jschoeberl/netgen!256
This commit is contained in:
Joachim Schöberl 2019-09-30 13:30:55 +00:00
commit af7d6fea48
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);
@ -909,13 +909,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");
@ -984,9 +987,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());
}
@ -1371,7 +1371,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
@ -1390,6 +1390,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();