21 #ifndef JDFTX_ELECTRONIC_IONINFO_H 22 #define JDFTX_ELECTRONIC_IONINFO_H 24 #include <electronic/common.h> 25 #include <electronic/SpeciesInfo.h> 26 #include <electronic/IonicMinimizer.h> 27 #include <electronic/matrix.h> 33 enum CoordsType {CoordsLattice, CoordsCartesian};
36 enum ForcesOutputCoords { ForcesCoordsPositions, ForcesCoordsLattice, ForcesCoordsCartesian, ForcesCoordsContravariant };
38 ForcesCoordsPositions,
"Positions",
39 ForcesCoordsLattice,
"Lattice",
40 ForcesCoordsCartesian,
"Cartesian",
41 ForcesCoordsContravariant,
"Contravariant");
44 enum coreOverlapCheck { additive, vector, none };
49 std::vector< std::shared_ptr<SpeciesInfo> >
species;
54 coreOverlapCheck coreOverlapCondition;
69 void printPositions(FILE*)
const;
87 void augmentDensityInit()
const;
88 void augmentDensitySpherical(
const QuantumNumber& qnum,
const diagMatrix& Fq,
const std::vector<matrix>& VdagCq)
const;
91 void augmentDensitySphericalGrad(
const QuantumNumber& qnum,
const diagMatrix& Fq,
const std::vector<matrix>& VdagCq, std::vector<matrix>& HVdagCq)
const;
93 void project(
const ColumnBundle& Cq, std::vector<matrix>& VdagCq,
matrix* rotExisting=0)
const;
100 void rhoAtom_calc(
const std::vector<diagMatrix>& F,
const std::vector<ColumnBundle>& C, std::vector<matrix>& rhoAtom)
const;
101 double rhoAtom_computeU(
const std::vector<matrix>& rhoAtom, std::vector<matrix>& U_rhoAtom)
const;
103 void rhoAtom_forces(
const std::vector<diagMatrix>& F,
const std::vector<ColumnBundle>& C,
const std::vector<matrix>& U_rhoAtom,
IonicGradient& forces)
const;
104 void rhoAtom_getV(
const ColumnBundle& Cq,
const std::vector<matrix>& U_rhoAtom, std::vector<ColumnBundle>& psi, std::vector<matrix>& M)
const;
118 bool shouldPrintForceComponents;
127 #endif // JDFTX_ELECTRONIC_IONINFO_H double EnlAndGrad(const QuantumNumber &qnum, const diagMatrix &Fq, const std::vector< matrix > &VdagCq, std::vector< matrix > &HVdagCq) const
bool checkPositions() const
check for overlapping atoms, return true if okay
std::vector< ScalarField > ScalarFieldArray
dynamic size collection of real space scalar fields
Definition: ScalarFieldArray.h:32
std::vector< std::shared_ptr< SpeciesInfo > > species
list of ionic species
Definition: IonInfo.h:49
void rhoAtom_initZero(std::vector< matrix > &rhoAtom) const
initialize matrices of appropriate size to zero
void rhoAtom_forces(const std::vector< diagMatrix > &F, const std::vector< ColumnBundle > &C, const std::vector< matrix > &U_rhoAtom, IonicGradient &forces) const
propagate U_rhoAtom to forces
A template to ease option parsing (maps enums <–> strings)
Definition: Util.h:179
ForcesOutputCoords forcesOutputCoords
coordinate system to print forces in
Definition: IonInfo.h:53
General complex matrix.
Definition: matrix.h:58
std::shared_ptr< ScalarFieldTildeData > ScalarFieldTilde
A smart reference-counting pointer to ScalarFieldTildeData.
Definition: ScalarField.h:45
void rhoAtom_getV(const ColumnBundle &Cq, const std::vector< matrix > &U_rhoAtom, std::vector< ColumnBundle > &psi, std::vector< matrix > &M) const
get DFT+U Hamiltonian basis (atomic orbitals) and matrices
Definition: Energies.h:26
double ionWidth
width for gaussian representation of nuclei
Definition: IonInfo.h:117
ScalarField tauCore
Model for the KE density of the core (TF+vW applied to nCore) (used by meta-GGAs) ...
Definition: IonInfo.h:64
Real diagonal matrix.
Definition: matrix.h:31
Definition: ElecInfo.h:35
IonicGradient forces
forces at current atomic positions
Definition: IonInfo.h:58
ScalarFieldTilde nChargeball
Extra electron density around ionic cores to keep fluid out (DEPRECATED)
Definition: IonInfo.h:62
Real and complex scalar fields in real and reciprocal space.
ColumnBundle rHcommutator(const ColumnBundle &Y, int iDir) const
Apply commutator operator [r_iDir,H] = D_iDir + nonlocal corrections.
CoordsType coordsType
coordinate system for ionic positions etc.
Definition: IonInfo.h:52
Utilities for threading (wrappers around std::thread)
bool vdWenable
Check method used for determining whether pseudopotential cores overlap.
Definition: IonInfo.h:55
double getZtot() const
get total Z of all species and atoms
ColumnBundle getAtomicOrbitals(int q, bool applyO, int extraCols=0) const
Get all atomic orbitals of a given state number q, optionally with operator O pre-applied (with room ...
void rhoAtom_grad(const ColumnBundle &Cq, const std::vector< matrix > &U_rhoAtom, ColumnBundle &HCq) const
propagate U_rhoAtom to wavefunction gradient (per k-point to enable band structure) ...
double rhoAtom_computeU(const std::vector< matrix > &rhoAtom, std::vector< matrix > &U_rhoAtom) const
compute U energy and gradient w.r.t atomic density matrices
IonWidthMethod
Definition: IonInfo.h:111
manually specify the ion width
Definition: IonInfo.h:114
ScalarFieldTilde rhoIon
Total ionic charge density (with width ionWidth, used for interactions with fluid) ...
Definition: IonInfo.h:61
void augmentOverlap(const ColumnBundle &Cq, ColumnBundle &OCq, std::vector< matrix > *VdagCq=0) const
Accumulate pseudopotential dependent contribution to the overlap in OCq.
Definition: Everything.h:41
determine ion width from grid spacing
Definition: IonInfo.h:113
void update(Energies &)
Update Vlocps, rhoIon, nChargeball, nCore and the energies dependent only on ionic positions...
void rhoAtom_calc(const std::vector< diagMatrix > &F, const std::vector< ColumnBundle > &C, std::vector< matrix > &rhoAtom) const
compute atomic density matrices
enum IonInfo::IonWidthMethod ionWidthMethod
method for determining ion charge width
std::shared_ptr< ScalarFieldData > ScalarField
A smart reference-counting pointer to ScalarFieldData.
Definition: ScalarField.h:41
int nAtomicOrbitals() const
Get total number of atomic orbitals.
ScalarField nCore
Core electron density for partial (nonlinear) core correction.
Definition: IonInfo.h:63
determine ion width from Ecut
Definition: IonInfo.h:112
size_t rhoAtom_nMatrices() const
Compute U corrections (DFT+U in the simplified rotationally-invariant scheme [Dudarev et al...
Object to hold all the forces.
Definition: IonicMinimizer.h:31
double ionicEnergyAndGrad(IonicGradient &forces) const
Return the total (free) energy and calculate the ionic gradient (forces)
Definition: ColumnBundle.h:30
double vdWscale
If non-zero, override the default scale parameter.
Definition: IonInfo.h:56
std::vector< string > pspFilenamePatterns
list of wildcards for pseudopotential sets
Definition: IonInfo.h:50
ScalarFieldTilde Vlocps
Net local pseudopotential.
Definition: IonInfo.h:60