57 : fMaterial(mat), fVerbose(0), fWarnings(0), nlev(
n)
89 for(
G4int i = 0; i < nshell; ++i) {
93 if(i < nshell-1 || !conductor) {
107 const G4double invsum = (sum > 0.0) ? 1./sum : 0.0;
127 G4cout <<
"G4DensityEffectCalculator::ComputeDensityCorrection for "
134 G4cout <<
" Delta: computed= " << exact
135 <<
", parametrized= " << approx <<
G4endl;
137 if(approx >= 0. && exact < 0.) {
143 <<
", x = " << x <<
": Delta exact= "
144 << exact <<
", approx= " << approx;
145 G4Exception(
"G4DensityEffectCalculator::DensityCorrection",
"mat008",
156 if(approx >= 0. && std::abs(exact - approx) > 1.) {
161 ed <<
"Sternheimer exact= " << exact <<
" and approx= "
162 << approx <<
" are too different for "
164 G4Exception(
"G4DensityEffectCalculator::DensityCorrection",
"mat008",
182 if(x > 20.) {
return -1.; }
189 if(sternrho <= 0. || sternrho > 100.) {
195 <<
", x = " << x <<
":\n"
196 <<
"Could not solve for Sternheimer rho. Probably you have a \n"
197 <<
"mean ionization energy which is incompatible with your\n"
198 <<
"distribution of energy levels, or an unusually dense material.\n"
199 <<
"Number of levels: " <<
nlev
200 <<
" Mean ionization energy(eV): " <<
meanexcite
201 <<
" Plasma energy(eV): " <<
plasmaE <<
"\n";
203 ed <<
"Level " << i <<
": strength " <<
sternf[i]
204 <<
": energy(eV)= " <<
levE[i] <<
"\n";
206 G4Exception(
"G4DensityEffectCalculator::SetupFermiDeltaCalc",
"mat008",
235 for(
G4int startLi = -10; startLi < 30; ++startLi){
250 const G4int maxIter = 100;
251 G4int nbad = 0, ngood = 0;
256 G4cout <<
"G4DensityEffectCalculator::Newton: strat= " << start
257 <<
" type: " << first <<
G4endl;
267 if(dvalue == 0.0) {
break; }
283 if(nbad > maxIter || std::isnan(value) || std::isinf(value)) {
break; }
286 G4cout <<
" Failed to converge last value= " << value
287 <<
" dvalue= " << dvalue <<
" lambda= " <<
lambda <<
G4endl;
static const G4double eps
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Log(G4double x)
static constexpr double L
G4GLOB_DLL std::ostream G4cout
static G4int GetNumberOfElectrons(G4int Z, G4int SubshellNb)
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
static G4int GetNumberOfShells(G4int Z)
G4DensityEffectCalculator(const G4Material *, G4int)
const G4Material * fMaterial
G4double Newton(G4double x0, G4bool first)
G4double DeltaOnceSolved(G4double)
~G4DensityEffectCalculator()
G4double ComputeDensityCorrection(G4double x)
G4double FermiDeltaCalculation(G4double x)
G4double GetDensityCorrection(G4double x)
G4double GetMeanExcitationEnergy() const
G4double GetPlasmaEnergy() const
G4double GetTotNbOfAtomsPerVolume() const
const G4Element * GetElement(G4int iel) const
G4IonisParamMat * GetIonisation() const
G4double GetFreeElectronDensity() const
size_t GetNumberOfElements() const
const G4double * GetVecNbOfAtomsPerVolume() const
const G4String & GetName() const
static G4NistManager * Instance()
static G4Pow * GetInstance()
G4double powZ(G4int Z, G4double y) const
G4double powN(G4double x, G4int n) const
static constexpr double eV
T max(const T t1, const T t2)
brief Return the largest of the two arguments