Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4HelixExplicitEuler Class Reference

#include <G4HelixExplicitEuler.hh>

+ Inheritance diagram for G4HelixExplicitEuler:

Public Member Functions

 G4HelixExplicitEuler (G4Mag_EqRhs *EqRhs)
 
 ~G4HelixExplicitEuler ()
 
void Stepper (const G4double y[], const G4double *, G4double h, G4double yout[], G4double yerr[])
 
void DumbStepper (const G4double y[], G4ThreeVector Bfld, G4double h, G4double yout[])
 
G4double DistChord () const
 
G4int IntegratorOrder () const
 
- Public Member Functions inherited from G4MagHelicalStepper
 G4MagHelicalStepper (G4Mag_EqRhs *EqRhs)
 
virtual ~G4MagHelicalStepper ()
 
virtual void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
 
virtual void DumbStepper (const G4double y[], G4ThreeVector Bfld, G4double h, G4double yout[])=0
 
G4double DistChord () const
 
- Public Member Functions inherited from G4MagIntegratorStepper
 G4MagIntegratorStepper (G4EquationOfMotion *Equation, G4int numIntegrationVariables, G4int numStateVariables=12)
 
virtual ~G4MagIntegratorStepper ()
 
virtual void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])=0
 
virtual G4double DistChord () const =0
 
virtual void ComputeRightHandSide (const G4double y[], G4double dydx[])
 
void NormaliseTangentVector (G4double vec[6])
 
void NormalisePolarizationVector (G4double vec[12])
 
void RightHandSide (const double y[], double dydx[])
 
G4int GetNumberOfVariables () const
 
G4int GetNumberOfStateVariables () const
 
virtual G4int IntegratorOrder () const =0
 
G4EquationOfMotionGetEquationOfMotion ()
 
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
 

Additional Inherited Members

- Protected Member Functions inherited from G4MagHelicalStepper
void LinearStep (const G4double yIn[], G4double h, G4double yHelix[]) const
 
void AdvanceHelix (const G4double yIn[], G4ThreeVector Bfld, G4double h, G4double yHelix[], G4double yHelix2[]=0)
 
void MagFieldEvaluate (const G4double y[], G4ThreeVector &Bfield)
 
G4double GetInverseCurve (const G4double Momentum, const G4double Bmag)
 
void SetAngCurve (const G4double Ang)
 
G4double GetAngCurve () const
 
void SetCurve (const G4double Curve)
 
G4double GetCurve () const
 
void SetRadHelix (const G4double Rad)
 
G4double GetRadHelix () const
 

Detailed Description

Definition at line 48 of file G4HelixExplicitEuler.hh.

Constructor & Destructor Documentation

◆ G4HelixExplicitEuler()

G4HelixExplicitEuler::G4HelixExplicitEuler ( G4Mag_EqRhs EqRhs)
inline

Definition at line 52 of file G4HelixExplicitEuler.hh.

◆ ~G4HelixExplicitEuler()

G4HelixExplicitEuler::~G4HelixExplicitEuler ( )
inline

Definition at line 55 of file G4HelixExplicitEuler.hh.

55{}

Member Function Documentation

◆ DistChord()

G4double G4HelixExplicitEuler::DistChord ( ) const
virtual

Implements G4MagIntegratorStepper.

Definition at line 78 of file G4HelixExplicitEuler.cc.

79{
80 // Implementation : must check whether h/R > 2 pi !!
81 // If( h/R < pi) use G4LineSection::DistLine
82 // Else DistChord=R_helix
83 //
84 G4double distChord;
85 G4double Ang_curve=GetAngCurve();
86
87
88 if(Ang_curve<=pi){
89 distChord=GetRadHelix()*(1-std::cos(0.5*Ang_curve));
90 }
91 else
92 if(Ang_curve<twopi){
93 distChord=GetRadHelix()*(1+std::cos(0.5*(twopi-Ang_curve)));
94 }
95 else{
96 distChord=2.*GetRadHelix();
97 }
98
99 return distChord;
100
101}
double G4double
Definition: G4Types.hh:64
G4double GetRadHelix() const
G4double GetAngCurve() const

◆ DumbStepper()

void G4HelixExplicitEuler::DumbStepper ( const G4double  y[],
G4ThreeVector  Bfld,
G4double  h,
G4double  yout[] 
)
virtual

Implements G4MagHelicalStepper.

Definition at line 103 of file G4HelixExplicitEuler.cc.

107{
108
109 AdvanceHelix(yIn, Bfld, h, yOut);
110
111}
void AdvanceHelix(const G4double yIn[], G4ThreeVector Bfld, G4double h, G4double yHelix[], G4double yHelix2[]=0)

◆ IntegratorOrder()

G4int G4HelixExplicitEuler::IntegratorOrder ( ) const
inlinevirtual

Implements G4MagIntegratorStepper.

Definition at line 74 of file G4HelixExplicitEuler.hh.

74{ return 1; }

◆ Stepper()

void G4HelixExplicitEuler::Stepper ( const G4double  y[],
const G4double ,
G4double  h,
G4double  yout[],
G4double  yerr[] 
)

Definition at line 43 of file G4HelixExplicitEuler.cc.

49{
50
51 //Estimation of the Stepping Angle
52
53 G4ThreeVector Bfld;
54 MagFieldEvaluate(yInput, Bfld);
55
56 const G4int nvar = 6 ;
57 G4int i;
58 G4double yTemp[7], yIn[7] ;
59 G4ThreeVector Bfld_midpoint;
60 // Saving yInput because yInput and yOut can be aliases for same array
61 for(i=0;i<nvar;i++) yIn[i]=yInput[i];
62
63 G4double h = Step * 0.5;
64
65 // Do full step and two half steps
66 G4double yTemp2[7];
67 AdvanceHelix(yIn, Bfld, h, yTemp2,yTemp);
68 MagFieldEvaluate(yTemp2, Bfld_midpoint) ;
69 AdvanceHelix(yTemp2, Bfld_midpoint, h, yOut);
70
71 // Error estimation
72 for(i=0;i<nvar;i++) {
73 yErr[i] = yOut[i] - yTemp[i] ;
74 }
75
76}
int G4int
Definition: G4Types.hh:66
void MagFieldEvaluate(const G4double y[], G4ThreeVector &Bfield)

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