Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::MagFieldEquation< FieldT > Class Template Reference

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.
 

Detailed Description

template<class FieldT>
class celeritas::MagFieldEquation< FieldT >

Evaluate the right hand side of the Lorentz equation.

The templated FieldT must be a function-like object with the signature

Real3 (*)(const Real3&)
Array< real_type, 3 > Real3
Three-dimensional cartesian coordinates.
Definition: geocel/Types.hh:22

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}) \]

Constructor & Destructor Documentation

◆ MagFieldEquation()

template<class FieldT >
CELER_FUNCTION celeritas::MagFieldEquation< FieldT >::MagFieldEquation ( FieldT &&  field,
units::ElementaryCharge  charge 
)
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.


The documentation for this class was generated from the following file: