Geant4-11
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
G4RK547FEq2 Class Reference

#include <G4RK547FEq2.hh>

Inheritance diagram for G4RK547FEq2:
G4MagIntegratorStepper

Public Member Functions

virtual G4double DistChord () const override
 
 G4RK547FEq2 (const G4RK547FEq2 &)=delete
 
 G4RK547FEq2 (G4EquationOfMotion *EqRhs, G4int integrationVariables=6)
 
G4EquationOfMotionGetEquationOfMotion ()
 
const G4EquationOfMotionGetEquationOfMotion () const
 
unsigned long GetfNoRHSCalls ()
 
G4int GetNumberOfStateVariables () const
 
G4int GetNumberOfVariables () const
 
G4int IntegrationOrder ()
 
virtual G4int IntegratorOrder () const override
 
G4bool IsFSAL () const
 
void NormalisePolarizationVector (G4double vec[12])
 
void NormaliseTangentVector (G4double vec[6])
 
G4RK547FEq2operator= (const G4RK547FEq2 &)=delete
 
void ResetfNORHSCalls ()
 
void RightHandSide (const G4double y[], G4double dydx[]) const
 
void RightHandSide (const G4double y[], G4double dydx[], G4double field[]) const
 
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
 
virtual void Stepper (const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[]) override
 
void Stepper (const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[], G4double dydxOutput[])
 

Protected Member Functions

void SetFSAL (G4bool flag=true)
 
void SetIntegrationOrder (G4int order)
 

Private Member Functions

void makeStep (const G4double yInput[], const G4double dydx[], const G4double hstep, G4double yOutput[], G4double *dydxOutput=nullptr, G4double *yError=nullptr) const
 

Private Attributes

G4double fdydx [G4FieldTrack::ncompSVEC]
 
G4double fdydxOut [G4FieldTrack::ncompSVEC]
 
G4EquationOfMotionfEquation_Rhs = nullptr
 
G4double fhstep = -1.0
 
G4int fIntegrationOrder = -1
 
G4bool fIsFSAL = false
 
const G4int fNoIntegrationVariables = 0
 
unsigned long fNoRHSCalls = 0UL
 
const G4int fNoStateVariables = 0
 
G4double fyIn [G4FieldTrack::ncompSVEC]
 
G4double fyOut [G4FieldTrack::ncompSVEC]
 

Detailed Description

Definition at line 44 of file G4RK547FEq2.hh.

Constructor & Destructor Documentation

◆ G4RK547FEq2() [1/2]

G4RK547FEq2::G4RK547FEq2 ( G4EquationOfMotion EqRhs,
G4int  integrationVariables = 6 
)

Definition at line 51 of file G4RK547FEq2.cc.

52 : G4MagIntegratorStepper(EqRhs, integrationVariables)
53{
54}
G4MagIntegratorStepper(G4EquationOfMotion *Equation, G4int numIntegrationVariables, G4int numStateVariables=12, G4bool isFSAL=false)

◆ G4RK547FEq2() [2/2]

G4RK547FEq2::G4RK547FEq2 ( const G4RK547FEq2 )
delete

Member Function Documentation

◆ DistChord()

G4double G4RK547FEq2::DistChord ( ) const
overridevirtual

Implements G4MagIntegratorStepper.

Definition at line 166 of file G4RK547FEq2.cc.

167{
169 makeStep(fyIn, fdydx, fhstep / 2., yMid);
170
171 const G4ThreeVector begin = makeVector(fyIn, Value3D::Position);
172 const G4ThreeVector mid = makeVector(yMid, Value3D::Position);
173 const G4ThreeVector end = makeVector(fyOut, Value3D::Position);
174
175 return G4LineSection::Distline(mid, begin, end);
176}
double G4double
Definition: G4Types.hh:83
static G4double Distline(const G4ThreeVector &OtherPnt, const G4ThreeVector &LinePntA, const G4ThreeVector &LinePntB)
void makeStep(const G4double yInput[], const G4double dydx[], const G4double hstep, G4double yOutput[], G4double *dydxOutput=nullptr, G4double *yError=nullptr) const
Definition: G4RK547FEq2.cc:56
G4double fhstep
Definition: G4RK547FEq2.hh:85
G4double fdydx[G4FieldTrack::ncompSVEC]
Definition: G4RK547FEq2.hh:81
G4double fyIn[G4FieldTrack::ncompSVEC]
Definition: G4RK547FEq2.hh:80
G4double fyOut[G4FieldTrack::ncompSVEC]
Definition: G4RK547FEq2.hh:82
G4ThreeVector makeVector(const ArrayType &array, Value3D value)

References G4LineSection::Distline(), fdydx, fhstep, fyIn, fyOut, makeStep(), field_utils::makeVector(), and G4FieldTrack::ncompSVEC.

◆ GetEquationOfMotion() [1/2]

G4EquationOfMotion * G4MagIntegratorStepper::GetEquationOfMotion ( )
inlineinherited

◆ GetEquationOfMotion() [2/2]

const G4EquationOfMotion * G4MagIntegratorStepper::GetEquationOfMotion ( ) const
inlineinherited

◆ GetfNoRHSCalls()

unsigned long G4MagIntegratorStepper::GetfNoRHSCalls ( )
inlineinherited

◆ GetNumberOfStateVariables()

G4int G4MagIntegratorStepper::GetNumberOfStateVariables ( ) const
inlineinherited

◆ GetNumberOfVariables()

G4int G4MagIntegratorStepper::GetNumberOfVariables ( ) const
inlineinherited

◆ IntegrationOrder()

G4int G4MagIntegratorStepper::IntegrationOrder ( )
inlineinherited

◆ IntegratorOrder()

virtual G4int G4RK547FEq2::IntegratorOrder ( ) const
inlineoverridevirtual

Implements G4MagIntegratorStepper.

Definition at line 67 of file G4RK547FEq2.hh.

67{ return 4; }

◆ IsFSAL()

G4bool G4MagIntegratorStepper::IsFSAL ( ) const
inlineinherited

◆ makeStep()

void G4RK547FEq2::makeStep ( const G4double  yInput[],
const G4double  dydx[],
const G4double  hstep,
G4double  yOutput[],
G4double dydxOutput = nullptr,
G4double yError = nullptr 
) const
private

Definition at line 56 of file G4RK547FEq2.cc.

