Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ExplicitEuler Class Reference

G4ExplicitEuler implements an Explicit Euler stepper for magnetic field: x_1 = x_0 + h * dx_0. The most simple approach for solving linear differential equations. Takes the current derivative and adds it to the current position. More...

#include <G4ExplicitEuler.hh>

Inheritance diagram for G4ExplicitEuler:

Public Member Functions

 G4ExplicitEuler (G4EquationOfMotion *EqRhs, G4int numberOfVariables=6)
 ~G4ExplicitEuler () override=default
void DumbStepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[]) override
G4int IntegratorOrder () const override
G4StepperType StepperType () const override
Public Member Functions inherited from G4MagErrorStepper
 G4MagErrorStepper (G4EquationOfMotion *EqRhs, G4int numberOfVariables, G4int numStateVariables=12)
 ~G4MagErrorStepper () override
 G4MagErrorStepper (const G4MagErrorStepper &)=delete
G4MagErrorStepperoperator= (const G4MagErrorStepper &)=delete
void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[]) override
G4double DistChord () 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)

Additional Inherited Members

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

Detailed Description

G4ExplicitEuler implements an Explicit Euler stepper for magnetic field: x_1 = x_0 + h * dx_0. The most simple approach for solving linear differential equations. Takes the current derivative and adds it to the current position.

Definition at line 48 of file G4ExplicitEuler.hh.

Constructor & Destructor Documentation

◆ G4ExplicitEuler()

G4ExplicitEuler::G4ExplicitEuler ( G4EquationOfMotion * EqRhs,
G4int numberOfVariables = 6 )

Constructor for G4ExplicitEuler.

Parameters
[in]EqRhsPointer to the provided equation of motion.
[in]numberOfVariablesThe number of integration variables.

Definition at line 43 of file G4ExplicitEuler.cc.

45 : G4MagErrorStepper(EqRhs, numberOfVariables)
46{
47}
G4MagErrorStepper(G4EquationOfMotion *EqRhs, G4int numberOfVariables, G4int numStateVariables=12)

◆ ~G4ExplicitEuler()

G4ExplicitEuler::~G4ExplicitEuler ( )
overridedefault

Default Destructor.

Member Function Documentation

◆ DumbStepper()

void G4ExplicitEuler::DumbStepper ( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[] )
overridevirtual

The stepper function for the integration.

Parameters
[in]yStarting values array of integration variables.
[in]dydxDerivatives array.
[in]hThe given step size.
[out]youtIntegration output.

Implements G4MagErrorStepper.

Definition at line 54 of file G4ExplicitEuler.cc.

58{
59 const G4int numberOfVariables = GetNumberOfVariables();
60
61 // Initialise time to t0, needed when it is not updated by the integration.
62
63 for(G4int i=0; i< numberOfVariables; ++i)
64 {
65 yOut[i] = yIn[i] + h*dydx[i] ; // 1st and only Step
66 }
67
68 return;
69}
int G4int
Definition G4Types.hh:85
G4int GetNumberOfVariables() const

◆ IntegratorOrder()

G4int G4ExplicitEuler::IntegratorOrder ( ) const
inlineoverridevirtual

Returns the order, 1, of integration.

Implements G4MagIntegratorStepper.

Definition at line 80 of file G4ExplicitEuler.hh.

80{ return 1; }

◆ StepperType()

G4StepperType G4ExplicitEuler::StepperType ( ) const
inlineoverridevirtual

Returns the stepper type-ID, "kExplicitEuler".

Reimplemented from G4MagIntegratorStepper.

Definition at line 85 of file G4ExplicitEuler.hh.

85{ return kExplicitEuler; }
@ kExplicitEuler
G4ExplicitEuler.

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