Print

Print


Commit in slic/src on MAIN
G4MagIntegratorStepperFactory.cc+23-131.1 -> 1.2
Fix typos. Remove deprecated G3 stepper. Delete old G4ChordFinder before creation.  Don't die on bad stepper name.

slic/src
G4MagIntegratorStepperFactory.cc 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- G4MagIntegratorStepperFactory.cc	10 Sep 2005 00:24:29 -0000	1.1
+++ G4MagIntegratorStepperFactory.cc	10 Sep 2005 00:41:28 -0000	1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/G4MagIntegratorStepperFactory.cc,v 1.1 2005/09/10 00:24:29 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/G4MagIntegratorStepperFactory.cc,v 1.2 2005/09/10 00:41:28 jeremy Exp $
 #include "G4MagIntegratorStepperFactory.hh"
 
 // G4
@@ -12,9 +12,10 @@
 #include "G4HelixImplicitEuler.hh"
 #include "G4HelixSimpleRunge.hh"
 #include "G4ImplicitEuler.hh"
-#include "G4RKG3_Stepper.hh"
+//#include "G4RKG3_Stepper.hh"
 #include "G4SimpleHeum.hh"
 #include "G4SimpleRunge.hh"
+#include "G4CashKarpRKF45.hh"
 #include "G4MagneticField.hh"
 #include "G4FieldManager.hh"
 #include "G4TransportationManager.hh"
@@ -60,13 +61,18 @@
   {
     std::cout << "Setting up new G4MagIntegratorStepper <" << name << ">" << std::endl;
 
-    G4ChordFinder* oldChordFinder = m_fieldMgr->GetChordFinder();
-    if (oldChordFinder != 0) {
-      delete oldChordFinder;
-    }
-
     G4MagIntegratorStepper* stepper = createG4MagIntegratorStepper(name);
-    m_fieldMgr->SetChordFinder(new G4ChordFinder(m_field, 1E-2*mm, stepper));
+
+    if ( stepper != 0 ) {
+
+      G4ChordFinder* oldChordFinder = m_fieldMgr->GetChordFinder();
+      if (oldChordFinder != 0) {
+	delete oldChordFinder;
+      }
+
+      /* Create new chord finder with default step minimum. */
+      m_fieldMgr->SetChordFinder(new G4ChordFinder(m_field, 1E-2*mm, stepper));
+    }
   }
 
   G4MagIntegratorStepper* G4MagIntegratorStepperFactory::createG4MagIntegratorStepper(string name)
@@ -74,7 +80,7 @@
     if (name=="G4ClassicalRK4") {
       return new G4ClassicalRK4(m_fieldEquations);
     }
-    else if (name=="G4ExlicitEuler") {
+    else if (name=="G4ExplicitEuler") {
       return new G4ExplicitEuler(m_fieldEquations);
     }
     else if (name=="G4HelixExplicitEuler") {
@@ -86,14 +92,14 @@
     else if (name=="G4HelixImplicitEuler") {
       return new G4HelixImplicitEuler(m_fieldEquations);
     }
-    else if (name=="G4G4HelixSimpleRunge") {
+    else if (name=="G4HelixSimpleRunge") {
       return new G4HelixSimpleRunge(m_fieldEquations);
     }
     else if (name=="G4ImplicitEuler") {
       return new G4ImplicitEuler(m_fieldEquations);
     }
-    else if (name=="G4RKG3_Stepper") {
-      return new G4RKG3_Stepper(m_fieldEquations);
+    else if (name=="G4CashKarpRKF45") {
+      return new G4CashKarpRKF45(m_fieldEquations);
     }
     else if (name=="G4SimpleHeum") {
       return new G4SimpleHeum(m_fieldEquations);
@@ -101,8 +107,12 @@
     else if (name=="G4SimpleRunge") {
       return new G4SimpleRunge(m_fieldEquations);
     }
+    // throws G4Exception
+    //    else if (name=="G4RKG3_Stepper") {
+    //      return new G4RKG3_Stepper(m_fieldEquations);
+    //    }
     else {
-      G4Exception("Unknown G4MagIntegratorStepper " + name);
+      std::cerr << "Unknown G4MagIntegratorStepper <" + name << ">" << std::endl;
     }
 
     return 0;
CVSspam 0.2.8