Commit 63af981f authored by Thomas Pitiot 's avatar Thomas Pitiot

correction facelevel des ihms2 et 3

parent fbcd4d64
......@@ -131,27 +131,25 @@ unsigned int IHM2<PFP>::faceLevel(Dart d)
fLevel = l < fLevel ? l : fLevel ; // of its edges
} while(it != d) ;
// unsigned int cur = m_map.getCurrentLevel() ;
// m_map.setCurrentLevel(fLevel) ;
// unsigned int nbSubd = 0 ;
// it = old ;
// unsigned int eId = m_map.getEdgeId(old) ; // the particular case of a face
// CGoGNout<<"catastrophe"<<m_map.getEdgeId(it)<<CGoGNendl;
// do // with all neighboring faces regularly subdivided
// {
// // but not the face itself
// ++nbSubd ; // is treated here
// it = m_map.phi1(it) ;
// } while(m_map.getEdgeId(it) == eId && it!=old) ;
// while(nbSubd > 1)
// {
// nbSubd /= 2 ;
// --fLevel ;
// }
// m_map.setCurrentLevel(cur) ;
unsigned int cur = m_map.getCurrentLevel() ;
m_map.setCurrentLevel(fLevel) ;
int nbSubd =0;
it = old ;
unsigned int eId = m_map.getEdgeId(old) ; // the particular case of a face
do // with all neighboring faces regularly subdivided
{
// but not the face itself
++nbSubd ; // is treated here
it = m_map.phi1(it) ;
} while(m_map.getEdgeId(it) == eId && m_map.getDartLevel(it)!=l_old) ;
while(nbSubd > 1)
{
nbSubd /= 2 ;
--fLevel ;
}
m_map.setCurrentLevel(cur) ;
return fLevel ;
}
......@@ -394,16 +392,16 @@ unsigned int IHM2<PFP>::subdivideFace(Dart d, bool triQuad, bool OneLevelDiffere
{
subdivideFace(nf,triQuad) ;
}
else if(!faceIsSubdivided(nf)) //check if neighboring faces have to be subdivided first to avoid one cell surrounded by subdivided ones
{
// else if(!faceIsSubdivided(nf)) //check if neighboring faces have to be subdivided first to avoid one cell surrounded by subdivided ones
// {
if(checkForSurrounded(nf))
{
// if(checkForSurrounded(nf))
// {
subdivideFace(nf,triQuad,false);
// subdivideFace(nf,triQuad,false);
}
}
// }
// }
}
}
......
......@@ -348,25 +348,25 @@ unsigned int ImplicitHierarchicalMap3::faceLevel(Dart d)
fLevel = l < fLevel ? l : fLevel ; // of its edges
} while(it != d) ;
// unsigned int cur = m_curLevel ;
// m_curLevel = fLevel ;
// unsigned int nbSubd = 0 ;
// it = old ;
// unsigned int eId = m_edgeId[old] ; // the particular case of a face
// do // with all neighboring faces regularly subdivided
// { // but not the face itself
// ++nbSubd ; // is treated here
// it = phi1(it) ;
// } while(m_edgeId[it] == eId) ;
// while(nbSubd > 1)
// {
// nbSubd /= 2 ;
// --fLevel ;
// }
unsigned int cur = m_curLevel ;
m_curLevel = fLevel ;
unsigned int nbSubd = 0 ;
it = old ;
unsigned int eId = m_edgeId[old] ; // the particular case of a face
do // with all neighboring faces regularly subdivided
{ // but not the face itself
++nbSubd ; // is treated here
it = phi1(it) ;
} while(m_edgeId[it] == eId && m_dartLevel[it]!=l_old) ;
while(nbSubd > 1)
{
nbSubd /= 2 ;
--fLevel ;
}
// m_curLevel = cur ;
m_curLevel = cur ;
return fLevel ;
}
......@@ -535,8 +535,6 @@ Dart ImplicitHierarchicalMap3::faceOldestDart(Dart d)
do
{
unsigned int l = m_dartLevel[it] ;
if(l == 0)
return it ;
if(l < l_old || (l == l_old && it.index < oldest.index))
{
......@@ -555,12 +553,12 @@ Dart ImplicitHierarchicalMap3::volumeOldestDart(Dart d)
Dart oldest = d;
unsigned int l_old = m_dartLevel[oldest];
Traversor3WF<ImplicitHierarchicalMap3> trav3WF(*this, oldest);
for(Dart dit = trav3WF.begin() ; dit != trav3WF.end() ; dit = trav3WF.next())
for(Dart f : facesIncidentToVolume3(*this,oldest))
{
Dart old = faceOldestDart(dit);
Dart old = faceOldestDart(f);
unsigned int l = m_dartLevel[old];
if(l < l_old || (l == l_old && it.index < oldest.index))
if(l < l_old || (l == l_old && old.index< oldest.index))
{
oldest = old;
l_old = l;
......@@ -620,8 +618,9 @@ bool ImplicitHierarchicalMap3::faceIsSubdivided(Dart d)
bool subd = false ;
++m_curLevel ;
if(m_dartLevel[phi1(d)] == m_curLevel && m_edgeId[phi1(d)] != m_edgeId[d])
subd = true ;
if(faceLevel(d)>fLevel)// modif thomas
// if(m_dartLevel[phi1(d)] == m_curLevel && m_edgeId[phi1(d)] != m_edgeId[d])
subd = true ;
--m_curLevel ;
return subd ;
......@@ -672,36 +671,17 @@ bool ImplicitHierarchicalMap3::volumeIsSubdivided(Dart d)
if(vLevel < m_curLevel)
return false;
bool subd = false;
bool subd = false;
++m_curLevel;
if(m_dartLevel[phi2(phi1(phi1(d)))] == m_curLevel && m_faceId[phi2(phi1(phi1(d)))] != m_faceId[d])
subd = true;
// if(m_dartLevel[phi2(phi1(phi1(d)))] == m_curLevel && m_faceId[phi2(phi1(phi1(d)))] != m_faceId[d])
if(volumeLevel(d)>vLevel) //test par thomas
subd = true;
--m_curLevel;
return subd;
// //bool facesAreSubdivided = faceIsSubdivided(d) ;
// bool facesAreSubdivided = true ;
//
// Traversor3WF<ImplicitHierarchicalMap3> trav3WF(*this, d);
// for(Dart dit = trav3WF.begin() ; dit != trav3WF.end() ; dit = trav3WF.next())
// {
// // in a first time, the level of a face
// //the level of the volume is the minimum of the
// //levels of its faces
//
// facesAreSubdivided &= faceIsSubdivided(dit) ;
// }
//
// //but not the volume itself
// bool subd = false;
// ++m_curLevel;
// if(facesAreSubdivided && m_dartLevel[phi2(phi1(phi1(d)))] == m_curLevel && m_faceId[phi2(phi1(phi1(d)))] != m_faceId[d])
// subd = true;
// --m_curLevel;
//
// return subd;
}
......@@ -774,11 +754,12 @@ bool ImplicitHierarchicalMap3::volumeIsSubdividedOnce(Dart d)
bool ImplicitHierarchicalMap3::checkForSurrounded (Dart d)
{
for(Vol dd : volumesAdjacentByFace3<ImplicitHierarchicalMap3>(*this,d))
for(Face fac : facesIncidentToVolume3<ImplicitHierarchicalMap3>(*this,d))
{
if(!sameVolume(phi3(d),dd))
if(!sameFace(d,fac))
{
if(!volumeIsSubdivided(dd))
if(!faceIsSubdivided(fac) /*&& !isBoundaryMarked(3,phi3(fac))*/)
{
return false;
}
......
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