#include #include #include #define PI 3.141592653589793 #define TWOPI 6.28318530717959 #define EPS0 8.8542e-12 /* (F/m) */ #define NperTORR 8.3221e20 #define MAXLEN 50000 #define NSMAX 4 #define NCMAX 401 #define HISTMAX 512 /* upper bound on histories */ #ifndef max() #define max(x, y) (((x) > (y)) ? (x) : (y)) #endif #ifndef min() #define min(x, y) (((x) < (y)) ? (x) : (y)) #endif #ifndef DBL_MIN #define DBL_MIN 1E-200 #endif /*******************************************************************/ #if defined(GLOBALORIGIN) #define GLOBAL #else #define GLOBAL extern #endif GLOBAL float nc2p, length, area, rhoback, backj, dde, epsilon, b, extr, extl, extc, w0, dcbias, acbias, extq, extq_1, extq_2, extq_3, exti, sigma, oldsigma, dx, dt, vxscale, vscale, dttx, xnc, se, pressure, gtemp, selsmax, elsengy0, elsengy1, elsengy2, sextmax, extengy0, extengy1, extengy2, sionmax, ionengy0, ionengy1, ionengy2,achrgx, bchrgx, ascat, bscat, seec[NSMAX], df, ramp, theta0, jp, b0, jwall[NSMAX], qm[NSMAX], q[NSMAX], m[NSMAX], jj0[NSMAX][2], v0[NSMAX][2], vt[NSMAX][2], vc[NSMAX][2], vperpt[NSMAX], vperp0[NSMAX], tx[NSMAX], tz[NSMAX], sx[NSMAX], sz[NSMAX], emin[NSMAX], de[NSMAX], dtheta[NSMAX], Escale[NSMAX], risetime, enter[NSMAX][2], emin_mid[NSMAX], de_mid[NSMAX], xs_mid[NSMAX], xf_mid[NSMAX], e_exc, e_ion, e_els; GLOBAL int nsp, nc, ng, nstrt, secondary, secsp, ecolsp, icolsp, ionsp, ecollisional, icollisional, hist_hi, thist_hi, freq_hi, interval, np[NSMAX], Index[1024], nfft, dcramped, nbin[NSMAX], reflux, inject[NSMAX], nsmoothing, ntimestep, nbin_mid[NSMAX], nrft; GLOBAL double t; GLOBAL char src; GLOBAL float **num, **x, **vx, **vy, **vz, **srho, *rho, *e, *phi, *a, *x_array, *t_array, **np_hist, **jwall_hist, **phi_hist, *sigma_hist, *f_array, *ese_hist, **kes_hist, *cur_hist, *com_cur_hist, *pow_hist, *com_pow_hist, **com_phi_hist, *cur_fft, *phi_fft, *pow_fft, *mphi_fft, *Local_t_array, *ionrate, *chrgxrate, **fe, **ftheta, **e_array, **th_array, **del_ke, **fe_mid, **fe_mid_log, **e_mid_array, *e_ave, **felect; GLOBAL void circuit1(), circuit2(), circuit3(), circuit4(), (*circuitptr)(); GLOBAL float frand(), bc1(), bc2(), bc3(), bc4(), (*bcptr)(); #undef GLOBAL