speciesAbsPtclData2

speciesAbsPtclData2

Stores data (individual or statistical) for particles absorbed by a boundary

The History of kind=speciesAbsPtclData2 (intended as an eventual replacement for kind=speciesAbsPtclData, c.f., speciesAbsPtclData) is a tensor history that records data about particles that get absorbed (by a kind=absAndSav or similar ParticleSink, c.f., absStairStep Parameters).

Depending on the attribute collectMethod this can record data for each individual particle, or it can record sums or statistics for all particles absorbed within each time step.

speciesAbsPtclData2 Parameters

ptclAbsorbers (vector of strings, required)

A list of particle absorbers (of kind=absAndSav or similar, see absStairStep Parameters) for which this history will record data. If this is non-empty, species must contain a list of the absorbed species, one for each absorber.

species (vector of strings, required)

A list of Species, one for each ptclAbsorber, indicating the species that will be absorbed.

ptclSources (vector of strings, optional, default = [])

A list of ParticleSources (with recordParticleData=true) for which this history will record data. If this is non-empty, ptclSourceSpecies must contain a list of the sourced species, one for each source.

ptclSourceSpecies (vector of strings, optional, default = [])

A list of species, one for each ParticleSource in ptclSources.

collectMethod (string, required)

The method for collecting particle data. May be one of the following:

recordForEachPtcl:

Store the desired particle attributes for each absorbed particle in a separate record—-useful when one wants to know the data for each particle; in this case the absorption time will automatically be recorded for each particle (as the last component of the result).

In this case, the history dataset will be an array of size \(N_p \times (1+m)\) where \(m\) is the number of ptclAttributes given, and \(N_p\) is the number of particles absorbed.

sumForEachStep:

Sum the desired particle attributes for all particles absorbed for each time step, yielding one record per time step

In this case, the history dataset will be an array of size \(n \times m\) where \(m\) is the number of ptclAttributes given, and \(n\) is the number of time steps.

statsForEachStep:

At each step, record

  • The total weight of absorbed particles, \(\sum_p w_p\),

  • The weighted sum of desired particle attributes, \(\sum_p w_p a_p\), where \(a_p\) is the desired particle attribute, such as xPosition or yVelocity, and

  • The weighted sum of squares, \(\sum_p w_p a_p^2\).

(For non-weighted particles, \(w_p\) is one.)

If there are \(m\) quantities in the ptclAttributes string, then the history dataset will be an array of dimensions \(n \times 3 \times m\), where in in the number of time steps. For each time step, the \(3\times m\) record has elements

  • \((0,n)\), the total weight of particles absorbed;

  • \((1,n)\) the weighted sum of particle attribute \(n\); and

  • \((2,n)\) the weighted sum of squares.

Dividing \((1,n)\) by \((0,n)\) yields the average of quantity \(n\) over all particles absorbed in a given time step.

ptclAttributes (vector of strings, required)

A list of the particle attributes that should be recorded by this history. Valid attributes are listed in speciesBinning under ptclAttributes.

speciesAbsPtclData2 History Example

<History testMoments>
 kind = speciesAbsPtclData2
 species = [ beamElectrons ]
 ptclAbsorbers = [ beamLeftAbsorber ]
 ptclAttributes = [pos0 pos1 pos2 gVel0 gVel1 gVel2 gamma ]
 collectMethod = statsForEachStep
</History>