#include <G4BFieldIntegrationDriver.hh>
|
| G4BFieldIntegrationDriver (std::unique_ptr< G4VIntegrationDriver > smallStepDriver, std::unique_ptr< G4VIntegrationDriver > largeStepDriver) |
|
| G4BFieldIntegrationDriver (const G4BFieldIntegrationDriver &)=delete |
|
const G4BFieldIntegrationDriver & | operator= (const G4BFieldIntegrationDriver &)=delete |
|
G4double | AdvanceChordLimited (G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance) override |
|
G4bool | AccurateAdvance (G4FieldTrack &track, G4double hstep, G4double eps, G4double hinitial=0) override |
|
G4bool | DoesReIntegrate () const override |
|
void | GetDerivatives (const G4FieldTrack &track, G4double dydx[]) const override |
|
void | GetDerivatives (const G4FieldTrack &track, G4double dydx[], G4double field[]) const override |
|
void | SetEquationOfMotion (G4EquationOfMotion *equation) override |
|
G4EquationOfMotion * | GetEquationOfMotion () override |
|
const G4MagIntegratorStepper * | GetStepper () const override |
|
G4MagIntegratorStepper * | GetStepper () override |
|
G4double | ComputeNewStepSize (G4double errMaxNorm, G4double hstepCurrent) override |
|
void | SetVerboseLevel (G4int level) override |
|
G4int | GetVerboseLevel () const override |
|
void | OnComputeStep (const G4FieldTrack *track) override |
|
void | OnStartTracking () override |
|
void | StreamInfo (std::ostream &os) const override |
|
void | PrintStatistics () const |
|
virtual | ~G4VIntegrationDriver ()=default |
|
virtual void | RenewStepperAndAdjust (G4MagIntegratorStepper *pItsStepper) |
|
virtual G4bool | QuickAdvance (G4FieldTrack &, const G4double[], G4double, G4double &, G4double &) |
|
◆ G4BFieldIntegrationDriver() [1/2]
Definition at line 62 of file G4BFieldIntegrationDriver.cc.
65 : fSmallStepDriver(std::move(smallStepDriver)),
66 fLargeStepDriver(std::move(largeStepDriver)),
67 fCurrDriver(fSmallStepDriver.get()),
69{
70 if (fSmallStepDriver->GetEquationOfMotion()
71 != fLargeStepDriver->GetEquationOfMotion())
72 {
73 G4Exception(
"G4BFieldIntegrationDriver Constructor:",
75 }
76}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
virtual G4EquationOfMotion * GetEquationOfMotion()=0
◆ G4BFieldIntegrationDriver() [2/2]
◆ AccurateAdvance()
◆ AdvanceChordLimited()
Implements G4VIntegrationDriver.
Definition at line 78 of file G4BFieldIntegrationDriver.cc.
82{
83 const G4double radius = CurvatureRadius(yCurrent);
84
86 if (chordDistance < 2 * radius)
87 {
88 stepMax = std::min(stepMax, twopi * radius);
89 driver = fSmallStepDriver.get();
90 ++fSmallDriverSteps;
91 } else
92 {
93 driver = fLargeStepDriver.get();
94 ++fLargeDriverSteps;
95 }
96
97 if (driver != fCurrDriver)
98 {
100 }
101
102 fCurrDriver = driver;
103
105 epsStep, chordDistance);
106}
virtual G4double AdvanceChordLimited(G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance)=0
virtual void OnComputeStep(const G4FieldTrack *=nullptr)=0
◆ ComputeNewStepSize()
◆ DoesReIntegrate()
G4bool G4BFieldIntegrationDriver::DoesReIntegrate |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ GetDerivatives() [1/2]
void G4BFieldIntegrationDriver::GetDerivatives |
( |
const G4FieldTrack & | track, |
|
|
G4double | dydx[] ) const |
|
inlineoverridevirtual |
◆ GetDerivatives() [2/2]
◆ GetEquationOfMotion()
◆ GetStepper() [1/2]
◆ GetStepper() [2/2]
◆ GetVerboseLevel()
G4int G4BFieldIntegrationDriver::GetVerboseLevel |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ OnComputeStep()
void G4BFieldIntegrationDriver::OnComputeStep |
( |
const G4FieldTrack * | track | ) |
|
|
inlineoverridevirtual |
◆ OnStartTracking()
void G4BFieldIntegrationDriver::OnStartTracking |
( |
| ) |
|
|
inlineoverridevirtual |
◆ operator=()
◆ PrintStatistics()
void G4BFieldIntegrationDriver::PrintStatistics |
( |
| ) |
const |
Definition at line 148 of file G4BFieldIntegrationDriver.cc.
149{
150 const auto totSteps = fSmallDriverSteps + fLargeDriverSteps;
151 const auto toFraction = [&](double value) { return value / totSteps * 100; };
152
153 G4cout <<
"============= G4BFieldIntegrationDriver statistics ===========\n"
154 << "total steps " << totSteps << " "
155 << "smallDriverSteps " << toFraction(fSmallDriverSteps) << " "
156 << "largeDriverSteps " << toFraction(fLargeDriverSteps) << "\n"
157 << "======================================\n";
158}
G4GLOB_DLL std::ostream G4cout
◆ SetEquationOfMotion()
Implements G4VIntegrationDriver.
Definition at line 109 of file G4BFieldIntegrationDriver.cc.
110{
111 fEquation = toMagneticEquation(equation);
112 fSmallStepDriver->SetEquationOfMotion(equation);
113 fLargeStepDriver->SetEquationOfMotion(equation);
114}
◆ SetVerboseLevel()
void G4BFieldIntegrationDriver::SetVerboseLevel |
( |
G4int | level | ) |
|
|
inlineoverridevirtual |
◆ StreamInfo()
void G4BFieldIntegrationDriver::StreamInfo |
( |
std::ostream & | os | ) |
const |
|
inlineoverridevirtual |
Implements G4VIntegrationDriver.
Definition at line 133 of file G4BFieldIntegrationDriver.hh.
134 {
135 os << "Small Step Driver Info: " << std::endl;
136 fSmallStepDriver->StreamInfo(os);
137 os << "Large Step Driver Info: " << std::endl;
138 fLargeStepDriver->StreamInfo(os);
139 }
The documentation for this class was generated from the following files: