Logo Search packages:      
Sourcecode: ktechlab version File versions  Download package

void Component::initElements ( const uint  stage  )  [inherited]

Todo:
this function is ugly and messy and needs tidying up

Definition at line 959 of file component.cpp.

References ElementMap::e, Pin::eqId(), Component::m_elementMapList, ElementMap::n, and Element::setCNodes().

{
      /// @todo this function is ugly and messy and needs tidying up
      
      const ElementMapList::iterator end = m_elementMapList.end();
            
      if ( stage == 1 )
      {
            for ( ElementMapList::iterator it = m_elementMapList.begin(); it != end; ++it )
            {
                  (*it).e->add_initial_dc();
            }
            return;
      }
      
      for ( ElementMapList::iterator it = m_elementMapList.begin(); it != end; ++it )
      {
            ElementMap m = (*it);
            
            if ( m.n[3] ) {
                  m.e->setCNodes( m.n[0]->eqId(), m.n[1]->eqId(), m.n[2]->eqId(), m.n[3]->eqId() );
            }
            else if ( m.n[2] ) {
                  m.e->setCNodes( m.n[0]->eqId(), m.n[1]->eqId(), m.n[2]->eqId() );
            }
            else if ( m.n[1] ) {
                  m.e->setCNodes( m.n[0]->eqId(), m.n[1]->eqId() );
            }
            else if ( m.n[0] ) {
                  m.e->setCNodes( m.n[0]->eqId() );
            }
      }
      
      for ( ElementMapList::iterator it = m_elementMapList.begin(); it != end; ++it )
      {
            (*it).e->add_map();
      }
}


Generated by  Doxygen 1.6.0   Back to index