Geant4  10.06.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4BulirschStoerDriver.hh
Go to the documentation of this file.
1 // ********************************************************************
2 // * License and Disclaimer *
3 // * *
4 // * The Geant4 software is copyright of the Copyright Holders of *
5 // * the Geant4 Collaboration. It is provided under the terms and *
6 // * conditions of the Geant4 Software License, included in the file *
7 // * LICENSE and available at http://cern.ch/geant4/license . These *
8 // * include a list of copyright holders. *
9 // * *
10 // * Neither the authors of this software system, nor their employing *
11 // * institutes,nor the agencies providing financial support for this *
12 // * work make any representation or warranty, express or implied, *
13 // * regarding this software system or assume any liability for its *
14 // * use. Please see the license in the file LICENSE and URL above *
15 // * for the full disclaimer and the limitation of liability. *
16 // * *
17 // * This code implementation is the result of the scientific and *
18 // * technical work of the GEANT4 collaboration. *
19 // * By using, copying, modifying or distributing the software (or *
20 // * any work based on the software) you agree to acknowledge its *
21 // * use in resulting scientific publications, and indicate your *
22 // * acceptance of all terms of the Geant4 Software license. *
23 // ********************************************************************
24 //
25 // G4BulirschStoer driver
26 //
27 // Class description:
28 //
29 // G4IntegrationDriver<G4BulirschStoer> is a driver class using
30 // Bulirsch-Stoer method to integrate the equation of motion.
31 
32 // Author: Dmitry Sorokin, Google Summer of Code 2016
33 // Supervision: John Apostolakis, CERN
34 // --------------------------------------------------------------------
35 #ifndef G4BULIRSCH_STOER_DRIVER_HH
36 #define G4BULIRSCH_STOER_DRIVER_HH
37 
38 #include "G4IntegrationDriver.hh"
39 #include "G4BulirschStoer.hh"
40 #include "G4ChordFinderDelegate.hh"
41 
42 template <>
44  public G4VIntegrationDriver,
45  public G4ChordFinderDelegate<G4IntegrationDriver<G4BulirschStoer>>
46 {
47  public:
48 
49  G4IntegrationDriver( G4double hminimum,
50  G4BulirschStoer* stepper,
51  G4int numberOfComponents = 6,
52  G4int statisticsVerbosity = 1);
53 
54  ~G4IntegrationDriver() = default;
55 
58 
60  G4double hstep,
61  G4double eps,
62  G4double chordDistance) override
63  {
65  AdvanceChordLimitedImpl(track, hstep, eps, chordDistance);
66  }
67 
68  virtual void OnStartTracking() override
69  {
71  }
72 
73  virtual void OnComputeStep() override {};
74 
75  virtual G4bool DoesReIntegrate() override { return false; } /// ????
76 
77  virtual G4bool AccurateAdvance( G4FieldTrack& track,
78  G4double stepLen,
79  G4double eps,
80  G4double beginStep = 0) override;
81 
82  virtual G4bool QuickAdvance( G4FieldTrack& y_val,
83  const G4double dydx[],
84  G4double hstep,
85  G4double& missDist,
86  G4double& dyerr) override;
87 
88  void OneGoodStep( G4double y[],
89  const G4double dydx[],
90  G4double& curveLength,
91  G4double htry,
92  G4double eps,
93  G4double& hdid,
94  G4double& hnext);
95 
96  virtual void GetDerivatives( const G4FieldTrack& track,
97  G4double dydx[]) const override;
98 
99  virtual void GetDerivatives( const G4FieldTrack& track,
100  G4double dydx[],
101  G4double field[]) const override;
102 
103  virtual void SetVerboseLevel(G4int level) override;
104  virtual G4int GetVerboseLevel() const override;
105 
107  G4double errMaxNorm, // normalised error
108  G4double hstepCurrent) override; // current step size
109 
110  virtual G4EquationOfMotion* GetEquationOfMotion() override;
112  virtual void SetEquationOfMotion(G4EquationOfMotion* equation) override;
113 
114  virtual const G4MagIntegratorStepper* GetStepper() const override;
115  virtual G4MagIntegratorStepper* GetStepper() override;
116 
117  private:
118 
119  G4int GetNumberOfVarialbles() const;
120 
123 
126 
132  yError[G4FieldTrack::ncompSVEC];
133 
134 
137 
139 
140  const G4int interval_sequence[2];
141 
142  using ChordFinderDelegate =
144 };
145 
146 #include "G4BulirschStoerDriver.icc"
147 
148 #endif
virtual void OnComputeStep() override
Definition: G4BulirschStoerDriver.hh:73
virtual G4EquationOfMotion * GetEquationOfMotion() override
G4BulirschStoer * bulirschStoer
Definition: G4BulirschStoerDriver.hh:125
Definition: G4FieldTrack.hh:44
virtual void GetDerivatives(const G4FieldTrack &track, G4double dydx[]) const override
virtual void OnStartTracking() override
Definition: G4BulirschStoerDriver.hh:68
Definition: G4MagIntegratorStepper.hh:47
Definition: G4BulirschStoer.hh:43
virtual ~G4IntegrationDriver() override
Definition: G4FieldTrack.hh:140
virtual G4bool AccurateAdvance(G4FieldTrack &track, G4double hstep, G4double eps, G4double hinitial=0) override
virtual void SetVerboseLevel(G4int newLevel) override
double G4double
Definition: G4Types.hh:80
bool G4bool
Definition: G4Types.hh:83
virtual G4bool QuickAdvance(G4FieldTrack &fieldTrack, const G4double dydx[], G4double hstep, G4double &dchord_step, G4double &dyerr) override
G4double fMinimumStep
Definition: G4BulirschStoerDriver.hh:121
virtual G4double AdvanceChordLimited(G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance) override
Definition: G4BulirschStoerDriver.hh:59
Definition: G4ChordFinderDelegate.hh:41
virtual G4double ComputeNewStepSize(G4double errMaxNorm, G4double hstepCurrent) override
G4IntegrationDriver(G4double hminimum, T *stepper, G4int numberOfComponents=6, G4int statisticsVerbosity=0)
Definition: G4ModifiedMidpoint.hh:41
const G4IntegrationDriver & operator=(const G4IntegrationDriver &)=delete
virtual G4int GetVerboseLevel() const override
Definition: G4EquationOfMotion.hh:43
G4ModifiedMidpoint fMidpointMethod
Definition: G4BulirschStoerDriver.hh:124
int G4int
Definition: G4Types.hh:82
virtual G4bool DoesReIntegrate() override
Definition: G4BulirschStoerDriver.hh:75
virtual void SetEquationOfMotion(G4EquationOfMotion *equation) override
Definition: G4VIntegrationDriver.hh:51
Definition: G4IntegrationDriver.hh:48
G4double fVerbosity
Definition: G4BulirschStoerDriver.hh:122
virtual const T * GetStepper() const override
void OneGoodStep(G4double yVar[], const G4double dydx[], G4double &curveLength, G4double htry, G4double eps, G4double &hdid, G4double &hnext)
G4double AdvanceChordLimitedImpl(G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance)