2 #include "G4Mag_UsualEqRhs.hh"
3 #include "G4DormandPrince745.hh"
4 #include "G4ClassicalRK4.hh"
5 #include "G4HelixSimpleRunge.hh"
6 #include "G4HelixExplicitEuler.hh"
7 #include "G4HelixImplicitEuler.hh"
8 #include "G4CashKarpRKF45.hh"
9 #include "G4RKG3_Stepper.hh"
10 #include "G4SimpleHeum.hh"
11 #include "G4NystromRK4.hh"
12 #include "G4ImplicitEuler.hh"
13 #include "G4ExplicitEuler.hh"
14 #include "G4ChordFinder.hh"
26 G4Mag_UsualEqRhs *iEquation =
new G4Mag_UsualEqRhs(
this);
28 if (std::find(SUPPORTED_STEPPERS.begin(), SUPPORTED_STEPPERS.end(), integration_stepper) == SUPPORTED_STEPPERS.end()) {
33 G4MagIntegratorStepper *mag_int_stepper =
nullptr;
36 if (integration_stepper ==
"G4DormandPrince745") {
37 mag_int_stepper =
new G4DormandPrince745(iEquation);
38 }
else if (integration_stepper ==
"G4ClassicalRK4") {
39 mag_int_stepper =
new G4ClassicalRK4(iEquation);
40 }
else if (integration_stepper ==
"G4SimpleRunge") {
41 mag_int_stepper =
new G4HelixSimpleRunge(iEquation);
42 }
else if (integration_stepper ==
"G4HelixExplicitEuler") {
43 mag_int_stepper =
new G4HelixExplicitEuler(iEquation);
44 }
else if (integration_stepper ==
"G4HelixImplicitEuler") {
45 mag_int_stepper =
new G4HelixImplicitEuler(iEquation);
46 }
else if (integration_stepper ==
"G4CashKarpRKF45") {
47 mag_int_stepper =
new G4CashKarpRKF45(iEquation);
48 }
else if (integration_stepper ==
"G4RKG3_Stepper") {
49 mag_int_stepper =
new G4RKG3_Stepper(iEquation);
50 }
else if (integration_stepper ==
"G4SimpleHeum") {
51 mag_int_stepper =
new G4SimpleHeum(iEquation);
52 }
else if (integration_stepper ==
"G4NystromRK4") {
53 mag_int_stepper =
new G4NystromRK4(iEquation);
54 }
else if (integration_stepper ==
"G4ImplicitEuler") {
55 mag_int_stepper =
new G4ImplicitEuler(iEquation);
56 }
else if (integration_stepper ==
"G4ExplicitEuler") {
57 mag_int_stepper =
new G4ExplicitEuler(iEquation);
60 gFLogMessage(
"Integration Stepper " + integration_stepper +
" not supported. Exiting.");
64 G4ChordFinder *fChordFinder =
new G4ChordFinder(
this, minimum_step, mag_int_stepper);
65 gFLogMessage(
"Loaded Integration Stepper: " + integration_stepper);
67 return new G4FieldManager(
this, fChordFinder);
void gFLogMessage(std::string message)
Logs a message with the field context.
GFieldDefinition gfield_definitions
G4FieldManager * create_FieldManager()
Creates the G4FieldManager for the field.
#define EC__STEPPER_NOT_FOUND
#define GFIELD_DEFAULT_INTEGRATION_STEPPER
double minimum_step
Minimum step size for integration.
std::string integration_stepper
Type of integration stepper.