Geant4 11.1.1
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 ()
 
 G4MagHelicalStepper (const G4MagHelicalStepper &)=delete
 
G4MagHelicalStepperoperator= (const G4MagHelicalStepper &)=delete
 
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, G4bool isFSAL=false)
 
virtual ~G4MagIntegratorStepper ()=default
 
 G4MagIntegratorStepper (const G4MagIntegratorStepper &)=delete
 
G4MagIntegratorStepperoperator= (const G4MagIntegratorStepper &)=delete
 
virtual void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])=0
 
virtual G4double DistChord () const =0
 
void NormaliseTangentVector (G4double vec[6])
 
void NormalisePolarizationVector (G4double vec[12])
 
void RightHandSide (const G4double y[], G4double dydx[]) const
 
void RightHandSide (const G4double y[], G4double dydx[], G4double field[]) const
 
G4int GetNumberOfVariables () const
 
G4int GetNumberOfStateVariables () const
 
virtual G4int IntegratorOrder () const =0
 
G4int IntegrationOrder ()
 
G4EquationOfMotionGetEquationOfMotion ()
 
const G4EquationOfMotionGetEquationOfMotion () const
 
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
 
unsigned long GetfNoRHSCalls ()
 
void ResetfNORHSCalls ()
 
G4bool IsFSAL () const
 

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
 
- Protected Member Functions inherited from G4MagIntegratorStepper
void SetIntegrationOrder (G4int order)
 
void SetFSAL (G4bool flag=true)
 

Detailed Description

Definition at line 42 of file G4HelixExplicitEuler.hh.

Constructor & Destructor Documentation

◆ G4HelixExplicitEuler()

G4HelixExplicitEuler::G4HelixExplicitEuler ( G4Mag_EqRhs EqRhs)

Definition at line 40 of file G4HelixExplicitEuler.cc.

◆ ~G4HelixExplicitEuler()

G4HelixExplicitEuler::~G4HelixExplicitEuler ( )

Definition at line 45 of file G4HelixExplicitEuler.cc.

46{
47}

Member Function Documentation

◆ DistChord()

G4double G4HelixExplicitEuler::DistChord ( ) const
virtual

Implements G4MagIntegratorStepper.

Definition at line 89 of file G4HelixExplicitEuler.cc.

90{
91 // Implementation : must check whether h/R > 2 pi !!
92 // If( h/R < pi) use G4LineSection::DistLine
93 // Else DistChord=R_helix
94 //
95 G4double distChord;
96 G4double Ang_curve=GetAngCurve();
97
98
99 if(Ang_curve<=pi)
100 {
101 distChord=GetRadHelix()*(1-std::cos(0.5*Ang_curve));
102 }
103 else if(Ang_curve<twopi)
104 {
105 distChord=GetRadHelix()*(1+std::cos(0.5*(twopi-Ang_curve)));
106 }
107 else
108 {
109 distChord=2.*GetRadHelix();
110 }
111
112 return distChord;
113}
double G4double
Definition: G4Types.hh:83
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 115 of file G4HelixExplicitEuler.cc.

119{
120 AdvanceHelix(yIn, Bfld, h, yOut);
121}
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 64 of file G4HelixExplicitEuler.hh.

64{ return 1; }

◆ Stepper()

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

Definition at line 49 of file G4HelixExplicitEuler.cc.

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

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