#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 |
Definition at line 50 of file G4ImplicitEuler.hh.
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 | ( | ) |
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] |