[Gate-users] How to Define Isotopes?

Akgun, Ugur uakgun at coe.edu
Sun Jul 25 19:08:22 CEST 2021


I'm having an issue getting isotopes working in my material database file.
I'm using Gate V9.1. I've looked in the source files looking for a way to
use isotopes and found parts that should give the functionality. Using what
they show I'm getting an error where f=0.8 in  +iso: name=Boron10 ; f=0.8
doesn't get read and returns the error message in the terminal:

GateMDBCreators.cc (l.198): Sum of fraction is not 1.0 for mat solidIsotope
0

Changing the +iso with +el and changing the name to a defined element makes
it work as expected so I'm not convinced it's the structure of the database
file. Does anyone know how to use this functionality? Any help would be
appreciated.

Lines from database file
[Isotopes]
Boron10:    S=B    ; z= 5.  ; N= 10; A=10 g/mole

[Materials]
solidIsotope: d=10.013 g/cm3 ; n=1
    +iso: name=Boron10 ; f=0.8
    +el: name=Tungsten ; f=0.2



Source files that show use use of isotopes
// Read a new isotope from the DB file --> returns an isotope creator
GateIsotopeCreator* GateMDBFile::ReadIsotope(const G4String& isotopeName)
{
  GateMessage("Materials", 5,
     "GateMDBFile<" << fileName
     << ">::ReadIsotope("
     << isotopeName <<")\n");

  // Find the isotope definition line in the [Isotopes] section of the DB
file
  G4String line = ReadItem("Isotopes", isotopeName);
  if (line == theReadItemErrorMsg)  return 0;

  GateMessage("Materials", 5,
     "GateMDBFile<" << fileName
     << ">: found definition for isotope '"
     << isotopeName << "' as an elementary isotope.\n");

  if (line == "")
    DecodingException(isotopeName,"\tThe isotope's definition line seems to
be empty\n");

  // Create an empty isotope-creator
  GateIsotopeCreator *creator = new GateIsotopeCreator(isotopeName);

  // Read the 1st field as the isotope's atomic number (Z)
  GateTokenizer::BrokenString stringPair =
GateTokenizer::BreakString(line,theFieldSeparator);
  creator->atomicNumber = ReadAtomicNumber(isotopeName,stringPair.first);

  // Read the 2nd field as the element's nucleon number (N)
  stringPair =
GateTokenizer::BreakString(stringPair.second,theFieldSeparator);
  creator->nucleonNumber = ReadNucleonNumber(isotopeName,stringPair.first);

  // Read the 3rd field as the element's molar mass (A)
  stringPair =
GateTokenizer::BreakString(stringPair.second,theFieldSeparator);
  creator->molarMass = ReadMolarMass(isotopeName,stringPair.first);

  GateMessage("Materials", 5,
     "GateMDBFile<" << fileName
     << ": definition loaded for isotope '"
     << isotopeName <<"'.\n");

  return creator;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20210725/7795c78e/attachment.html>


More information about the Gate-users mailing list