Message: Re: 2 GDML Questions Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: 2 GDML Questions 

Forum: Geometry
Re: Question 2 GDML Questions (Brent)
Date: 08 Apr, 2015
From: Witek Pokorski <Witek Pokorski>

Hi Brent,

so, the reason why you see the warnings now, is because of the following change:

06-06-13 V.Ivanchenko (materials-V09-06-17) - G4Material - added warning if new material has doublicate name

I guess, the reason for that change is that Vladimir needs to access the materials *by name* in order create some cross section tables, or something. I will check with him what exactly is behind that. Now, if you had two different materials with the same name, that would of course be a problem and could lead to incorrect results. In our case the material is the same, so the simulation results should not be affected.

Now, how to solve it.... Well, at the level of GDML, I could make the modification (not a trivial one, but feasible) that when you use modularised GDML files, each module lives in his own 'namespace', or in other words, I could prepend to all the material names, the module name, making it unique. This would get rid of the warnings concerning duplicated material names, but of course, would not get rid of the duplication of material objects in memory.

To make sure that we do not waste CPU/memory we would need to somehow, every time we instantiate a new material, to compare it with all the materials that are already in memory. We cannot rely on the names, because we can have two GDML modules where there are _different_ materials with the same name, and vice-versa, we can have two identical materials with the same name.... Not clear how to deal with it.

Concerning your idea to tell the GDML parser not to read several times the same xml file, it would certainly be a very good solution, but I don't know if/how to do it right now. The xml ENTITY works simply like '#include'. We would need find a way to make it conditional (if not read yet...). Moreover, the assumption was that each GDML module file was fully self consistent. If now we want not to parse the materials file, we would need to find a way to refer to materials parsed within other modules. It is not clear to me if/how this could be done. I will try to investigate.

Concerning you second question, to be honest, I do not know why it worked for you before... When you do the 'composite' you need to add elements, so clearly you do need to have those elements defined. When you do 'mixture' you can mix materials, so yes, it works with materials. So, in other words, the current situation that you describe seems to be correct for me. I will try to understand better if there was some change in Geant4 that made the previous case (with only materials defined) to work (I would say, by chance) before.

Cheers, Witek

 Add Message Add Message
to: "Re: 2 GDML Questions"

 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 ]