48 std::vector<G4VStatMFMacroCluster*> * ClusterVector) :
52 _FreeInternalE0(FreeE0),
54 _MeanMultiplicity(0.0),
55 _MeanTemperature(0.0),
56 _ChemPotentialMu(0.0),
57 _ChemPotentialNu(0.0),
59 _theClusters(ClusterVector)
69 G4double Tb = std::max(std::sqrt(_ExEnergy/(theA*0.12)),0.01*MeV);
85 while (fTa < 0.0 && ++iterations < 10) {
92 while (fTa*fTb > 0.0 && iterations++ < 10) {
93 Tb += 2.*std::fabs(Tb-Ta);
98 G4cerr <<
"G4StatMFMacroTemperature:"<<
" Ta="<<Ta<<
" Tb="<<Tb<<
G4endl;
99 G4cerr <<
"G4StatMFMacroTemperature:"<<
" fTa="<<fTa<<
" fTb="<<fTb<<
G4endl;
100 throw G4HadronicException(__FILE__, __LINE__,
"G4StatMFMacroTemperature::CalcTemperature: I couldn't bracket the solution.");
107 G4cout <<
"G4StatMFMacroTemperature, Crenshaw method failed:"<<
" Ta="
108 <<Ta<<
" Tb="<<Tb<<
G4endl;
109 G4cout <<
"G4StatMFMacroTemperature, Crenshaw method failed:"<<
" fTa="
110 <<fTa<<
" fTb="<<fTb<<
G4endl;
112 _MeanTemperature = theSolver->
GetRoot();
118 if (std::fabs(FunctionValureAtRoot) > 5.e-2) {
119 if (_MeanTemperature < 1. || _MeanTemperature > 50.) {
120 G4cout <<
"Crenshaw method failed; function = " << FunctionValureAtRoot
121 <<
" solution? = " << _MeanTemperature <<
" MeV " <<
G4endl;
125 if (!theSolverBrent->
Brent(*
this)){
126 G4cout <<
"G4StatMFMacroTemperature, Brent method failed:"
127 <<
" Ta="<<Ta<<
" Tb="<<Tb<<
G4endl;
128 G4cout <<
"G4StatMFMacroTemperature, Brent method failed:"
129 <<
" fTa="<<fTa<<
" fTb="<<fTb<<
G4endl;
130 throw G4HadronicException(__FILE__, __LINE__,
"G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
133 _MeanTemperature = theSolverBrent->
GetRoot();
134 FunctionValureAtRoot = this->
operator()(_MeanTemperature);
135 delete theSolverBrent;
137 if (std::abs(FunctionValureAtRoot) > 5.e-2) {
138 G4cout <<
"Brent method failed; function = " << FunctionValureAtRoot
139 <<
" solution? = " << _MeanTemperature <<
" MeV " <<
G4endl;
140 throw G4HadronicException(__FILE__, __LINE__,
"G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
146 return _MeanTemperature;
157 G4double FreeVol = _Kappa*(4.*pi/3.)*R0*R0*R0;
160 CalcChemicalPotentialNu(T);
165 std::vector<G4VStatMFMacroCluster*>::iterator i;
166 for (i = _theClusters->begin(); i != _theClusters->end(); ++i)
168 AverageEnergy += (*i)->GetMeanMultiplicity() * (*i)->CalcEnergy(T);
172 AverageEnergy += 0.6*elm_coupling*theZ*theZ/R;
176 for (i = _theClusters->begin(); i != _theClusters->end(); ++i)
178 _MeanEntropy += (*i)->CalcEntropy(T,FreeVol);
182 return AverageEnergy - _FreeInternalE0;
185void G4StatMFMacroTemperature::CalcChemicalPotentialNu(
const G4double T)
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
static G4Pow * GetInstance()
G4double A13(G4double A) const
G4double Z13(G4int Z) const
G4bool Brent(Function &theFunction)
void SetIntervalLimits(const G4double Limit1, const G4double Limit2)
G4double GetRoot(void) const
G4bool Crenshaw(Function &theFunction)
G4double GetChemicalPotentialMu(void) const
G4double CalcChemicalPotentialNu(void)
G4double GetMeanMultiplicity(void) const
G4StatMFMacroTemperature(const G4double anA, const G4double aZ, const G4double ExEnergy, const G4double FreeE0, const G4double kappa, std::vector< G4VStatMFMacroCluster * > *ClusterVector)
G4double operator()(const G4double T)
~G4StatMFMacroTemperature()
G4double CalcTemperature(void)
static G4double GetKappaCoulomb()