Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 57 of file G4StatMFMacroChemicalPotential.cc.

59 {
60  G4Pow* g4calc = G4Pow::GetInstance();
62 
63  // Initial value for _ChemPotentialNu
64  _ChemPotentialNu = (theZ/theA)*(8.0*G4StatMFParameters::GetGamma0()
65  +2.0*CP*g4calc->Z23(theA))
67 
68  G4double ChemPa = _ChemPotentialNu;
69  G4double ChemPb = 0.5*_ChemPotentialNu;
70 
71  G4double fChemPa = this->operator()(ChemPa);
72  G4double fChemPb = this->operator()(ChemPb);
73 
74  if (fChemPa*fChemPb > 0.0) {
75  // bracketing the solution
76  if (fChemPa < 0.0) {
77  do {
78  ChemPb -= 1.5*std::abs(ChemPb-ChemPa);
79  fChemPb = this->operator()(ChemPb);
80  // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
81  } while (fChemPb < 0.0);
82  } else {
83  do {
84  ChemPb += 1.5*std::abs(ChemPb-ChemPa);
85  fChemPb = this->operator()(ChemPb);
86  // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
87  } while (fChemPb > 0.0);
88  }
89  }
90 
93  theSolver->SetIntervalLimits(ChemPa,ChemPb);
94  // if (!theSolver->Crenshaw(*this))
95  if (!theSolver->Brent(*this)){
96  G4cout <<"G4StatMFMacroChemicalPotential:"<<" ChemPa="<<ChemPa
97  <<" ChemPb="<<ChemPb<< G4endl;
98  G4cout <<"G4StatMFMacroChemicalPotential:"<<" fChemPa="<<fChemPa
99  <<" fChemPb="<<fChemPb<< G4endl;
100  throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroChemicalPotential::CalcChemicalPotentialNu: I couldn't find the root.");
101  }
102  _ChemPotentialNu = theSolver->GetRoot();
103  delete theSolver;
104  return _ChemPotentialNu;
105 }
static G4double GetGamma0()
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
Definition: G4Pow.hh:56
void SetIntervalLimits(const G4double Limit1, const G4double Limit2)
G4bool Brent(Function &theFunction)
G4GLOB_DLL std::ostream G4cout
G4double GetRoot(void) const
Definition: G4Solver.hh:77
static G4double GetCoulomb()
G4double Z23(G4int Z) const
Definition: G4Pow.hh:154
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

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.

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

Here is the caller graph for this function:


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