Message: Space varying Magnetic Field Problem Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Space varying Magnetic Field Problem 

Forum: Fields: Magnetic and Otherwise
Date: 07 Jun, 2010
From: Michael Rinaldi <Michael Rinaldi>

Hi folks, I've constructed a model that implements a 3D space varying magnetic field in a particular volume. The field is read in from a file and is a set of values of Bx, By, and Bz. The field values are defined on a 1 cm grid. I wrote the GetFieldValue() function to return the pertinent field components as needed by the stepper. My problem is that I get vastly different steps by changing the field value slightly.

The function GetFieldValue(const G4double point[4], double *field) that is required from me is written so that each time it is called my code does a tri-linear interpolation on my 3D grid to find the field at the input point from the stepper point[0],point[1],point[2]. I'm thinking that since this interpolation is happening on a coarse 1cm x 1cm x 1cm grid then the field values are not smooth enough to give a good smooth track.

I'd like some advice as to the best way to proceed. Should I increase the grid by a factor of 10 so that it is defined every 1mm instead of 1cm or should I use a different stepper. Currently I'm simply using

G4ChordFinder *chordFinder = new G4ChordFinder(magField, stepMinimum);

which I believe uses the RK4 stepper. If I need to change the stepper how do I do that?

Thanks, Mike

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

1 Feedback: Re: Space varying Magnetic Field Problem   (Gumplinger Peter - 07 Jun, 2010)
2 None: Re: Space varying Magnetic Field Problem   (John Apostolakis - 07 Jun, 2010)
 Add Message Add Message
to: "Space varying Magnetic Field Problem"

 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 ]