G4HelixMixedStepper Class Reference

#include <G4HelixMixedStepper.hh>

Inheritance diagram for G4HelixMixedStepper:

G4MagHelicalStepper G4MagIntegratorStepper

Public Member Functions

 G4HelixMixedStepper (G4Mag_EqRhs *EqRhs, G4int fStepperNumber=0)
 ~G4HelixMixedStepper ()
void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
void DumbStepper (const G4double y[], G4ThreeVector Bfld, G4double h, G4double yout[])
G4double DistChord () const
void SetVerbose (G4int newvalue)
void PrintCalls ()
G4MagIntegratorStepperSetupStepper (G4Mag_EqRhs *EqRhs, G4int StepperName)
G4int IntegratorOrder () const

Detailed Description

Definition at line 58 of file G4HelixMixedStepper.hh.


Constructor & Destructor Documentation

G4HelixMixedStepper::G4HelixMixedStepper ( G4Mag_EqRhs EqRhs,
G4int  fStepperNumber = 0 
)

Definition at line 57 of file G4HelixMixedStepper.cc.

References SetupStepper(), and SetVerbose().

00058   : G4MagHelicalStepper(EqRhs)
00059     
00060 {
00061    SetVerbose(1); fNumCallsRK4=0; fNumCallsHelix=0;
00062    if(!fStepperNumber) fStepperNumber=4;
00063    fRK4Stepper =  SetupStepper(EqRhs, fStepperNumber);
00064 }

G4HelixMixedStepper::~G4HelixMixedStepper (  ) 

Definition at line 67 of file G4HelixMixedStepper.cc.

References PrintCalls().

00067                                           {
00068      
00069      delete(fRK4Stepper);
00070      if (fVerbose>0){ PrintCalls();};
00071 } 


Member Function Documentation

G4double G4HelixMixedStepper::DistChord (  )  const [virtual]

Reimplemented from G4MagHelicalStepper.

Definition at line 145 of file G4HelixMixedStepper.cc.

References G4MagHelicalStepper::GetAngCurve(), G4MagHelicalStepper::GetRadHelix(), and G4INCL::Math::pi.

00146 {
00147   // Implementation : must check whether h/R > 2 pi  !!
00148   //   If( h/R <  pi) use G4LineSection::DistLine
00149   //   Else           DistChord=R_helix
00150   //
00151   G4double distChord;
00152   G4double Ang_curve=GetAngCurve();
00153 
00154       
00155          if(Ang_curve<=pi){
00156            distChord=GetRadHelix()*(1-std::cos(0.5*Ang_curve));
00157          }
00158          else 
00159          if(Ang_curve<twopi){
00160            distChord=GetRadHelix()*(1+std::cos(0.5*(twopi-Ang_curve)));
00161          }
00162          else{
00163           distChord=2.*GetRadHelix();  
00164          }
00165 
00166    
00167 
00168   return distChord;
00169   
00170 }

void G4HelixMixedStepper::DumbStepper ( const G4double  y[],
G4ThreeVector  Bfld,
G4double  h,
G4double  yout[] 
) [virtual]

Implements G4MagHelicalStepper.

Definition at line 132 of file G4HelixMixedStepper.cc.

References G4MagHelicalStepper::AdvanceHelix().

00136 {
00137  
00138     
00139        AdvanceHelix(yIn, Bfld, h, yOut);
00140 
00141     
00142                
00143 }  

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

Implements G4MagIntegratorStepper.

Definition at line 93 of file G4HelixMixedStepper.hh.

00093 { return 4; }

void G4HelixMixedStepper::PrintCalls (  ) 

Definition at line 172 of file G4HelixMixedStepper.cc.

References G4cout, and G4endl.

Referenced by ~G4HelixMixedStepper().

00173 {
00174   G4cout<<"In HelixMixedStepper::Number of calls to smallStepStepper = "<<fNumCallsRK4
00175         <<"  and Number of calls to Helix = "<<fNumCallsHelix<<G4endl;
00176 }

G4MagIntegratorStepper * G4HelixMixedStepper::SetupStepper ( G4Mag_EqRhs EqRhs,
G4int  StepperName 
)

Definition at line 180 of file G4HelixMixedStepper.cc.

References G4cout, and G4endl.

Referenced by G4HelixMixedStepper().

00181 {
00182   G4MagIntegratorStepper* pStepper;
00183   if (fVerbose>0)G4cout<<"In G4HelixMixedStepper Stepper for small steps is "; 
00184   switch ( StepperNumber )
00185     {
00186      case 0: pStepper = new G4ExplicitEuler( pE ); if (fVerbose>0)G4cout<<"G4ExplicitEuler"<<G4endl; break;
00187      case 1: pStepper = new G4ImplicitEuler( pE ); if (fVerbose>0)G4cout<<"G4ImplicitEuler"<<G4endl; break;
00188      case 2: pStepper = new G4SimpleRunge( pE ); if (fVerbose>0)G4cout<<"G4SimpleRunge"<<G4endl; break;
00189      case 3: pStepper = new G4SimpleHeum( pE );  if (fVerbose>0)G4cout<<"G4SimpleHeum"<<G4endl;break;
00190      case 4: pStepper = new G4ClassicalRK4( pE ); if (fVerbose>0)G4cout<<"G4ClassicalRK4"<<G4endl; break;
00191      case 5: pStepper = new G4HelixExplicitEuler( pE ); if (fVerbose>0)G4cout<<"G4HelixExplicitEuler"<<G4endl; break;
00192      case 6: pStepper = new G4HelixImplicitEuler( pE ); if (fVerbose>0)G4cout<<"G4HelixImplicitEuler"<<G4endl; break;
00193      case 7: pStepper = new G4HelixSimpleRunge( pE ); if (fVerbose>0)G4cout<<"G4HelixSimpleRunge"<<G4endl; break;
00194      case 8: pStepper = new G4CashKarpRKF45( pE );    if (fVerbose>0)G4cout<<"G4CashKarpRKF45"<<G4endl; break;
00195      case 9: pStepper = new G4ExactHelixStepper( pE );  if (fVerbose>0)G4cout<<"G4ExactHelixStepper"<<G4endl;   break;
00196      case 10: pStepper = new G4RKG3_Stepper( pE );  if (fVerbose>0)G4cout<<"G4RKG3_Stepper"<<G4endl;   break;
00197       
00198       default: pStepper = new G4ClassicalRK4( pE );G4cout<<"Default G4ClassicalRK4"<<G4endl; break;
00199       
00200     }
00201   return pStepper;
00202 }

void G4HelixMixedStepper::SetVerbose ( G4int  newvalue  )  [inline]

Definition at line 86 of file G4HelixMixedStepper.hh.

Referenced by G4HelixMixedStepper().

00086 {fVerbose=newvalue;}

void G4HelixMixedStepper::Stepper ( const G4double  y[],
const G4double  dydx[],
G4double  h,
G4double  yout[],
G4double  yerr[] 
) [virtual]

Reimplemented from G4MagHelicalStepper.


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