G4ImplicitEuler Class Reference

#include <G4ImplicitEuler.hh>

Inheritance diagram for G4ImplicitEuler:

G4MagErrorStepper G4MagIntegratorStepper

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

Detailed Description

Definition at line 50 of file G4ImplicitEuler.hh.


Constructor & Destructor Documentation

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

Definition at line 50 of file G4ImplicitEuler.cc.

00051                                                          : 
00052 G4MagErrorStepper(EqRhs, numberOfVariables)
00053 {
00054   unsigned int noVariables= std::max(numberOfVariables,8); // For Time .. 7+1
00055   dydxTemp = new G4double[noVariables] ;
00056   yTemp    = new G4double[noVariables] ;
00057 }

G4ImplicitEuler::~G4ImplicitEuler (  ) 

Definition at line 64 of file G4ImplicitEuler.cc.

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


Member Function Documentation

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

Implements G4MagErrorStepper.

Definition at line 75 of file G4ImplicitEuler.cc.

References G4MagIntegratorStepper::GetNumberOfVariables(), and G4MagIntegratorStepper::RightHandSide().

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

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

Implements G4MagIntegratorStepper.

Definition at line 65 of file G4ImplicitEuler.hh.

00065 { return 2 ; } ;


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