mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 21:00:34 +05:00
timers
This commit is contained in:
parent
9ced2f561f
commit
7aa5c536a8
@ -521,7 +521,6 @@ namespace netgen
|
||||
int oldnp, DelaunayTet & startel, Point3d & pmin, Point3d & pmax)
|
||||
{
|
||||
static Timer t("Meshing3::Delaunay1"); RegionTimer reg(t);
|
||||
static Timer tloop("Meshing3::Delaunay1 loop");
|
||||
|
||||
Array<Point<3>> centers;
|
||||
Array<double> radi2;
|
||||
@ -632,7 +631,6 @@ namespace netgen
|
||||
for (PointIndex pi = mesh.Points().Begin(); pi < mesh.Points().End()-4; pi++)
|
||||
mixed[pi] = PointIndex ( (prim * pi) % np + PointIndex::BASE );
|
||||
|
||||
tloop.Start();
|
||||
for (PointIndex pi = mesh.Points().Begin(); pi < mesh.Points().End()-4; pi++)
|
||||
{
|
||||
if (pi % 1000 == 0)
|
||||
@ -661,7 +659,6 @@ namespace netgen
|
||||
connected, treesearch, freelist, list, insphere, closesphere);
|
||||
|
||||
}
|
||||
tloop.Stop();
|
||||
|
||||
for (int i = tempels.Size(); i >= 1; i--)
|
||||
if (tempels.Get(i)[0] <= 0)
|
||||
@ -775,14 +772,13 @@ namespace netgen
|
||||
|
||||
// for (i = mesh.GetNP() - 3; i <= mesh.GetNP(); i++)
|
||||
// tempmesh.AddLockedPoint (i);
|
||||
for (PointIndex pi = tempmesh.Points().Begin();
|
||||
pi < tempmesh.Points().End(); pi++)
|
||||
tempmesh.AddLockedPoint (pi);
|
||||
for (auto pi : tempmesh.Points().Range())
|
||||
tempmesh.AddLockedPoint (pi);
|
||||
|
||||
// tempmesh.PrintMemInfo(cout);
|
||||
// tempmesh.PrintMemInfo(cout);
|
||||
// tempmesh.Save ("tempmesh.vol");
|
||||
|
||||
for (int i = 1; i <= 2; i++)
|
||||
for (int i = 1; i <= 4; i++)
|
||||
{
|
||||
tempmesh.FindOpenElements ();
|
||||
|
||||
@ -793,14 +789,14 @@ namespace netgen
|
||||
|
||||
MeshOptimize3d meshopt(mp);
|
||||
// tempmesh.CalcSurfacesOfNode();
|
||||
meshopt.SwapImprove(tempmesh, OPT_CONFORM);
|
||||
meshopt.SwapImprove(tempmesh, OPT_CONFORM);
|
||||
}
|
||||
|
||||
MeshQuality3d (tempmesh);
|
||||
|
||||
tempels.SetSize(0);
|
||||
for (int i = 1; i <= tempmesh.GetNE(); i++)
|
||||
tempels.Append (tempmesh.VolumeElement(i));
|
||||
for (auto & el : tempmesh.VolumeElements())
|
||||
tempels.Append (el);
|
||||
}
|
||||
|
||||
|
||||
@ -1588,7 +1584,6 @@ namespace netgen
|
||||
mesh.FindOpenElements(domainnr);
|
||||
|
||||
mesh.Compress();
|
||||
|
||||
PopStatus ();
|
||||
}
|
||||
}
|
||||
|
@ -277,9 +277,9 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh,
|
||||
OPTIMIZEGOAL goal)
|
||||
{
|
||||
static Timer t("MeshOptimize3d::SplitImprove"); RegionTimer reg(t);
|
||||
static Timer tloop("MeshOptimize3d::SplitImprove loop");
|
||||
|
||||
double bad1, bad2, badmax, badlimit;
|
||||
|
||||
int cnt = 0;
|
||||
int np = mesh.GetNP();
|
||||
int ne = mesh.GetNE();
|
||||
@ -319,7 +319,6 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh,
|
||||
PrintMessage (5, "badmax = ", badmax);
|
||||
badlimit = 0.5 * badmax;
|
||||
|
||||
|
||||
boundp.Clear();
|
||||
for (auto & el : mesh.SurfaceElements())
|
||||
for (PointIndex pi : el.PNums())
|
||||
@ -350,6 +349,7 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh,
|
||||
}
|
||||
}
|
||||
|
||||
tloop.Start();
|
||||
for (ElementIndex ei : mesh.VolumeElements().Range())
|
||||
{
|
||||
Element & elem = mesh[ei];
|
||||
@ -543,7 +543,7 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tloop.Stop();
|
||||
|
||||
mesh.Compress();
|
||||
PrintMessage (5, cnt, " splits performed");
|
||||
@ -574,6 +574,7 @@ void MeshOptimize3d :: SwapImprove (Mesh & mesh, OPTIMIZEGOAL goal,
|
||||
const BitArray * working_elements)
|
||||
{
|
||||
static Timer t("MeshOptimize3d::SwapImprove"); RegionTimer reg(t);
|
||||
static Timer tloop("MeshOptimize3d::SwapImprove loop");
|
||||
|
||||
PointIndex pi3(0), pi4(0), pi5(0), pi6(0);
|
||||
int cnt = 0;
|
||||
@ -631,7 +632,8 @@ void MeshOptimize3d :: SwapImprove (Mesh & mesh, OPTIMIZEGOAL goal,
|
||||
|
||||
// INDEX_2_HASHTABLE<int> edgeused(2 * ne + 5);
|
||||
INDEX_2_CLOSED_HASHTABLE<int> edgeused(12 * ne + 5);
|
||||
|
||||
|
||||
tloop.Start();
|
||||
for (ElementIndex ei = 0; ei < ne; ei++)
|
||||
{
|
||||
if (multithread.terminate)
|
||||
@ -1405,7 +1407,7 @@ void MeshOptimize3d :: SwapImprove (Mesh & mesh, OPTIMIZEGOAL goal,
|
||||
*/
|
||||
}
|
||||
// (*mycout) << endl;
|
||||
|
||||
tloop.Stop();
|
||||
/*
|
||||
cout << "edgeused: ";
|
||||
edgeused.PrintMemInfo(cout);
|
||||
|
@ -33,7 +33,7 @@ namespace netgen
|
||||
T_POINTS points;
|
||||
|
||||
// The communicator for this mesh. Just a dummy if compiled without MPI.
|
||||
MPI_Comm comm;
|
||||
NgMPI_Comm comm;
|
||||
|
||||
/// line-segments at edges
|
||||
Array<Segment, 0, size_t> segments;
|
||||
@ -605,8 +605,8 @@ namespace netgen
|
||||
int AddEdgeDescriptor(const EdgeDescriptor & fd)
|
||||
{ edgedecoding.Append(fd); return edgedecoding.Size() - 1; }
|
||||
|
||||
MPI_Comm GetCommunicator() const { return this->comm; }
|
||||
void SetCommunicator(MPI_Comm acomm);
|
||||
auto GetCommunicator() const { return this->comm; }
|
||||
void SetCommunicator(NgMPI_Comm acomm);
|
||||
|
||||
///
|
||||
DLL_HEADER void SetMaterial (int domnr, const string & mat);
|
||||
|
@ -732,6 +732,8 @@ enum blocktyp { BLOCKUNDEF, BLOCKINNER, BLOCKBOUND, BLOCKOUTER };
|
||||
|
||||
void Meshing3 :: BlockFill (Mesh & mesh, double gh)
|
||||
{
|
||||
static Timer t("Mesing3::BlockFill"); RegionTimer reg(t);
|
||||
|
||||
PrintMessage (3, "Block-filling called (obsolete) ");
|
||||
|
||||
int i, j(0), i1, i2, i3, j1, j2, j3;
|
||||
@ -1096,10 +1098,12 @@ static int TestSameSide (const Point3d & p1, const Point3d & p2)
|
||||
void Meshing3 :: BlockFillLocalH (Mesh & mesh,
|
||||
const MeshingParameters & mp)
|
||||
{
|
||||
static Timer t("Mesing3::BlockFillLocalH"); RegionTimer reg(t);
|
||||
|
||||
double filldist = mp.filldist;
|
||||
|
||||
(*testout) << "blockfill local h" << endl;
|
||||
(*testout) << "rel filldist = " << filldist << endl;
|
||||
|
||||
// (*testout) << "blockfill local h" << endl;
|
||||
// (*testout) << "rel filldist = " << filldist << endl;
|
||||
PrintMessage (3, "blockfill local h");
|
||||
|
||||
|
||||
|
@ -63,8 +63,11 @@ int Meshing3 :: ApplyRules
|
||||
)
|
||||
|
||||
{
|
||||
NgProfiler::RegionTimer regtot(97);
|
||||
static Timer t("ruler3 - all"); RegionTimer reg(t);
|
||||
static Timer tstart("ruler3 - rule start");
|
||||
static Timer tloop("ruler3 - rule loop");
|
||||
|
||||
tstart.Start();
|
||||
float err, minerr, teterr, minteterr;
|
||||
char ok, found, hc;
|
||||
// vnetrule * rule;
|
||||
@ -76,19 +79,19 @@ int Meshing3 :: ApplyRules
|
||||
|
||||
|
||||
Array<int, PointIndex::BASE> pused; // point is already mapped, number of uses
|
||||
Array<char> fused; // face is already mapped
|
||||
Array<PointIndex> pmap; // map of reference point to local point
|
||||
Array<bool> pfixed; // point mapped by face-map
|
||||
Array<int> fmapi; // face in reference is mapped to face nr ...
|
||||
Array<int> fmapr; // face in reference is rotated to map
|
||||
Array<Point3d> transfreezone; // transformed free-zone
|
||||
ArrayMem<char,100> fused; // face is already mapped
|
||||
ArrayMem<PointIndex,100> pmap; // map of reference point to local point
|
||||
ArrayMem<bool,100> pfixed; // point mapped by face-map
|
||||
ArrayMem<int,100> fmapi; // face in reference is mapped to face nr ...
|
||||
ArrayMem<int,100> fmapr; // face in reference is rotated to map
|
||||
ArrayMem<Point3d,100> transfreezone; // transformed free-zone
|
||||
INDEX_2_CLOSED_HASHTABLE<int> ledges(100); // edges in local environment
|
||||
|
||||
Array<Point3d> tempnewpoints;
|
||||
ArrayMem<Point3d,100> tempnewpoints;
|
||||
Array<MiniElement2d> tempnewfaces;
|
||||
Array<int> tempdelfaces;
|
||||
ArrayMem<int,100> tempdelfaces;
|
||||
Array<Element> tempelements;
|
||||
Array<Box3d> triboxes; // bounding boxes of local faces
|
||||
ArrayMem<Box3d,100> triboxes; // bounding boxes of local faces
|
||||
|
||||
Array<int, PointIndex::BASE> pnearness;
|
||||
Array<int> fnearness;
|
||||
@ -221,7 +224,8 @@ int Meshing3 :: ApplyRules
|
||||
|
||||
|
||||
// check each rule:
|
||||
|
||||
tstart.Stop();
|
||||
tloop.Start();
|
||||
for (int ri = 1; ri <= rules.Size(); ri++)
|
||||
{
|
||||
int base = (lfaces[0].GetNP() == 3) ? 100 : 200;
|
||||
@ -1111,7 +1115,8 @@ int Meshing3 :: ApplyRules
|
||||
if (loktestmode)
|
||||
(*testout) << "end rule" << endl;
|
||||
}
|
||||
|
||||
tloop.Stop();
|
||||
|
||||
if (found)
|
||||
{
|
||||
/*
|
||||
|
@ -923,6 +923,8 @@ double CalcTotalBad (const Mesh::T_POINTS & points,
|
||||
const Mesh::T_VOLELEMENTS & elements,
|
||||
const MeshingParameters & mp)
|
||||
{
|
||||
static Timer t("CalcTotalBad"); RegionTimer reg(t);
|
||||
|
||||
double sum = 0;
|
||||
double elbad;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user