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

void nec_context::nefld ( nec_float  xob,
nec_float  yob,
nec_float  zob,
nec_complex *  ex,
nec_complex *  ey,
nec_complex *  ez 
) [private]

nefld computes the near field at specified points in space after the structure currents have been computed.

Parameters:
xob,yob,zob The field evaluation points.

Definition at line 4728 of file nec_context.cpp.

References bir, c_geometry::cab, cir, current_vector, efld(), c_geometry::icon1, c_geometry::icon2, c_geometry::m, c_geometry::n, c_geometry::pbi, c_geometry::px, c_geometry::py, c_geometry::pz, c_geometry::sab, c_geometry::salp, c_geometry::segment_length, c_geometry::segment_radius, c_geometry::t1x, c_geometry::t1y, c_geometry::t1z, c_geometry::t2x, c_geometry::t2y, c_geometry::t2z, c_geometry::test_ek_approximation(), unere(), c_geometry::x, c_geometry::y, and c_geometry::z.

{
      int i, ix, ipr, iprx, jc;
      nec_float zp, ax;
      nec_complex acx, bcx, ccx;
      
      *ex=cplx_00();
      *ey=cplx_00();
      *ez=cplx_00();
      ax=0.0;
      
      int n = m_geometry->n;
      for( i = 0; i < n; i++ )
      {
            xj= xob- m_geometry->x[i];
            yj= yob- m_geometry->y[i];
            zj= zob- m_geometry->z[i];
            zp= m_geometry->cab[i]* xj+ m_geometry->sab[i]* yj+ m_geometry->salp[i]* zj;
      
            if ( fabs( zp) > 0.5001* m_geometry->segment_length[i])
                  continue;
      
            zp= xj* xj+ yj* yj+ zj* zj- zp* zp;
            xj= m_geometry->segment_radius[i];
      
            if ( zp > 0.9* xj* xj)
                  continue;
      
            ax= xj;
            break;
      } /* for( i = 0; i < n; i++ ) */

      for( i = 0; i < n; i++ )
      {
            ix = i+1;
            m_s = m_geometry->segment_length[i];
            m_b = m_geometry->segment_radius[i];
            xj= m_geometry->x[i];
            yj= m_geometry->y[i];
            zj= m_geometry->z[i];
            cabj= m_geometry->cab[i];
            sabj= m_geometry->sab[i];
            salpj= m_geometry->salp[i];
      
            if ( m_use_exk == true)
            {
            ipr= m_geometry->icon1[i];
      
            if ( ipr < 0 )
            {
                  ipr = -ipr;
                  iprx = ipr-1;
            
                  if ( -m_geometry->icon1[iprx] != ix )
                        ind1=2;
                  else
                  {
                        ind1 = m_geometry->test_ek_approximation(i,iprx);
#ifdef NEC_ERROR_CHECK
                        int ind_test;
                        nec_float xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]);
                        if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.) > 1.0e-6) )
                              ind_test=2;
                        else
                              ind_test=0;
                        ASSERT(ind_test == ind1);
#endif
                  }
            } /* if ( ipr < 0 ) */
            else
            if ( ipr == 0 )
                  ind1=1;
            else
            {
                  iprx = ipr-1;
      
                  if ( ipr != ix )
                  {
                        if ( m_geometry->icon2[iprx] != ix )
                              ind1=2;
                        else
                        {
                              ind1 = m_geometry->test_ek_approximation(i,iprx);
#ifdef NEC_ERROR_CHECK
                              int ind_test;
                              nec_float xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]);
                              if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.) > 1.0e-6) )
                                    ind_test=2;
                              else
                                    ind_test=0;
                              ASSERT(ind_test == ind1);
