Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ImplicitEuler Class Reference

#include <G4ImplicitEuler.hh>

Inheritance diagram for G4ImplicitEuler:
Collaboration 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 ()
 
void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
 
G4double DistChord () const
 
- Public Member Functions inherited from G4MagIntegratorStepper
 G4MagIntegratorStepper (G4EquationOfMotion *Equation, G4int numIntegrationVariables, G4int numStateVariables=12, bool isFSAL=false)
 
virtual ~G4MagIntegratorStepper ()
 
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
 
G4int IntegrationOrder ()
 
G4EquationOfMotionGetEquationOfMotion ()
 
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
 
unsigned long GetfNoRHSCalls ()
 
void ResetfNORHSCalls ()
 
bool IsFSAL ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4MagIntegratorStepper
void SetIntegrationOrder (int order)
 
void SetFSAL (bool flag=true)
 

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.

51  :
52 G4MagErrorStepper(EqRhs, numberOfVariables)
53 {
54  unsigned int noVariables= std::max(numberOfVariables,8); // For Time .. 7+1
55  dydxTemp = new G4double[noVariables] ;
56  yTemp = new G4double[noVariables] ;
57 }
G4MagErrorStepper(G4EquationOfMotion *EqRhs, G4int numberOfVariables, G4int numStateVariables=12)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4ImplicitEuler::~G4ImplicitEuler ( )

Definition at line 64 of file G4ImplicitEuler.cc.

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

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.

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

Here is the call graph for this function:

G4int G4ImplicitEuler::IntegratorOrder ( ) const
inlinevirtual

Implements G4MagIntegratorStepper.

Definition at line 65 of file G4ImplicitEuler.hh.

65 { return 2 ; } ;

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