Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FSALIntegrationDriver< T > Class Template Reference

G4FSALIntegrationDriver is a templated driver class which controls the integration error of a Runge-Kutta stepper. More...

#include <G4FSALIntegrationDriver.hh>

Inheritance diagram for G4FSALIntegrationDriver< T >:

Public Member Functions

 G4FSALIntegrationDriver (G4double hminimum, T *stepper, G4int numberOfComponents=6, G4int statisticsVerbosity=1)
 ~G4FSALIntegrationDriver () override
 G4FSALIntegrationDriver (const G4FSALIntegrationDriver &)=delete
G4FSALIntegrationDriveroperator= (const G4FSALIntegrationDriver &)=delete
G4double AdvanceChordLimited (G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance) override
void OnStartTracking () override
void OnComputeStep (const G4FieldTrack *=nullptr) override
G4bool DoesReIntegrate () const override
G4bool AccurateAdvance (G4FieldTrack &track, G4double hstep, G4double eps, G4double hinitial=0.0) override
G4bool QuickAdvance (G4FieldTrack &fieldTrack, const G4double dydx[], G4double hstep, G4double &dchord_step, G4double &dyerr) override
void OneGoodStep (G4double y[], G4double dydx[], G4double &curveLength, G4double htry, G4double eps, G4double &hdid, G4double &hnext)
void SetVerboseLevel (G4int newLevel) override
G4int GetVerboseLevel () const override
void StreamInfo (std::ostream &os) const override
G4double GetMinimumStep () const
void SetMinimumStep (G4double newval)
G4double GetSmallestFraction () const
void SetSmallestFraction (G4double val)
Public Member Functions inherited from G4RKIntegrationDriver< T >
 G4RKIntegrationDriver (T *stepper)
 G4RKIntegrationDriver (const G4RKIntegrationDriver &)=delete
G4RKIntegrationDriveroperator= (const G4RKIntegrationDriver &)=delete
void GetDerivatives (const G4FieldTrack &track, G4double dydx[]) const override
void GetDerivatives (const G4FieldTrack &track, G4double dydx[], G4double field[]) const override
G4double ComputeNewStepSize (G4double errMaxNorm, G4double hstepCurrent) final
G4EquationOfMotionGetEquationOfMotion () override
void SetEquationOfMotion (G4EquationOfMotion *equation) override
const T * GetStepper () const override
T * GetStepper () override
void StreamInfo (std::ostream &os) const override
G4double GetSafety () const
G4double GetPshrnk () const
G4double GetPgrow () const
void RenewStepperAndAdjust (G4MagIntegratorStepper *stepper) override
void ReSetParameters (G4double safety=0.9)
void SetSafety (G4double valS)
G4int GetMaxNoSteps () const
void SetMaxNoSteps (G4int val)
G4double GetSmallestFraction () const
void SetSmallestFraction (G4double val)
Public Member Functions inherited from G4VIntegrationDriver
virtual ~G4VIntegrationDriver ()=default
Public Member Functions inherited from G4ChordFinderDelegate< G4FSALIntegrationDriver< T > >
virtual ~G4ChordFinderDelegate ()
G4double AdvanceChordLimitedImpl (G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance)
void ResetStepEstimate ()
G4double GetLastStepEstimateUnc ()
void SetLastStepEstimateUnc (G4double stepEst)
G4int GetNoCalls ()
G4int GetNoTrials ()
G4int GetNoMaxTrials ()
void SetFractions_Last_Next (G4double fractLast=0.90, G4double fractNext=0.95)
void SetFirstFraction (G4double fractFirst)
G4double GetFirstFraction ()
G4double GetFractionLast ()
G4double GetFractionNextEstimate ()
void StreamDelegateInfo (std::ostream &os) const
void TestChordPrint (G4int noTrials, G4int lastStepTrial, G4double dChordStep, G4double fDeltaChord, G4double nextStepTrial)

Protected Member Functions

void IncrementQuickAdvanceCalls ()
Protected Member Functions inherited from G4RKIntegrationDriver< T >
G4double ShrinkStepSize (G4double h, G4double error) const
G4double GrowStepSize (G4double h, G4double error) const
G4double ShrinkStepSize2 (G4double h, G4double error2) const
G4double GrowStepSize2 (G4double h, G4double error2) const
void UpdateErrorConstraints ()

Additional Inherited Members

Static Protected Attributes inherited from G4VIntegrationDriver
static constexpr G4double max_stepping_increase = 5
static constexpr G4double max_stepping_decrease = 0.1

Detailed Description

template<class T>
class G4FSALIntegrationDriver< T >

G4FSALIntegrationDriver is a templated driver class which controls the integration error of a Runge-Kutta stepper.

Definition at line 46 of file G4FSALIntegrationDriver.hh.

Constructor & Destructor Documentation

◆ G4FSALIntegrationDriver() [1/2]

template<class T>
G4FSALIntegrationDriver< T >::G4FSALIntegrationDriver ( G4double hminimum,
T * stepper,
G4int numberOfComponents = 6,
G4int statisticsVerbosity = 1 )
inline

Constructor for G4FSALIntegrationDriver.

Parameters
[in]hminimumMinimum allowed step.
[in]stepperPointer to the stepper algorithm.
[in]numberOfComponentsThe number of integration variables, if not matching stepper's number of variables, issue exception.
[in]statisticsVerbosityVerbosity level.

Referenced by G4FSALIntegrationDriver(), and operator=().

◆ ~G4FSALIntegrationDriver()

template<class T>
G4FSALIntegrationDriver< T >::~G4FSALIntegrationDriver ( )
inlineoverride

Destructor. Provides statistics if verbosity level is greater than zero.

◆ G4FSALIntegrationDriver() [2/2]

template<class T>
G4FSALIntegrationDriver< T >::G4FSALIntegrationDriver ( const G4FSALIntegrationDriver< T > & )
delete

Copy constructor and assignment operator not allowed.

Member Function Documentation

◆ AccurateAdvance()

template<class T>
G4bool G4FSALIntegrationDriver< T >::AccurateAdvance ( G4FieldTrack & track,
G4double hstep,
G4double eps,
G4double hinitial = 0.0 )
inlineoverridevirtual

Advances integration accurately by relative accuracy better than 'eps'. On output the track is replaced by the value at the end of interval.

Parameters
[in,out]trackThe current track in field.
[in]hstepProposed step length.
[in]epsRequested accuracy, y_err/hstep.
[in]hinitialInitial minimum integration step.
Returns
true if integration succeeds.

Implements G4VIntegrationDriver.

◆ AdvanceChordLimited()

template<class T>
G4double G4FSALIntegrationDriver< T >::AdvanceChordLimited ( G4FieldTrack & track,
G4double hstep,
G4double eps,
G4double chordDistance )
inlineoverridevirtual

Computes the step to take, based on chord limits.

Parameters
[in,out]trackThe current track in field.
[in]hstepProposed step length.
[in]epsRequested accuracy, y_err/hstep.
[in]chordDistanceMaximum sagitta distance.
Returns
The length of step taken.

Implements G4VIntegrationDriver.

◆ DoesReIntegrate()

template<class T>
G4bool G4FSALIntegrationDriver< T >::DoesReIntegrate ( ) const
inlineoverridevirtual

The driver does implement re-integration. Returns true.

Implements G4VIntegrationDriver.

◆ GetMinimumStep()

template<class T>
G4double G4FSALIntegrationDriver< T >::GetMinimumStep ( ) const
inline

Getter and Setter for minimum allowed step.

◆ GetSmallestFraction()

template<class T>
G4double G4FSALIntegrationDriver< T >::GetSmallestFraction ( ) const
inline

Getter and Setter for smallest fraction.

◆ GetVerboseLevel()

template<class T>
G4int G4FSALIntegrationDriver< T >::GetVerboseLevel ( ) const
inlineoverridevirtual

Implements G4VIntegrationDriver.

◆ IncrementQuickAdvanceCalls()

template<class T>
void G4FSALIntegrationDriver< T >::IncrementQuickAdvanceCalls ( )
inlineprotected

Increments the counter for the number of calls to QuickAdvance().

◆ OnComputeStep()

template<class T>
void G4FSALIntegrationDriver< T >::OnComputeStep ( const G4FieldTrack * = nullptr)
inlineoverridevirtual

Dispatch interface method for computing step. Does nothing here.

Implements G4VIntegrationDriver.

◆ OneGoodStep()

template<class T>
void G4FSALIntegrationDriver< T >::OneGoodStep ( G4double y[],
G4double dydx[],
G4double & curveLength,
G4double htry,
G4double eps,
G4double & hdid,
G4double & hnext )
inline

Takes one Step that is as large as possible while satisfying the accuracy criterion.

Parameters
[in,out]yThe current track state, y.
[in]dydxdydx array.
[in,out]curveLengthStep start, x.
[in]htryStep to attempt.
[in]epsThe relative accuracy.
[out]hdidStep achieved.
[out]hnextProposed next step.

◆ OnStartTracking()

template<class T>
void G4FSALIntegrationDriver< T >::OnStartTracking ( )
inlineoverridevirtual

Dispatch interface method for initialisation/reset of driver.

Implements G4VIntegrationDriver.

◆ operator=()

template<class T>
G4FSALIntegrationDriver & G4FSALIntegrationDriver< T >::operator= ( const G4FSALIntegrationDriver< T > & )
delete

◆ QuickAdvance()

template<class T>
G4bool G4FSALIntegrationDriver< T >::QuickAdvance ( G4FieldTrack & fieldTrack,
const G4double dydx[],
G4double hstep,
G4double & dchord_step,
G4double & dyerr )
inlineoverridevirtual

Attempts one integration step, and returns estimated error 'dyerr'. It does not ensure accuracy.

Parameters
[in,out]fieldTrackThe current track in field.
[in]dydxdydx array.
[in]hstepProposed step length.
[out]dchord_stepEstimated sagitta distance.
[out]dyerrEstimated error.
Returns
true if integration succeeds.

Reimplemented from G4VIntegrationDriver.

◆ SetMinimumStep()

template<class T>
void G4FSALIntegrationDriver< T >::SetMinimumStep ( G4double newval)
inline

◆ SetSmallestFraction()

template<class T>
void G4FSALIntegrationDriver< T >::SetSmallestFraction ( G4double val)
inline

◆ SetVerboseLevel()

template<class T>
void G4FSALIntegrationDriver< T >::SetVerboseLevel ( G4int newLevel)
inlineoverridevirtual

Setter and getter for verbosity.

Implements G4VIntegrationDriver.

◆ StreamInfo()

template<class T>
void G4FSALIntegrationDriver< T >::StreamInfo ( std::ostream & os) const
inlineoverridevirtual

Writes out to stream the parameters/state of the driver.

Implements G4VIntegrationDriver.


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