62{
65 {
66 yOutput[i] = yTemp[i] = yInput[i];
67 }
68
74
75 const G4double b21 = 2./13.,
76 b31 = 3./52., b32 = 9./52.,
77 b41 = 12955./26244., b42 = -15925./8748.,
78 b43 = 12350./6561.,
79 b51 = -10383./52480., b52 = 13923./10496.,
80 b53 = -176553./199424., b54 = 505197./997120.,
81 b61 = 1403./7236., b62 = -429./268., b63 = 733330./309339.,
82 b64 = -7884./8911., b65 = 104960./113967.,
83 b71 = 181./2700., b72 = 0., b73 = 656903./1846800.,
84 b74 = 19683./106400., b75 = 34112./110565.,
85 b76 = 67./800.;
86
87 const G4double dc1 = b71 - 11377./154575.,
88 dc2 = b72 - 0.,
89 dc3 = b73 - 35378291./105729300.,
90 dc4 = b74 - 343359./1522850.,
91 dc5 = b75 - 535952./1947645.,
92 dc6 = b76 - 134./17175.,
93 dc7 = 0. - 1./12.;
94
95 // RightHandSide(yInput, dydx);
96 for(G4int i = 0; i < GetNumberOfVariables(); ++i)
97 yTemp[i] = yInput[i] + hstep * b21 * dydx[i];
98
99 RightHandSide(yTemp, ak2);
100 for(G4int i = 0; i < GetNumberOfVariables(); ++i)
101 yTemp[i] = yInput[i] + hstep * (b31 * dydx[i] + b32 * ak2[i]);
102
103 RightHandSide(yTemp, ak3);
104 for(G4int i = 0;i < GetNumberOfVariables(); ++i)
105 yTemp[i] = yInput[i] + hstep * (b41 * dydx[i] + b42 * ak2[i] +
106 b43 * ak3[i]);
107
108 RightHandSide(yTemp, ak4);
109 for(G4int i = 0; i < GetNumberOfVariables(); ++i)
110 yTemp[i] = yInput[i] + hstep * (b51 * dydx[i] + b52 * ak2[i] +
111 b53 * ak3[i] + b54 * ak4[i]);
112
113 RightHandSide(yTemp, ak5);
114 for(G4int i = 0; i < GetNumberOfVariables(); ++i)
115 yTemp[i] = yInput[i] + hstep * (b61 * dydx[i] + b62 * ak2[i] +
116 b63 * ak3[i] + b64 * ak4[i] +
117 b65 * ak5[i]);
118
119 RightHandSide(yTemp, ak6);
120 for(G4int i = 0; i < GetNumberOfVariables(); ++i)
121 yOutput[i] = yInput[i] + hstep * (b71 * dydx[i] + b72 * ak2[i] +
122 b73 * ak3[i] + b74 * ak4[i] +
123 b75 * ak5[i] + b76 * ak6[i]);
124 if (dydxOutput && yError)
125 {
126 RightHandSide(yOutput, dydxOutput);
127 for(G4int i = 0; i < GetNumberOfVariables(); ++i)
128 yError[i] = hstep * (dc1 * dydx[i] + dc2 * ak2[i] + dc3 * ak3[i] +
129 dc4 * ak4[i] + dc5 * ak5[i] + dc6 * ak6[i] +
130 dc7 * dydxOutput[i]);
131 }
132}
static const G4double ak2
int G4int
Definition: G4Types.hh:85
G4int GetNumberOfVariables() const
void RightHandSide(const G4double y[], G4double dydx[]) const
G4int GetNumberOfStateVariables() const

References ak2, G4MagIntegratorStepper::GetNumberOfStateVariables(), G4MagIntegratorStepper::GetNumberOfVariables(), G4FieldTrack::ncompSVEC, and G4MagIntegratorStepper::RightHandSide().

Referenced by DistChord(), and Stepper().

◆ NormalisePolarizationVector()

void G4MagIntegratorStepper::NormalisePolarizationVector ( G4double  vec[12])
inlineinherited

◆ NormaliseTangentVector()

void G4MagIntegratorStepper::NormaliseTangentVector ( G4double  vec[6])
inlineinherited

◆ operator=()

G4RK547FEq2 & G4RK547FEq2::operator= ( const G4RK547FEq2 )
delete

◆ ResetfNORHSCalls()

void G4MagIntegratorStepper::ResetfNORHSCalls ( )
inlineinherited

◆ RightHandSide() [1/2]

void G4MagIntegratorStepper::RightHandSide ( const G4double  y[],
G4double  dydx[] 
) const
inlineinherited

◆ RightHandSide() [2/2]

void G4MagIntegratorStepper::RightHandSide ( const G4double  y[],
G4double  dydx[],
G4double  field[] 
) const
inlineinherited

◆ SetEquationOfMotion()

void G4MagIntegratorStepper::SetEquationOfMotion ( G4EquationOfMotion newEquation)
inlineinherited

◆ SetFSAL()

void G4MagIntegratorStepper::SetFSAL ( G4bool  flag = true)
inlineprotectedinherited

◆ SetIntegrationOrder()

void G4MagIntegratorStepper::SetIntegrationOrder ( G4int  order)
inlineprotectedinherited

◆ Stepper() [1/2]

