File indexing completed on 2025-01-18 09:58:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #ifndef G4FSALINTEGRATIONDRIVER_HH
0035 #define G4FSALINTEGRATIONDRIVER_HH
0036
0037 #include "G4RKIntegrationDriver.hh"
0038 #include "G4ChordFinderDelegate.hh"
0039
0040 template <class T>
0041 class G4FSALIntegrationDriver : public G4RKIntegrationDriver<T>,
0042 public G4ChordFinderDelegate<G4FSALIntegrationDriver<T>>
0043 {
0044 public:
0045
0046 G4FSALIntegrationDriver(G4double hminimum,
0047 T* stepper,
0048 G4int numberOfComponents = 6,
0049 G4int statisticsVerbosity = 1);
0050
0051 ~G4FSALIntegrationDriver() override;
0052
0053 G4FSALIntegrationDriver(const G4FSALIntegrationDriver&) = delete;
0054 G4FSALIntegrationDriver& operator=(const G4FSALIntegrationDriver&) = delete;
0055
0056 G4double AdvanceChordLimited(G4FieldTrack& track,
0057 G4double hstep,
0058 G4double eps,
0059 G4double chordDistance) override;
0060
0061 void OnStartTracking() override
0062 {
0063 ChordFinderDelegate::ResetStepEstimate();
0064 }
0065
0066 void OnComputeStep(const G4FieldTrack* = nullptr) override {}
0067
0068 G4bool DoesReIntegrate() const override { return true; }
0069
0070 G4bool AccurateAdvance( G4FieldTrack& track,
0071 G4double hstep,
0072 G4double eps,
0073 G4double hinitial = 0.0) override;
0074
0075
0076
0077
0078 G4bool QuickAdvance( G4FieldTrack& fieldTrack,
0079 const G4double dydx[],
0080 G4double hstep,
0081 G4double& dchord_step,
0082 G4double& dyerr ) override;
0083
0084
0085 void SetVerboseLevel(G4int newLevel) override;
0086 G4int GetVerboseLevel() const override;
0087
0088 void StreamInfo( std::ostream& os ) const override;
0089
0090
0091
0092
0093 G4double GetMinimumStep() const;
0094 void SetMinimumStep(G4double newval);
0095
0096 void OneGoodStep(G4double y[],
0097 G4double dydx[],
0098 G4double& curveLength,
0099 G4double htry,
0100 G4double eps,
0101 G4double& hdid,
0102 G4double& hnext);
0103
0104
0105
0106
0107 G4double GetSmallestFraction() const;
0108 void SetSmallestFraction(G4double val);
0109
0110 protected:
0111
0112 void IncrementQuickAdvanceCalls();
0113
0114 private:
0115
0116 void CheckStep(const G4ThreeVector& posIn,
0117 const G4ThreeVector& posOut,
0118 G4double hdid);
0119
0120 G4double fMinimumStep;
0121
0122
0123 G4double fSmallestFraction{1e-12};
0124
0125
0126
0127
0128
0129 G4int fVerboseLevel;
0130
0131
0132
0133 G4int fNoQuickAvanceCalls{0};
0134 G4int fNoAccurateAdvanceCalls{0};
0135 G4int fNoAccurateAdvanceBadSteps{0};
0136 G4int fNoAccurateAdvanceGoodSteps{0};
0137
0138 using Base = G4RKIntegrationDriver<T>;
0139 using ChordFinderDelegate = G4ChordFinderDelegate<G4FSALIntegrationDriver<T>>;
0140 };
0141
0142 #include "G4FSALIntegrationDriver.icc"
0143
0144 #endif