Message: Re: Seg Fault in G4VProcess::GetProcessName() ??? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Seg Fault in G4VProcess::GetProcessName() ??? 

Keywords: G4ChordFinder field "Equation of motion"
Forum: Fields: Magnetic and Otherwise
Re: Question Setting up a gravity field
Date: 24 Aug, 2004
From: John Apostolakis <John Apostolakis>

Dear Julian,

Creating a new field does require some digging. Let me try to help this key and slightly tricky step.

The G4ChordFinder constructors are

      G4ChordFinder( G4MagInt_Driver* pIntegrationDriver );

  --> This first one is the one to use in the general case

      G4ChordFinder( G4MagneticField* itsMagField,
                     G4double         stepMinimum = 1.0e-2 * mm, 
                     G4MagIntegratorStepper* pItsStepper = 0 );  
        // A constructor that creates defaults for all "children" classes.

  --> This is a 'short-cut' for the usual case (a magnetic field)
      to help the user to create all that is required quickly.

For non-magnetic field cases, a user must use the first constructor, after creating any new class(es) for a new field and/or instances of the stepper, driver and field equation.

The order to creating the objects should likely be:
  1) The field
  2) The equation of motion, 
  3) The stepper, giving it the equation
  4) The driver, passing it the stepper
  5) The chord finder, passing it the driver

An example to refer to, in order to create a new field, is examples/extended/field/field02

I expect that you have created your field and equation, so I will point out steps 3 through 5 in this example:

3) The Stepper, In "SetStepper":

      fStepper = new G4ClassicalRK4( fEquation, nvar );       
      G4cout<<"G4ClassicalRK4 (default) is called"<<G4endl;     
    or
      fStepper = new G4CashKarpRKF45( fEquation, nvar );      
      G4cout<<"G4CashKarpRKF45 is called"<<G4endl;     

4) The Driver, and
5) The ChordFinder 
     both in "UpdateField"

///////////////////////////////////////////////////////////////////////////// // // Register this field to 'global' Field Manager and // Create Stepper and Chord Finder with predefined type, minstep (resp.) //

void F02ElectricFieldSetup::UpdateField()
{
 ...

  fIntgrDriver = new G4MagInt_Driver(fMinStep, 
				     fStepper, 
                                     fStepper->GetNumberOfVariables() );

  if(fChordFinder) delete fChordFinder;
  fChordFinder = new G4ChordFinder(fIntgrDriver);

fFieldManager->SetChordFinder( fChordFinder ); }

I hope that this information helps you setup your novel application.

Best regards, John

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

 Add Message Add Message
to: "Re: Seg Fault in G4VProcess::GetProcessName() ???"

 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 ]