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

void nec_context::calculate_network_data ( void   )  [private]

Calculate network data such as the lengths of transmission lines.

Calculate network data such as the lengths of transmission lines. TODO Fix up this horrible mess. As far as I can figure we should simply be calculating the x11i[] value for every network with ntyp = 2 or 3 (transmission lines). The bug being reported by Remi, could be caused by this network failing to calculate the length correctly under some circumstances.

This is an extremely strange statement. ntyp[j] net_type ntyp[j]/net_type 1 1 1 2 1 2 3 1 3 1 2 0 2 2 1 3 2 1

Definition at line 1472 of file nec_context.cpp.

References c_geometry::x, c_geometry::y, and c_geometry::z.

{
      if ( (network_count == 0) || (inc > 1) )
            return;
            
      int itmp3 = 0;
      int net_type = ntyp[0];

      for (int i = 0; i < 2; i++ )
      {
            if ( net_type == 3)
                  net_type = 2;

            for (int j = 0; j < network_count; j++)
            {
                  if ( (ntyp[j]/net_type) != 1 )
                  {
                        itmp3 = ntyp[j]; // can never be zero
                  }
                  else
                  {
                        if ( (ntyp[j] >= 2) && (x11i[j] <= 0.0) )
                        {
                              int idx4 = iseg1[j]-1;
                              int idx5 = iseg2[j]-1;
                              nec_float xx = m_geometry->x[idx5]- m_geometry->x[idx4];
                              nec_float yy = m_geometry->y[idx5]- m_geometry->y[idx4];
                              nec_float zz = m_geometry->z[idx5]- m_geometry->z[idx4];
                              
                              // set the length of the transmission line to be the 
                              // straight line distance.
                              x11i[j] = wavelength*sqrt(xx*xx + yy*yy + zz*zz);
                        }
                  }
            }
            if ( itmp3 == 0)  // can only be zero if all the networks are the same type
                  return;
            net_type = itmp3;
      }
} /* calculate_network_data */


Generated by  Doxygen 1.6.0   Back to index