#endif
                        }
                  } /* if ( ipr != ix ) */
                  else
                  {
                        if ( cabj* cabj+ sabj* sabj > 1.0e-8)
                              ind1=2;
                        else
                              ind1=0;
                  }
            } /* else */
      
            ipr= m_geometry->icon2[i];
      
            if ( ipr < 0 )
            {
                  ipr = -ipr;
                  iprx = ipr-1;
            
                  if ( -m_geometry->icon2[iprx] != ix )
                        ind1=2;
                  else
                  {
                        ind1 = m_geometry->test_ek_approximation(i,iprx);
#ifdef NEC_ERROR_CHECK
                        int ind_test;
                        nec_float xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]);
                        if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.) > 1.0e-6) )
                              ind_test=2;
                        else
                              ind_test=0;
                        ASSERT(ind_test == ind1);
#endif
                  }
            } /* if ( ipr < 0 ) */
            else
            if ( ipr == 0 )
                  ind2=1;
            else
            {
                  iprx = ipr-1;
      
                  if ( ipr != ix )
                  {
                        if ( m_geometry->icon1[iprx] != ix )
                              ind2=2;
                        else
                        {
                              ind2 = m_geometry->test_ek_approximation(i,iprx);
#ifdef NEC_ERROR_CHECK
                              int ind_test;
                              nec_float xi= fabs( cabj* m_geometry->cab[iprx]+ sabj* m_geometry->sab[iprx]+ salpj* m_geometry->salp[iprx]);
                              if ( (xi < 0.999999) || (fabs(m_geometry->segment_radius[iprx]/m_b-1.) > 1.0e-6) )
                                    ind_test=2;
                              else
                                    ind_test=0;
                              ASSERT(ind_test == ind2);
#endif
                        }
                  } /* if ( ipr != (i+1) ) */
                  else
                  {
                        if ( cabj* cabj+ sabj* sabj > 1.0e-8)
                              ind1=2;
                        else
                              ind1=0;
                  }
            } /* else */
      
            } /* if ( m_use_exk == true) */
      
            efld( xob, yob, zob, ax, true);
            acx= nec_complex( air[i], aii[i]);
            bcx= nec_complex( bir[i], bii[i]);
            ccx= nec_complex( cir[i], cii[i]);
            *ex += exk* acx+ exs* bcx+ exc* ccx;
            *ey += eyk* acx+ eys* bcx+ eyc* ccx;
            *ez += ezk* acx+ ezs* bcx+ ezc* ccx;
      
      } /* for( i = 0; i < n; i++ ) */
      
      
      jc= n-1;
      for( i = 0; i < m_geometry->m; i++ )
      {
            m_s= m_geometry->pbi[i];
            xj= m_geometry->px[i];
            yj= m_geometry->py[i];
            zj= m_geometry->pz[i];
            t1xj= m_geometry->t1x[i];
            t1yj= m_geometry->t1y[i];
            t1zj= m_geometry->t1z[i];
            t2xj= m_geometry->t2x[i];
            t2yj= m_geometry->t2y[i];
            t2zj= m_geometry->t2z[i];
            jc += 3;
            acx= t1xj* current_vector[jc-2]+ t1yj* current_vector[jc-1]+ t1zj* current_vector[jc];
            bcx= t2xj* current_vector[jc-2]+ t2yj* current_vector[jc-1]+ t2zj* current_vector[jc];
      
            {
                  unere( xob, yob, zob, false);
                  *ex += acx* exk+ bcx* exs;
                  *ey += acx* eyk+ bcx* eys;
                  *ez += acx* ezk+ bcx* ezs;
            }
            if (ground.present())
            {
                  unere( xob, yob, zob, true);
                  *ex += acx* exk+ bcx* exs;
                  *ey += acx* eyk+ bcx* eys;
                  *ez += acx* ezk+ bcx* ezs;
            }
/*          for( ipa = 0; ipa < ground.ksymp; ipa++ )
            {
                  int ipgnd= ipa+1;
                  unere( xob, yob, zob, ipgnd == 2);
                  *ex= *ex+ acx* exk+ bcx* exs;
                  *ey= *ey+ acx* eyk+ bcx* eys;
                  *ez= *ez+ acx* ezk+ bcx* ezs;
            } */
      } /* for( i = 0; i < m; i++ ) */
}


Generated by  Doxygen 1.6.0   Back to index