mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-11 16:49:16 +05:00
timers
This commit is contained in:
parent
8671e2423f
commit
17a457c1fc
@ -602,7 +602,9 @@ namespace netgen
|
||||
Array<DelaunayTet> & tempels,
|
||||
int oldnp, DelaunayTet & startel, Point3d & pmin, Point3d & pmax)
|
||||
{
|
||||
Array<Point<3> > centers;
|
||||
static Timer t("Meshing3::Delaunay1"); RegionTimer reg(t);
|
||||
|
||||
Array<Point<3>> centers;
|
||||
Array<double> radi2;
|
||||
|
||||
Point3d tpmin, tpmax;
|
||||
@ -783,6 +785,8 @@ namespace netgen
|
||||
|
||||
void Meshing3 :: Delaunay (Mesh & mesh, int domainnr, const MeshingParameters & mp)
|
||||
{
|
||||
static Timer t("Meshing3::Delaunay"); RegionTimer reg(t);
|
||||
|
||||
int np, ne;
|
||||
|
||||
PrintMessage (1, "Delaunay meshing");
|
||||
|
@ -22,6 +22,8 @@ namespace netgen
|
||||
void MeshOptimize3d :: CombineImprove (Mesh & mesh,
|
||||
OPTIMIZEGOAL goal)
|
||||
{
|
||||
static Timer t("MeshOptimize3d::CombineImprove"); RegionTimer reg(t);
|
||||
|
||||
int np = mesh.GetNP();
|
||||
int ne = mesh.GetNE();
|
||||
|
||||
@ -274,6 +276,8 @@ void MeshOptimize3d :: CombineImprove (Mesh & mesh,
|
||||
void MeshOptimize3d :: SplitImprove (Mesh & mesh,
|
||||
OPTIMIZEGOAL goal)
|
||||
{
|
||||
static Timer t("MeshOptimize3d::SplitImprove"); RegionTimer reg(t);
|
||||
|
||||
double bad1, bad2, badmax, badlimit;
|
||||
|
||||
int cnt = 0;
|
||||
@ -569,6 +573,8 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh,
|
||||
void MeshOptimize3d :: SwapImprove (Mesh & mesh, OPTIMIZEGOAL goal,
|
||||
const BitArray * working_elements)
|
||||
{
|
||||
static Timer t("MeshOptimize3d::SwapImprove"); RegionTimer reg(t);
|
||||
|
||||
PointIndex pi3(0), pi4(0), pi5(0), pi6(0);
|
||||
int cnt = 0;
|
||||
|
||||
@ -2303,6 +2309,8 @@ void MeshOptimize3d :: SwapImproveSurface (Mesh & mesh, OPTIMIZEGOAL goal,
|
||||
|
||||
void MeshOptimize3d :: SwapImprove2 (Mesh & mesh, OPTIMIZEGOAL goal)
|
||||
{
|
||||
static Timer t("MeshOptimize3d::SwapImprove2"); RegionTimer reg(t);
|
||||
|
||||
PointIndex pi1(0), pi2(0), pi3(0), pi4(0), pi5(0);
|
||||
Element el21(TET), el22(TET), el31(TET), el32(TET), el33(TET);
|
||||
|
||||
|
@ -221,7 +221,7 @@ namespace netgen
|
||||
DLL_HEADER PointIndex AddPoint (const Point3d & p, int layer = 1);
|
||||
DLL_HEADER PointIndex AddPoint (const Point3d & p, int layer, POINTTYPE type);
|
||||
|
||||
int GetNP () const { return points.Size(); }
|
||||
auto GetNP () const { return points.Size(); }
|
||||
|
||||
// [[deprecated("Use Point(PointIndex) instead of int !")]]
|
||||
MeshPoint & Point(int i) { return points.Elem(i); }
|
||||
@ -291,7 +291,7 @@ namespace netgen
|
||||
timestamp = NextTimeStamp();
|
||||
}
|
||||
|
||||
int GetNSE () const { return surfelements.Size(); }
|
||||
auto GetNSE () const { return surfelements.Size(); }
|
||||
|
||||
// [[deprecated("Use SurfaceElement(SurfaceElementIndex) instead of int !")]]
|
||||
Element2d & SurfaceElement(int i) { return surfelements.Elem(i); }
|
||||
@ -316,7 +316,7 @@ namespace netgen
|
||||
// write to pre-allocated container, thread-safe
|
||||
DLL_HEADER void SetVolumeElement (ElementIndex sei, const Element & el);
|
||||
|
||||
int GetNE () const { return volelements.Size(); }
|
||||
auto GetNE () const { return volelements.Size(); }
|
||||
|
||||
// [[deprecated("Use VolumeElement(ElementIndex) instead of int !")]]
|
||||
Element & VolumeElement(int i) { return volelements.Elem(i); }
|
||||
|
@ -14,6 +14,8 @@ namespace netgen
|
||||
// extern double teterrpow;
|
||||
MESHING3_RESULT MeshVolume (MeshingParameters & mp, Mesh& mesh3d)
|
||||
{
|
||||
static Timer t("MeshVolume"); RegionTimer reg(t);
|
||||
|
||||
int oldne;
|
||||
int meshed;
|
||||
|
||||
@ -639,6 +641,8 @@ namespace netgen
|
||||
Mesh & mesh3d)
|
||||
// const CSGeometry * geometry)
|
||||
{
|
||||
static Timer t("OptimizeVolume"); RegionTimer reg(t);
|
||||
|
||||
int i;
|
||||
|
||||
PrintMessage (1, "Volume Optimization");
|
||||
@ -698,6 +702,8 @@ namespace netgen
|
||||
|
||||
void RemoveIllegalElements (Mesh & mesh3d)
|
||||
{
|
||||
static Timer t("RemoveIllegalElements"); RegionTimer reg(t);
|
||||
|
||||
int it = 10;
|
||||
int nillegal, oldn;
|
||||
|
||||
|
@ -168,12 +168,17 @@ int Meshing3 :: AddConnectedPair (const INDEX_2 & apair)
|
||||
MESHING3_RESULT Meshing3 ::
|
||||
GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
|
||||
{
|
||||
static int meshing3_timer = NgProfiler::CreateTimer ("Meshing3::GenerateMesh");
|
||||
static int meshing3_timer_a = NgProfiler::CreateTimer ("Meshing3::GenerateMesh a");
|
||||
static int meshing3_timer_b = NgProfiler::CreateTimer ("Meshing3::GenerateMesh b");
|
||||
static int meshing3_timer_c = NgProfiler::CreateTimer ("Meshing3::GenerateMesh c");
|
||||
static int meshing3_timer_d = NgProfiler::CreateTimer ("Meshing3::GenerateMesh d");
|
||||
NgProfiler::RegionTimer reg (meshing3_timer);
|
||||
static Timer t("Meshing3::GenerateMesh"); RegionTimer reg(t);
|
||||
static Timer meshing3_timer_a("Meshing3::GenerateMesh a", 2);
|
||||
static Timer meshing3_timer_b("Meshing3::GenerateMesh b", 2);
|
||||
static Timer meshing3_timer_c("Meshing3::GenerateMesh c", 1);
|
||||
static Timer meshing3_timer_d("Meshing3::GenerateMesh d", 2);
|
||||
// static int meshing3_timer = NgProfiler::CreateTimer ("Meshing3::GenerateMesh");
|
||||
// static int meshing3_timer_a = NgProfiler::CreateTimer ("Meshing3::GenerateMesh a");
|
||||
// static int meshing3_timer_b = NgProfiler::CreateTimer ("Meshing3::GenerateMesh b");
|
||||
// static int meshing3_timer_c = NgProfiler::CreateTimer ("Meshing3::GenerateMesh c");
|
||||
// static int meshing3_timer_d = NgProfiler::CreateTimer ("Meshing3::GenerateMesh d");
|
||||
// NgProfiler::RegionTimer reg (meshing3_timer);
|
||||
|
||||
|
||||
Array<Point3d, PointIndex::BASE> locpoints; // local points
|
||||
@ -269,20 +274,16 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
|
||||
}
|
||||
|
||||
const MiniElement2d & bel = adfront->GetFace (baseelem);
|
||||
const Point3d & p1 = adfront->GetPoint (bel[0]);
|
||||
const Point3d & p2 = adfront->GetPoint (bel[1]);
|
||||
const Point3d & p3 = adfront->GetPoint (bel[2]);
|
||||
const Point<3> p1 = adfront->GetPoint (bel[0]);
|
||||
const Point<3> p2 = adfront->GetPoint (bel[1]);
|
||||
const Point<3> p3 = adfront->GetPoint (bel[2]);
|
||||
|
||||
|
||||
// (*testout) << endl << "base = " << bel << endl;
|
||||
|
||||
|
||||
Point3d pmid = Center (p1, p2, p3);
|
||||
Point<3> pmid = Center (p1, p2, p3);
|
||||
|
||||
double his = (Dist (p1, p2) + Dist(p1, p3) + Dist(p2, p3)) / 3;
|
||||
double hshould;
|
||||
|
||||
hshould = mesh.GetH (pmid);
|
||||
|
||||
double hshould = mesh.GetH (pmid);
|
||||
|
||||
if (adfront->GetFace (baseelem).GetNP() == 4)
|
||||
hshould = max2 (his, hshould);
|
||||
|
||||
@ -292,13 +293,13 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
|
||||
double hinner = hmax * (1 + stat.qualclass);
|
||||
double houter = hmax * (1 + 2 * stat.qualclass);
|
||||
|
||||
NgProfiler::StartTimer (meshing3_timer_a);
|
||||
meshing3_timer_a.Start();
|
||||
stat.qualclass =
|
||||
adfront -> GetLocals (baseelem, locpoints, locfaces,
|
||||
pindex, findex, connectedpairs,
|
||||
houter, hinner,
|
||||
locfacesplit);
|
||||
NgProfiler::StopTimer (meshing3_timer_a);
|
||||
meshing3_timer_a.Stop();
|
||||
|
||||
// (*testout) << "locfaces = " << endl << locfaces << endl;
|
||||
|
||||
@ -320,9 +321,6 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (testmode)
|
||||
{
|
||||
(*testout) << "baseelem = " << baseelem << " qualclass = " << stat.qualclass << endl;
|
||||
@ -479,7 +477,8 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
|
||||
(*testout) << endl;
|
||||
}
|
||||
|
||||
NgProfiler::StartTimer (meshing3_timer_c);
|
||||
// NgProfiler::StartTimer (meshing3_timer_c);
|
||||
meshing3_timer_c.Start();
|
||||
|
||||
found = ApplyRules (plainpoints, allowpoint,
|
||||
locfaces, locfacesplit, connectedpairs,
|
||||
@ -489,8 +488,8 @@ GenerateMesh (Mesh & mesh, const MeshingParameters & mp)
|
||||
if (found >= 0) impossible = 0;
|
||||
if (found < 0) found = 0;
|
||||
|
||||
|
||||
NgProfiler::StopTimer (meshing3_timer_c);
|
||||
meshing3_timer_c.Stop();
|
||||
// NgProfiler::StopTimer (meshing3_timer_c);
|
||||
|
||||
if (!found) loktestmode = 0;
|
||||
|
||||
|
@ -1353,6 +1353,8 @@ void Mesh :: ImproveMesh (const CSG eometry & geometry, OPTIMIZEGOAL goal)
|
||||
|
||||
void Mesh :: ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal)
|
||||
{
|
||||
static Timer t("Mesh::ImproveMesh"); RegionTimer reg(t);
|
||||
|
||||
int typ = 1;
|
||||
|
||||
(*testout) << "Improve Mesh" << "\n";
|
||||
|
Loading…
Reference in New Issue
Block a user