7. Source Code

7.1 Constants

   //Bash
   __constant__ double dt_1440[6];                                              // dt/24
   __constant__ double dt_1440_P[6];

   // Coulomb
   __constant__ unsigned int NumTiles;
   __constant__ double k1;                                                      // k1=q^2/(4*pi*e0*m)

   // EField
   __constant__ double wk[15];
   __constant__ double wk_2[15];                                                // wk^2/4
   __constant__ double ak[15];
   __constant__ double bk[15];
   __constant__ double ak_bar[15]; 
   __constant__ double bk_bar[15];
   __constant__ double qmwk[15];                                                // -q/m*wk
   __constant__ double qmwk_2[15];                                              // -q/(2*m)*wk^2

   //Bfield
   __constant__ double wc_z;                                                    // q/M*Bz

   //Current
   __constant__   double   zk1[2];//      =   {-3.420000000000000e-003, -5.300000000000000e-004};
   __constant__   double   zk2[2];//      =   {5.300000000000000e-004, 3.420000000000000e-003};

   __constant__   double   q;
   __constant__   int      numIons;

   __constant__   double   A1_k[2];//      =   { 1.124200857823431e+002, 7.638144882605995e+001 };
   __constant__   double   A2_k[2];//      =   { 2.291995469476302e+007, 4.543296642619807e+006 };
   __constant__   double   A3_k[2];//      =   { 1.145997734738151e+007, 2.271648321309904e+006 };
   __constant__   double   A4_k[2];//      =   { 4.672868905535898e+012, 2.702429019099451e+011 };

   __constant__   double   yk_2[2];//           =       { 4.904899999999999e-006, 1.681190000000000e-005 };

   //RLC
   __constant__   double   Rw0_2;
   __constant__   double   inv_dtC;
   __constant__   double   w0_2;
   __constant__   double   gamma;

7.2. Bfield - Magnetic Field

__device__ void AccBfield (double *vel, double *f)

(description)

Parameters:

vel - velocity

f - acceleration

7.3. Coulomb

__device__ void AccCoulomb(double *Pos0, double *pos, double *f, double e_2)

(description - particle interaction)

Parameters:

Pos0 - vector; coordinate of all particles

pos - vector; ortskoordinate vom teilchen auf die man kräfte ausrechnen will

f - acceleration

e_2 - softening

7.4. Efield - Electric field

__device__ void AccEfield(double *pos, double U, double *f)

(description - particle interaction)

Parameters:

pos - vector; ortskoordinate vom teilchen auf die man kräfte ausrechnen will

U - voltage

f - acceleration

7.5. Current

__device__ void CurrentTotal(double *Ik, double *I, double *dI)

(description - particle interaction)

Input: Ik(t_j+1), I(t_j)

Output: I(t_j+1), dI(t_j+1)

Ik(t_j+1) = single ion currents

I(t_j+1) = total current

dI(t_j+1) = I(t_j+1) - I(t_j)

7.6. IONBash6

__global__ void RunIONBash6 (double *Pos6, double *Vel6, double *Acc6, double *Pos5, double *Vel5, double *Acc5, double *Vel4, double *Acc4, double *Vel3, double *Acc3, double *Vel2, double *Acc2, double *Vel1, double *Acc1, double *Vel0, double *U, double e_2)

(description - particle interaction)

Parameters:

Pos6 - vector; newest coordinate of all particles (1x3*N-Matrix, out)

Pos5 - vector; coordinate of all particles (1x3*N-Matrix, in)

Acc6 - acceleration (1x3*N-Matrix, out)

Acc0 - Acc5 - acceleration (1x3*N-Matrix, in)

Vel6 - velocity (1x3*N-Matrix, out)

Vel0 - Vel5 - velocity (1x3*N-Matrix, in)

U - voltage (1x1-matrix)

e_2 - softening (in)

7.7. IONBash6_P

__global__ void RunIONBash6 (double *Pos6, double *Vel6, double *Acc6, double *Pos5, double *Vel5, double *Acc5, double *Vel4, double *Acc4, double *Vel3, double *Acc3, double *Vel2, double *Acc2, double *Vel1, double *Acc1, double *Vel0, double *U, double e_2)

(description - particle interaction)

Parameters:

Pos6 - vector; newest coordinate of all particles (1x3*N-Matrix, out)

Pos5 - vector; coordinate of all particles (1x3*N-Matrix, in)

Acc6 - acceleration (1x3-Matrix, out)

Acc0 - Acc5 - acceleration (1x3*N-Matrix, in)

Vel6 - velocity (1x3*N-Matrix, out)

Vel0 - Vel5 - velocity (1x3*N-Matrix, in)

U - voltage (1x1-matrix)

e_2 - softening (in)

7.8. RLCBash6

__global__ void RunRLCBash6(double *U6, double *V6, double *g6, double *U5, double *V5, double *g5, double *V4, double *g4, double *V3, double *g3, double *V2, double *g2, double *V1, double *g1, double *V0, double *I, double *dI)

(description - particle interaction)

Parameters: (1x1-Matrix)

U6 - voltage (out)

U0 - U5 - voltage (in)

V6 - time discrete first order derivative of the voltage (out)

V1 - V5 - time discrete first order derivative of the voltage (in)

g6 - time discrete second order derivative of the voltage (out)

g2 - g5 - time discrete second order derivative of the voltage (in)

I - difference current (in)

dI - single current of each particle (in)

7.9. RLCBash6_P

__global__ void RunRLCBash6_P(double *U6, double *V6, double *g6, double *U5, double *V5, double *g5, double *V4, double *g4, double *V3, double *g3, double *V2, double *g2, double *V1, double *UP, double *VP, double *IP, double *dIP)

(description - particle interaction)

Parameters:

U6 - voltage (out)

U5 - voltage (in)

UP - (in)

V6 - time discrete first order derivative of the voltage (out)

V1 - V5 - time discrete first order derivative of the voltage (in)

VP - ... (in)

g6 - time discrete second order derivative of the voltage (out)

g2 - g5 - time discrete second order derivative of the voltage (in)

IP - difference current P (in)

dIP - single current of each particle P (in)

Back Table of Contents Forward


-- EvaMartenstein - 20 Apr 2015
Topic revision: r16 - 2015-05-07, EvaMartenstein
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)