Commit 5befddd1 authored by Praetorius, Simon's avatar Praetorius, Simon

make parallelIndexSet a real set

parent 3f65bf6c
...@@ -30,6 +30,7 @@ void buildParallelIndexSet(Basis const& basis, PIS& pis) ...@@ -30,6 +30,7 @@ void buildParallelIndexSet(Basis const& basis, PIS& pis)
auto lv = basis.localView(); auto lv = basis.localView();
AMDiS::GlobalBasisIdSet<Basis> dofIdSet(basis); AMDiS::GlobalBasisIdSet<Basis> dofIdSet(basis);
std::vector<bool> visited(basis.dimension(), false);
pis.beginResize(); pis.beginResize();
for (auto const& e : elements(gv)) for (auto const& e : elements(gv))
{ {
...@@ -38,26 +39,30 @@ void buildParallelIndexSet(Basis const& basis, PIS& pis) ...@@ -38,26 +39,30 @@ void buildParallelIndexSet(Basis const& basis, PIS& pis)
for (std::size_t i = 0; i < dofIdSet.size(); ++i) for (std::size_t i = 0; i < dofIdSet.size(); ++i)
{ {
auto localIndex = lv.index(i); auto localIndex = lv.index(i);
auto globalId = dofIdSet.id(i); if (!visited[localIndex]) {
PType attribute = dofIdSet.partitionType(i); auto globalId = dofIdSet.id(i);
switch (attribute) PType attribute = dofIdSet.partitionType(i);
{ switch (attribute)
case PType::InteriorEntity: {
pis.add(globalId, LI(localIndex, Attribute::owner, true)); case PType::InteriorEntity:
break;
case PType::BorderEntity:
if (borderEntities.contains(dofIdSet.entityId(i)))
pis.add(globalId, LI(localIndex, Attribute::owner, true)); pis.add(globalId, LI(localIndex, Attribute::owner, true));
else break;
case PType::BorderEntity:
if (borderEntities.contains(dofIdSet.entityId(i)))
pis.add(globalId, LI(localIndex, Attribute::owner, true));
else
pis.add(globalId, LI(localIndex, Attribute::overlap, true));
break;
case PType::OverlapEntity:
pis.add(globalId, LI(localIndex, Attribute::overlap, true)); pis.add(globalId, LI(localIndex, Attribute::overlap, true));
break; break;
case PType::OverlapEntity: case PType::FrontEntity:
case PType::FrontEntity: case PType::GhostEntity:
pis.add(globalId, LI(localIndex, Attribute::overlap, true)); pis.add(globalId, LI(localIndex, Attribute::copy, true));
break; break;
case PType::GhostEntity: }
pis.add(globalId, LI(localIndex, Attribute::copy, true));
break; visited[localIndex] = true;
} }
} }
dofIdSet.unbind(); dofIdSet.unbind();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment