Geant4  10.02.p03
G4StatMFMacroTemperature Class Reference

#include <G4StatMFMacroTemperature.hh>

Collaboration diagram for G4StatMFMacroTemperature:

Public Member Functions

 G4StatMFMacroTemperature (const G4double anA, const G4double aZ, const G4double ExEnergy, const G4double FreeE0, const G4double kappa, std::vector< G4VStatMFMacroCluster *> *ClusterVector)
 
 ~G4StatMFMacroTemperature ()
 
G4double operator() (const G4double T)
 
G4double GetMeanMultiplicity (void) const
 
G4double GetChemicalPotentialMu (void) const
 
G4double GetChemicalPotentialNu (void) const
 
G4double GetTemperature (void) const
 
G4double GetEntropy (void) const
 
G4double CalcTemperature (void)
 

Private Member Functions

 G4StatMFMacroTemperature ()
 
 G4StatMFMacroTemperature (const G4StatMFMacroTemperature &)
 
G4StatMFMacroTemperatureoperator= (const G4StatMFMacroTemperature &right)
 
G4bool operator== (const G4StatMFMacroTemperature &right) const
 
G4bool operator!= (const G4StatMFMacroTemperature &right) const
 
G4double FragsExcitEnergy (const G4double T)
 
void CalcChemicalPotentialNu (const G4double T)
 

Private Attributes

G4double theA
 
G4double theZ
 
G4double _ExEnergy
 
G4double _FreeInternalE0
 
G4double _Kappa
 
G4double _MeanMultiplicity
 
G4double _MeanTemperature
 
G4double _ChemPotentialMu
 
G4double _ChemPotentialNu
 
G4double _MeanEntropy
 
std::vector< G4VStatMFMacroCluster * > * _theClusters
 

Detailed Description

Definition at line 42 of file G4StatMFMacroTemperature.hh.

Constructor & Destructor Documentation

◆ G4StatMFMacroTemperature() [1/3]

G4StatMFMacroTemperature::G4StatMFMacroTemperature ( const G4double  anA,
const G4double  aZ,
const G4double  ExEnergy,
const G4double  FreeE0,
const G4double  kappa,
std::vector< G4VStatMFMacroCluster *> *  ClusterVector 
)

Definition at line 47 of file G4StatMFMacroTemperature.cc.

◆ ~G4StatMFMacroTemperature()

G4StatMFMacroTemperature::~G4StatMFMacroTemperature ( )

Definition at line 63 of file G4StatMFMacroTemperature.cc.

64 {}

◆ G4StatMFMacroTemperature() [2/3]

G4StatMFMacroTemperature::G4StatMFMacroTemperature ( )
private
Here is the caller graph for this function:

◆ G4StatMFMacroTemperature() [3/3]

G4StatMFMacroTemperature::G4StatMFMacroTemperature ( const G4StatMFMacroTemperature )
inlineprivate

Definition at line 62 of file G4StatMFMacroTemperature.hh.

62 {};
Here is the call graph for this function:

Member Function Documentation

◆ CalcChemicalPotentialNu()

void G4StatMFMacroTemperature::CalcChemicalPotentialNu ( const G4double  T)
private

Definition at line 186 of file G4StatMFMacroTemperature.cc.

188 {
189  G4StatMFMacroChemicalPotential * theChemPot = new
191 
194  _MeanMultiplicity = theChemPot->GetMeanMultiplicity();
195  delete theChemPot;
196 
197  return;
198 }
std::vector< G4VStatMFMacroCluster * > * _theClusters
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalcTemperature()

G4double G4StatMFMacroTemperature::CalcTemperature ( void  )

Definition at line 66 of file G4StatMFMacroTemperature.cc.

67 {
68  // Inital guess for the interval of the ensemble temperature values
69  G4double Ta = 0.5;
70  G4double Tb = std::max(std::sqrt(_ExEnergy/(theA*0.12)),0.01*MeV);
71 
72  G4double fTa = this->operator()(Ta);
73  G4double fTb = this->operator()(Tb);
74 
75  // Bracketing the solution
76  // T should be greater than 0.
77  // The interval is [Ta,Tb]
78  // We start with a value for Ta = 0.5 MeV
79  // it should be enough to have fTa > 0 If it isn't
80  // the case, we decrease Ta. But carefully, because
81  // fTa growes very fast when Ta is near 0 and we could have
82  // an overflow.
83 
84  G4int iterations = 0;
85  // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
86  while (fTa < 0.0 && ++iterations < 10) {
87  Ta -= 0.5*Ta;
88  fTa = this->operator()(Ta);
89  }
90  // Usually, fTb will be less than 0, but if it is not the case:
91  iterations = 0;
92  // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
93  while (fTa*fTb > 0.0 && iterations++ < 10) {
94  Tb += 2.*std::fabs(Tb-Ta);
95  fTb = this->operator()(Tb);
96  }
97 
98  if (fTa*fTb > 0.0) {
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.");
102  }
103 
105  new G4Solver<G4StatMFMacroTemperature>(100,1.e-4);
106  theSolver->SetIntervalLimits(Ta,Tb);
107  if (!theSolver->Crenshaw(*this)){
108  G4cout <<"G4StatMFMacroTemperature, Crenshaw method failed:"<<" Ta="
109  <<Ta<<" Tb="<<Tb<< G4endl;
110  G4cout <<"G4StatMFMacroTemperature, Crenshaw method failed:"<<" fTa="
111  <<fTa<<" fTb="<<fTb<< G4endl;
112  }
113  _MeanTemperature = theSolver->GetRoot();
114  G4double FunctionValureAtRoot = this->operator()(_MeanTemperature);
115  delete theSolver;
116 
117  // Verify if the root is found and it is indeed within the physical domain,
118  // say, between 1 and 50 MeV, otherwise try Brent method:
119  if (std::fabs(FunctionValureAtRoot) > 5.e-2) {
120  if (_MeanTemperature < 1. || _MeanTemperature > 50.) {
121  G4cout << "Crenshaw method failed; function = " << FunctionValureAtRoot
122  << " solution? = " << _MeanTemperature << " MeV " << G4endl;
123  G4Solver<G4StatMFMacroTemperature> * theSolverBrent =
124  new G4Solver<G4StatMFMacroTemperature>(200,1.e-3);
125  theSolverBrent->SetIntervalLimits(Ta,Tb);
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.");
132  }
133 
134  _MeanTemperature = theSolverBrent->GetRoot();
135  FunctionValureAtRoot = this->operator()(_MeanTemperature);
136  delete theSolverBrent;
137  }
138  if (std::abs(FunctionValureAtRoot) > 5.e-2) {
139  G4cout << "Brent method failed; function = " << FunctionValureAtRoot
140  << " solution? = " << _MeanTemperature << " MeV " << G4endl;
141  throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
142  }
143  }
144  //G4cout << "G4StatMFMacroTemperature::CalcTemperature: function = "
145  //<< FunctionValureAtRoot
146  // << " T(MeV)= " << _MeanTemperature << G4endl;
147  return _MeanTemperature;
148 }
static const double MeV
Definition: G4SIunits.hh:211
void SetIntervalLimits(const G4double Limit1, const G4double Limit2)
int G4int
Definition: G4Types.hh:78
G4bool Brent(Function &theFunction)
G4GLOB_DLL std::ostream G4cout
G4double operator()(const G4double T)
#define G4endl
Definition: G4ios.hh:61
G4bool Crenshaw(Function &theFunction)
double G4double
Definition: G4Types.hh:76
G4double GetRoot(void) const
Definition: G4Solver.hh:77
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FragsExcitEnergy()

G4double G4StatMFMacroTemperature::FragsExcitEnergy ( const G4double  T)
private

Definition at line 150 of file G4StatMFMacroTemperature.cc.

153 {
154  // Model Parameters
155  G4Pow* g4pow = G4Pow::GetInstance();
157  G4double R = R0*g4pow->A13(1.0+G4StatMFParameters::GetKappaCoulomb());
158  G4double FreeVol = _Kappa*(4.*pi/3.)*R0*R0*R0;
159 
160  // Calculate Chemical potentials
162 
163 
164  // Average total fragment energy
165  G4double AverageEnergy = 0.0;
166  std::vector<G4VStatMFMacroCluster*>::iterator i;
167  for (i = _theClusters->begin(); i != _theClusters->end(); ++i)
168  {
169  AverageEnergy += (*i)->GetMeanMultiplicity() * (*i)->CalcEnergy(T);
170  }
171 
172  // Add Coulomb energy
173  AverageEnergy += 0.6*elm_coupling*theZ*theZ/R;
174 
175  // Calculate mean entropy
176  _MeanEntropy = 0.0;
177  for (i = _theClusters->begin(); i != _theClusters->end(); ++i)
178  {
179  _MeanEntropy += (*i)->CalcEntropy(T,FreeVol);
180  }
181 
182  // Excitation energy per nucleon
183  return AverageEnergy - _FreeInternalE0;
184 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
static G4double GetKappaCoulomb()
Definition: G4Pow.hh:56
int elm_coupling
Definition: hepunit.py:286
static G4double Getr0()
G4double Z13(G4int Z) const
Definition: G4Pow.hh:127
G4double A13(G4double A) const
Definition: G4Pow.hh:132
static const double pi
Definition: G4SIunits.hh:74
void CalcChemicalPotentialNu(const G4double T)
std::vector< G4VStatMFMacroCluster * > * _theClusters
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetChemicalPotentialMu()

G4double G4StatMFMacroTemperature::GetChemicalPotentialMu ( void  ) const
inline

Definition at line 74 of file G4StatMFMacroTemperature.hh.

Here is the caller graph for this function:

◆ GetChemicalPotentialNu()

G4double G4StatMFMacroTemperature::GetChemicalPotentialNu ( void  ) const
inline

Definition at line 76 of file G4StatMFMacroTemperature.hh.

Here is the caller graph for this function:

◆ GetEntropy()

G4double G4StatMFMacroTemperature::GetEntropy ( void  ) const
inline

Definition at line 80 of file G4StatMFMacroTemperature.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMeanMultiplicity()

G4double G4StatMFMacroTemperature::GetMeanMultiplicity ( void  ) const
inline

Definition at line 72 of file G4StatMFMacroTemperature.hh.

Here is the caller graph for this function:

◆ GetTemperature()

G4double G4StatMFMacroTemperature::GetTemperature ( void  ) const
inline

Definition at line 78 of file G4StatMFMacroTemperature.hh.

◆ operator!=()

G4bool G4StatMFMacroTemperature::operator!= ( const G4StatMFMacroTemperature right) const
private
Here is the caller graph for this function:

◆ operator()()

G4double G4StatMFMacroTemperature::operator() ( const G4double  T)
inline

Definition at line 53 of file G4StatMFMacroTemperature.hh.

54  { return (_ExEnergy - this->FragsExcitEnergy(T))/_ExEnergy; }
G4double FragsExcitEnergy(const G4double T)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

G4StatMFMacroTemperature& G4StatMFMacroTemperature::operator= ( const G4StatMFMacroTemperature right)
private
Here is the caller graph for this function:

◆ operator==()

G4bool G4StatMFMacroTemperature::operator== ( const G4StatMFMacroTemperature right) const
private
Here is the caller graph for this function:

Member Data Documentation

◆ _ChemPotentialMu

G4double G4StatMFMacroTemperature::_ChemPotentialMu
private

Definition at line 106 of file G4StatMFMacroTemperature.hh.

◆ _ChemPotentialNu

G4double G4StatMFMacroTemperature::_ChemPotentialNu
private

Definition at line 108 of file G4StatMFMacroTemperature.hh.

◆ _ExEnergy

G4double G4StatMFMacroTemperature::_ExEnergy
private

Definition at line 96 of file G4StatMFMacroTemperature.hh.

◆ _FreeInternalE0

G4double G4StatMFMacroTemperature::_FreeInternalE0
private

Definition at line 98 of file G4StatMFMacroTemperature.hh.

◆ _Kappa

G4double G4StatMFMacroTemperature::_Kappa
private

Definition at line 100 of file G4StatMFMacroTemperature.hh.

◆ _MeanEntropy

G4double G4StatMFMacroTemperature::_MeanEntropy
private

Definition at line 110 of file G4StatMFMacroTemperature.hh.

◆ _MeanMultiplicity

G4double G4StatMFMacroTemperature::_MeanMultiplicity
private

Definition at line 102 of file G4StatMFMacroTemperature.hh.

◆ _MeanTemperature

G4double G4StatMFMacroTemperature::_MeanTemperature
private

Definition at line 104 of file G4StatMFMacroTemperature.hh.

◆ _theClusters

std::vector<G4VStatMFMacroCluster*>* G4StatMFMacroTemperature::_theClusters
private

Definition at line 112 of file G4StatMFMacroTemperature.hh.

◆ theA

G4double G4StatMFMacroTemperature::theA
private

Definition at line 92 of file G4StatMFMacroTemperature.hh.

◆ theZ

G4double G4StatMFMacroTemperature::theZ
private

Definition at line 94 of file G4StatMFMacroTemperature.hh.


The documentation for this class was generated from the following files: