Note that there are some explanatory texts on larger screens.

plurals
  1. POInterpret a string as it refers to an in program variable. Geant4 units
    primarykey
    data
    text
    <p>So, I understand that this is not something built into the language (i.e. there is no eval() method in c++). I also understand that it is very difficult to associate the contents of a string input at runtime with a variable name from the program, since most of that info goes away. Nevertheless...</p> <p>I am trying to write a little class to allow users in my research group to add materials and material properties into a database file and call those materials up with one command so that material construction is easy in Geant4. Unfortunately, Geant4 uses a header file to define actual variables for these units such as cm3, mm, MeV, and kg to convert units into the internal Geant4 system of units. I don't believe there is any kind of map that links these to their corresponding strings. The fact of the matter is, Geant4 is for physics modelling, and there are a butt ton of units. There is no real way I can map them all, either, since Geant4 is expandable and some new physics code may come along that wants a new unit I don't know about.</p> <p>What I would like to do is get the string that describes the unit from the text file and somehow match that to the actual variable of the same name so I can perform the conversion. Is there any way to hack and slash this out, or is it totally impossible (or totally nearly impossible)?</p> <p>Of course I could make people convert to the internal units for all of their database entries, but that could quickly get ugly and be a large source of hard to track down error (15 places before the decimal looks a lot like 14).</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload