40#include "G4MagneticField.hh"
41#include "G4UniformMagField.hh"
42#include "G4FieldManager.hh"
43#include "G4TransportationManager.hh"
44#include "G4Mag_UsualEqRhs.hh"
45#include "G4MagIntegratorStepper.hh"
46#include "G4ChordFinder.hh"
48#include "G4ExplicitEuler.hh"
49#include "G4ImplicitEuler.hh"
50#include "G4SimpleRunge.hh"
51#include "G4SimpleHeum.hh"
52#include "G4ClassicalRK4.hh"
53#include "G4HelixExplicitEuler.hh"
54#include "G4HelixImplicitEuler.hh"
55#include "G4HelixSimpleRunge.hh"
56#include "G4CashKarpRKF45.hh"
57#include "G4RKG3_Stepper.hh"
58#include "G4ConstRK4.hh"
59#include "G4NystromRK4.hh"
60#include "G4HelixMixedStepper.hh"
61#include "G4ExactHelixStepper.hh"
63#include "G4BogackiShampine23.hh"
64#include "G4BogackiShampine45.hh"
65#include "G4DormandPrince745.hh"
66#include "G4DormandPrinceRK56.hh"
67#include "G4DormandPrinceRK78.hh"
68#include "G4TsitourasRK45.hh"
70#include "G4PhysicalConstants.hh"
71#include "G4SystemOfUnits.hh"
85 G4bool useFSALstepper )
87 fUseFSALstepper(useFSALstepper),
90 G4cout <<
" F01FieldSetup: magnetic field set to Uniform( "
91 << fieldVector <<
" ) " << G4endl;
93 if( stepperNum == -1000 )
117 fUseFSALstepper(false),
120 G4cout <<
" F01FieldSetup: magnetic field set to Uniform( 0.0, 0, 0 ) "
140 fFieldManager = G4TransportationManager::GetTransportationManager()
154 G4cout <<
" 4/5. Updating eps_min and eps_max in Field Manager." << G4endl;
169 G4cout <<
"F01FieldSetup: requesting Max(imum) Epsilon = " <<
fDesiredEpsilonMax << G4endl;
174 G4bool softFail=
true;
178 G4cout <<
"F01FieldSetup: requested increase Max(imum) Accepted Epsilon to "
182 G4double maxEpsAllowed = G4FieldManager::GetMaxAcceptedEpsilon();
184 G4cout <<
"F01FieldSetup: requested increase Max(imum) Accepted Epsilon to "
186 <<
" Setting it to max allowed = " << maxEpsAllowed << G4endl;
198 G4cout <<
" Changed FieldManager epsilon values to epsilon_min= "
200 <<
" and epsilon_max= "
222 G4cout <<
" F01FieldSetup::CreateStepperAndChordFinder() called. " << G4endl
223 <<
" 1. Creating Stepper." << G4endl;
226 G4cout<<
"The minimal step is equal to "<<
fMinStep/mm<<
" mm"<<G4endl;
228 G4cout <<
" 2. Creating ChordFinder." << G4endl;
231 G4cout <<
" 3. Updating Field Manager (chord finder, field-ptr)." << G4endl;
251 G4cout<<
"G4DormandPrince745 Stepper is chosen"<<G4endl;
256 G4cout<<
"G4ExplicitEuler is chosen."<<G4endl;
260 G4cout<<
"G4ImplicitEuler is chosen"<<G4endl;
264 G4cout<<
"G4SimpleRunge is chosen"<<G4endl;
268 G4cout<<
"G4SimpleHeum is chosen"<<G4endl;
272 G4cout<<
"G4ClassicalRK4 (default) is chosen"<<G4endl;
276 G4cout<<
"G4HelixExplicitEuler is chosen"<<G4endl;
280 G4cout<<
"G4HelixImplicitEuler is chosen"<<G4endl;
284 G4cout<<
"G4HelixSimpleRunge is chosen"<<G4endl;
288 G4cout<<
"G4CashKarpRKF45 is chosen"<<G4endl;
292 G4cout<<
"G4RKG3_Stepper is chosen"<<G4endl;
296 G4cout<<
"G4ExactHelixStepper is chosen"<<G4endl;
300 G4cout<<
"G4HelixMixedStepper is chosen"<<G4endl;
304 G4cout<<
"G4ConstRK4 Stepper is chosen"<<G4endl;
309 G4cout<<
" G4NystromRK4 Stepper is chosen"<<G4endl;
314 G4cout<<
"G4BogackiShampine23 Stepper is chosen"<<G4endl;
321 G4cout<<
"G4BogackiShampine45 Stepper is chosen"<<G4endl;
327 G4cout<<
"G4TsitourasRK45 Stepper is chosen"<<G4endl;
333 G4cout<<
"G4DormandPrinceRK56 Stepper is chosen"<<G4endl;
337 G4cout<<
"G4DormandPrinceRK78 Stepper is chosen"<<G4endl;
344 G4cout<<
"G4DormandPrince745 (default) Stepper is chosen"<<G4endl;
351#include "G4VIntegrationDriver.hh"
352#include "G4FSALIntegrationDriver.hh"
353#include "G4RK547FEq1.hh"
354#include "G4RK547FEq2.hh"
355#include "G4RK547FEq3.hh"
361 const char *methodName=
"F01FieldSetup::CreateFSALStepperAndDriver()";
365 G4cout <<
" F01FieldSetup::CreateFSALStepperAndDriver() called. " << G4endl;
366 G4cout <<
" 1. Creating Stepper." << G4endl;
372 G4cout <<
" 2. Creating FSAL Driver." << G4endl;
380 G4cout <<
" Stepper type '1' is G4RK547FEq1 stepper (in FSAL mode) with FSAL driver. "
390 G4cout <<
" Stepper type '2' is G4RK547FEq2 stepper (in FSAL mode) with FSAL driver. "
400 G4cout <<
" Stepper type '3' is G4RK547FEq3 stepper (in FSAL mode) with FSAL driver. "
407 G4cout <<
" Warning from " << methodName <<
" : stepperType (= "
409 <<
" Using value '1' instead - i.e. G4RK547FEq1 stepper. "
418 delete stepper1; stepper1 =
nullptr;
419 delete stepper2; stepper2 =
nullptr;
420 delete stepper3; stepper3 =
nullptr;
423 fStepper = fsalDriver->GetStepper();
434 G4cout <<
" F01FieldSetup::CreateFSALStepperAndChordFinder() called. " << G4endl;
438 G4cout<<
"The minimal step is equal to "<<
fMinStep/mm<<
" mm"<<G4endl;
440 G4cout <<
" 3. Creating ChordFinder." << G4endl;
463 G4cout <<
"Setting Field strength to "
464 << fieldVector / gauss <<
" Gauss." << G4endl;
467 if (fieldVector != G4ThreeVector(0.,0.,0.))
474 G4cout <<
" Magnetic field pointer is null." << G4endl;
495 return G4TransportationManager::GetTransportationManager()
501#include "G4BorisScheme.hh"
502#include"G4BorisDriver.hh"
508 G4cout <<
" F01FieldSetup::CreateAndSetupBorisDriver() called. " << G4endl;
509 G4cout <<
" 1. Creating Scheme (Stepper)." << G4endl;
511 G4cout <<
" 2. Creating Driver." << G4endl;
516 G4cout <<
" 3. Creating ChordFinder." << G4endl;
519 G4cout <<
" 4. Updating Field Manager (with ChordFinder, field)." << G4endl;
F01FieldMessenger allows interactive user control of.
Definition of the F01FieldSetup class.
G4double fDesiredEpsilonMin
G4MagneticField * fMagneticField
void CreateStepperAndChordFinder()
G4FieldManager * fFieldManager
G4VIntegrationDriver * fDriver
void CreateFSALStepperAndChordFinder()
G4FieldManager * GetGlobalFieldManager()
void SetFieldZValue(G4double fieldValue)
G4Mag_UsualEqRhs * fEquation
G4MagIntegratorStepper * fStepper
G4VIntegrationDriver * CreateFSALStepperAndDriver()
void CreateAndSetupBorisDriver()
G4ChordFinder * fChordFinder
void SetFieldValue(G4ThreeVector fieldVector)
G4double fDesiredEpsilonMax
F01FieldMessenger * fFieldMessenger