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

#include <G4SimpleRunge.hh>

+ Inheritance diagram for G4SimpleRunge:

Public Member Functions

 G4SimpleRunge (G4EquationOfMotion *EquationRhs, G4int numberOfVariables=6)
 
 ~G4SimpleRunge ()
 
void DumbStepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[])
 
G4int IntegratorOrder () const
 
- Public Member Functions inherited from G4MagErrorStepper
 G4MagErrorStepper (G4EquationOfMotion *EqRhs, G4int numberOfVariables, G4int numStateVariables=12)
 
virtual ~G4MagErrorStepper ()
 
void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
 
virtual void DumbStepper (const G4double y[], const G4double dydx[], 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)
 

Detailed Description

Definition at line 51 of file G4SimpleRunge.hh.

Constructor & Destructor Documentation

◆ G4SimpleRunge()

G4SimpleRunge::G4SimpleRunge ( G4EquationOfMotion EquationRhs,
G4int  numberOfVariables = 6 
)

Definition at line 48 of file G4SimpleRunge.cc.

49 : G4MagErrorStepper(EqRhs, numberOfVariables),
50 fNumberOfVariables(numberOfVariables)
51{
52
53 unsigned int noVariables= std::max(numberOfVariables,
55 // To deal with Time >= 7+1
56 dydxTemp = new G4double[noVariables] ;
57 yTemp = new G4double[noVariables] ;
58}
double G4double
Definition: G4Types.hh:64
G4int GetNumberOfStateVariables() const

◆ ~G4SimpleRunge()

G4SimpleRunge::~G4SimpleRunge ( )

Definition at line 65 of file G4SimpleRunge.cc.

66{
67 delete[] dydxTemp;
68 delete[] yTemp;
69}

Member Function Documentation

◆ DumbStepper()

void G4SimpleRunge::DumbStepper ( const G4double  y[],
const G4double  dydx[],
G4double  h,
G4double  yout[] 
)
virtual

Implements G4MagErrorStepper.

Definition at line 76 of file G4SimpleRunge.cc.

80{
81 // Initialise time to t0, needed when it is not updated by the integration.
82 yTemp[7] = yOut[7] = yIn[7]; // Better to set it to NaN; // TODO
83
84 G4int i;
85
86 for( i = 0; i < fNumberOfVariables; i++ )
87 {
88 yTemp[i] = yIn[i] + 0.5 * h*dydx[i] ;
89 }
90
91 RightHandSide(yTemp,dydxTemp);
92
93 for( i = 0; i < fNumberOfVariables; i++ )
94 {
95 yOut[i] = yIn[i] + h * ( dydxTemp[i] );
96 }
97}
int G4int
Definition: G4Types.hh:66
void RightHandSide(const double y[], double dydx[])

◆ IntegratorOrder()

G4int G4SimpleRunge::IntegratorOrder ( ) const
inlinevirtual

Implements G4MagIntegratorStepper.

Definition at line 67 of file G4SimpleRunge.hh.

67{ return 2; }

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