Commit a74b2cdb authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Small bugfix in findElInfoAtPoint, thanks to Francisco.

parent bc349314
......@@ -674,10 +674,22 @@ namespace AMDiS {
mel_info->fillMacroInfo(mel);
// We have the care about not to visite a macro element twice. In this case the
// function would end up in an infinite loop. If a macro element is visited a
// second time, what can happen with periodic boundary conditions, the point is
// not within the mesh!
std::set<int> macrosVisited;
macrosVisited.insert(mel->getIndex());
int k;
while ((k = mel_info->worldToCoord(xy, &lambda)) >= 0) {
if (mel->getNeighbour(k)) {
mel = mel->getNeighbour(k);
mel = mel->getNeighbour(k);
if (macrosVisited.count(mel->getIndex()))
return false;
macrosVisited.insert(mel->getIndex());
mel_info->fillMacroInfo(mel);
continue;
}
......
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