Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TSimpleRunge< T_Equation, N > Class Template Reference

G4TSimpleRunge is a templated version of G4SimpleRunge. More...

#include <G4TSimpleRunge.hh>

Inheritance diagram for G4TSimpleRunge< T_Equation, N >:

Public Member Functions

 G4TSimpleRunge (T_Equation *EqRhs, G4int numberOfVariables=6)
 ~G4TSimpleRunge ()=default
void RightHandSide (G4double y[], G4double dydx[])
void DumbStepper (const G4double yIn[], const G4double dydx[], G4double h, G4double yOut[])
G4int IntegratorOrder () const
Public Member Functions inherited from G4TMagErrorStepper< G4TSimpleRunge< T_Equation, N >, T_Equation, N >
 G4TMagErrorStepper (T_Equation *EqRhs, G4int numberOfVariables, G4int numStateVariables=12)
virtual ~G4TMagErrorStepper ()=default
G4TMagErrorStepperoperator= (const G4TMagErrorStepper &)=delete
void RightHandSide (G4double y[], G4double dydx[])
void Stepper (const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[]) override final
G4double DistChord () const override final
G4StepperType StepperType () const override
Public Member Functions inherited from G4MagIntegratorStepper
 G4MagIntegratorStepper (G4EquationOfMotion *Equation, G4int numIntegrationVariables, G4int numStateVariables=12, G4bool isFSAL=false)
virtual ~G4MagIntegratorStepper ()=default
 G4MagIntegratorStepper (const G4MagIntegratorStepper &)=delete
G4MagIntegratorStepperoperator= (const G4MagIntegratorStepper &)=delete
void NormaliseTangentVector (G4double vec[6])
void NormalisePolarizationVector (G4double vec[12])
void RightHandSide (const G4double y[], G4double dydx[]) const
void RightHandSide (const G4double y[], G4double dydx[], G4double field[]) const
G4int GetNumberOfVariables () const
G4int GetNumberOfStateVariables () const
G4int IntegrationOrder ()
G4EquationOfMotionGetEquationOfMotion ()
const G4EquationOfMotionGetEquationOfMotion () const
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
unsigned long GetfNoRHSCalls ()
void ResetfNORHSCalls ()
G4bool IsFSAL () const
G4bool isQSS () const
void SetIsQSS (G4bool val)

Static Public Attributes

static constexpr double IntegratorCorrection = 1. / ((1 << 2) - 1)

Additional Inherited Members

Protected Member Functions inherited from G4MagIntegratorStepper
void SetIntegrationOrder (G4int order)
void SetFSAL (G4bool flag=true)

Detailed Description

template<class T_Equation, int N>
class G4TSimpleRunge< T_Equation, N >

G4TSimpleRunge is a templated version of G4SimpleRunge.

Definition at line 48 of file G4TSimpleRunge.hh.

Constructor & Destructor Documentation

◆ G4TSimpleRunge()

template<class T_Equation, int N>
G4TSimpleRunge< T_Equation, N >::G4TSimpleRunge ( T_Equation * EqRhs,
G4int numberOfVariables = 6 )
inline

Definition at line 55 of file G4TSimpleRunge.hh.

58 , fNumberOfVariables(numberOfVariables)
59 , fEquation_Rhs(EqRhs)
60
61 {
62 // default GetNumberOfStateVariables() == 12
63 assert(this->GetNumberOfStateVariables() <= 12);
64 }
G4int GetNumberOfStateVariables() const
G4TMagErrorStepper(T_Equation *EqRhs, G4int numberOfVariables, G4int numStateVariables=12)
G4TSimpleRunge is a templated version of G4SimpleRunge.

Referenced by G4TSimpleRunge().

◆ ~G4TSimpleRunge()

template<class T_Equation, int N>
G4TSimpleRunge< T_Equation, N >::~G4TSimpleRunge ( )
default

Member Function Documentation

◆ DumbStepper()

template<class T_Equation, int N>
void G4TSimpleRunge< T_Equation, N >::DumbStepper ( const G4double yIn[],
const G4double dydx[],
G4double h,
G4double yOut[] )
inline

Definition at line 74 of file G4TSimpleRunge.hh.

77 {
78 // Initialise time to t0, needed when it is not updated by the integration.
79 yTemp[7] = yOut[7] = yIn[7]; // Better to set it to NaN; // TODO
80
81 for(G4int i = 0; i < N; ++i)
82 {
83 yTemp[i] = yIn[i] + 0.5 * h * dydx[i];
84 }
85
86 this->RightHandSide(yTemp, dydxTemp);
87
88 for(G4int i = 0; i < N; ++i)
89 {
90 yOut[i] = yIn[i] + h * (dydxTemp[i]);
91 }
92 }
void RightHandSide(G4double y[], G4double dydx[])

◆ IntegratorOrder()

template<class T_Equation, int N>
G4int G4TSimpleRunge< T_Equation, N >::IntegratorOrder ( ) const
inlinevirtual

Returns the order of the integrator, i.e. its error behaviour is of the order O(h^order).

Implements G4MagIntegratorStepper.

Definition at line 94 of file G4TSimpleRunge.hh.

94{ return 2; }

◆ RightHandSide()

template<class T_Equation, int N>
void G4TSimpleRunge< T_Equation, N >::RightHandSide ( G4double y[],
G4double dydx[] )
inline

Definition at line 68 of file G4TSimpleRunge.hh.

70 {
71 fEquation_Rhs->T_Equation::RightHandSide(y, dydx);
72 }

Referenced by DumbStepper().

Member Data Documentation

◆ IntegratorCorrection

template<class T_Equation, int N>
double G4TSimpleRunge< T_Equation, N >::IntegratorCorrection = 1. / ((1 << 2) - 1)
staticconstexpr

Definition at line 53 of file G4TSimpleRunge.hh.


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