104 G4cout <<
" G4Material WARNING:"
105 <<
" define a material with density=0 is not allowed. \n"
106 <<
" The material " <<
name <<
" will be constructed with the"
156 G4cout <<
"--- Warning from G4Material::G4Material()"
157 <<
" define a material with density=0 is not allowed. \n"
158 <<
" The material " <<
name <<
" will be constructed with the"
192 G4cout <<
"--- Warning from G4Material::G4Material()"
193 <<
" define a material with density=0 is not allowed. \n"
194 <<
" The material " <<
name <<
" will be constructed with the"
278 G4cout <<
"G4Material WARNING: duplicate name of material "
301 Zi = (*theElementVector)[i]->GetZ();
302 Ai = (*theElementVector)[i]->GetA();
365 fAtoms =
new std::vector<G4int>;
366 fElm =
new std::vector<const G4Element*>;
370 ed <<
"For material " <<
fName <<
" and added element "
371 << elm->
GetName() <<
" with Natoms=" << nAtoms
372 <<
" wrong attempt to add more than the declared number of elements "
374 G4Exception (
"G4Material::AddElementByNumberOfAtoms()",
"mat031",
379 ed <<
"For material " <<
fName <<
" and added element "
380 << elm->
GetName() <<
" with Natoms=" << nAtoms
381 <<
" problem: cannot add by number of atoms after "
382 <<
"addition of elements by mass fraction";
383 G4Exception (
"G4Material::AddElementByNumberOfAtoms()",
"mat031",
390 if ( elm == (*
fElm)[i] ) {
391 (*fAtoms)[i] += nAtoms;
398 fElm->push_back(elm);
399 fAtoms->push_back(nAtoms);
437 if(fraction < 0.0 || fraction > 1.0) {
439 ed <<
"For material " <<
fName <<
" and added element "
440 << elm->
GetName() <<
" massFraction= " << fraction
442 G4Exception (
"G4Material::AddElementByMassFraction()",
"mat031",
447 ed <<
"For material " <<
fName <<
" and added element "
448 << elm->
GetName() <<
", massFraction= " << fraction
450 <<
" problem: cannot add by mass fraction after "
451 <<
"addition of elements by number of atoms";
452 G4Exception (
"G4Material::AddElementByMassFraction()",
"mat031",
457 ed <<
"For material " <<
fName <<
" and added element "
458 << elm->
GetName() <<
", massFraction= " << fraction
460 <<
"; attempt to add more than the declared number of components "
462 G4Exception (
"G4Material::AddElementByMassFraction()",
"mat031",
466 fElmFrac =
new std::vector<G4double>;
467 fElm =
new std::vector<const G4Element*>;
474 if ( elm == (*
fElm)[i] ) {
475 (*fElmFrac)[i] += fraction;
482 fElm->push_back(elm);
498 if(fraction < 0.0 || fraction > 1.0) {
500 ed <<
"For material " <<
fName <<
" and added material "
501 <<
material->GetName() <<
", massFraction= " << fraction
508 ed <<
"For material " <<
fName <<
" and added material "
509 <<
material->GetName() <<
", massFraction= " << fraction
511 <<
" problem: cannot add by mass fraction after "
512 <<
"addition of elements by number of atoms";
518 ed <<
"For material " <<
fName <<
" and added material "
519 <<
material->GetName() <<
", massFraction= " << fraction
520 <<
"; attempt to add more than the declared number of components "
527 fElmFrac =
new std::vector<G4double>;
528 fElm =
new std::vector<const G4Element*>;
533 for(
G4int j=0; j<nelm; ++j) {
535 auto frac =
material->GetFractionVector();
539 if ( elm == (*
fElm)[i] ) {
540 (*fElmFrac)[i] += fraction*frac[j];
547 fElm->push_back(elm);
548 fElmFrac->push_back(fraction*frac[j]);
581 ed <<
"For material " <<
fName <<
" sum of fractional masses "
582 << wtSum <<
" is not 1 - results may be wrong";
586 G4double coeff = (wtSum > 0.0) ? 1./wtSum : 1.0;
618 G4int Z = (*theElementVector)[i]->GetZasInt();
619 G4double A = (*theElementVector)[i]->GetN();
626 NILinv *=
amu/lambda0;
634#ifdef G4MULTITHREADED
638#ifdef G4MULTITHREADED
647#ifdef G4MULTITHREADED
651#ifdef G4MULTITHREADED
660#ifdef G4MULTITHREADED
665#ifdef G4MULTITHREADED
697 G4cout <<
"G4Material::GetMaterial() WARNING: The material: "
699 <<
" does not exist in the table. Return NULL pointer."
740 ed <<
"For material " <<
fName <<
" ERROR in GetZ() - Nelm="
754 ed <<
"For material " <<
fName <<
" ERROR in GetA() - Nelm="
766 std::ios::fmtflags mode = flux.flags();
767 flux.setf(std::ios::fixed,std::ios::floatfield);
771 <<
" Material: " << std::setw(8) <<
material->fName
772 <<
" " <<
material->fChemicalFormula <<
" "
773 <<
" density: " << std::setw(6) << std::setprecision(3)
775 <<
" RadL: " << std::setw(7) << std::setprecision(3)
777 <<
" Nucl.Int.Length: " << std::setw(7) << std::setprecision(3)
779 <<
"\n" << std::setw(30)
780 <<
" Imean: " << std::setw(7) << std::setprecision(3)
782 <<
" temperature: " << std::setw(6) << std::setprecision(2)
784 <<
" pressure: " << std::setw(6) << std::setprecision(2)
789 <<
"\n ---> " << (*(
material->theElementVector))[i]
790 <<
"\n ElmMassFraction: "
791 << std::setw(6)<< std::setprecision(2)
793 <<
" ElmAbundance " << std::setw(6)<< std::setprecision(2)
794 << 100*(
material->fVecNbOfAtomsPerVolume[i])
798 flux.precision(
prec);
799 flux.setf(mode,std::ios::floatfield);
820 flux <<
"\n***** Table : Nb of materials = " << MaterialTable.size()
823 for (
size_t i=0; i<MaterialTable.size(); ++i) {
842#ifdef G4MULTITHREADED
848#ifdef G4MULTITHREADED
std::vector< const G4Element * > G4ElementVector
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
std::vector< G4Material * > G4MaterialTable
static constexpr double perCent
static constexpr double cm3
static constexpr double g
static constexpr double perThousand
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4GLOB_DLL std::ostream G4cout
static G4int GetNumberOfFreeElectrons(G4int Z, G4double th)
const G4String & GetName() const
G4double GetMeanExcitationEnergy() const
void ComputeDensityEffectOnFly(G4bool)
void SetMeanExcitationEnergy(G4double value)
G4DensityEffectCalculator * GetDensityEffectCalculator()
G4double fTotNbOfElectPerVolume
G4double GetDensity() const
G4double fFreeElecDensity
const G4String & GetChemicalFormula() const
void SetFreeElectronDensity(G4double)
const G4ElementVector * GetElementVector() const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
const G4Material * fBaseMaterial
void ComputeDerivedQuantities()
static G4MaterialTable theMaterialTable
G4double GetTotNbOfAtomsPerVolume() const
void InitializePointers()
G4String fChemicalFormula
static size_t GetNumberOfMaterials()
G4SandiaTable * fSandiaTable
virtual G4bool IsExtended() const
const G4double * GetFractionVector() const
void CopyPointersOfBaseMaterial()
G4double GetTotNbOfElectPerVolume() const
G4IonisParamMat * GetIonisation() const
G4double GetFreeElectronDensity() const
size_t GetNumberOfElements() const
std::map< G4Material *, G4double > fMatComponents
G4double fTotNbOfAtomsPerVolume
void SetChemicalFormula(const G4String &chF)
const G4int * GetAtomsVector() const
G4double * fVecNbOfAtomsPerVolume
G4double * fMassFractionVector
G4SandiaTable * GetSandiaTable() const
std::vector< G4int > * fAtoms
void AddElementByNumberOfAtoms(const G4Element *elm, G4int nAtoms)
G4ElementVector * theElementVector
G4double GetRadlen() const
G4double GetMassOfMolecule() const
const G4double * GetVecNbOfAtomsPerVolume() const
G4Material(const G4String &name, G4double z, G4double a, G4double density, G4State state=kStateUndefined, G4double temp=NTP_Temperature, G4double pressure=CLHEP::STP_Pressure)
static G4MaterialTable * GetMaterialTable()
void ComputeNuclearInterLength()
void AddMaterial(G4Material *material, G4double fraction)
void ComputeRadiationLength()
const G4String & GetName() const
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
void AddElementByMassFraction(const G4Element *elm, G4double fraction)
std::vector< G4double > * fElmFrac
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void ComputeDensityEffectOnFly(G4bool)
G4IonisParamMat * fIonisation
G4double GetNuclearInterLength() const
G4MaterialPropertiesTable * fMaterialPropertiesTable
std::vector< const G4Element * > * fElm
static G4NistManager * Instance()
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
static constexpr double kelvin
static constexpr double g
static constexpr double atmosphere
static constexpr double cm2
static constexpr double Avogadro
static constexpr double eV
const char * name(G4int ptype)
void Print(G4Element &ele)
int universe_mean_density