Don't do mesh smoothing at non-tet elements

This commit is contained in:
Matthias Hochsteger 2024-01-19 09:21:22 +01:00
parent 4e30c0dd64
commit 10377be7d7

View File

@ -335,6 +335,20 @@ namespace netgen
{ {
static Timer tim("PointFunction - build elementsonpoint table"); RegionTimer reg(tim); static Timer tim("PointFunction - build elementsonpoint table"); RegionTimer reg(tim);
Array<bool, PointIndex> bad_point(points.Size());
bad_point = false;
// Don't optimize if point is adjacent to a non-tet element
ParallelForRange(elements.Range(), [&] (auto myrange)
{
for(auto ei : myrange)
{
const auto & el = elements[ei];
if(el.NP()!=4)
for(auto pi : el.PNums())
bad_point[pi] = true;
}
});
elementsonpoint = ngcore::CreateSortedTable<ElementIndex, PointIndex>( elements.Range(), elementsonpoint = ngcore::CreateSortedTable<ElementIndex, PointIndex>( elements.Range(),
[&](auto & table, ElementIndex ei) [&](auto & table, ElementIndex ei)
{ {
@ -344,6 +358,7 @@ namespace netgen
return; return;
for (PointIndex pi : el.PNums()) for (PointIndex pi : el.PNums())
if(!bad_point[pi])
table.Add (pi, ei); table.Add (pi, ei);
}, points.Size()); }, points.Size());
} }