BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
bdsim
parser
atom.cc
1
/*
2
Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3
University of London 2001 - 2023.
4
5
This file is part of BDSIM.
6
7
BDSIM is free software: you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published
9
by the Free Software Foundation version 3 of the License.
10
11
BDSIM is distributed in the hope that it will be useful, but
12
WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
#include "atom.h"
20
21
using namespace
GMAD
;
22
23
Atom::Atom
()
24
{
25
clear
();
26
PublishMembers
();
27
}
28
29
void
Atom::clear
()
30
{
31
name
=
""
;
32
A
= 0.0;
33
Z = 0.0;
34
symbol =
""
;
35
}
36
37
void
Atom::PublishMembers
()
38
{
39
publish
(
"name"
, &
Atom::name
);
40
publish
(
"A"
, &
Atom::A
);
41
publish
(
"Z"
, &Atom::Z);
42
publish
(
"symbol"
, &Atom::symbol);
43
}
44
45
void
Atom::print
()
const
46
{
47
std::cout <<
"atom: "
<<
name
<<
" "
48
<<
"A= "
<<
A
<<
"g/mole "
49
<<
"Z= "
<< Z <<
" "
50
<<
"symbol= "
<< symbol <<
" "
51
<< std::endl;
52
}
GMAD::Published< Atom >::publish
void publish(const std::string &name, T C::*mp)
Make pointer to member from class C and type T with accessible with a name.
Definition:
published.h:92
GMAD
Parser namespace for GMAD language. Combination of Geant4 and MAD.
Definition:
BDSBeamlineIntegral.hh:27
GMAD::Atom::A
double A
g*mol^-1
Definition:
atom.h:40
GMAD::Atom::print
void print() const
printout
Definition:
atom.cc:45
GMAD::Atom::clear
void clear()
reset
Definition:
atom.cc:29
GMAD::Atom::Atom
Atom()
constructor
Definition:
atom.cc:23
GMAD::Atom::name
std::string name
name
Definition:
atom.h:38
GMAD::Atom::PublishMembers
void PublishMembers()
publish members so these can be looked up from parser
Definition:
atom.cc:37
Generated on Mon Aug 14 2023 13:49:30 for BDSIM by
1.9.6