Message: Re: G4Material WARNING: doublicate name of the new material Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: G4Material WARNING: doublicate name of the new material 

Forum: Geometry
Re: Question G4Material WARNING: doublicate name of the new material (Stefan E. Mueller)
Date: 18 Jun, 2014
From: John Apostolakis <John Apostolakis>

Dear Stefan,

If your set of materials is stable then I suggest that you add a flag to your DetectorConstruction class
  G4bool fMaterialsCreated
which you set once you have instantiated (created) them.

So long as you check this flag before calling the method (or going through the code) that creates these materials, you will be fine.

Otherwise you can revise the code to use the NIST material manager, which has a method to "find or create" a material.

In that case you will not be creating the material twice if you call the method for a material - it will just create it on the first call and return a pointer to the same created material on the second call.

Regards,
John
===================================================

On Jun 18, 2014, at 10:04 AM, Stefan E. Mueller <stefan.mueller@hzdr.de> wrote:

> 
> *** Discussion title: Geometry
> 
> Dear all,
> 
> I use a GeometryMessenger to change the geometry of my simulation
> between runs (following the AnaEx01 example). This works nicely,
> however, when I update the geometry between runs (
> DetectorConstruction->UpdateGeometry();), I get the following warnings:
> 
> G4Material WARNING: doublicate name of the new material interGalactic
> G4Material WARNING: doublicate name of the new material Copper
> G4Material WARNING: doublicate name of the new material Iron
> G4Material WARNING: doublicate name of the new material Lead
> G4Material WARNING: doublicate name of the new material Air
> G4Material WARNING: doublicate name of the new material Water
> G4Material WARNING: doublicate name of the new material StSt
> G4Material WARNING: doublicate name of the new material Concrete
> G4Material WARNING: doublicate name of the new material Castiron
> 
> While for the geometry, I clean everything with
> 
>  G4GeometryManager::GetInstance()->OpenGeometry();
>  G4PhysicalVolumeStore::GetInstance()->Clean();
>  G4LogicalVolumeStore::GetInstance()->Clean();
>  G4SolidStore::GetInstance()->Clean();
> 
> before building the geometry, I don't know if I should do something
> similar for the definition of materials (which also happens in my
> DetectorConstruction::Construct() code).
> 
> Apparently, deleting materials between runs is not supported, what would
> be the best way to get rid of these warnings? Or can I just ignore them?
> 
> Cheers,
> 
> Stefan
> 
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at: 
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1346.html 

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

1 Ok: Re: G4Material WARNING: doublicate name of the new material   (Stefan E. Mueller - 20 Jun, 2014)
 Add Message Add Message
to: "Re: G4Material WARNING: doublicate name of the new material"

 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 ]