Message: segfault using boolean solids Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None segfault using boolean solids 

Forum: Geometry
Date: 09 Apr, 2014
From: Kevin Lyons <Kevin Lyons>

Hi,

I'm using G4SubtractionSolid to remove a small sphere (translated from the origin) from a larger one to create one volume. A second volume is then created to fill in the hole left by the subtraction with a different material. The code compiles, and looks correct when visualized, but running the code causes a segfault. If I comment out all of the code relating to the second volume everything runs fine, so it is definitely an issue with the geometry.

Is this a case of overlapping solids according to Geant? If so, what is the correct way to do it?

Some relevant bits of code:

G4VPhysicalVolume* DetectorConstruction::ConstructVolume1()
{
  G4VSolid* BigSphere = new G4Sphere(...,BigRadius,...); 
  G4VSolid* SmallSphere = new G4Sphere(...,SmallRadius,...);

  G4VSolid* solidVolume1 = new G4SubtractionSolid(Big-Small",BigSphere,SmallSphere,0,translationVector);

  logicVolume1 = new G4LogicalVolume(solidVolume1,material1,...);

  Volume1 = new G4PVPlacement(0,Origin,logicVolume1,...);

  return Volume1;
}

G4VPhysicalVolume* DetectorConstruction::ConstructVolume2()
{
   G4VSolid* solidVolume2 = new G4Sphere(...,SmallRadius,...);
   logicVolume2 = new G4LogicalVolume(solidVolume2,material2,...);
   Volume2 = new G4PVPlacement(0,translationVector,logicVolume2,...);

   return Volume2;
}

Thanks! Kevin

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

1 None: Re: segfault using boolean solids   (Joseph Perl - 09 Apr, 2014)
(_ None: Re: segfault using boolean solids   (Kevin Lyons - 09 Apr, 2014)
 Add Message Add Message
to: "segfault using boolean solids"

 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 ]