mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-12 00:59:16 +05:00
ParallelFor loops in setup of CombineImprove()
This commit is contained in:
parent
19c86a9f3d
commit
9fd4970614
@ -409,49 +409,36 @@ namespace netgen
|
||||
auto elementsonnode = mesh.CreatePoint2SurfaceElementTable(faceindex);
|
||||
Array<SurfaceElementIndex> hasonepi, hasbothpi;
|
||||
|
||||
int ntasks = ngcore::TaskManager::GetMaxThreads();
|
||||
Array<std::tuple<PointIndex, PointIndex>> edges;
|
||||
|
||||
BuildEdgeList( mesh, elementsonnode, edges );
|
||||
|
||||
Array<bool,PointIndex> fixed(np);
|
||||
ParallelFor( fixed.Range(), [&fixed] (auto i) NETGEN_LAMBDA_INLINE
|
||||
{ fixed[i] = false; });
|
||||
|
||||
ParallelFor( edges.Range(), [&] (auto i) NETGEN_LAMBDA_INLINE
|
||||
{
|
||||
auto [pi0, pi1] = edges[i];
|
||||
if (mesh.IsSegment (pi0, pi1))
|
||||
{
|
||||
fixed[pi0] = true;
|
||||
fixed[pi1] = true;
|
||||
}
|
||||
});
|
||||
|
||||
timerstart1.Stop();
|
||||
|
||||
/*
|
||||
for (SegmentIndex si = 0; si < mesh.GetNSeg(); si++)
|
||||
ParallelFor( mesh.LockedPoints().Range(), [&] (auto i) NETGEN_LAMBDA_INLINE
|
||||
{
|
||||
INDEX_2 i2(mesh[si][0], mesh[si][1]);
|
||||
fixed[i2.I1()] = true;
|
||||
fixed[i2.I2()] = true;
|
||||
}
|
||||
*/
|
||||
|
||||
for (SurfaceElementIndex sei : seia)
|
||||
{
|
||||
Element2d & sel = mesh[sei];
|
||||
for (int j = 0; j < sel.GetNP(); j++)
|
||||
{
|
||||
PointIndex pi1 = sel.PNumMod(j+2);
|
||||
PointIndex pi2 = sel.PNumMod(j+3);
|
||||
if (mesh.IsSegment (pi1, pi2))
|
||||
{
|
||||
fixed[pi1] = true;
|
||||
fixed[pi2] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
for(int i = 0; i < mesh.LockedPoints().Size(); i++)
|
||||
fixed[mesh.LockedPoints()[i]] = true;
|
||||
*/
|
||||
for (PointIndex pi : mesh.LockedPoints())
|
||||
fixed[pi] = true;
|
||||
});
|
||||
|
||||
|
||||
Array<Vec<3>,PointIndex> normals(np);
|
||||
|
||||
// for (PointIndex pi = mesh.Points().Begin(); pi < mesh.Points().End(); pi++)
|
||||
for (PointIndex pi : mesh.Points().Range())
|
||||
ParallelFor( mesh.Points().Range(), [&] (auto pi) NETGEN_LAMBDA_INLINE
|
||||
{
|
||||
if (elementsonnode[pi].Size())
|
||||
{
|
||||
@ -463,7 +450,7 @@ namespace netgen
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
timerstart.Stop();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user