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.

00051                                                                                       :
00052         theA(anA),
00053         theZ(aZ),
00054         _Kappa(kappa),
00055         _MeanMultiplicity(0.0),
00056         _MeanTemperature(temp),
00057         _ChemPotentialMu(0.0),
00058         _ChemPotentialNu(0.0),
00059         _theClusters(ClusterVector) 
00060         {};
        

G4StatMFMacroChemicalPotential::~G4StatMFMacroChemicalPotential (  )  [inline]

Definition at line 62 of file G4StatMFMacroChemicalPotential.hh.

00062 {};


Member Function Documentation

G4double G4StatMFMacroChemicalPotential::CalcChemicalPotentialNu ( void   ) 

Definition at line 59 of file G4StatMFMacroChemicalPotential.cc.

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

00061 {
00062     G4double CP = ((3./5.)*elm_coupling/G4StatMFParameters::Getr0())*
00063         (1.0-1.0/std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(),1.0/3.0));
00064 
00065     // Initial value for _ChemPotentialNu       
00066     _ChemPotentialNu = (theZ/theA)*(8.0*G4StatMFParameters::GetGamma0()+2.0*CP*std::pow(theA,2./3.)) -
00067         4.0*G4StatMFParameters::GetGamma0();
00068                 
00069 
00070     G4double ChemPa = _ChemPotentialNu;
00071     G4double ChemPb = 0.5*_ChemPotentialNu;
00072     
00073     G4double fChemPa = this->operator()(ChemPa); 
00074     G4double fChemPb = this->operator()(ChemPb); 
00075 
00076     if (fChemPa*fChemPb > 0.0) {    
00077         // bracketing the solution
00078         if (fChemPa < 0.0) {
00079             do {
00080                 ChemPb -= 1.5*std::abs(ChemPb-ChemPa);
00081                 fChemPb = this->operator()(ChemPb);   
00082             } while (fChemPb < 0.0);
00083         } else {
00084             do {
00085                 ChemPb += 1.5*std::abs(ChemPb-ChemPa);
00086                 fChemPb = this->operator()(ChemPb);
00087             } while (fChemPb > 0.0);
00088         }
00089     }
00090 
00091     G4Solver<G4StatMFMacroChemicalPotential> * theSolver =
00092       new G4Solver<G4StatMFMacroChemicalPotential>(100,1.e-4);
00093     theSolver->SetIntervalLimits(ChemPa,ChemPb);
00094     //    if (!theSolver->Crenshaw(*this)) 
00095     if (!theSolver->Brent(*this)){
00096       G4cerr <<"G4StatMFMacroChemicalPotential:"<<" ChemPa="<<ChemPa<<" ChemPb="<<ChemPb<< G4endl;
00097       G4cerr <<"G4StatMFMacroChemicalPotential:"<<" fChemPa="<<fChemPa<<" fChemPb="<<fChemPb<< G4endl;
00098       throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroChemicalPotential::CalcChemicalPotentialNu: I couldn't find the root.");
00099     }
00100     _ChemPotentialNu = theSolver->GetRoot();
00101     delete theSolver;
00102     return _ChemPotentialNu;
00103 }

G4double G4StatMFMacroChemicalPotential::GetChemicalPotentialMu ( void   )  const [inline]

Definition at line 84 of file G4StatMFMacroChemicalPotential.hh.

00084 {return _ChemPotentialMu;}

G4double G4StatMFMacroChemicalPotential::GetChemicalPotentialNu ( void   )  const [inline]

Definition at line 86 of file G4StatMFMacroChemicalPotential.hh.

00086 {return _ChemPotentialNu;}

G4double G4StatMFMacroChemicalPotential::GetMeanMultiplicity ( void   )  const [inline]

Definition at line 82 of file G4StatMFMacroChemicalPotential.hh.

00082 {return _MeanMultiplicity;}

G4double G4StatMFMacroChemicalPotential::operator() ( const G4double  nu  )  [inline]

Definition at line 64 of file G4StatMFMacroChemicalPotential.hh.

Referenced by CalcChemicalPotentialNu().

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


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:25 2013 for Geant4 by  doxygen 1.4.7