VGM Version 5.3
Loading...
Searching...
No Matches
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
20
21//_____________________________________________________________________________
22std::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}
The VGM interface to elements.
Definition IElement.h:34
virtual IIsotope * Isotope(int i) const =0
Return the i-th isotope constituing this element.
virtual int NofIsotopes() const =0
Return the number of isotopes constituing this element.
virtual double Z() const =0
Return the effective atomic number.
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...
virtual std::string Name() const =0
Return the name of this element.
virtual std::string Symbol() const =0
Return the symbol of this element.
virtual double A() const =0
Return the effective effective mass of a mole in g/mole.
virtual double N() const =0
Return the effective number of nucleons.
std::ostream & operator<<(std::ostream &out, const VGM::IElement &element)
Definition element.cxx:22