modern timers, remove vector allocation

This commit is contained in:
Joachim Schöberl 2019-08-02 09:42:58 +02:00
parent ae45a7abf0
commit a73594b738
3 changed files with 13 additions and 13 deletions

View File

@ -277,10 +277,8 @@ namespace netgen
NgArray<INDEX> & lindex, NgArray<INDEX> & lindex,
double xh) double xh)
{ {
static int timer = NgProfiler::CreateTimer ("adfront2::GetLocals"); // static Timer timer("adfront2::GetLocals"); RegionTimer reg (timer);
NgProfiler::RegionTimer reg (timer);
int pstind; int pstind;
Point<3> midp, p0; Point<3> midp, p0;

View File

@ -362,7 +362,7 @@ namespace netgen
NgProfiler::StopTimer (ts3); NgProfiler::StopTimer (ts3);
static Timer tloop("surfacemeshing mainloop"); static Timer tloop("surfacemeshing mainloop");
static Timer tgetlocals("surfacemeshing getlocals"); // static Timer tgetlocals("surfacemeshing getlocals");
{ {
RegionTimer rloop(tloop); RegionTimer rloop(tloop);
while (!adfront.Empty() && !multithread.terminate) while (!adfront.Empty() && !multithread.terminate)
@ -441,10 +441,10 @@ namespace netgen
double hinner = (3 + qualclass) * max2 (his, hshould); double hinner = (3 + qualclass) * max2 (his, hshould);
tgetlocals.Start(); // tgetlocals.Start();
adfront.GetLocals (baselineindex, locpoints, mpgeominfo, loclines, adfront.GetLocals (baselineindex, locpoints, mpgeominfo, loclines,
pindex, lindex, 2*hinner); pindex, lindex, 2*hinner);
tgetlocals.Stop(); // tgetlocals.Stop();
NgProfiler::RegionTimer reg2 (timer2); NgProfiler::RegionTimer reg2 (timer2);
@ -790,8 +790,8 @@ namespace netgen
if (found) if (found)
{ {
static Timer t("ApplyRules"); // static Timer t("ApplyRules");
RegionTimer r(t); // RegionTimer r(t);
rulenr = ApplyRules (plainpoints, legalpoints, maxlegalpoint, rulenr = ApplyRules (plainpoints, legalpoints, maxlegalpoint,
loclines, maxlegalline, locelements, loclines, maxlegalline, locelements,
dellines, qualclass, mp); dellines, qualclass, mp);

View File

@ -54,9 +54,7 @@ namespace netgen
NgArray<INDEX> & dellines, int tolerance, NgArray<INDEX> & dellines, int tolerance,
const MeshingParameters & mp) const MeshingParameters & mp)
{ {
static int timer = NgProfiler::CreateTimer ("meshing2::ApplyRules"); // static Timer timer ("meshing2::ApplyRules"); RegionTimer reg (timer);
NgProfiler::RegionTimer reg (timer);
double maxerr = 0.5 + 0.3 * tolerance; double maxerr = 0.5 + 0.3 * tolerance;
@ -76,6 +74,9 @@ namespace netgen
NgArrayMem<int,100> tempdellines; NgArrayMem<int,100> tempdellines;
NgArrayMem<Element2d,100> tempelements; NgArrayMem<Element2d,100> tempelements;
// a least 2 * maximal number of old points in rules,
// what is actually 4 now
double oldumem[20];
elements.SetSize (0); elements.SetSize (0);
dellines.SetSize (0); dellines.SetSize (0);
@ -457,7 +458,8 @@ namespace netgen
if (!ok) continue; if (!ok) continue;
Vector oldu (2 * rule->GetNOldP()); // Vector oldu (2 * rule->GetNOldP());
Vector oldu (2 * rule->GetNOldP(), &oldumem[0]);
for (int i = 1; i <= rule->GetNOldP(); i++) for (int i = 1; i <= rule->GetNOldP(); i++)
{ {