pub trait BcaTally: Send {
// Required method
fn merge(&mut self, other: Self)
where Self: Sized;
// Provided methods
fn begin_history(&mut self, _index: u64) { ... }
fn electronic(
&mut self,
_p: &Particle,
_from: [f64; 3],
_channel: ElectronicChannel,
_energy_ev: f64,
) { ... }
fn partner(
&mut self,
_p: &Particle,
_impact_parameter_m: f64,
_partners: usize,
) { ... }
fn lattice(
&mut self,
_at: [f64; 3],
_layer: usize,
_kind: LatticeDeposit,
_energy_ev: f64,
) { ... }
fn recoil(&mut self, _recoil: &Particle) { ... }
fn stopped(&mut self, _p: &Particle) { ... }
fn escaped(&mut self, _p: &Particle, _face: Face) { ... }
fn end_history(&mut self, _index: u64, _budget: &EnergyBudget) { ... }
}Expand description
Event hooks called by the engine. All default to no-ops except merge.
Positions are [x, y, z] in metres, x the depth. The Particle passed
is the state after the event (for example after the energy loss).
Required Methods§
Provided Methods§
Sourcefn begin_history(&mut self, _index: u64)
fn begin_history(&mut self, _index: u64)
A primary history starts.
Sourcefn electronic(
&mut self,
_p: &Particle,
_from: [f64; 3],
_channel: ElectronicChannel,
_energy_ev: f64,
)
fn electronic( &mut self, _p: &Particle, _from: [f64; 3], _channel: ElectronicChannel, _energy_ev: f64, )
Electronic loss of energy_ev. For ElectronicChannel::NonLocal
it was spread along the straight segment from from to p.pos; for
ElectronicChannel::Local it was deposited at p.pos.
Sourcefn partner(&mut self, _p: &Particle, _impact_parameter_m: f64, _partners: usize)
fn partner(&mut self, _p: &Particle, _impact_parameter_m: f64, _partners: usize)
A collision partner of p, reported before the collision changes
p (so p is the incoming state, unlike in the other hooks):
impact_parameter_m is the distance from the partner to the incoming
straight path, and partners the number of partners of this collision
step, each of which is reported by its own call. The amorphous model
reports its hard collision and each weak collision as a step of one
partner; the crystal flight model reports every simultaneous partner
of a step with the same partners.
Sourcefn lattice(
&mut self,
_at: [f64; 3],
_layer: usize,
_kind: LatticeDeposit,
_energy_ev: f64,
)
fn lattice( &mut self, _at: [f64; 3], _layer: usize, _kind: LatticeDeposit, _energy_ev: f64, )
Nuclear energy energy_ev left in the lattice at at in region
layer (the layer index of a stack, the flat voxel index of a voxel
grid).
Sourcefn recoil(&mut self, _recoil: &Particle)
fn recoil(&mut self, _recoil: &Particle)
A target atom was displaced (transfer above E_d); recoil is its
state at creation, before it is followed (or stopped, if below the
recoil cutoff or if cascades are off).
Sourcefn stopped(&mut self, _p: &Particle)
fn stopped(&mut self, _p: &Particle)
A particle came to rest at p.pos with kinetic energy p.energy_ev.
Sourcefn escaped(&mut self, _p: &Particle, _face: Face)
fn escaped(&mut self, _p: &Particle, _face: Face)
A particle left the target through face; p is its state outside
(after refraction by the surface barrier).
Sourcefn end_history(&mut self, _index: u64, _budget: &EnergyBudget)
fn end_history(&mut self, _index: u64, _budget: &EnergyBudget)
A primary history ended; budget is its energy bookkeeping.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".