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

void Element::setCNodes ( const int  n0 = noCNode,
const int  n1 = noCNode,
const int  n2 = noCNode,
const int  n3 = noCNode 
) [inherited]

Tells the element which nodes to use. Remember that -1 is ground. You should refer to the individual elements for which nodes are used for what.

Definition at line 100 of file element.cpp.

References ElementSet::cnodes(), ElementSet::ground(), and Element::updateStatus().

Referenced by Element::componentDeleted(), and Component::initElements().

      if ( !p_eSet )
//          cerr << "Element::setCNodes: can't set nodes without circuit!"<<endl;
            for ( int i=0; i<8; i++ )
                  p_cnode[i] = 0l;
      // MAX_CNODES-1 should match the last array index below.
      assert( MAX_CNODES == 4 );
      p_cnode[0] = (n0>-1)?p_eSet->cnodes()[n0]:(n0==-1?p_eSet->ground():0l);
      p_cnode[1] = (n1>-1)?p_eSet->cnodes()[n1]:(n1==-1?p_eSet->ground():0l);
      p_cnode[2] = (n2>-1)?p_eSet->cnodes()[n2]:(n2==-1?p_eSet->ground():0l);
      p_cnode[3] = (n3>-1)?p_eSet->cnodes()[n3]:(n3==-1?p_eSet->ground():0l);

Generated by  Doxygen 1.6.0   Back to index