21 #ifndef JDFTX_ELECTRONIC_SPECIESINFO_H 22 #define JDFTX_ELECTRONIC_SPECIESINFO_H 24 #include <electronic/common.h> 25 #include <electronic/RadialFunction.h> 26 #include <electronic/VanDerWaals.h> 27 #include <electronic/matrix.h> 40 string potfilename, pulayfilename;
64 int getDimension()
const;
75 void print(FILE* fp)
const;
76 void populationAnalysis(
const std::vector<matrix>& RhoAll)
const;
110 size_t rhoAtom_nMatrices()
const;
111 void rhoAtom_initZero(
matrix* rhoAtomPtr)
const;
112 void rhoAtom_calc(
const std::vector<diagMatrix>& F,
const std::vector<ColumnBundle>& C,
matrix* rhoAtomPtr)
const;
113 double rhoAtom_computeU(
const matrix* rhoAtomPtr,
matrix* U_rhoAtomPtr)
const;
115 void rhoAtom_forces(
const std::vector<diagMatrix>& F,
const std::vector<ColumnBundle>& C,
const matrix* U_rhoAtomPtr, std::vector<
vector3<> >& forces)
const;
145 matrix3<> Rprev;
void updateLatticeDependent();
151 std::vector< std::vector<RadialFunctionG> > VnlRadial;
152 std::vector<matrix> Mnl;
155 std::vector<matrix> Qint;
158 std::map<std::pair<vector3<>,
const Basis*>, std::shared_ptr<ColumnBundle> > cachedV;
165 bool operator<(
const QijIndex&)
const;
169 std::map<QijIndex,RadialFunctionG> Qradial;
173 uint64_t* nagIndex;
size_t* nagIndexPtr;
175 std::vector<std::vector<RadialFunctionG> > psiRadial;
176 std::vector<std::vector<RadialFunctionG> >* OpsiRadial;
177 std::vector<std::vector<double> > atomEigs;
180 std::vector< std::vector<int> > Vnl2j, psi2j;
188 std::vector<double> Vext;
190 std::vector<PlusU> plusU;
193 std::shared_ptr<VanDerWaals::AtomParams> vdwOverride;
200 double width_chargeball;
204 double tauCore_rCut;
bool tauCorePlot;
207 void readFhi(istream&);
208 void readUspp(istream&);
209 void readUPF(istream&);
213 void estimateAtomEigs();
214 void getAtom_nRadial(
int spin,
double magneticMoment,
RadialFunctionG& nRadial,
bool forceNeutral)
const;
217 friend struct CommandIonSpecies;
218 friend struct CommandSetVDW;
220 friend struct CommandAddU;
221 friend struct CommandChargeball;
222 friend struct CommandTauCore;
223 friend struct CommandWavefunction;
232 ( SpeciesInfo::Constraint::None,
"None",
233 SpeciesInfo::Constraint::Linear,
"Linear",
234 SpeciesInfo::Constraint::Planar,
"Planar",
235 SpeciesInfo::Constraint::HyperPlane,
"HyperPlane" 238 #endif // JDFTX_ELECTRONIC_SPECIESINFO_H Base class for different wannier minimizers:
Definition: WannierMinimizer.h:48
void augmentOverlap(const ColumnBundle &Cq, ColumnBundle &OCq, matrix *VdagCq=0) const
Accumulate pseudopotential contribution to the overlap in OCq.
void setAtomicOrbitals(ColumnBundle &Y, bool applyO, int colOffset=0) const
Calculate atomic orbitals with/without O preapplied (store in Y with an optional column offset) ...
double EnlAndGrad(const QuantumNumber &qnum, const diagMatrix &Fq, const matrix &VdagCq, matrix &HVdagCq) const
string name
Identifier.
Definition: SpeciesInfo.h:39
void augmentDensityGridGrad(const ScalarFieldArray &E_n, std::vector< vector3<> > *forces=0)
Gradient propagation corresponding to augmentDensityGrid (stores intermediate spherical function resu...
std::vector< Constraint > constraints
List of all constraints on ions of this species.
Definition: SpeciesInfo.h:67
double mass
ionic mass (currently unused)
Definition: SpeciesInfo.h:52
std::vector< ScalarField > ScalarFieldArray
dynamic size collection of real space scalar fields
Definition: ScalarFieldArray.h:32
int atomicOrbitalOffset(unsigned iAtom, unsigned n, int l, int m, int s) const
s is 0/1 for up/dn spinors in non-relativistic case, s=0/1 is for j=l+/-0.5 and mj=m+/-0.5 in relativistic case
Quantum Espresso's Universal Pseudopotential Format (the XML version 2 only)
Definition: SpeciesInfo.h:82
STL strings and streams with case insensitive comparison.
double initialOxidationState
Initial oxidation state of this species (only affects LCAO)
Definition: SpeciesInfo.h:70
A template to ease option parsing (maps enums <–> strings)
Definition: Util.h:179
void accumulateAtomicPotential(ScalarFieldTilde &dTilde) const
Accumulate electrostatic potential of neutral atoms from this species.
General complex matrix.
Definition: matrix.h:58
Definition: VanDerWaals.h:28
std::vector< vector3<> > initialMagneticMoments
Initial magnetic moments of each atom (used only for LCAO and symmetries) (x and y magnetizations onl...
Definition: SpeciesInfo.h:69
std::shared_ptr< ScalarFieldTildeData > ScalarFieldTilde
A smart reference-counting pointer to ScalarFieldTildeData.
Definition: ScalarField.h:45
void updateLocal(ScalarFieldTilde &Vlocps, ScalarFieldTilde &rhoIon, ScalarFieldTilde &nChargeball, ScalarFieldTilde &nCore, ScalarFieldTilde &tauCore) const
Add contributions from this species to Vlocps, rhoIon, nChargeball and nCore/tauCore (if any) ...
Real diagonal matrix.
Definition: matrix.h:31
Definition: ElecInfo.h:35
static matrix getYlmOverlapMatrix(int l, int j2)
Get the ((2l+1)*2)x((2l+1)*2) overlap matrix of the spin-spherical harmonics for total angular moment...
Calculate phonon dispersion, free energies and electron-phonon matrix elements.
Definition: Phonon.h:47
double coreRadius
maximum pseudopotential core radius (used for core overlap checks during ionic/lattice relaxation) ...
Definition: SpeciesInfo.h:53
std::vector< vector3<> > atpos
array of atomic positions of this species
Definition: SpeciesInfo.h:43
bool isRelativistic() const
whether pseudopotential is relativistic
Definition: SpeciesInfo.h:77
void augmentDensityInit()
Clear internal data and prepare for density augmentation (call before a loop ober augmentDensitySpher...
int nAtomicOrbitals() const
return number of atomic orbitals in this species (all atoms)
FHI format with ABINIT header (.fhi files)
Definition: SpeciesInfo.h:80
void augmentDensitySphericalGrad(const QuantumNumber &qnum, const diagMatrix &Fq, const matrix &VdagCq, matrix &HVdagCq) const
Gradient propagation corresponding to augmentDensitySpherical (uses intermediate spherical function r...
double Z
Valence charge of the species (prefactor to 1/r in long-range part of pseudopotential) ...
Definition: SpeciesInfo.h:37
vector3 operator()(const vector3<> &grad) const
Type of the constraint that is being applied to the ion.
PseudopotentialFormat getPSPFormat()
Returns the pseudopotential format.
Definition: SpeciesInfo.h:85
PseudopotentialFormat
Definition: SpeciesInfo.h:79
Definition: IonicMinimizer.h:52
A function on a non-uniform real-space radial grid.
Definition: RadialFunction.h:101
void augmentDensitySpherical(const QuantumNumber &qnum, const diagMatrix &Fq, const matrix &VdagCq)
Accumulate the pseudopotential dependent contribution to the density in the spherical functions nAug ...
ConstraintType
The direction or plane normal of the constraint (in cartesian coordinates)
Definition: SpeciesInfo.h:60
G-space radial function stored on a uniform grid (of |G|)
Definition: RadialFunction.h:28
Definition: Everything.h:41
int atomicNumber
Atomic number of the species (0 if unavailable)
Definition: SpeciesInfo.h:38
void sync_atpos()
update changes in atpos; call whenever atpos is changed (this will update atpos_gpu and invalidate ca...
void accumNonlocalForces(const ColumnBundle &Cq, const matrix &VdagC, const matrix &E_VdagC, const matrix &grad_CdagOCq, std::vector< vector3<> > &forces) const
Propagate gradient with respect to atomic projections (in E_VdagC, along with additional overlap cont...
bool fromWildcard
whether this pseudopotential was automatically added using a wildcard (for command printing purposes ...
Definition: SpeciesInfo.h:41
classes ScalarFieldArray, ScalarFieldTildeArray and just enough operators to enable CG w...
void accumulateAtomicDensity(ScalarFieldTildeArray &nTilde) const
Accumulate atomic density from this species.
Contains the information on the constraints of motion for each ion.
Definition: SpeciesInfo.h:57
vector3 d
preconditioning factor (0 fixes ion)
Definition: SpeciesInfo.h:59
vector3 * atposPref
points to atposGpu in GPU mode and atpos otherwise
Definition: SpeciesInfo.h:49
USPP format ultrasoft pseudopotential.
Definition: SpeciesInfo.h:81
double ZfullCore
number of electrons in full-core correction (atomicNumber - Z - integral(nCore))
Definition: SpeciesInfo.h:54
Definition: SpeciesInfo.h:33
static matrix getYlmToSpinAngleMatrix(int l, int j2)
Spin-angle helper functions:
void augmentDensityGrid(ScalarFieldArray &n) const
Accumulate the spherical augmentation functions nAug to the grid electron density (call only once...
double dE_dnG
Derivative of [total energy per atom] w.r.t [nPlanewaves per unit volume] (for Pulay corrections) ...
Definition: SpeciesInfo.h:51
int lMaxAtomicOrbitals() const
return maximum angular momentum in available atomic orbitals
std::vector< vector3<> > velocities
array of atomic velocities (null unless running MD) in lattice coordinates
Definition: SpeciesInfo.h:44
std::vector< vector3<> > getLocalForces(const ScalarFieldTilde &ccgrad_Vlocps, const ScalarFieldTilde &ccgrad_rhoIon, const ScalarFieldTilde &ccgrad_nChargeball, const ScalarFieldTilde &ccgrad_nCore, const ScalarFieldTilde &ccgrad_tauCore) const
Return the local forces (due to Vlocps, rhoIon, nChargeball and nCore/tauCore)
std::vector< ScalarFieldTilde > ScalarFieldTildeArray
dynamic size collection of reciprocal space scalar fields
Definition: ScalarFieldArray.h:33
Definition: ColumnBundle.h:30
vector3 * atposGpu
copy of atomic positions on the gpu
Definition: SpeciesInfo.h:46
Stores the list of what to dump and when, and implements the functions to do so.
Definition: Dump.h:59