EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
estar_dataParser.h
1 /*
2 ###############################################################################
3 #
4 # EGSnrc estar
5 # Copyright (C) 2026 National Research Council Canada
6 #
7 # This file is part of EGSnrc.
8 #
9 # EGSnrc is free software: you can redistribute it and/or modify it under
10 # the terms of the GNU Affero General Public License as published by the
11 # Free Software Foundation, either version 3 of the License, or (at your
12 # option) any later version.
13 #
14 # EGSnrc is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 # FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
17 # more details.
18 #
19 # You should have received a copy of the GNU Affero General Public License
20 # along with EGSnrc. If not, see <http://www.gnu.org/licenses/>.
21 #
22 ###############################################################################
23 #
24 # Author: Sehmimul Hoque, 2022
25 #
26 # Contributors: Martin J. Berger
27 # Johnathan S. Coursey
28 # Reid Townson
29 # Ernesto Mainegra-Hing
30 #
31 # Based on the original ESTAR code by Martin J. Berger,
32 # National Institute of Standards and Technology (NIST). Including
33 # modifications by Johnathan S. Coursey.
34 #
35 ###############################################################################
36 */
37 
38 #pragma once
39 
40 #include <string>
41 
42 /*
43  This module reads data from the elementData.h file and structures it
44  for use in other modules. There are 100 sets of data in elementData.h
45  (indexed by atomic number - 1), where each set corresponds to one element.
46  * For example: the third set of data in elementData.h is the data for Lithium.
47 */
48 
56 
65  int nmax[100];
66 
69 
78  int nc[100][26];
79 
87  double bd[100][26];
88 };
89 
99 ElementOscillatorData parseData();
100 
101 /*
102  This module parses and interprets a single chemical formula for a
103  compound or element. The final product is a parseformula object.
104 */
105 
114 struct parseformula {
115  std::string str_arr[100]; // stores the chemical symbol of each element
116  // present in the compound/element
117  int num_arr[100]; // stores the number of atoms of the corresponding
118  // element in str_arr
119  // * example: for H2O, num_arr = [2, 1]
120  int elem_types; // number of different types of elements present
121  // * example: for H2O, elem_types = 2
122 };
123 
136 parseformula parse(std::string str);
137 
Holds the dispersion oscillator data for all 100 elements.
int nc[100][26]
Number of electrons in each subshell for each element.
double bd[100][26]
Absorption edge energies (in units of hbar) for each oscillator.
int numLevelsStandard
Number of elements in the standard energy grid.
int nmax[100]
Number of dispersion oscillators for each element.
Holds the parsed representation of a chemical formula.