Skip to content

Instantly share code, notes, and snippets.

@arnaudgelas
Created May 13, 2011 01:00
Show Gist options
  • Save arnaudgelas/969766 to your computer and use it in GitHub Desktop.
Save arnaudgelas/969766 to your computer and use it in GitHub Desktop.
Procedure2
/* Procedure 2 Update Level Set Lists
// Update the zero level set
1: for each point p in Lz
2: add F(p) to phi(p)
3: if(phi(p)> .5), remove p from Lz, add p to Sp1
4: if(phi(p)<-.5), remove p from Lz, add p to Sn1
*/
LevelSetNodeListType* list_0 = m_SparseLevelSet->GetListNode( 0 );
while( !list_0->empty() && !m_Update.empty() )
{
LevelSetNodePairType p = list_0->front();
list_0->pop_front();
LevelSetOutputType update = m_Update.front();
m_Update.pop_front();
p.m_Value += m_Dt * update;
if( p.m_Value > 0.5 )
{
S_plus_1.push_back( p );
}
else
{
if( p.m_Value < -0.5 )
{
S_neg_1.push_back( p );
}
else
{
new_list_0.push_back( p );
}
}
}
// update list_0
while( !new_list_0.empty() )
{
list_0->push_back( new_list_0.front() );
new_list_0.pop_front();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment