JDFTx  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ElecInfo Class Reference

Public Types

enum  FillingsUpdate { FillingsConst, FillingsHsub }
 
enum  SmearingType { SmearingFermi, SmearingGauss, SmearingCold }
 

Public Member Functions

bool isMine (int q) const
 check if state index is local
 
int whose (int q) const
 find out which process this state index belongs to
 
int qStartOther (int iProc) const
 find out qStart for another process
 
int qStopOther (int iProc) const
 find out qStop for another process
 
bool isNoncollinear () const
 
int spinorLength () const
 
int nSpins () const
 
vector3< int > kFoldingCount () const
 
void setup (const Everything &e, std::vector< diagMatrix > &F, Energies &ener)
 setup bands and initial fillings
 
void printFillings (FILE *fp) const
 
void smearReport (const double *muOverride=0) const
 
void updateFillingsEnergies (const std::vector< diagMatrix > &eps, Energies &) const
 Calculate variable fillings Legendre multipliers (TS/muN)
 
double muEff (double mu, double Bz, int q) const
 
double smear (double mu, double eps) const
 smearing function
 
double smearPrime (double mu, double eps) const
 derivative of smearing function
 
double smearEntropy (double mu, double eps) const
 entropy associated with smearing function
 
diagMatrix smear (double mu, const diagMatrix &eps) const
 elementwise smearing function
 
diagMatrix smearPrime (double mu, const diagMatrix &eps) const
 elementwise smearing function derivative
 
diagMatrix smearEntropy (double mu, const diagMatrix &eps) const
 element-wise smearing function entropy
 
matrix smearGrad (double mu, const diagMatrix &eps, const matrix &gradF) const
 Propagate matrix gradient w.r.t F to gradient w.r.t. eps (in the basis where fillings are diagonal)
 
double nElectronsCalc (double mu, const std::vector< diagMatrix > &eps, double &Bz) const
 
double findMu (const std::vector< diagMatrix > &eps, double nElectrons, double &Bz) const
 
void kpointsPrint (FILE *fp, bool printSpin=false) const
 Output k-points, weights and optionally spins.
 
void kpointPrint (FILE *fp, int q, bool printSpin=false) const
 Output k-points, weights and optionally spins.
 
int findHOMO (int q) const
 
void read (std::vector< diagMatrix > &, const char *fname, int nRowsOverride=0) const
 Returns the band index of the Highest Occupied Kohn-Sham Orbital.
 
void read (std::vector< matrix > &, const char *fname, int nRowsOverride=0, int nColsOverride=0) const
 
void write (const std::vector< diagMatrix > &, const char *fname, int nRowsOverride=0) const
 
void write (const std::vector< matrix > &, const char *fname, int nRowsOverride=0, int nColsOverride=0) const
 
void appendWrite (const std::vector< diagMatrix > &, const char *fname, int nRowsOverride=0) const
 

Public Attributes

int nBands
 
int nStates
 Number of bands and total number of states.
 
int nDensities
 
int spinWeight
 
int qWeightSum
 number of density components, spin weight factor (= max occupation per state) and sum of k-point weights
 
int qStart
 
int qStop
 Range of states handled by current process (= 0 and nStates for non-MPI jobs)
 
SpinType spinType
 tells us what sort of spins we are using if any
 
double nElectrons
 the number of electrons = Sum w Tr[F]
 
std::vector< QuantumNumberqnums
 k-points, spins and weights for each state
 
enum ElecInfo::FillingsUpdate fillingsUpdate
 
bool scalarFillings
 whether fillings are scalar (equal for all bands) at all quantum numbers
 
enum ElecInfo::SmearingType smearingType
 
double smearingWidth
 Smearing width (temperature in the Fermi case)
 
double mu
 If NaN, fix nElectrons, otherwise fix/target chemical potential to this.
 
bool muLoop
 Whether to optimize mu in an outer loop over fixed charge calculations.
 
bool hasU
 
string initialFillingsFilename
 Flag to check whether the calculation has a DFT+U self-interaction correction. More...
 

Friends

struct CommandElecInitialFillings
 
struct CommandElecInitialCharge
 
struct CommandElecInitialMagnetization
 
struct CommandInitialState
 
class ElecVars
 
struct LCAOminimizer
 
struct CommandKpointFolding
 
class Everything
 
class Phonon
 

Member Enumeration Documentation

Enumerator
FillingsConst 

constant fillings (T=0)

FillingsHsub 

fillings are a function of subspace Hamiltonian

Enumerator
SmearingFermi 

Fermi-Dirac smearing.

SmearingGauss 

Gaussian smearing.

SmearingCold 

Cold smearing.

Member Function Documentation

double ElecInfo::findMu ( const std::vector< diagMatrix > &  eps,
double  nElectrons,
double &  Bz 
) const

Find the chemical potential for which the smearing function with specified eigenvalues adds up to nElectrons If magnetization is constrained, retrieve corresponding Lagrange multiplier Bz as well

double ElecInfo::nElectronsCalc ( double  mu,
const std::vector< diagMatrix > &  eps,
double &  Bz 
) const

Compute number of electrons for the smearing function with specified eigenvalues If magnetization is constrained, bisect on corresponding Lagrange multiplier Bz, and retrieve it too

Member Data Documentation

string ElecInfo::initialFillingsFilename

Flag to check whether the calculation has a DFT+U self-interaction correction.

filename for initial fillings (zero-length if none)


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