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

File injectors: Unrecognised element "inject_from_file" ,"y_data" ,"py_data"in input deck. #688

Closed qiqi77346 closed 3 months ago

qiqi77346 commented 3 months ago

I use the file injector in input.deck, but unrecognised element "inject_from_file" ,"y_data" ,"py_data" when running the input.deck. I don't understand why unrecognised element "inject_from_file" ,"y_data" ,"py_data" of injector block. Below is my input.deck.

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

begin:control nx = 8000
ny = 600 nsteps = -1 t_end = 10femto x_min = 0d x_max = 100d y_min = -30d y_max = 30*d dt_multiplier = 0.95 dlb_threshold=0.9 smooth_currents=T smooth_iterations=10 end:control

begin:species name = beam mass = 1.0 charge = -1 end:species

begin:injector boundary = x_min species = beam inject_from_file = T y_data = "inject_y.txt" px_data = "inject_px.txt" py_data = "inject_py.txt" w_data = "inject_w.txt" t_data = "inject_t.txt" end:injector

begin:species name = gamma
mass=0 charge=0 npart = 0 dump = T identify:photon end:species

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

begin:subset name = sub_photon random_fraction = 0.01 include_species:gamma end:subset

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

begin:output name = fields_part file_prefix = ov dt_snapshot = 1*femto
grid = always ex =always + single ey =always + single ez =always + single bx =always + single by =always + single bz =always + single end:output

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

begin:output name = particle_part file_prefix = ox dt_snapshot = 1*femto
grid = always particle_weight = electron_trace + sub_photon
particle_energy = electron_trace + sub_photon
px = electron_trace + sub_photon
py = electron_trace + sub_photon
pz = electron_trace + sub_photon
end:output ##########################################################################################

TomGoffrey commented 3 months ago

There's a few issues with your input deck, lines such as t_end = 10femto should be replaced with t_end = 10*femto. Also, note the warning:

 *** WARNING ***
 Input deck line number 7
 The constant block variable "t" conflicts with a
 built-in constant name. It will be ignored.

I can't test the full set-up as I don't have access to the injector files you are using. That being said, I have no problem parsing the injector section of the input deck. What version of EPOCH are you using?

qiqi77346 commented 3 months ago

There's a few issues with your input deck, lines such as t_end = 10femto should be replaced with t_end = 10*femto. Also, note the warning:

 *** WARNING ***
 Input deck line number 7
 The constant block variable "t" conflicts with a
 built-in constant name. It will be ignored.

I can't test the full set-up as I don't have access to the injector files you are using. That being said, I have no problem parsing the injector section of the input deck. What version of EPOCH are you using?

Hi, TomGoffrey

Thank you for your attentions. The reason is that I should use EPOCH-4.19.0 rather than 4.17.18 to run the input.deck. When I use the EPOCH-4.19.0, the input.deck can be run without errors.

TomGoffrey commented 3 months ago

OK, good to hear.