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

#include <G4ImplicitEuler.hh>

+ Inheritance diagram for G4ImplicitEuler:

Public Member Functions

 G4ImplicitEuler (G4EquationOfMotion *EqRhs, G4int numberOfVariables=6)
 
 ~G4ImplicitEuler ()
 
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 ()
 
 G4MagErrorStepper (const G4MagErrorStepper &)=delete
 
G4MagErrorStepperoperator= (const G4MagErrorStepper &)=delete
 
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, 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 G4MagIntegratorStepper
void SetIntegrationOrder (G4int order)
 
void SetFSAL (G4bool flag=true)
 

Detailed Description

Definition at line 45 of file G4ImplicitEuler.hh.

Constructor & Destructor Documentation

◆ G4ImplicitEuler()

G4ImplicitEuler::G4ImplicitEuler ( G4EquationOfMotion EqRhs,
G4int  numberOfVariables = 6 
)

Definition at line 47 of file G4ImplicitEuler.cc.

49 : G4MagErrorStepper(EqRhs, numberOfVariables)
50{
51 unsigned int noVariables = std::max(numberOfVariables,8); // For Time .. 7+1
52 dydxTemp = new G4double[noVariables] ;
53 yTemp = new G4double[noVariables] ;
54}
double G4double
Definition: G4Types.hh:83

◆ ~G4ImplicitEuler()

G4ImplicitEuler::~G4ImplicitEuler ( )

Definition at line 61 of file G4ImplicitEuler.cc.

62{
63 delete [] dydxTemp;
64 delete [] yTemp;
65}

Member Function Documentation

◆ DumbStepper()

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

Implements G4MagErrorStepper.

Definition at line 72 of file G4ImplicitEuler.cc.

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

◆ IntegratorOrder()

G4int G4ImplicitEuler::IntegratorOrder ( ) const
inlinevirtual

Implements G4MagIntegratorStepper.

Definition at line 58 of file G4ImplicitEuler.hh.

58{ return 2; }

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