File indexing completed on 2026-09-13 09:10:16
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 inline
0032 G4int G4MagIntegratorStepper::IntegrationOrder()
0033 {
0034 return fIntegrationOrder;
0035 }
0036
0037 inline
0038 G4EquationOfMotion* G4MagIntegratorStepper::GetEquationOfMotion()
0039 {
0040 return fEquation_Rhs;
0041 }
0042
0043 inline
0044 const G4EquationOfMotion* G4MagIntegratorStepper::GetEquationOfMotion() const
0045 {
0046 return fEquation_Rhs;
0047 }
0048
0049 inline
0050 void G4MagIntegratorStepper::SetEquationOfMotion(G4EquationOfMotion* newEq)
0051 {
0052 if( newEq != nullptr )
0053 {
0054 fEquation_Rhs = newEq;
0055 }
0056 }
0057
0058 inline
0059 unsigned long G4MagIntegratorStepper::GetfNoRHSCalls()
0060 {
0061 return fNoRHSCalls;
0062 }
0063
0064 inline
0065 void G4MagIntegratorStepper::ResetfNORHSCalls()
0066 {
0067 fNoRHSCalls = 0;
0068 }
0069
0070 inline
0071 G4bool G4MagIntegratorStepper::IsFSAL() const
0072 {
0073 return fIsFSAL;
0074 }
0075
0076 inline
0077 G4bool G4MagIntegratorStepper::isQSS() const
0078 {
0079 return fIsQSS;
0080 }
0081
0082 inline
0083 void G4MagIntegratorStepper::SetIsQSS(G4bool val)
0084 {
0085 fIsQSS = val;
0086 }
0087
0088 inline
0089 void G4MagIntegratorStepper::SetIntegrationOrder(G4int order)
0090 {
0091 fIntegrationOrder = order;
0092 }
0093
0094 inline
0095 void G4MagIntegratorStepper::SetFSAL(G4bool flag)
0096 {
0097 fIsFSAL = flag;
0098 }
0099
0100 inline
0101 G4int G4MagIntegratorStepper::GetNumberOfVariables() const
0102 {
0103 return fNoIntegrationVariables;
0104 }
0105
0106
0107 inline
0108 G4int G4MagIntegratorStepper::GetNumberOfStateVariables() const
0109 {
0110 return fNoStateVariables;
0111 }
0112
0113 inline
0114 void G4MagIntegratorStepper::RightHandSide(const G4double y[],
0115 G4double dydx[]) const
0116 {
0117 fEquation_Rhs->RightHandSide(y, dydx);
0118 ++fNoRHSCalls;
0119 }
0120
0121 inline
0122 void G4MagIntegratorStepper::RightHandSide(const G4double y[],
0123 G4double dydx[],
0124 G4double field[]) const
0125 {
0126 fEquation_Rhs->EvaluateRhsReturnB(y, dydx, field);
0127 ++fNoRHSCalls;
0128 }
0129
0130 inline
0131 void G4MagIntegratorStepper::NormaliseTangentVector( G4double vec[6] )
0132 {
0133 G4double drds2 = vec[3]*vec[3]+vec[4]*vec[4]+vec[5]*vec[5];
0134
0135 if( std::fabs(drds2 - 1.0) > 1.e-14 )
0136 {
0137 G4double normx = 1.0 / std::sqrt(drds2);
0138 for(auto i=3; i<6; ++i) { vec[i] *= normx; }
0139 }
0140 }
0141
0142 inline
0143 void G4MagIntegratorStepper::NormalisePolarizationVector( G4double vec[12] )
0144 {
0145 G4double drds2 = vec[9]*vec[9]+vec[10]*vec[10]+vec[11]*vec[11];
0146
0147 if( drds2 > 0. )
0148 {
0149 if( std::fabs(drds2 - 1.0) > 1.e-14 )
0150 {
0151 G4double normx = 1.0 / std::sqrt(drds2);
0152 for(auto i=9; i<12; ++i) { vec[i] *= normx; }
0153 }
0154 }
0155 }