Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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
39#include "G4BulirschStoer.hh"
41
42template <>
45 public G4ChordFinderDelegate<G4IntegrationDriver<G4BulirschStoer>>
46{
47 public:
48
50 G4BulirschStoer* stepper,
51 G4int numberOfComponents = 6,
52 G4int statisticsVerbosity = 1);
53
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(const G4FieldTrack* /*track*/ = nullptr) override {};
74
75 virtual G4bool DoesReIntegrate() const override { return false; } /// ????
76
78 G4double stepLen,
79 G4double eps,
80 G4double beginStep = 0) override;
81
83 const G4double dydx[],
84 G4double hstep,
85 G4double& missDist,
86 G4double& dyerr) override;
87
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
112 virtual void SetEquationOfMotion(G4EquationOfMotion* equation) override;
113
114 virtual const G4MagIntegratorStepper* GetStepper() const override;
116
117 virtual void StreamInfo( std::ostream& os ) const override;
118 // Write out the parameters / state of the driver
119
120 private:
121
122 G4int GetNumberOfVarialbles() const;
123
124 G4double fMinimumStep;
125 G4double fVerbosity;
126
127 G4ModifiedMidpoint fMidpointMethod;
128 G4BulirschStoer* bulirschStoer;
129
136
137
140
141 G4double derivs[2][6][G4FieldTrack::ncompSVEC];
142
143 const G4int interval_sequence[2];
144
145 using ChordFinderDelegate =
147};
148
149#include "G4BulirschStoerDriver.icc"
150
151#endif
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4double AdvanceChordLimitedImpl(G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance)
void OneGoodStep(G4double y[], const G4double dydx[], G4double &curveLength, G4double htry, G4double eps, G4double &hdid, G4double &hnext)
virtual G4EquationOfMotion * GetEquationOfMotion() override
G4IntegrationDriver(const G4IntegrationDriver &)=delete
virtual void SetEquationOfMotion(G4EquationOfMotion *equation) override
virtual G4double AdvanceChordLimited(G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance) override
virtual G4MagIntegratorStepper * GetStepper() override
virtual const G4MagIntegratorStepper * GetStepper() const override
virtual G4int GetVerboseLevel() const override
const G4EquationOfMotion * GetEquationOfMotion() const
virtual G4double ComputeNewStepSize(G4double errMaxNorm, G4double hstepCurrent) override
G4IntegrationDriver & operator=(const G4IntegrationDriver &)=delete
virtual void StreamInfo(std::ostream &os) const override
virtual G4bool QuickAdvance(G4FieldTrack &y_val, const G4double dydx[], G4double hstep, G4double &missDist, G4double &dyerr) override
virtual G4bool DoesReIntegrate() const override
virtual void GetDerivatives(const G4FieldTrack &track, G4double dydx[], G4double field[]) const override
virtual void SetVerboseLevel(G4int level) override
G4IntegrationDriver(G4double hminimum, G4BulirschStoer *stepper, G4int numberOfComponents=6, G4int statisticsVerbosity=1)
virtual void GetDerivatives(const G4FieldTrack &track, G4double dydx[]) const override
virtual G4bool AccurateAdvance(G4FieldTrack &track, G4double stepLen, G4double eps, G4double beginStep=0) override
????
virtual void OnComputeStep(const G4FieldTrack *=nullptr) override