G4SimpleRunge Class Reference

#include <G4SimpleRunge.hh>

Inheritance diagram for G4SimpleRunge:

G4MagErrorStepper G4MagIntegratorStepper

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

Detailed Description

Definition at line 51 of file G4SimpleRunge.hh.


Constructor & Destructor Documentation

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

Definition at line 48 of file G4SimpleRunge.cc.

References G4MagIntegratorStepper::GetNumberOfStateVariables().

00049   : G4MagErrorStepper(EqRhs, numberOfVariables),
00050     fNumberOfVariables(numberOfVariables)
00051 {
00052    
00053    unsigned int noVariables= std::max(numberOfVariables,
00054                                         GetNumberOfStateVariables()); 
00055                                              // To deal with Time >= 7+1 
00056    dydxTemp = new G4double[noVariables] ;
00057    yTemp    = new G4double[noVariables] ;
00058 }

G4SimpleRunge::~G4SimpleRunge (  ) 

Definition at line 65 of file G4SimpleRunge.cc.

00066 {
00067    delete[] dydxTemp;
00068    delete[] yTemp;
00069 }


Member Function Documentation

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

Implements G4MagErrorStepper.

Definition at line 76 of file G4SimpleRunge.cc.

References G4MagIntegratorStepper::RightHandSide().

00080 {
00081   // Initialise time to t0, needed when it is not updated by the integration.
00082   yTemp[7] = yOut[7] = yIn[7];   //  Better to set it to NaN;  // TODO
00083 
00084   G4int i;
00085 
00086   for( i = 0; i < fNumberOfVariables; i++ ) 
00087   {
00088     yTemp[i] = yIn[i] + 0.5 * h*dydx[i] ;
00089   }
00090   
00091   RightHandSide(yTemp,dydxTemp);
00092   
00093   for( i = 0; i < fNumberOfVariables; i++ ) 
00094   {
00095     yOut[i] = yIn[i] + h * ( dydxTemp[i] );
00096   }
00097 }  

G4int G4SimpleRunge::IntegratorOrder (  )  const [inline, virtual]

Implements G4MagIntegratorStepper.

Definition at line 67 of file G4SimpleRunge.hh.

00067 { return 2; }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:23 2013 for Geant4 by  doxygen 1.4.7