Import Geant4 11.4.0 source tree
This commit is contained in:
@@ -26,11 +26,11 @@
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// G4IntegrationDriver<G4BulirschStoer> is a driver class using
|
||||
// G4IntegrationDriver<G4BulirschStoer> is a concrete driver class using
|
||||
// Bulirsch-Stoer method to integrate the equation of motion.
|
||||
|
||||
// Author: Dmitry Sorokin, Google Summer of Code 2016
|
||||
// Supervision: John Apostolakis, CERN
|
||||
// Author: Dmitry Sorokin (CERN, Google Summer of Code 2016), 13.02.2018
|
||||
// Supervision: John Apostolakis (CERN)
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4BULIRSCH_STOER_DRIVER_HH
|
||||
#define G4BULIRSCH_STOER_DRIVER_HH
|
||||
@@ -39,6 +39,11 @@
|
||||
#include "G4BulirschStoer.hh"
|
||||
#include "G4ChordFinderDelegate.hh"
|
||||
|
||||
/**
|
||||
* @brief G4IntegrationDriver<G4BulirschStoer> is a concrete driver class
|
||||
* using the Bulirsch-Stoer method to integrate the equation of motion.
|
||||
*/
|
||||
|
||||
template <>
|
||||
class G4IntegrationDriver<G4BulirschStoer>:
|
||||
public G4VIntegrationDriver,
|
||||
@@ -46,45 +51,97 @@ class G4IntegrationDriver<G4BulirschStoer>:
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor for the concrete G4IntegrationDriver.
|
||||
* @param[in] hminimum The minumum allowed step..
|
||||
* @param[in] Boris Pointer to the Bulirsch-Stoer motion algorithm.
|
||||
* @param[in] numberOfComponents The number of integration variables.
|
||||
* @param[in] verbosity Flag for verbosity.
|
||||
*/
|
||||
G4IntegrationDriver( G4double hminimum,
|
||||
G4BulirschStoer* stepper,
|
||||
G4int numberOfComponents = 6,
|
||||
G4int statisticsVerbosity = 1);
|
||||
|
||||
/**
|
||||
* Default Destructor.
|
||||
*/
|
||||
~G4IntegrationDriver() = default;
|
||||
|
||||
/**
|
||||
* Copy constructor and assignment operator not allowed.
|
||||
*/
|
||||
G4IntegrationDriver(const G4IntegrationDriver&) = delete;
|
||||
G4IntegrationDriver& operator=(const G4IntegrationDriver&) = delete;
|
||||
|
||||
virtual G4double AdvanceChordLimited(G4FieldTrack& track,
|
||||
G4double hstep,
|
||||
G4double eps,
|
||||
G4double chordDistance) override
|
||||
{
|
||||
return ChordFinderDelegate::
|
||||
AdvanceChordLimitedImpl(track, hstep, eps, chordDistance);
|
||||
}
|
||||
|
||||
virtual void OnStartTracking() override
|
||||
{
|
||||
ChordFinderDelegate::ResetStepEstimate();
|
||||
}
|
||||
|
||||
virtual void OnComputeStep(const G4FieldTrack* /*track*/ = nullptr) override {};
|
||||
|
||||
virtual G4bool DoesReIntegrate() const override { return false; } /// ????
|
||||
|
||||
virtual G4bool AccurateAdvance( G4FieldTrack& track,
|
||||
G4double stepLen,
|
||||
G4double eps,
|
||||
G4double beginStep = 0) override;
|
||||
|
||||
virtual G4bool QuickAdvance( G4FieldTrack& y_val,
|
||||
const G4double dydx[],
|
||||
/**
|
||||
* Computes the step to take, based on chord limits.
|
||||
* @param[in,out] track The current track in field.
|
||||
* @param[in] hstep Proposed step length.
|
||||
* @param[in] eps Requested accuracy, y_err/hstep.
|
||||
* @param[in] chordDistance Maximum sagitta distance.
|
||||
* @returns The length of step taken.
|
||||
*/
|
||||
G4double AdvanceChordLimited(G4FieldTrack& track,
|
||||
G4double hstep,
|
||||
G4double& missDist,
|
||||
G4double& dyerr) override;
|
||||
G4double eps,
|
||||
G4double chordDistance) override;
|
||||
|
||||
/**
|
||||
* Dispatch interface method for initialisation/reset of driver.
|
||||
*/
|
||||
void OnStartTracking() override;
|
||||
|
||||
/**
|
||||
* Dispatch interface method for computing step. Does nothing here.
|
||||
*/
|
||||
void OnComputeStep(const G4FieldTrack* track = nullptr) override;
|
||||
|
||||
/**
|
||||
* The driver does not implement re-integration. Returns false.
|
||||
*/
|
||||
G4bool DoesReIntegrate() const override;
|
||||
|
||||
/**
|
||||
* Advances integration accurately by relative accuracy better than 'eps'.
|
||||
* @param[in,out] track The current track in field.
|
||||
* @param[in] stepLen Proposed step length.
|
||||
* @param[in] eps Requested accuracy, y_err/hstep.
|
||||
* @param[in] beginStep Initial minimum integration step.
|
||||
* @returns true if integration succeeds.
|
||||
*/
|
||||
G4bool AccurateAdvance( G4FieldTrack& track,
|
||||
G4double stepLen,
|
||||
G4double eps,
|
||||
G4double beginStep = 0) override;
|
||||
|
||||
/**
|
||||
* Attempts one integration step, and returns estimated error 'dyerr'.
|
||||
* It does not ensure accuracy.
|
||||
* @param[in,out] y_val The current track in field.
|
||||
* @param[in] dydx dydx array.
|
||||
* @param[in] hstep Proposed step length.
|
||||
* @param[out] missDist Estimated sagitta distance.
|
||||
* @param[out] dyerr Estimated error.
|
||||
* @returns true if integration succeeds.
|
||||
*/
|
||||
G4bool QuickAdvance( G4FieldTrack& y_val,
|
||||
const G4double dydx[],
|
||||
G4double hstep,
|
||||
G4double& missDist,
|
||||
G4double& dyerr) override;
|
||||
|
||||
/**
|
||||
* Takes one Step that is as large as possible while satisfying the
|
||||
* accuracy criterion.
|
||||
* @param[in,out] y The current track state, y.
|
||||
* @param[in] dydx dydx array.
|
||||
* @param[in,out] curveLength Step start, x.
|
||||
* @param[in] htry Step to attempt.
|
||||
* @param[in] eps The relative accuracy.
|
||||
* @param[out] hdid Step achieved.
|
||||
* @param[out] hnext Proposed next step.
|
||||
*/
|
||||
void OneGoodStep( G4double y[],
|
||||
const G4double dydx[],
|
||||
G4double& curveLength,
|
||||
@@ -93,29 +150,47 @@ class G4IntegrationDriver<G4BulirschStoer>:
|
||||
G4double& hdid,
|
||||
G4double& hnext);
|
||||
|
||||
virtual void GetDerivatives( const G4FieldTrack& track,
|
||||
G4double dydx[]) const override;
|
||||
/**
|
||||
* Getters for derivatives.
|
||||
*/
|
||||
void GetDerivatives( const G4FieldTrack& track,
|
||||
G4double dydx[]) const override;
|
||||
void GetDerivatives( const G4FieldTrack& track,
|
||||
G4double dydx[],
|
||||
G4double field[]) const override;
|
||||
|
||||
virtual void GetDerivatives( const G4FieldTrack& track,
|
||||
G4double dydx[],
|
||||
G4double field[]) const override;
|
||||
/**
|
||||
* Setter and getter for verbosity.
|
||||
*/
|
||||
void SetVerboseLevel(G4int level) override;
|
||||
G4int GetVerboseLevel() const override;
|
||||
|
||||
virtual void SetVerboseLevel(G4int level) override;
|
||||
virtual G4int GetVerboseLevel() const override;
|
||||
/**
|
||||
* Computes the new step size .
|
||||
* @param[in] errMaxNorm The normalised error.
|
||||
* @param[in] hstepCurrent The current step size.
|
||||
* @returns The new step size.
|
||||
*/
|
||||
G4double ComputeNewStepSize(G4double errMaxNorm,
|
||||
G4double hstepCurrent) override;
|
||||
|
||||
virtual G4double ComputeNewStepSize(
|
||||
G4double errMaxNorm, // normalised error
|
||||
G4double hstepCurrent) override; // current step size
|
||||
|
||||
virtual G4EquationOfMotion* GetEquationOfMotion() override;
|
||||
/**
|
||||
* Getters and setter for the equation of motion.
|
||||
*/
|
||||
G4EquationOfMotion* GetEquationOfMotion() override;
|
||||
const G4EquationOfMotion* GetEquationOfMotion() const;
|
||||
virtual void SetEquationOfMotion(G4EquationOfMotion* equation) override;
|
||||
void SetEquationOfMotion(G4EquationOfMotion* equation) override;
|
||||
|
||||
virtual const G4MagIntegratorStepper* GetStepper() const override;
|
||||
virtual G4MagIntegratorStepper* GetStepper() override;
|
||||
/**
|
||||
* Getters for the stepper.
|
||||
*/
|
||||
const G4MagIntegratorStepper* GetStepper() const override;
|
||||
G4MagIntegratorStepper* GetStepper() override;
|
||||
|
||||
virtual void StreamInfo( std::ostream& os ) const override;
|
||||
// Write out the parameters / state of the driver
|
||||
/**
|
||||
* Writes out to stream the parameters/state of the driver.
|
||||
*/
|
||||
void StreamInfo( std::ostream& os ) const override;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user