Skip to content
Snippets Groups Projects
Commit f8cfc225 authored by Oliver Sander's avatar Oliver Sander
Browse files

Merge branch 'bugfix/delete-all-isnew-markers' into 'master'

[bugfix][adaptivity] Remove isNew markers on ALL levels

When global refining not all isNew markers were removed.
This also caused a bug when mixing growth and adaptivity as the
isNew marker is also used for newly added elements through growth.

If merged this needs to be backported to the 2.4 release branch!

See merge request !8
parents 9748a5b0 31c7e790
No related branches found
No related tags found
No related merge requests found
......@@ -319,13 +319,15 @@ void Dune::FoamGrid<dimgrid, dimworld>::postAdapt()
willCoarsen=false;
// Loop over all leaf entities and remove the isNew Marker.
for (const auto& element : elements(this->leafGridView()))
for (int level = maxLevel(); level >= 0; --level)
{
FoamGridEntityImp<dimgrid, dimgrid, dimworld>& e = *const_cast<FoamGridEntityImp<dimgrid, dimgrid, dimworld>*>(this->getRealImplementation(element).target_);
e.isNew_=false;
assert(!e.willVanish_);
if (e.father_)
e.father_->markState_=FoamGridEntityImp<dimgrid, dimgrid, dimworld>::DO_NOTHING;
for(auto eIt = std::get<dimgrid>(entityImps_[level]).begin(); eIt != std::get<dimgrid>(entityImps_[level]).end(); ++eIt)
{
eIt->isNew_=false;
assert(!eIt->willVanish_);
if (eIt->father_)
eIt->father_->markState_=FoamGridEntityImp<dimgrid, dimgrid, dimworld>::DO_NOTHING;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment