Message: Re: using G4SubtractionSolid correctly for complex geometry Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: using G4SubtractionSolid correctly for complex geometry 

Forum: Geometry
Re: None using G4SubtractionSolid correctly for complex geometry (Anthony Villano)
Re: None Re: using G4SubtractionSolid correctly for complex geometry (John Allison)
Re: None Re: using G4SubtractionSolid correctly for complex geometry (John Allison)
Re: Agree Re: using G4SubtractionSolid correctly for complex geometry (Michael H. Kelsey)
Date: 16 Jan, 2016
From: John Allison <John Allison>

Hi Mike and Anthony

You're right! The pointer reuse should not be a problem. I suspend judgement on the effect of a name reuse.

I think my initial response was a little hasty. In principle there should be nothing wrong in making a multiple subtraction. However, as Mike says, a mother-daughter would work better, more efficiently.

Let me make some further comments...

It's asking a lot of Geant4 to make a subtraction of subtractions 15 times. I imagine the vis representation would die - but let me say the tracking should be OK, but less efficient than a mother-daughter geometry.

However, if the vis system dies, it usually throws an error of the type "polyhedron not available" (as Mike said). I have never seen a vis problem of the type you describe, Anthony. (Again, to emphasise, the tracking should be OK - this is purely a vis problem. To check this you could use RayTracer - it uses the tracking system and is immune to these polyhedron vis problems.)

If you adopt a mother-daughter model be aware that a surface representation (and RayTracer) will disguise the daughters. A wireframe representation should show them.

If you stick to a subtraction-of-subtractions model, make sure the subtracting volume does not share surfaces. I would make it stick out slightly (this does not affect the subtraction result). For example, I would

  const G4double extra = 1.*um;

and add it to to the (half) dimensions of the subtracting solid and make appropriate adjustments to shift.

Incidentally, it is enough to say

  G4ThreeVector shift;

(the default is (0,0,0)).

And... it is not necessary to cast the pointer to G4SubtractionSolid:

  botPlate = (G4VSolid*) new G4SubtractionSolid("botPlate_S",botPlate,small_hole,NULL,shift);

because a G4SubtractionSolid _is_ a G4VSolid and C++ allows

  botPlate = new G4SubtractionSolid("botPlate_S",botPlate,small_hole,NULL,shift);

Finally, one possibility is to use a CAD system to define your plate and export it to Geant4. You will need to export it to a CAD system that can export to GDML (Geometry Definition Markup Language) and read it into Geant4 (see examples/extended/persistency/gdml). Get back to me about that.

Cheers

John

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

1 None: Re: using G4SubtractionSolid correctly for complex geometry   (Anthony Villano - 16 Jan, 2016)
2 None: Re: using G4SubtractionSolid correctly for complex geometry   (Anthony Villano - 16 Jan, 2016)
1 None: Re: using G4SubtractionSolid correctly for complex geometry   (Anthony Villano - 16 Jan, 2016)
(_ None: Re: using G4SubtractionSolid correctly for complex geometry   (John Allison - 17 Jan, 2016)
(_ None: Re: using G4SubtractionSolid correctly for complex geometry   (Anthony Villano - 17 Jan, 2016)
 Add Message Add Message
to: "Re: using G4SubtractionSolid correctly for complex 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 ]