fileDensSrc
Loads particle phase space coordinates contained in a text file specified by “file” in the example block below. In 3 dimensional 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 2D simulation, for constant weight particles, the data file should have five columns of data which specifies \({x, y, P_x, P_y, P_z}\). For variable weight particles, a 6th column is needed to specify the weight. Likewise, In 1D simulation, for constant weight particles, the data file should have four columns of data which specifies \({x, P_x, P_y, P_z}\). For variable weight particles, a 5th column is needed to specify the weight.
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 theapplyPeriod
.
- 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 defineshift_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>