#include <G4Element.hh>
Definition at line 97 of file G4Element.hh.
Definition at line 75 of file G4Element.cc.
77 : fName(name), fSymbol(symbol)
82 ed <<
"Fail to create G4Element " << name
83 <<
" Z= " << zeff <<
" < 1 !";
88 ed <<
"G4Element Warning: " << name <<
" Z= " << zeff
89 <<
" A= " << aeff/(
g/
mole);
97 fNeff = fAeff/(
g/
mole);
99 if(fNeff < 1.0) fNeff = 1.0;
103 ed <<
"Fail to create G4Element " << name
104 <<
" with Z= " << zeff <<
" N= " << fNeff
105 <<
" N < Z is not allowed" <<
G4endl;
110 fAtomicShells =
new G4double[fNbOfAtomicShells];
111 fNbOfShellElectrons =
new G4int[fNbOfAtomicShells];
113 AddNaturalIsotopes();
115 for (
G4int i=0;i<fNbOfAtomicShells;i++)
120 ComputeDerivedQuantities();
static constexpr double perMillion
std::ostringstream G4ExceptionDescription
static constexpr double g
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4int GetNumberOfElectrons(G4int Z, G4int SubshellNb)
static constexpr double mole
static G4int GetNumberOfShells(G4int Z)
Definition at line 128 of file G4Element.cc.
130 : fName(name),fSymbol(symbol)
132 InitializePointers();
134 size_t n = size_t(nIsotopes);
138 ed <<
"Fail to create G4Element " << name
139 <<
" <" << symbol <<
"> with " << nIsotopes
144 fRelativeAbundanceVector =
new G4double[nIsotopes];
std::vector< G4Isotope * > G4IsotopeVector
std::ostringstream G4ExceptionDescription
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4Element::~G4Element |
( |
| ) |
|
|
virtual |
Definition at line 253 of file G4Element.cc.
255 if (theIsotopeVector) {
delete theIsotopeVector; }
256 if (fRelativeAbundanceVector) {
delete [] fRelativeAbundanceVector; }
257 if (fAtomicShells) {
delete [] fAtomicShells; }
258 if (fNbOfShellElectrons) {
delete [] fNbOfShellElectrons; }
259 if (fIonisation) {
delete fIonisation; }
262 theElementTable[fIndexInTable] = 0;
G4Element::G4Element |
( |
__void__ & |
| ) |
|
Definition at line 245 of file G4Element.cc.
246 : fZeff(0), fNeff(0), fAeff(0)
248 InitializePointers();
Definition at line 152 of file G4Element.cc.
154 if (theIsotopeVector == 0) {
156 ed <<
"Fail to add Isotope to G4Element " << fName
157 <<
" with Z= " << fZeff <<
" N= " << fNeff;
164 if ( fNumberOfIsotopes < (
G4int)theIsotopeVector->size() ) {
166 if (fNumberOfIsotopes==0) { fZeff =
G4double(iz); }
169 ed <<
"Fail to add Isotope Z= " << iz <<
" to G4Element " << fName
170 <<
" with different Z= " << fZeff << fNeff;
175 fRelativeAbundanceVector[fNumberOfIsotopes] = abundance;
176 (*theIsotopeVector)[fNumberOfIsotopes] = isotope;
181 ed <<
"Fail to add Isotope Z= " << iz <<
" to G4Element " << fName
182 <<
" - more isotopes than declaired ";
188 if ( fNumberOfIsotopes == (
G4int)theIsotopeVector->size() ) {
191 for (
G4int i=0; i<fNumberOfIsotopes; i++) {
192 fAeff += fRelativeAbundanceVector[i]*(*theIsotopeVector)[i]->GetA();
193 wtSum += fRelativeAbundanceVector[i];
195 if(wtSum > 0.0) { fAeff /= wtSum; }
196 fNeff = fAeff/(
g/
mole);
199 for(
G4int i=0; i<fNumberOfIsotopes; ++i) {
200 fRelativeAbundanceVector[i] /= wtSum;
205 fAtomicShells =
new G4double[fNbOfAtomicShells];
206 fNbOfShellElectrons =
new G4int[fNbOfAtomicShells];
208 for (
G4int j = 0; j < fNbOfAtomicShells; j++ )
213 ComputeDerivedQuantities();
std::ostringstream G4ExceptionDescription
static constexpr double g
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4int GetNumberOfElectrons(G4int Z, G4int SubshellNb)
static constexpr double mole
static G4int GetNumberOfShells(G4int Z)
G4double G4Element::GetAtomicMassAmu |
( |
| ) |
const |
|
inline |
Definition at line 367 of file G4Element.cc.
369 if (i<0 || i>=fNbOfAtomicShells) {
371 ed <<
"Invalid argument " << i <<
" in for G4Element " << fName
372 <<
" with Z= " << fZeff
373 <<
" and Nshells= " << fNbOfAtomicShells;
377 return fAtomicShells[i];
std::ostringstream G4ExceptionDescription
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition at line 412 of file G4Element.cc.
415 for (
size_t J=0; J<theElementTable.size(); ++J)
417 if (theElementTable[J]->
GetName() == elementName)
418 return theElementTable[J];
423 G4cout <<
"\n---> warning from G4Element::GetElement(). The element: "
424 << elementName <<
" does not exist in the table. Return NULL pointer."
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
G4double G4Element::GetfCoulomb |
( |
| ) |
const |
|
inline |
G4double G4Element::GetfRadTsai |
( |
| ) |
const |
|
inline |
size_t G4Element::GetIndex |
( |
| ) |
const |
|
inline |
Definition at line 170 of file G4Element.hh.
171 {
return (*theIsotopeVector)[iso];}
Definition at line 163 of file G4Element.hh.
163 {
return theIsotopeVector;}
const G4String& G4Element::GetName |
( |
| ) |
const |
|
inline |
G4bool G4Element::GetNaturalAbundanceFlag |
( |
| ) |
const |
|
inline |
G4int G4Element::GetNbOfAtomicShells |
( |
| ) |
const |
|
inline |
Definition at line 147 of file G4Element.hh.
147 {
return fNbOfAtomicShells;}
G4int G4Element::GetNbOfShellElectrons |
( |
G4int |
index | ) |
const |
Definition at line 382 of file G4Element.cc.
384 if (i<0 || i>=fNbOfAtomicShells) {
386 ed <<
"Invalid argument " << i <<
" for G4Element " << fName
387 <<
" with Z= " << fZeff
388 <<
" and Nshells= " << fNbOfAtomicShells;
389 G4Exception(
"G4Element::GetNbOfShellElectrons()",
"mat016",
393 return fNbOfShellElectrons[i];
std::ostringstream G4ExceptionDescription
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
size_t G4Element::GetNumberOfElements |
( |
| ) |
|
|
static |
Definition at line 405 of file G4Element.cc.
407 return theElementTable.size();
size_t G4Element::GetNumberOfIsotopes |
( |
| ) |
const |
|
inline |
Definition at line 159 of file G4Element.hh.
159 {
return fNumberOfIsotopes;}
G4double* G4Element::GetRelativeAbundanceVector |
( |
| ) |
const |
|
inline |
Definition at line 167 of file G4Element.hh.
168 {
return fRelativeAbundanceVector;}
const G4String& G4Element::GetSymbol |
( |
| ) |
const |
|
inline |
G4int G4Element::GetZasInt |
( |
| ) |
const |
|
inline |
void G4Element::SetNaturalAbundanceFlag |
( |
G4bool |
val | ) |
|
|
inline |
std::ostream& operator<< |
( |
std::ostream & |
flux, |
|
|
const G4Element * |
element |
|
) |
| |
|
friend |
Definition at line 432 of file G4Element.cc.
434 std::ios::fmtflags mode = flux.flags();
435 flux.setf(std::ios::fixed,std::ios::floatfield);
439 <<
" Element: " << element->fName <<
" (" << element->fSymbol <<
")"
440 <<
" Z = " << std::setw(4) << std::setprecision(1) << element->fZeff
441 <<
" N = " << std::setw(5) << std::setprecision(1)
443 <<
" A = " << std::setw(6) << std::setprecision(3)
444 << (element->fAeff)/(
g/
mole) <<
" g/mole";
446 for (
G4int i=0; i<element->fNumberOfIsotopes; i++)
448 <<
"\n ---> " << (*(element->theIsotopeVector))[i]
449 <<
" abundance: " << std::setw(6) << std::setprecision(3)
450 << (element->fRelativeAbundanceVector[i])/
perCent <<
" %";
452 flux.precision(prec);
453 flux.setf(mode,std::ios::floatfield);
static constexpr double perCent
static constexpr double g
static constexpr double mole
std::ostream& operator<< |
( |
std::ostream & |
flux, |
|
|
const G4Element & |
element |
|
) |
| |
|
friend |
std::ostream& operator<< |
( |
std::ostream & |
flux, |
|
|
G4ElementTable |
ElementTable |
|
) |
| |
|
friend |
Definition at line 467 of file G4Element.cc.
470 flux <<
"\n***** Table : Nb of elements = " << ElementTable.size()
473 for (
size_t i=0; i<ElementTable.size(); i++) flux << ElementTable[i]
The documentation for this class was generated from the following files: