mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
more tracing and parallelization
This commit is contained in:
parent
dca5a01e04
commit
19ec4fc9ca
@ -1009,7 +1009,7 @@ namespace netgen
|
|||||||
ref.Bisect (*mesh, biopt);
|
ref.Bisect (*mesh, biopt);
|
||||||
|
|
||||||
(*tracer)("call updatetop", false);
|
(*tracer)("call updatetop", false);
|
||||||
mesh -> UpdateTopology(task_manager);
|
mesh -> UpdateTopology(task_manager, tracer);
|
||||||
(*tracer)("call updatetop", true);
|
(*tracer)("call updatetop", true);
|
||||||
mesh -> GetCurvedElements().SetIsHighOrder (false);
|
mesh -> GetCurvedElements().SetIsHighOrder (false);
|
||||||
}
|
}
|
||||||
|
@ -3346,13 +3346,15 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
//IdentifyCutEdges(mesh, cutedges);
|
//IdentifyCutEdges(mesh, cutedges);
|
||||||
|
|
||||||
|
(*opt.tracer)("mark elements", false);
|
||||||
|
|
||||||
hangingvol =
|
hangingvol =
|
||||||
MarkHangingTets (mtets, cutedges, opt.task_manager) +
|
MarkHangingTets (mtets, cutedges, opt.task_manager) +
|
||||||
MarkHangingPrisms (mprisms, cutedges) +
|
MarkHangingPrisms (mprisms, cutedges) +
|
||||||
MarkHangingIdentifications (mids, cutedges);
|
MarkHangingIdentifications (mids, cutedges);
|
||||||
|
|
||||||
|
(*opt.tracer)("mark elements", true);
|
||||||
|
|
||||||
size_t nsel = mtris.Size();
|
size_t nsel = mtris.Size();
|
||||||
NgProfiler::StartTimer (timer_bisecttrig);
|
NgProfiler::StartTimer (timer_bisecttrig);
|
||||||
@ -3625,6 +3627,8 @@ namespace netgen
|
|||||||
(*opt.tracer)("copy tets", false);
|
(*opt.tracer)("copy tets", false);
|
||||||
mesh.ClearVolumeElements();
|
mesh.ClearVolumeElements();
|
||||||
mesh.VolumeElements().SetAllocSize (mtets.Size()+mprisms.Size());
|
mesh.VolumeElements().SetAllocSize (mtets.Size()+mprisms.Size());
|
||||||
|
mesh.VolumeElements().SetSize(mtets.Size());
|
||||||
|
/*
|
||||||
for (int i = 1; i <= mtets.Size(); i++)
|
for (int i = 1; i <= mtets.Size(); i++)
|
||||||
{
|
{
|
||||||
Element el(TET);
|
Element el(TET);
|
||||||
@ -3634,6 +3638,22 @@ namespace netgen
|
|||||||
el.SetOrder (mtets.Get(i).order);
|
el.SetOrder (mtets.Get(i).order);
|
||||||
mesh.AddVolumeElement (el);
|
mesh.AddVolumeElement (el);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
ParallelForRange
|
||||||
|
(opt.task_manager, mtets.Size(), [&] (size_t begin, size_t end)
|
||||||
|
{
|
||||||
|
for (size_t i = begin; i < end; i++)
|
||||||
|
{
|
||||||
|
Element el(TET);
|
||||||
|
auto & tet = mtets[i];
|
||||||
|
el.SetIndex (tet.matindex);
|
||||||
|
el.SetOrder (tet.order);
|
||||||
|
for (int j = 0; j < 4; j++)
|
||||||
|
el[j] = tet.pnums[j];
|
||||||
|
mesh.SetVolumeElement (ElementIndex(i), el);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
(*opt.tracer)("copy tets", true);
|
(*opt.tracer)("copy tets", true);
|
||||||
|
|
||||||
for (int i = 1; i <= mprisms.Size(); i++)
|
for (int i = 1; i <= mprisms.Size(); i++)
|
||||||
|
@ -402,6 +402,19 @@ namespace netgen
|
|||||||
return ve;
|
return ve;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Mesh :: SetVolumeElement (ElementIndex ei, const Element & el)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
int maxn = el[0];
|
||||||
|
for (int i = 1; i < el.GetNP(); i++)
|
||||||
|
if (el[i] > maxn) maxn = el[i];
|
||||||
|
|
||||||
|
maxn += 1-PointIndex::BASE;
|
||||||
|
*/
|
||||||
|
|
||||||
|
volelements[ei] = el;
|
||||||
|
volelements.Last().flags.illegal_valid = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -307,6 +307,8 @@ namespace netgen
|
|||||||
DLL_HEADER void GetSurfaceElementsOfFace (int facenr, Array<SurfaceElementIndex> & sei) const;
|
DLL_HEADER void GetSurfaceElementsOfFace (int facenr, Array<SurfaceElementIndex> & sei) const;
|
||||||
|
|
||||||
DLL_HEADER ElementIndex AddVolumeElement (const Element & el);
|
DLL_HEADER ElementIndex AddVolumeElement (const Element & el);
|
||||||
|
// write to pre-allocated container, thread-safe
|
||||||
|
DLL_HEADER void SetVolumeElement (ElementIndex sei, const Element & el);
|
||||||
|
|
||||||
int GetNE () const { return volelements.Size(); }
|
int GetNE () const { return volelements.Size(); }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user