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

Agree 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)
Date: 15 Jan, 2016
From: Michael H. Kelsey <Michael H. Kelsey>

On Fri, 15 Jan 2016 23:43:02 GMT, John Allison wrote:
> On second thoughts, the reuse of the pointer should not be a problem,
> since G4SubtractionSolid keeps copies. :-)

Hi, John. Reusing the function's local variable to hold the pointer isn't an issue. Each solid is instantiated with "new", which gives a unique pointer that gets registered to the G4SolidStore. So long as the user doesn't ever need access to those previous pointers, it doesn't matter (this is similar to the way we "throw away" placements by doing "new G4PVPlacement..." without assigning the pointer to a local variable).

However, your point about reusing the _name_ of the solid is intriguing. G4SolidStore itself doesn't seem to care (given my own experience) if multiple objects get the same name, but I'm not sure whether lookups will return what the user might expect in that case. I think you'll only get back a single pointer, which may be the first, last, or whatever instance of the name.

  -- Mike Kelsey

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   (John Allison - 16 Jan, 2016)
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)
... 2 Message(s)
 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 ]