void G4RK547FEq2::Stepper ( const G4double  yInput[],
const G4double  dydx[],
G4double  hstep,
G4double  yOutput[],
G4double  yError[] 
)
overridevirtual

Implements G4MagIntegratorStepper.

Definition at line 134 of file G4RK547FEq2.cc.

139{
140 copy(fyIn, yInput);
141 copy(fdydx, dydx);
142 fhstep = hstep;
143
144 makeStep(fyIn, fdydx, fhstep, fyOut, fdydxOut, yError);
145
146 copy(yOutput, fyOut);
147}
G4double fdydxOut[G4FieldTrack::ncompSVEC]
Definition: G4RK547FEq2.hh:83
void copy(G4double dst[], const G4double src[], size_t size=G4FieldTrack::ncompSVEC)
Definition: G4FieldUtils.cc:98

References field_utils::copy(), fdydx, fdydxOut, fhstep, fyIn, fyOut, and makeStep().

◆ Stepper() [2/2]

void G4RK547FEq2::Stepper ( const G4double  yInput[],
const G4double  dydx[],
G4double  hstep,
G4double  yOutput[],
G4double  yError[],
G4double  dydxOutput[] 
)

Definition at line 149 of file G4RK547FEq2.cc.

155{
156 copy(fyIn, yInput);
157 copy(fdydx, dydx);
158 fhstep = hstep;
159
160 makeStep(fyIn, fdydx, fhstep, fyOut, fdydxOut, yError);
161
162 copy(yOutput, fyOut);
163 copy(dydxOutput, fdydxOut);
164}

References field_utils::copy(), fdydx, fdydxOut, fhstep, fyIn, fyOut, and makeStep().

Field Documentation

◆ fdydx

G4double G4RK547FEq2::fdydx[G4FieldTrack::ncompSVEC]
private

Definition at line 81 of file G4RK547FEq2.hh.

Referenced by DistChord(), and Stepper().

◆ fdydxOut

G4double G4RK547FEq2::fdydxOut[G4FieldTrack::ncompSVEC]
private

Definition at line 83 of file G4RK547FEq2.hh.

Referenced by Stepper().

◆ fEquation_Rhs

G4EquationOfMotion* G4MagIntegratorStepper::fEquation_Rhs = nullptr
privateinherited

Definition at line 124 of file G4MagIntegratorStepper.hh.

◆ fhstep

G4double G4RK547FEq2::fhstep = -1.0
private

Definition at line 85 of file G4RK547FEq2.hh.

Referenced by DistChord(), and Stepper().

◆ fIntegrationOrder

G4int G4MagIntegratorStepper::fIntegrationOrder = -1
privateinherited

Definition at line 134 of file G4MagIntegratorStepper.hh.

◆ fIsFSAL

G4bool G4MagIntegratorStepper::fIsFSAL = false
privateinherited

Definition at line 136 of file G4MagIntegratorStepper.hh.

◆ fNoIntegrationVariables

const G4int G4MagIntegratorStepper::fNoIntegrationVariables = 0
privateinherited

Definition at line 125 of file G4MagIntegratorStepper.hh.

◆ fNoRHSCalls

unsigned long G4MagIntegratorStepper::fNoRHSCalls = 0UL
mutableprivateinherited

Definition at line 128 of file G4MagIntegratorStepper.hh.

◆ fNoStateVariables

const G4int G4MagIntegratorStepper::fNoStateVariables = 0
privateinherited

Definition at line 126 of file G4MagIntegratorStepper.hh.

◆ fyIn

G4double G4RK547FEq2::fyIn[G4FieldTrack::ncompSVEC]
private

Definition at line 80 of file G4RK547FEq2.hh.

Referenced by DistChord(), and Stepper().

◆ fyOut

G4double G4RK547FEq2::fyOut[G4FieldTrack::ncompSVEC]
private

Definition at line 82 of file G4RK547FEq2.hh.

Referenced by DistChord(), and Stepper().


The documentation for this class was generated from the following files: