Message: Electric Field does not work... Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Electric Field does not work... 

Keywords: Electric Field
Forum: Fields: Magnetic and Otherwise
Date: 29 Aug, 2004
From: Dai ho Ko <kodainim@hotmail.com>

Hello!

I've tried to set e-field to local area. So I've made next 2 files(Shown in part)..

---------------------------------------------------------------------------

#include "ExN03Field.hh"

ExN03Field::ExN03Field()
{
  Bz = 3000*kilovolt/cm;
}

ExN03Field::~ExN03Field() {;}

void ExN03Field::GetFieldValue(const double Point[3],double *Bfield) const
{
  Bfield[0] = 0.;
  Bfield[2] = 0.;
  if(Point[2]>0.0 )
  { Bfield[1] = Bz; }
  else
  { Bfield[1] = 0.; }
}

----------------------------------------------------------------------

ExN03Field* myField = new ExN03Field;

//G4UniformElectricField* myField

//= new G4UniformElectricField(G4ThreeVector(0,90000*kilovolt/cm,0));

G4FieldManager *pFieldMgr;

G4MagIntegratorStepper *pStepper;

G4ChordFinder* pChordFinder;

G4EqMagElectricField *fEquation = new

G4EqMagElectricField(myField);

G4MagInt_Driver* pIntgrDriver;

pStepper = new G4ClassicalRK4(fEquation,8);

pFieldMgr=G4TransportationManager::GetTransportationManager()-> GetFieldManager();

pFieldMgr->SetDetectorField(myField);

pIntgrDriver = new G4MagInt_Driver(0.001*mm,pStepper,pStepper-> GetNumberOfVariables());

//if(pChordFinder) delete pChordFinder;

pChordFinder = new G4ChordFinder(pIntgrDriver);

pFieldMgr->SetChordFinder(pChordFinder);

------------------------------------------------------------------

Whenever I use 'ExN03Field* myField = new ExN03Field;' statement, exe file doen't work. No error occurs, compiling is OK, but does not work. It stops when it deals with first particle.

But when I use 'G4UniformElectricField* myField = new G4UniformElectricField(G4ThreeVector(0,90000*kilovolt/cm,0));' statement exe file works.

Did I miss some statements?

It's been making me crazy fot 3 days...

Thanks in advance.

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

1 None: Re: Electric Field does not work...   (Dai ho Ko - 31 Aug, 2004)
1 None: Re: Electric Field does not work...   (Dai ho Ko - 31 Aug, 2004)
3 None: Re: Electric Field does not work...   (John Apostolakis - 31 Aug, 2004)
1 None: Re: Electric Field does not work...   (Dai ho Ko - 31 Aug, 2004)
 Add Message Add Message
to: "Electric Field does not work..."

 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 ]