Message: Re: segmentation fault after changing geometry Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: segmentation fault after changing geometry 

Forum: Geometry
Re: Question segmentation fault after changing geometry (andi klein)
Date: 17 Aug, 2005
From: Vladimir IVANTCHENKO <vnivanch@mail.cern.ch>

On Tue, 16 Aug 2005, andi klein wrote:

> *** Discussion title: Geometry
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/geometry/426"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> I am using the N03 example as a skeleton for my own program. By using
> Detector messenger I change the position of a collimator. The firts
> initial settting are read in through the vis.mac command and executed
> just fine. After having beam on for a few events, I then try to change
> the position, which works fine. However, if I execute the beamOn command
> now, I get a segmentation fault.
> 
> I am running Geant4 7.1
> 
> Here the part where I am trying to change the settings in
> DetectorConstruct
> 
> void G4_ffDetectorConstruction::setIrisPos(G4int IrisPosV)
> 
> { IrisX = IrisPosV; }
> 
> void G4_ffDetectorConstruction::setCollPos(G4int CollPosV)
> 
> { CollX = CollPosV;
> 
> } #include "G4RunManager.hh"
> 
> void G4_ffDetectorConstruction::UpdateGeometry()
> 
> { G4RunManager::GetRunManager()->DefineWorldVolume(ConstructChamber());
> 
> G4RunManagerKernel::GetRunManagerKernel()->GeometryHasBeenModified();
> 
> }
> 
> And here the detectormessenger:
> 
>   IrisCmd = new G4UIcmdWithAnInteger("/G4_ff/det/setIrisPos",this);
>   IrisCmd->SetGuidance("Select position in X of iris.");
> //  IrisCmd->SetParameterName("choice",false);
> //  IrisCmd->SetDefaultValue(1);
>   IrisCmd->AvailableForStates(G4State_Idle);
> 
>   CollCmd = new G4UIcmdWithAnInteger("/G4_ff/det/setCollPos",this);
>   CollCmd->SetGuidance("Select position in X of collimator.");
> //  CollCmd->SetDefaultValue(1);
> //  CollCmd->SetParameterName("choice",false);
>   CollCmd->AvailableForStates(G4State_Idle);
> 
>     UpdateCmd = new G4UIcmdWithoutParameter("/G4_ff/det/update",this);
>   UpdateCmd->SetGuidance("Update geometry.");
>   UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
>   UpdateCmd->SetGuidance("if you changed geometrical value(s).");
>   UpdateCmd->AvailableForStates(G4State_Idle);
> 
> Can anyone help me, I might do just soemthing really stupid. andi
> 

Please, look into examples/extended/electromagnetic/TestEm3, 7 and others.  
It is possible to change geometry. Important moment: then the G4 kernel
needs to know, that the geometry was updated. It is done by using
corresponding UI command.

VI

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

1 Question: Re: segmentation fault after changing geometry   (Steven Avery - 07 Sep, 2005)
(_ None: Re: segmentation fault after changing geometry   (David Oxley - 07 Apr, 2008)
 Add Message Add Message
to: "Re: segmentation fault after changing geometry"

 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 ]