You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found the problem will happen only when iterating through boundaries, so I compared the implementation btween gsHDomainBoundaryIterator.h and gsHDomainIterator.h. I noticed that the next() function in gsHDomainIterator.h (Line 93) has a different implementation with the one in gsHDomainBoundaryIterator.h (Line 96).
In gsHDomainIterator.h:
bool next(index_t increment)
{
for (index_t i = 0; i != increment && this->m_isGood; ++i)
{
this->m_isGood = nextLexicographic(m_curElement, m_meshStart, m_meshEnd);
if (!this->m_isGood)
this->m_isGood = nextLeaf();
}
if (this->m_isGood)
updateElement();
m_id += increment; //increment id
return this->m_isGood;
}
In gsHDomainBoundaryIterator.h:
bool next(index_t increment)
{
for (index_t i = 0; i < increment; i++)
this->m_isGood = nextLexicographic(m_curElement, m_meshStart, m_meshEnd);
if (this->m_isGood) // new element in m_leaf
updateElement();
else // went through all elements in m_leaf
this->m_isGood = nextLeaf();
return this->m_isGood;
}
Finally, by replacing Line 9899 in gsHDomainBoundaryIterator.h with Line 95100 in gsHDomainIterator.h, this issue can be fixed. Although this works for me now, I don't know if it will cause some other issues in the future.
Modified next() in gsHDomainBoundaryIterator.h:
bool next(index_t increment)
{
/*
for (index_t i = 0; i < increment; i++)
this->m_isGood = nextLexicographic(m_curElement, m_meshStart, m_meshEnd);
*/
for (index_t i = 0; i != increment && this->m_isGood; ++i)
{
this->m_isGood = nextLexicographic(m_curElement, m_meshStart, m_meshEnd);
if (!this->m_isGood)
this->m_isGood = nextLeaf();
}
if (this->m_isGood) // new element in m_leaf
updateElement();
else // went through all elements in m_leaf
this->m_isGood = nextLeaf();
return this->m_isGood;
}
https://github.com/gismo/gismo/blob/74b2d0c85407013d35bf6d07192c6954868acd3d/src/gsHSplines/gsHDomainBoundaryIterator.h#L98C48-L98C48
This will cause the iterator go outside the domain when using openMP.
The text was updated successfully, but these errors were encountered: