Warwick-Plasma / epoch

Particle-in-cell code for plasma physics simulations
https://epochpic.github.io
GNU General Public License v3.0
184 stars 58 forks source link

UNLOCATABLE PARTICLE from particles_from_file block #690

Closed qiqi77346 closed 3 months ago

qiqi77346 commented 3 months ago

Hi, I am using particles_from_file block to load macro-particles into the simulation. When I run the input.deck, getting the following error:

Specify output directory Name of species 1 is beam Name of species 2 is gamma Initial conditions complete and valid. Calculating optimal processor topology Processor subdivision is 16 40 Skipping redistribution. Balance: 0.994, after: 0.999 (pre-load balance) Attempting to load particles No particles specified for species "beam" Inserted 102912 custom particles of species "beam" UNLOCATABLE PARTICLE 1 -1 Unlocatable particle on processor 0 8.159482033231285E-005 -9.275104108873857E-006

It show that "Inserted 102912 custom particles of species "beam"". I don't understand why UNLOCATABLE PARTICLE ?

the input.deck is following:


begin:constant
  lambda_0 = 1 * micron
  d        =1 * micron
  omega    = 2 * pi * c/lambda_0
  nel      = critical(omega)
  T_0      = lambda_0/c
end:constant

begin:control
  nx = 7000     
  ny = 600
  nsteps = -1
  t_end = 100 * T_0     
  x_min = 90*d
  x_max = 160*d
  y_min = -10*d
  y_max =  10*d
  dt_multiplier = 0.95
  dlb_threshold=0.9
  stdout_frequency = 100
  smooth_currents=T
  smooth_iterations=10
end:control

begin:species
  name = beam
  mass = 1.0
  charge = -1
  dump = T 
  identify:electron
end:species

begin:particles_from_file
    species = beam
    x_data = "/share/home/epoch-4.18.0-2022-12-14/epoch2d/wsd/particle_injection/x.bin"
    y_data = "/share/home/epoch-4.18.0-2022-12-14/epoch2d/wsd/particle_injection/y.bin"
    w_data = "/share/home/epoch-4.18.0-2022-12-14/epoch2d/wsd/particle_injection/w.bin"
    px_data = "/share/home/epoch-4.18.0-2022-12-14/epoch2d/wsd/particle_injection/px.bin"
    py_data = "/share/home/epoch-4.18.0-2022-12-14/epoch2d/wsd/particle_injection/py.bin"
    #offset = 8
end:particles_from_file

begin:subset
  name = electron_trace
  random_fraction = 1
  include_species:beam
end:subset

begin:boundaries
  bc_x_min = open
  bc_x_max = open
  bc_y_min = periodic
  bc_y_max = periodic
end:boundaries

begin:output
  name = densitys_part
  file_prefix = o1
  dt_snapshot = 1 * T_0    
  grid = always
  number_density = always + species + single
  ekbar = always + species + single
end:output

begin:output
  name = particle_part
  file_prefix = o2
  dt_snapshot = 1 * T_0     
  grid = always
  particle_weight = electron_trace  
  particle_energy = electron_trace 
  px = electron_trace 
  py = electron_trace  
  pz = electron_trace  
  gamma = electron_trace  
  vx = electron_trace  
  vy = electron_trace  
  vz = electron_trace 
end:output
TomGoffrey commented 3 months ago

As I mentioned in #688 lines like x_min = 90d need fixing. Could you fix hose and see if that fixes the error please?

qiqi77346 commented 3 months ago

Hi, TomGoffrey

I ran it with the correct input.deck, but the above error still occurred, Attached is input.pdf, please see it.

I also want to send you w.bin/x.bin/y.bin/px.bin/py.bin file, but the attachment is not allowed to upload.

Yours sincerely input.pdf

TomGoffrey commented 3 months ago

The particle you are trying to load has an x position of about 81 microns, but your x_min is 90 microns, so can't be loaded.

qiqi77346 commented 3 months ago

The particle you are trying to load has an x position of about 81 microns, but your x_min is 90 microns, so can't be loaded.

@TomGoffrey, Now I think I understand. Thank you for your assistance.

TomGoffrey commented 3 months ago

No problem.