26#ifndef dftefeKohnShamDFT_h
27#define dftefeKohnShamDFT_h
43 template <
typename ValueTypeElectrostaticsCoeff,
44 typename ValueTypeElectrostaticsBasis,
45 typename ValueTypeWaveFunctionCoeff,
46 typename ValueTypeWaveFunctionBasis,
53 std::variant<Hamiltonian<float, memorySpace> *,
60 ValueTypeWaveFunctionBasis>;
63 ValueTypeWaveFunctionCoeff>;
68 using OpContext =
typename linearAlgebra::HermitianIterativeEigenSolver<
76 const std::vector<utils::Point> &atomCoordinates,
77 const std::vector<double> & atomCharges,
78 const std::vector<double> & smearedChargeRadius,
82 const double smearingTemperature,
83 const double fermiEnergyTolerance,
84 const double fracOccupancyTolerance,
85 const double eigenSolveResidualTolerance,
86 const double scfDensityResidualNormTolerance,
89 const bool evaluateEnergyEverySCF,
92 const double mixingParameter,
93 const bool isAdaptiveAndersonMixingParameter,
96 &electronChargeDensityInput,
101 ValueTypeElectrostaticsBasis,
103 dim>> feBMTotalCharge,
105 ValueTypeWaveFunctionBasis,
112 feBDTotalChargeStiffnessMatrix,
115 memorySpace>> feBDTotalChargeRhs,
119 memorySpace>> feBDKineticHamiltonian,
123 feBDElectrostaticsHamiltonian,
126 memorySpace>> feBDEXCHamiltonian,
149 const std::vector<utils::Point> &atomCoordinates,
150 const std::vector<double> & atomCharges,
151 const std::vector<double> & smearedChargeRadius,
155 const double smearingTemperature,
156 const double fermiEnergyTolerance,
157 const double fracOccupancyTolerance,
158 const double eigenSolveResidualTolerance,
159 const double scfDensityResidualNormTolerance,
162 const bool evaluateEnergyEverySCF,
165 const double mixingParameter,
166 const bool isAdaptiveAndersonMixingParameter,
169 &electronChargeDensityInput,
174 ValueTypeElectrostaticsBasis,
176 dim>> feBMTotalCharge,
178 ValueTypeWaveFunctionBasis,
185 feBDTotalChargeStiffnessMatrix,
188 memorySpace>> feBDTotalChargeRhs,
192 feBDNuclearChargeStiffnessMatrix,
195 memorySpace>> feBDNuclearChargeRhs,
199 memorySpace>> feBDKineticHamiltonian,
203 feBDElectrostaticsHamiltonian,
206 memorySpace>> feBDEXCHamiltonian,
243 ValueTypeWaveFunctionCoeff,
249 ValueTypeWaveFunctionBasis,
254 ValueTypeWaveFunctionCoeff,
259 ValueTypeElectrostaticsCoeff,
260 ValueTypeWaveFunctionBasis,
264 std::shared_ptr<
KineticFE<ValueTypeWaveFunctionBasis,
265 ValueTypeWaveFunctionCoeff,
271 ValueTypeWaveFunctionBasis,
290 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
An abstract class to store and access data for a given basis, such as the basis function values on a ...
Definition: FEBasisDataStorage.h:53
An abstract class to encapsulate the partitioning of a finite element basis across multiple processor...
Definition: FEBasisManager.h:44
Definition: DensityCalculator.h:42
Definition: ElectrostaticLocalFE.h:55
Definition: ExchangeCorrelationFE.h:51
Definition: Hamiltonian.h:35
Definition: KineticFE.h:48
Definition: KohnShamDFT.h:50
const utils::mpi::MPIComm & d_mpiCommDomain
Definition: KohnShamDFT.h:288
std::vector< RealType > d_kohnShamEnergies
Definition: KohnShamDFT.h:275
linearAlgebra::Vector< ValueTypeWaveFunctionCoeff, memorySpace > d_lanczosGuess
Definition: KohnShamDFT.h:293
linearAlgebra::blasLapack::real_type< ValueType > RealType
Definition: KohnShamDFT.h:67
const size_type d_numElectrons
Definition: KohnShamDFT.h:296
const OpContext * d_MContext
Definition: KohnShamDFT.h:287
const size_type d_numWantedEigenvalues
Definition: KohnShamDFT.h:235
bool d_isSolved
Definition: KohnShamDFT.h:304
std::shared_ptr< const basis::FEBasisManager< ValueTypeWaveFunctionCoeff, ValueTypeWaveFunctionBasis, memorySpace, dim > > d_feBMWaveFn
Definition: KohnShamDFT.h:274
std::vector< RealType > d_occupation
Definition: KohnShamDFT.h:236
linearAlgebra::MultiVector< ValueType, memorySpace > * d_kohnShamWaveFunctions
Definition: KohnShamDFT.h:277
MixingScheme< RealType, RealType > d_mixingScheme
Definition: KohnShamDFT.h:289
linearAlgebra::blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperator > ValueType
Definition: KohnShamDFT.h:66
bool d_isAdaptiveAndersonMixingParameter
Definition: KohnShamDFT.h:281
std::variant< Hamiltonian< float, memorySpace > *, Hamiltonian< double, memorySpace > *, Hamiltonian< std::complex< float >, memorySpace > *, Hamiltonian< std::complex< double >, memorySpace > * > HamiltonianPtrVariant
Definition: KohnShamDFT.h:56
std::shared_ptr< ElectrostaticLocalFE< ValueTypeElectrostaticsBasis, ValueTypeElectrostaticsCoeff, ValueTypeWaveFunctionBasis, memorySpace, dim > > d_hamitonianElec
Definition: KohnShamDFT.h:263
utils::MemoryStorage< RealType, utils::MemorySpace::HOST > d_jxwDataHost
Definition: KohnShamDFT.h:238
quadrature::QuadratureValuesContainer< RealType, memorySpace > d_densityOutQuadValues
Definition: KohnShamDFT.h:284
size_type d_mixingHistory
Definition: KohnShamDFT.h:279
std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeWaveFunctionBasis, memorySpace > > d_feBDEXCHamiltonian
Definition: KohnShamDFT.h:301
double d_mixingParameter
Definition: KohnShamDFT.h:280
RealType d_groundStateEnergy
Definition: KohnShamDFT.h:303
size_type d_numMaxSCFIter
Definition: KohnShamDFT.h:286
typename linearAlgebra::HermitianIterativeEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace >::OpContext OpContext
Definition: KohnShamDFT.h:71
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: KohnShamDFT.h:291
std::shared_ptr< KineticFE< ValueTypeWaveFunctionBasis, ValueTypeWaveFunctionCoeff, memorySpace, dim > > d_hamitonianKin
Definition: KohnShamDFT.h:268
linearAlgebra::blasLapack::scalar_type< ValueTypeElectrostaticsBasis, ValueTypeWaveFunctionBasis > ValueTypeOperator
Definition: KohnShamDFT.h:60
quadrature::QuadratureValuesContainer< RealType, memorySpace > d_densityInQuadValues
Definition: KohnShamDFT.h:284
std::shared_ptr< KohnShamEigenSolver< ValueTypeOperator, ValueTypeOperand, memorySpace > > d_ksEigSolve
Definition: KohnShamDFT.h:241
bool d_evaluateEnergyEverySCF
Definition: KohnShamDFT.h:282
utils::ConditionalOStream d_rootCout
Definition: KohnShamDFT.h:278
const double d_SCFTol
Definition: KohnShamDFT.h:237
void solve()
Definition: KohnShamDFT.t.cpp:601
std::shared_ptr< KohnShamOperatorContextFE< ValueTypeOperator, ValueTypeOperand, ValueTypeWaveFunctionBasis, memorySpace, dim > > d_hamitonianOperator
Definition: KohnShamDFT.h:252
quadrature::QuadratureValuesContainer< RealType, memorySpace > d_densityResidualQuadValues
Definition: KohnShamDFT.h:285
const OpContext * d_MInvContext
Definition: KohnShamDFT.h:287
std::shared_ptr< DensityCalculator< ValueTypeWaveFunctionBasis, ValueTypeWaveFunctionCoeff, memorySpace, dim > > d_densCalc
Definition: KohnShamDFT.h:246
double getGroundStateEnergy()
Definition: KohnShamDFT.t.cpp:947
linearAlgebra::MultiVector< ValueTypeWaveFunctionCoeff, memorySpace > d_waveFunctionSubspaceGuess
Definition: KohnShamDFT.h:295
std::shared_ptr< ExchangeCorrelationFE< ValueTypeWaveFunctionBasis, ValueTypeWaveFunctionCoeff, memorySpace, dim > > d_hamitonianXC
Definition: KohnShamDFT.h:257
linearAlgebra::blasLapack::scalar_type< ValueTypeElectrostaticsCoeff, ValueTypeWaveFunctionCoeff > ValueTypeOperand
Definition: KohnShamDFT.h:63
Definition: KohnShamEigenSolver.h:59
A derived class of linearAlgebra::OperatorContext to encapsulate the action of a discrete Kohn-Sham o...
Definition: KohnShamOperatorContextFE.h:63
This class performs the anderson mixing in a variable agnostic way This class takes can take differen...
Definition: MixingScheme.h:61
Abstract class to encapsulate the action of a discrete operator on vectors, matrices,...
Definition: IdentityOperatorContext.h:53
Definition: LinAlgOpContext.h:38
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
A class that encapsulates a vector. This is a vector in the mathematical sense and not in the sense o...
Definition: Vector.h:122
Definition: QuadratureValuesContainer.h:39
Provides an interface to print based on whether a certain condition is met or not....
Definition: ConditionalOStream.h:45
Definition: Function.h:10
Definition: MemoryStorage.h:38
blas::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:70
blas::real_type< ValueType > real_type
Definition: BlasLapackTypedef.h:64
int MPIComm
Definition: MPITypes.h:83
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8