some timers

This commit is contained in:
Matthias Hochsteger 2021-06-16 10:49:31 +02:00
parent 8d51db278f
commit 62edae9b40
2 changed files with 16 additions and 9 deletions

View File

@ -235,9 +235,11 @@ namespace netgen
NgArray<int> & freelist, SphereList & list, NgArray<int> & freelist, SphereList & list,
IndexSet & insphere, IndexSet & closesphere, Array<DelaunayTet> & newels) IndexSet & insphere, IndexSet & closesphere, Array<DelaunayTet> & newels)
{ {
static Timer t("Meshing3::AddDelaunayPoint");// RegionTimer reg(t); static Timer t("Meshing3::AddDelaunayPoint", NoTracing, NoTiming); RegionTimer reg(t);
// static Timer tsearch("addpoint, search"); static Timer tsearch("addpoint, search", NoTracing, NoTiming);
// static Timer tinsert("addpoint, insert"); static Timer tfind("addpoint, find all tets", NoTracing, NoTiming);
static Timer tnewtets("addpoint, build new tets", NoTracing, NoTiming);
static Timer tinsert("addpoint, insert", NoTracing, NoTiming);
/* /*
find any sphere, such that newp is contained in find any sphere, such that newp is contained in
@ -277,7 +279,7 @@ namespace netgen
} }
*/ */
// tsearch.Start(); tsearch.Start();
double minquot{1e20}; double minquot{1e20};
tettree.GetFirstIntersecting tettree.GetFirstIntersecting
(newp, newp, [&](const auto pi) (newp, newp, [&](const auto pi)
@ -300,7 +302,7 @@ namespace netgen
} }
return false; return false;
} ); } );
// tsearch.Stop(); tsearch.Stop();
if (cfelind == -1) if (cfelind == -1)
{ {
@ -308,6 +310,7 @@ namespace netgen
return; return;
} }
tfind.Start();
/* /*
insphere: point is in sphere -> delete element insphere: point is in sphere -> delete element
closesphere: point is close to sphere -> considered for same center closesphere: point is close to sphere -> considered for same center
@ -399,6 +402,8 @@ namespace netgen
} }
} // while (changed) } // while (changed)
tfind.Stop();
tnewtets.Start();
newels.SetSize(0); newels.SetSize(0);
Element2d face(TRIG); Element2d face(TRIG);
@ -553,10 +558,11 @@ namespace netgen
tpmax.SetToMax (*pp[k]); tpmax.SetToMax (*pp[k]);
} }
tpmax = tpmax + 0.01 * (tpmax - tpmin); tpmax = tpmax + 0.01 * (tpmax - tpmin);
// tinsert.Start(); tinsert.Start();
tettree.Insert (tpmin, tpmax, nelind); tettree.Insert (tpmin, tpmax, nelind);
// tinsert.Stop(); tinsert.Stop();
} }
tnewtets.Stop();
} }

View File

@ -444,8 +444,8 @@ namespace netgen
void LocalH :: FindInnerBoxes (AdFront3 * adfront, void LocalH :: FindInnerBoxes (AdFront3 * adfront,
int (*testinner)(const Point3d & p1)) int (*testinner)(const Point3d & p1))
{ {
static int timer = NgProfiler::CreateTimer ("LocalH::FindInnerBoxes"); static Timer timer("LocalH::FindInnerBoxes");
NgProfiler::RegionTimer reg (timer); RegionTimer reg (timer);
int nf = adfront->GetNF(); int nf = adfront->GetNF();
@ -851,6 +851,7 @@ namespace netgen
void LocalH :: GetOuterPoints (NgArray<Point<3> > & points) void LocalH :: GetOuterPoints (NgArray<Point<3> > & points)
{ {
static Timer t("LocalH::GetOuterPoints"); RegionTimer rt(t);
for (int i = 0; i < boxes.Size(); i++) for (int i = 0; i < boxes.Size(); i++)
if (!boxes[i]->flags.isinner && !boxes[i]->flags.cutboundary) if (!boxes[i]->flags.isinner && !boxes[i]->flags.cutboundary)
points.Append ( boxes[i] -> PMid()); points.Append ( boxes[i] -> PMid());