Message: Re: Large system, very slow field tracking... how to improve? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Ok Re: Large system, very slow field tracking... how to improve? 

Forum: Fields: Magnetic and Otherwise
Re: None Large system, very slow field tracking... how to improve? (Tim Chambers)
Re: None Re: Large system, very slow field tracking... how to improve? (Tom Roberts)
Date: 29 Jun, 2005
From: Tim Chambers <Tim Chambers>

Just in case anyone else has the same problem I thought I should post 
my solution... I implemented this code yesterday and it works great.  
It would not be an exaggeration to say the program runs more than 100x 
faster.
in DetectorConstruction.cc:


	SolarField* theField = new SolarField();
	G4FieldManager* fieldMgr =
		G4TransportationManager::GetTransportationManager()
		->GetFieldManager();
	G4double minStep = 1*mm;
	
	G4Mag_UsualEqRhs* theEqn = new G4Mag_UsualEqRhs(theField);
	G4MagIntegratorStepper* theStepper = new G4HelixExplicitEuler(theEqn);	
	G4MagInt_Driver* theDriver = new G4MagInt_Driver(minStep, theStepper, 
					theStepper->GetNumberOfVariables());
	G4ChordFinder* theFinder = new G4ChordFinder(theDriver);
	
	fieldMgr->SetChordFinder(theFinder);
	fieldMgr->SetDetectorField(theField);


In addition to using the Helix integrator, scaling the tracking 
parameters to match the simulation size gave me another noticeable 
improvement in the running time.  Thanks all!

-Tim Chambers

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "Re: Large system, very slow field tracking... how to improve?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]