Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4StatMFMacroChemicalPotential Class Reference

#include <G4StatMFMacroChemicalPotential.hh>

Public Member Functions

 G4StatMFMacroChemicalPotential (const G4double anA, const G4double aZ, const G4double kappa, const G4double temp, std::vector< G4VStatMFMacroCluster * > *ClusterVector)
 
 ~G4StatMFMacroChemicalPotential ()
 
G4double operator() (const G4double nu)
 
G4double GetMeanMultiplicity (void) const
 
G4double GetChemicalPotentialMu (void) const
 
G4double GetChemicalPotentialNu (void) const
 
G4double CalcChemicalPotentialNu (void)
 

Detailed Description

Definition at line 44 of file G4StatMFMacroChemicalPotential.hh.

Constructor & Destructor Documentation

G4StatMFMacroChemicalPotential::G4StatMFMacroChemicalPotential ( const G4double  anA,
const G4double  aZ,
const G4double  kappa,
const G4double  temp,
std::vector< G4VStatMFMacroCluster * > *  ClusterVector 
)
inline

Definition at line 48 of file G4StatMFMacroChemicalPotential.hh.

51  :
52  theA(anA),
53  theZ(aZ),
54  _Kappa(kappa),
55  _MeanMultiplicity(0.0),
56  _MeanTemperature(temp),
57  _ChemPotentialMu(0.0),
58  _ChemPotentialNu(0.0),
59  _theClusters(ClusterVector)
60  {};
G4StatMFMacroChemicalPotential::~G4StatMFMacroChemicalPotential ( )
inline

Definition at line 62 of file G4StatMFMacroChemicalPotential.hh.

62 {};

Member Function Documentation

G4double G4StatMFMacroChemicalPotential::CalcChemicalPotentialNu ( void  )

Definition at line 59 of file G4StatMFMacroChemicalPotential.cc.

References G4Solver< Function >::Brent(), python.hepunit::elm_coupling, G4cerr, G4endl, G4StatMFParameters::GetGamma0(), G4StatMFParameters::GetKappaCoulomb(), G4StatMFParameters::Getr0(), G4Solver< Function >::GetRoot(), operator()(), and G4Solver< Function >::SetIntervalLimits().

61 {
63  (1.0-1.0/std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(),1.0/3.0));
64 
65  // Initial value for _ChemPotentialNu
66  _ChemPotentialNu = (theZ/theA)*(8.0*G4StatMFParameters::GetGamma0()+2.0*CP*std::pow(theA,2./3.)) -
68 
69 
70  G4double ChemPa = _ChemPotentialNu;
71  G4double ChemPb = 0.5*_ChemPotentialNu;
72 
73  G4double fChemPa = this->operator()(ChemPa);
74  G4double fChemPb = this->operator()(ChemPb);
75 
76  if (fChemPa*fChemPb > 0.0) {
77  // bracketing the solution
78  if (fChemPa < 0.0) {
79  do {
80  ChemPb -= 1.5*std::abs(ChemPb-ChemPa);
81  fChemPb = this->operator()(ChemPb);
82  } while (fChemPb < 0.0);
83  } else {
84  do {
85  ChemPb += 1.5*std::abs(ChemPb-ChemPa);
86  fChemPb = this->operator()(ChemPb);
87  } while (fChemPb > 0.0);
88  }
89  }
90 
93  theSolver->SetIntervalLimits(ChemPa,ChemPb);
94  // if (!theSolver->Crenshaw(*this))
95  if (!theSolver->Brent(*this)){
96  G4cerr <<"G4StatMFMacroChemicalPotential:"<<" ChemPa="<<ChemPa<<" ChemPb="<<ChemPb<< G4endl;
97  G4cerr <<"G4StatMFMacroChemicalPotential:"<<" fChemPa="<<fChemPa<<" fChemPb="<<fChemPb<< G4endl;
98  throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroChemicalPotential::CalcChemicalPotentialNu: I couldn't find the root.");
99  }
100  _ChemPotentialNu = theSolver->GetRoot();
101  delete theSolver;
102  return _ChemPotentialNu;
103 }
static G4double GetGamma0()
static G4double GetKappaCoulomb()
tuple elm_coupling
Definition: hepunit.py:286
void SetIntervalLimits(const G4double Limit1, const G4double Limit2)
G4bool Brent(Function &theFunction)
static G4double Getr0()
G4double GetRoot(void) const
Definition: G4Solver.hh:77
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4GLOB_DLL std::ostream G4cerr
G4double G4StatMFMacroChemicalPotential::GetChemicalPotentialMu ( void  ) const
inline

Definition at line 84 of file G4StatMFMacroChemicalPotential.hh.

84 {return _ChemPotentialMu;}
G4double G4StatMFMacroChemicalPotential::GetChemicalPotentialNu ( void  ) const
inline

Definition at line 86 of file G4StatMFMacroChemicalPotential.hh.

86 {return _ChemPotentialNu;}
G4double G4StatMFMacroChemicalPotential::GetMeanMultiplicity ( void  ) const
inline

Definition at line 82 of file G4StatMFMacroChemicalPotential.hh.

82 {return _MeanMultiplicity;}
G4double G4StatMFMacroChemicalPotential::operator() ( const G4double  nu)
inline

Definition at line 64 of file G4StatMFMacroChemicalPotential.hh.

Referenced by CalcChemicalPotentialNu().

65  { return (theZ - this->CalcMeanZ(nu))/theZ; }

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