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

void nec_context::gf ( nec_float  zk,
nec_float *  co,
nec_float *  si 
) [private]

Computes the integrand exp(jkr)/(kr) for numerical integration.

TODO: Place the ija, rkb2, zpk = xk*z global variables as parameters (possibly also the rk parameter).

Definition at line 3977 of file nec_context.cpp.

{
      static nec_float _gf_const0 = -1.38888889e-3;
      static nec_float _gf_const1 = 4.16666667e-2;
      
      nec_float zdk = zk - zpk;
      nec_float rk = sqrt(rkb2 + zdk*zdk);
      *si= sin(rk)/ rk;
      
      if ( ija != 0 )
      {
            *co = cos(rk)/ rk;
            return;
      }
      
      if ( rk >= .2)
      {
            *co = (cos(rk) - 1.0)/rk;
            return;
      }
      
      nec_float rks = rk*rk;
      *co = ((_gf_const0 * rks + _gf_const1)* rks - 0.5)* rk;
}


Generated by  Doxygen 1.6.0   Back to index