! AWAKE simulation
! Using proton bunch and plasma parameters as in 
!   http://cds.cern.ch/record/1537318/files/SPSC-TDR-003.pdf

!----------the node configuration for this simulation----------
node_conf 
{
  node_number(1) = 128,
  if_periodic(1) = .false.,
}
!----------spatial grid----------
grid 
{
  nx_p(1) = 44000,
  coordinates = "cartesian",
}
!----------time step and global data dump timestep number----------
time_step 
{
  dt     =  0.002,
  ndump  =  5000, 
}
!----------restart information----------
restart 
{
  ndump_fac = 50,
  if_restart=.false.,
  if_remold=.true.,
}
!----------spatial limits of the simulations----------
! (note that this includes information about
! the motion of the simulation box)
space 
{
  xmin(1) =  0.000d0,
  xmax(1) =  110.0d0,
  if_move(1)= .true.,
  move_start = 0.0,
  move_u = 29.531048094309458,
}
!----------time limits ----------
time 
{
  tmin =   0.0, 
  tmax =   6000.0,
}
!----------boundary conditions for em-fields ----------
emf_bound 
{
  type(1:2,1) = 30, 30,  
}
!----------diagnostic for electromagnetic fields---------- 
diag_emf 
{
  ndump_fac = 1,
  ndump_fac_ene_int = 1,
  reports = "e1","e2","e3","b1","b2","b3",
}
!----------number of particle species----------
particles 
{ 
  num_species = 2,
!  num_cathode = 1,
}
!==================================================
! ELECTRONS
!==================================================
species 
{
  name="electrons",
  num_par_max = 4000000,
  rqm=-1.0,
  num_par_x(1) = 10,
  den_min = 1.0d-12,
  interpolation = "cubic",
  vth(1:3) = 0.0d0, 0.0d0, 0.0d0,
  vfl(1:3)=  0.0d0, 0.0d0, 0.0d0,
!  if_collide = .true.,
!  if_like_collide = .true.,
  q_real = -1.0,
}
!----------density profile for this species----------
profile 
{
  profile_type = "math func",
  math_func_expr = "1 * if(x1 > 110.0, 1, 0) * if(x1 <= 10000, 1, 0)",
}
!----------boundary conditions for this species----------
spe_bound 
{
  type(1:2,1) =  5, 5,
  !type(1:2,2) =  5, 5,
}
!----------diagnostic for this species----------
diag_species 
{
  ndump_fac = 1,
!  ndump_fac_pha = 1,
  reports = "charge",
!  ps_xmin(1:2) =  0.0,0.0,
!  ps_xmax(1:2) =  60.0,20.0,
!  ps_nx(1:2)   =  800,400,
! ps_pmin(1) = -0.1,
! ps_pmax(1) = 0.1,
!  ps_np(1:2) = 256,128,
!  if_ps_p_auto(1:3) = .true.,.true.,.true., 
!  phasespaces = "p1x1_|charge|", "p1_|charge|", 
}
!=====================================
! IONS
!=====================================
species 
{
  name="ions",
  num_par_max = 4000000,
  rqm=1836,
  num_par_x(1) = 2,
  !den_min = 1.0d-12,
  vth(1:3) = 0.0d0, 0.0d0, 0.0d0,
  vfl(1:3) = 0.0d0, 0.0d0, 0.0d0,
  interpolation = "cubic",
!  if_collide = .true.,
!  if_like_collide = .true.,
  q_real = 1.0,
}
profile 
{
  profile_type = "math func",
  math_func_expr = "1 * if(x1 > 110.0, 1, 0) * if(x1 <= 10000, 1, 0)",
}
spe_bound 
{
  type(1:2,1) =  5, 5,
  !type(1:2,2) =  5, 5,
}
diag_species 
{
  ndump_fac = 1,
!  ndump_fac_pha = 1,
  reports = "charge",
!  ps_xmin(1:2) =  0.0,0.0,
!  ps_xmax(1:2) =  40.0,20.0,
!  ps_nx(1:2)   = 100,50,
!! ps_pmin(1) = -0.1,
!! ps_pmax(1) = 0.1,
!  ps_np(1:2) = 256,128,
!  if_ps_p_auto(1:3) = .true.,.true.,.true., 
!  phasespaces = "p1x1_|charge|", "p1_|charge|", 
}

!collisions
!{
!  n_collide = 1,
!  nx_collision_cells(1) = 100,
!  norm_charge_density = 3.3e20, 
!  coulomb_logarithm_automatic = .true., 
!} 

! ------------- zpulses ------------------
zpulse
{
  a0 = 1.5,
  omega0 = 29.531048094309458,
  pol = 0.0,
  propagation = "forward",
  direction = 1, 
  lon_type = "gaussian",
  lon_duration = 3.1415926535897931,
  lon_range = 13.0,
  lon_x0 = 103.5,
  !lon_start = 7.15, ! 1 lambda lag: 6.25
!  per_type = "gaussian", 
!  per_w0 = 2.82,
!  per_focus = 318.06,
}
zpulse 
{
  a0 = 0.1,
  omega0 = 29.531048094309458,
  pol = 0.0,
  propagation = "forward",
  direction = 1, 
  lon_type = "gaussian",
  lon_duration = 23.920150273832764,
  lon_range = 97.0,
  lon_x0 = 48.5,
  !lon_start = 7.15, ! 1 lambda lag: 6.25
!  per_type = "gaussian", 
!  per_w0 = 2.82,
!  per_focus = 318.06,
}

!-------------smooth for currents------------- 
smooth
{
  smooth_type = "compensated",
}
!antenna_array
!{
!  n_antenna = 1,
!}
!antenna
!{
!  a0 = 0.295845,
!  omega0 = 41.76320872606459,
!  pol = 0.0,
!  side = 1,
!  ant_type = 2,
!  t_rise = 28.2,
!  t_flat = 0.0, ! 56.4 in total
!  t_fall = 28.2,
!  rad_x = 2.82,
!  rad_y = 1,
!  x0 = 7.5,
!  y0 = 0.0, !33.719,
!  tilt = 0.0,
!  phase = 0.0,
!  delay = 0.0,
!  focus = 247.06,
!}
!antenna
!{
!  a0 = 0.5,
!  omega0 = 100.0,
!  pol = 0,
!  side = 2,
!  ant_type = 1,
!  t_rise = 0.88858,
!  t_flat = 0.0,
!  t_fall = 0.88858,
! rad_x = 1.0d6,
!  x0 = 13.3, ! 1.5 wavelength leading
!  y0 = 13.3,
!}
! ------------- electrical current settings ----------------
current{}
! ------------- electrical charge settings ----------------
charge{}
! ------------- end of osiris input file ---------------
