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

G4VFSALIntegrationStepper is a class similar to G4VMagIntegratorStepper, but for steppers which estimate the value of the derivative at the projected endpoint of integration, at each successful step. This ability is known as 'First Same As Last' (FSAL). It reduces the number of required calls to the equation's RightHandSide method, and, as such the number of calls to the (potentially expensive) field evaluation methods. More...

#include <G4VFSALIntegrationStepper.hh>

Inheritance diagram for G4VFSALIntegrationStepper:

Public Member Functions

 G4VFSALIntegrationStepper (G4EquationOfMotion *Equation, G4int numIntegrationVariables, G4int numStateVariables=12)
virtual ~G4VFSALIntegrationStepper ()=default
 G4VFSALIntegrationStepper (const G4VFSALIntegrationStepper &)=delete
G4VFSALIntegrationStepperoperator= (const G4VFSALIntegrationStepper &)=delete
virtual void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[], G4double lastDydx[])=0
virtual G4double DistChord () const =0
void NormaliseTangentVector (G4double vec[6])
void NormalisePolarizationVector (G4double vec[12])
void RightHandSide (const double y[], double dydx[])
G4int GetNumberOfVariables () const
G4int GetNumberOfStateVariables () const
virtual G4int IntegratorOrder () const =0
G4EquationOfMotionGetEquationOfMotion ()
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
G4int GetfNoRHSCalls ()
void increasefNORHSCalls ()
void ResetfNORHSCalls ()

Detailed Description

G4VFSALIntegrationStepper is a class similar to G4VMagIntegratorStepper, but for steppers which estimate the value of the derivative at the projected endpoint of integration, at each successful step. This ability is known as 'First Same As Last' (FSAL). It reduces the number of required calls to the equation's RightHandSide method, and, as such the number of calls to the (potentially expensive) field evaluation methods.

Definition at line 59 of file G4VFSALIntegrationStepper.hh.

Constructor & Destructor Documentation

◆ G4VFSALIntegrationStepper() [1/2]

G4VFSALIntegrationStepper::G4VFSALIntegrationStepper ( G4EquationOfMotion * Equation,
G4int numIntegrationVariables,
G4int numStateVariables = 12 )

Constructor for G4VFSALIntegrationStepper.

Parameters
[in]EquationPointer to the provided equation of motion.
[in]numStateVariablesThe number of state variables.

Definition at line 36 of file G4VFSALIntegrationStepper.cc.

40 : fEquation_Rhs(Equation),
41 fNoIntegrationVariables(num_integration_vars),
42 fNoStateVariables(num_state_vars)
43{
44}

Referenced by G4FSALBogackiShampine45::G4FSALBogackiShampine45(), G4FSALDormandPrince745::G4FSALDormandPrince745(), G4VFSALIntegrationStepper(), and operator=().

◆ ~G4VFSALIntegrationStepper()

virtual G4VFSALIntegrationStepper::~G4VFSALIntegrationStepper ( )
virtualdefault

Default Destructor.

◆ G4VFSALIntegrationStepper() [2/2]

G4VFSALIntegrationStepper::G4VFSALIntegrationStepper ( const G4VFSALIntegrationStepper & )
delete

Copy constructor and assignment operator not allowed.

Member Function Documentation

◆ DistChord()

virtual G4double G4VFSALIntegrationStepper::DistChord ( ) const
pure virtual

Returns an estimate of the maximum distance of a chord from the true path over the segment last integrated.

Implemented in G4FSALBogackiShampine45, and G4FSALDormandPrince745.

◆ GetEquationOfMotion()

G4EquationOfMotion * G4VFSALIntegrationStepper::GetEquationOfMotion ( )
inline

Returns a pointer to the equation of motion. As some steppers (e.g. RKG3) require other methods of Eq_Rhs, this function allows for access to them.

◆ GetfNoRHSCalls()

G4int G4VFSALIntegrationStepper::GetfNoRHSCalls ( )
inline

Methods for debug use.

Definition at line 155 of file G4VFSALIntegrationStepper.hh.

155{ return fNoRHSCalls; }

◆ GetNumberOfStateVariables()

G4int G4VFSALIntegrationStepper::GetNumberOfStateVariables ( ) const
inline

Returns the number of variables of state variables (>= above, integration)

Referenced by G4FSALBogackiShampine45::G4FSALBogackiShampine45().

◆ GetNumberOfVariables()

G4int G4VFSALIntegrationStepper::GetNumberOfVariables ( ) const
inline

◆ increasefNORHSCalls()

void G4VFSALIntegrationStepper::increasefNORHSCalls ( )

Definition at line 46 of file G4VFSALIntegrationStepper.cc.

47{
48 ++fNoRHSCalls;
49}

Referenced by RightHandSide().

◆ IntegratorOrder()

virtual G4int G4VFSALIntegrationStepper::IntegratorOrder ( ) const
pure virtual

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

Implemented in G4FSALBogackiShampine45, and G4FSALDormandPrince745.

◆ NormalisePolarizationVector()

void G4VFSALIntegrationStepper::NormalisePolarizationVector ( G4double vec[12])
inline

Simple utility function to (re)normalise 'unit spin' vector.

◆ NormaliseTangentVector()

void G4VFSALIntegrationStepper::NormaliseTangentVector ( G4double vec[6])
inline

Simple utility function to (re)normalise 'unit velocity' vector.

◆ operator=()

G4VFSALIntegrationStepper & G4VFSALIntegrationStepper::operator= ( const G4VFSALIntegrationStepper & )
delete

◆ ResetfNORHSCalls()

void G4VFSALIntegrationStepper::ResetfNORHSCalls ( )
inline

Definition at line 157 of file G4VFSALIntegrationStepper.hh.

157{ fNoRHSCalls = 0; }

◆ RightHandSide()

void G4VFSALIntegrationStepper::RightHandSide ( const double y[],
double dydx[] )

Utility method to supply the standard Evaluation of the Right Hand side of the associated equation.

Definition at line 51 of file G4VFSALIntegrationStepper.cc.

53{
54 fEquation_Rhs->RightHandSide(y, dydx);
56}

Referenced by G4FSALBogackiShampine45::interpolate(), G4FSALDormandPrince745::SetupInterpolate(), G4FSALBogackiShampine45::Stepper(), and G4FSALDormandPrince745::Stepper().

◆ SetEquationOfMotion()

void G4VFSALIntegrationStepper::SetEquationOfMotion ( G4EquationOfMotion * newEquation)
inline

Setter for the equation of motion.

◆ Stepper()

virtual void G4VFSALIntegrationStepper::Stepper ( const G4double y[],
const G4double dydx[],
G4double h,
G4double yout[],
G4double yerr[],
G4double lastDydx[] )
pure virtual

The stepper for the Runge Kutta integration. The stepsize is fixed, with the step size given by 'h'. Integrates ODE starting values yInput[0 to 6]. Outputs yout[] and its estimated error yerr[].

Parameters
[in]yStarting values array of integration variables.
[in]dydxDerivatives array.
[in]hThe given step size.
[out]youtIntegration output.
[out]yerrThe estimated error.
[out]lastDydxLast derivative.

Implemented in G4FSALBogackiShampine45, and G4FSALDormandPrince745.


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