VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
BaseVGM
source
materials
element.cxx
Go to the documentation of this file.
1
// $Id$
2
3
// -----------------------------------------------------------------------
4
// The BaseVGM package of the Virtual Geometry Model
5
// Copyright (C) 2007, Ivana Hrivnacova
6
// All rights reserved.
7
//
8
// For the licensing terms see vgm/LICENSE.
9
// Contact: ivana@ipno.in2p3.fr
10
// -----------------------------------------------------------------------
11
12
//
13
// VGM::IElement output stream
14
// ------------------------
15
//
16
// Author: Ivana Hrivnacova; IPN Orsay
17
18
#include "
VGM/materials/IElement.h
"
19
#include "
VGM/materials/IIsotope.h
"
20
21
//_____________________________________________________________________________
22
std::ostream&
operator<<
(std::ostream& out,
const
VGM::IElement
& element)
23
{
24
out <<
"Element: "
25
<<
"\""
<< element.
Name
() <<
"\" "
26
<<
"\""
<< element.
Symbol
() <<
"\""
27
<<
" Z = "
<< element.
Z
() <<
" N = "
<< element.
N
()
28
<<
" A = "
<< element.
A
() <<
" g/mole"
;
29
30
for
(
int
i = 0; i < element.
NofIsotopes
(); i++) {
31
if
(i == 0) out << std::endl;
32
out <<
" "
<< i <<
"th isotope: "
<< *element.
Isotope
(i)
33
<<
" abundance: "
<< element.
RelAbundance
(i) * 100. <<
"%"
;
34
if
(i < element.
NofIsotopes
() - 1) out << std::endl;
35
}
36
37
return
out;
38
}
IElement.h
IIsotope.h
VGM::IElement
The VGM interface to elements.
Definition
IElement.h:34
VGM::IElement::Isotope
virtual IIsotope * Isotope(int i) const =0
Return the i-th isotope constituing this element.
VGM::IElement::NofIsotopes
virtual int NofIsotopes() const =0
Return the number of isotopes constituing this element.
VGM::IElement::Z
virtual double Z() const =0
Return the effective atomic number.
VGM::IElement::RelAbundance
virtual double RelAbundance(int i) const =0
Return the relative abundance (the fraction of nb of atomes per volume) of the i-th isotope constitui...
VGM::IElement::Name
virtual std::string Name() const =0
Return the name of this element.
VGM::IElement::Symbol
virtual std::string Symbol() const =0
Return the symbol of this element.
VGM::IElement::A
virtual double A() const =0
Return the effective effective mass of a mole in g/mole.
VGM::IElement::N
virtual double N() const =0
Return the effective number of nucleons.
operator<<
std::ostream & operator<<(std::ostream &out, const VGM::IElement &element)
Definition
element.cxx:22
Generated on
for VGM by
1.17.0