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

void nec_context::unere ( nec_float  xob,
nec_float  yob,
nec_float  zob,
bool  ground_reflection 
) [private]

Calculates the electric field due to unit current in the t1 and t2 directions on a patch.

ground_reflection If true, then calculate the field reflected from the ground. (was ipgnd == 2)

Definition at line 6488 of file nec_context.cpp.

Referenced by nefld(), and pcint().

      nec_float px, py, cth;
      nec_complex rrv, rrh, edp;
      nec_float zr = zj;
      nec_float t1zr = t1zj;
      nec_float t2zr = t2zj;
      if ( ground_reflection)
            zr =- zr;
            t1zr = -t1zr;
            t2zr = -t2zr;
      nec_float rx = xob- xj;
      nec_float ry = yob- yj;
      nec_float rz = zob- zr;
      nec_float r2 = rx*rx + ry*ry + rz*rz;
      if ( r2 <= 1.0e-20)
      nec_float r = sqrt(r2);
      nec_float tt1 = -two_pi() * r;
      nec_float tt2 = tt1 * tt1;
      nec_float rt = r2*r;
      nec_complex er = nec_complex( sin(tt1),-cos(tt1))*( CONST2* m_s);
      nec_complex q1= nec_complex(tt2 - 1.0, tt1)* er/ rt;
      nec_complex q2= nec_complex(3.0- tt2,-3.0*tt1)* er/( rt* r2);
      er = q2*( t1xj* rx+ t1yj* ry+ t1zr* rz);
      exk= q1* t1xj+ er* rx;
      eyk= q1* t1yj+ er* ry;
      ezk= q1* t1zr+ er* rz;
      er= q2*( t2xj* rx+ t2yj* ry+ t2zr* rz);
      exs= q1* t2xj+ er* rx;
      eys= q1* t2yj+ er* ry;
      ezs= q1* t2zr+ er* rz;
      if ( !ground_reflection)
      // handle the ground_reflection
      if (  ground.type_perfect() ) // (ground.iperf == 1)
            exk=- exk;
            eyk=- eyk;  
            ezk=- ezk;
            exs=- exs;
            eys=- eys;
            ezs=- ezs;
      nec_float xymag = sqrt(rx*rx + ry*ry);
      if ( xymag <= 1.0e-6)
            px=- ry/ xymag;
            py= rx/ xymag;
            cth= rz/ sqrt( xymag* xymag+ rz* rz);
            rrv= sqrt(1.0- ground.get_zrati_sqr() * (1.0 - cth*cth));
      rrh= ground.zrati* cth;
      rrh=( rrh- rrv)/( rrh+ rrv);
      rrv= ground.zrati* rrv;
      rrv=-( cth- rrv)/( cth+ rrv);
      edp=( exk* px+ eyk* py)*( rrh- rrv);
      exk= exk* rrv+ edp* px;
      eyk= eyk* rrv+ edp* py;
      ezk= ezk* rrv;
      edp=( exs* px+ eys* py)*( rrh- rrv);
      exs= exs* rrv+ edp* px;
      eys= eys* rrv+ edp* py;
      ezs= ezs* rrv;

Generated by  Doxygen 1.6.0   Back to index