File indexing completed on 2025-01-18 09:58:39
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 void G4MagIntegratorStepper::SetIntegrationOrder(G4int order)
0078 {
0079 fIntegrationOrder = order;
0080 }
0081
0082 inline
0083 void G4MagIntegratorStepper::SetFSAL(G4bool flag)
0084 {
0085 fIsFSAL = flag;
0086 }
0087
0088 inline
0089 G4int G4MagIntegratorStepper::GetNumberOfVariables() const
0090 {
0091 return fNoIntegrationVariables;
0092 }
0093
0094
0095 inline
0096 G4int G4MagIntegratorStepper::GetNumberOfStateVariables() const
0097 {
0098 return fNoStateVariables;
0099 }
0100
0101 inline
0102 void G4MagIntegratorStepper::RightHandSide(const G4double y[],
0103 G4double dydx[]) const
0104 {
0105 fEquation_Rhs->RightHandSide(y, dydx);
0106 ++fNoRHSCalls;
0107 }
0108
0109 inline
0110 void G4MagIntegratorStepper::RightHandSide(const G4double y[],
0111 G4double dydx[],
0112 G4double field[]) const
0113 {
0114 fEquation_Rhs->EvaluateRhsReturnB(y, dydx, field);
0115 ++fNoRHSCalls;
0116 }
0117
0118 inline
0119 void G4MagIntegratorStepper::NormaliseTangentVector( G4double vec[6] )
0120 {
0121 G4double drds2 = vec[3]*vec[3]+vec[4]*vec[4]+vec[5]*vec[5];
0122
0123 if( std::fabs(drds2 - 1.0) > 1.e-14 )
0124 {
0125 G4double normx = 1.0 / std::sqrt(drds2);
0126 for(auto i=3; i<6; ++i) { vec[i] *= normx; }
0127 }
0128 }
0129
0130 inline
0131 void G4MagIntegratorStepper::NormalisePolarizationVector( G4double vec[12] )
0132 {
0133 G4double drds2 = vec[9]*vec[9]+vec[10]*vec[10]+vec[11]*vec[11];
0134
0135 if( drds2 > 0. )
0136 {
0137 if( std::fabs(drds2 - 1.0) > 1.e-14 )
0138 {
0139 G4double normx = 1.0 / std::sqrt(drds2);
0140 for(auto i=9; i<12; ++i) { vec[i] *= normx; }
0141 }
0142 }
0143 }