fileDensSrc

Loads particle phase space coordinates contained in a text file specified by “file” in the example block below. Regardless of the dimension of the simulation, the imported file should have at least six columns, separated by spaces (no commas). For constant weight particles, the six columns specify \({x, y, z, P_x, P_y, P_z}\) , where \({P_i = \gamma v_i}\). For variable weight particles, a 7th column needs to be included to specify the weight of the particle.

In the file, each row corresponds to a single particle.

By default, the distribution of particles in the file will be loaded at the first time step. To repeat loading, use the applyPeriod attribute.

fileDensSrc Parameters

file (string, required)

The text file containing the particle phase space data to be loaded.

fileNameBase (string, optional)

Base name for series of text files to be loaded over a series of time steps. If this parameter is used then file is not needed.

fileExtension (string, optional)

File extension for series of text files to be loaded. Required if fileNameBase is used.

applyPeriod (integer, optional)

The time step intervals to load the particles. So, if this value is 2, particles will be loaded every other timestep. If 3, particles will be loaded every third timestep, etc. If used with fileNameBase the files loaded will be named fileNameBase_N.fileExtension where N is an integer multiple of the applyPeriod.

shiftPtclPosition (double vector, optional)

Allows the user to shift the position of the particles. The units of shift_i are meters. For example, to shift each particle by the same random distance in x between 0 and 1 micron, one can define shift_x = __import__("random").random()*1E-6.

Example fileDensSrc Block

<ParticleSource electronSrc>
  kind = fileDensSrc
  file = textFilePtclSource.dat
  #applyPeriod = 3
  #shiftPtclPosition = [shift_x shift_y shift_z]
</ParticleSource>