49 std::vector<G4VStatMFMacroCluster*> * ClusterVector) :
53 _FreeInternalE0(FreeE0),
55 _MeanMultiplicity(0.0),
56 _MeanTemperature(0.0),
57 _ChemPotentialMu(0.0),
58 _ChemPotentialNu(0.0),
60 _theClusters(ClusterVector)
86 while (fTa < 0.0 && ++iterations < 10) {
93 while (fTa*fTb > 0.0 && iterations++ < 10) {
94 Tb += 2.*std::fabs(Tb-Ta);
99 G4cerr <<
"G4StatMFMacroTemperature:"<<
" Ta="<<Ta<<
" Tb="<<Tb<<
G4endl;
100 G4cerr <<
"G4StatMFMacroTemperature:"<<
" fTa="<<fTa<<
" fTb="<<fTb<<
G4endl;
101 throw G4HadronicException(__FILE__, __LINE__,
"G4StatMFMacroTemperature::CalcTemperature: I couldn't bracket the solution.");
108 G4cout <<
"G4StatMFMacroTemperature, Crenshaw method failed:"<<
" Ta="
109 <<Ta<<
" Tb="<<Tb<<
G4endl;
110 G4cout <<
"G4StatMFMacroTemperature, Crenshaw method failed:"<<
" fTa="
111 <<fTa<<
" fTb="<<fTb<<
G4endl;
119 if (std::fabs(FunctionValureAtRoot) > 5.
e-2) {
120 if (_MeanTemperature < 1. || _MeanTemperature > 50.) {
121 G4cout <<
"Crenshaw method failed; function = " << FunctionValureAtRoot
126 if (!theSolverBrent->
Brent(*
this)){
127 G4cout <<
"G4StatMFMacroTemperature, Brent method failed:"
128 <<
" Ta="<<Ta<<
" Tb="<<Tb<<
G4endl;
129 G4cout <<
"G4StatMFMacroTemperature, Brent method failed:"
130 <<
" fTa="<<fTa<<
" fTb="<<fTb<<
G4endl;
131 throw G4HadronicException(__FILE__, __LINE__,
"G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
136 delete theSolverBrent;
138 if (std::abs(FunctionValureAtRoot) > 5.
e-2) {
139 G4cout <<
"Brent method failed; function = " << FunctionValureAtRoot
141 throw G4HadronicException(__FILE__, __LINE__,
"G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
166 std::vector<G4VStatMFMacroCluster*>::iterator i;
169 AverageEnergy += (*i)->GetMeanMultiplicity() * (*i)->CalcEnergy(T);
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double _ChemPotentialMu
G4double Z13(G4int Z) const
G4double A13(G4double A) const
static constexpr double MeV
G4double operator()(const G4double T)
G4double CalcTemperature(void)
static G4double GetKappaCoulomb()
G4StatMFMacroTemperature()
~G4StatMFMacroTemperature()
G4double GetMeanMultiplicity(void) const
G4double CalcChemicalPotentialNu(void)
G4bool Crenshaw(Function &theFunction)
static G4Pow * GetInstance()
G4double GetRoot(void) const
G4double _MeanTemperature
void SetIntervalLimits(const G4double Limit1, const G4double Limit2)
static constexpr double elm_coupling
G4GLOB_DLL std::ostream G4cerr
G4double GetChemicalPotentialMu(void) const
G4double FragsExcitEnergy(const G4double T)
void CalcChemicalPotentialNu(const G4double T)
G4GLOB_DLL std::ostream G4cout
G4double _ChemPotentialNu
static constexpr double pi
std::vector< G4VStatMFMacroCluster * > * _theClusters
G4double _MeanMultiplicity
G4bool Brent(Function &theFunction)