Celeritas
0.5.0-56+6b053cd
|
Evaluate the right hand side of the Lorentz equation. More...
#include <MagFieldEquation.hh>
Public Types | |
Type aliases | |
using | Field_t = FieldT |
Public Member Functions | |
CELER_FUNCTION | MagFieldEquation (FieldT &&field, units::ElementaryCharge q) |
Construct with a magnetic field equation and particle charge. More... | |
CELER_FUNCTION OdeState | operator() (OdeState const &y) const |
Evaluate the right hand side of the Lorentz equation. | |
Evaluate the right hand side of the Lorentz equation.
The templated FieldT
must be a function-like object with the signature
which returns a magnetic field vector at a given position. The field strength is in Celeritas native units, not Tesla.
Calling an instance of this class calculates the local derivatives of position and momentum (i.e. direction and force) based on the given magnetic field state.
\[ m \frac{d^2 \vec{x}}{d t^2} = (q/c)(\vec{v} \times \vec{B}) s = |v|t \vec{y} = d\vec{x}/ds \frac{d\vec{x}}{ds} = \vec{v}/|v| \frac{d\vec{y}}{ds} = (q/pc)(\vec{y} \times \vec{B}) \]
|
inline |
Construct with a magnetic field equation and particle charge.
The internal coefficient is based on Celeritas native units and the "natural" unit system used by the ParticleTrackView
.