2 // ********************************************************************
 
    3 // * License and Disclaimer                                           *
 
    5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
 
    6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
 
    7 // * conditions of the Geant4 Software License,  included in the file *
 
    8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
 
    9 // * include a list of copyright holders.                             *
 
   11 // * Neither the authors of this software system, nor their employing *
 
   12 // * institutes,nor the agencies providing financial support for this *
 
   13 // * work  make  any representation or  warranty, express or implied, *
 
   14 // * regarding  this  software system or assume any liability for its *
 
   15 // * use.  Please see the license in the file  LICENSE  and URL above *
 
   16 // * for the full disclaimer and the limitation of liability.         *
 
   18 // * This  code  implementation is the result of  the  scientific and *
 
   19 // * technical work of the GEANT4 collaboration.                      *
 
   20 // * By using,  copying,  modifying or  distributing the software (or *
 
   21 // * any work based  on the software)  you  agree  to acknowledge its *
 
   22 // * use  in  resulting  scientific  publications,  and indicate your *
 
   23 // * acceptance of all terms of the Geant4 Software license.          *
 
   24 // ********************************************************************
 
   27 // $Id: G4MagIntegratorDriver.icc 69699 2013-05-13 08:50:30Z gcosmo $
 
   29 // --------------------------------------------------------------------
 
   32 G4double G4MagInt_Driver::GetHmin() const
 
   38 G4double G4MagInt_Driver::Hmin() const
 
   44 G4double G4MagInt_Driver::GetSafety() const
 
   50 G4double G4MagInt_Driver::GetPshrnk() const
 
   56 G4double G4MagInt_Driver::GetPgrow() const
 
   62 G4double G4MagInt_Driver::GetErrcon() const
 
   68 void G4MagInt_Driver::SetHmin(G4double newval)
 
   70       fMinimumStep = newval;
 
   74 G4double G4MagInt_Driver::ComputeAndSetErrcon()
 
   76       errcon = std::pow(max_stepping_increase/GetSafety(),1.0/GetPgrow());
 
   81 void G4MagInt_Driver::ReSetParameters(G4double new_safety)
 
   84       pshrnk = -1.0 / pIntStepper->IntegratorOrder();
 
   85       pgrow  = -1.0 / (1.0 + pIntStepper->IntegratorOrder());
 
   86       ComputeAndSetErrcon();
 
   90 void G4MagInt_Driver::SetSafety(G4double val)
 
   93       ComputeAndSetErrcon();
 
   97 void G4MagInt_Driver::SetPgrow(G4double  val)
 
  100       ComputeAndSetErrcon(); 
 
  104 void G4MagInt_Driver::SetErrcon(G4double val)
 
  110 void G4MagInt_Driver::RenewStepperAndAdjust(G4MagIntegratorStepper *pItsStepper)
 
  112       pIntStepper = pItsStepper; 
 
  117 const G4MagIntegratorStepper* G4MagInt_Driver::GetStepper() const
 
  123 G4MagIntegratorStepper* G4MagInt_Driver::GetStepper() 
 
  129 G4int G4MagInt_Driver::GetMaxNoSteps() const
 
  135 void G4MagInt_Driver::SetMaxNoSteps(G4int val)
 
  141 void G4MagInt_Driver::GetDerivatives(const G4FieldTrack &y_curr, // const, INput
 
  142                                            G4double     dydx[])  // OUTput
 
  144   G4double  tmpValArr[G4FieldTrack::ncompSVEC];
 
  145   y_curr.DumpToArray( tmpValArr  );
 
  146   pIntStepper -> RightHandSide( tmpValArr , dydx );
 
  150 G4double G4MagInt_Driver::GetVerboseLevel() const
 
  152       return fVerboseLevel;
 
  156 void G4MagInt_Driver::SetVerboseLevel(G4int newLevel)
 
  158       fVerboseLevel= newLevel;
 
  162 G4double G4MagInt_Driver::GetSmallestFraction() const
 
  164       return fSmallestFraction;