37#ifdef DFTFE_WITH_DEVICE
53#include <interpolation.h>
85#ifndef DOXYGEN_SHOULD_SKIP_THIS
93 alglib::spline1dinterpolant psi;
98 template <
unsigned int T1,
unsigned int T2, dftfe::utils::MemorySpace memory>
100 template <
unsigned int T1,
unsigned int T2, dftfe::utils::MemorySpace memory>
111 template <
unsigned int FEOrder,
112 unsigned int FEOrderElectro,
116 friend class forceClass<FEOrder, FEOrderElectro, memorySpace>;
118 friend class symmetryClass<FEOrder, FEOrderElectro, memorySpace>;
136 const MPI_Comm & mpi_comm_domain,
139 const std::string &scratchFolderName,
169 const bool checkSmearedChargeWidthsForOverlap =
true,
170 const bool useSingleAtomSolutionOverride =
false,
171 const bool isMeshDeformed =
false);
203 std::tuple<bool, double>
204 solve(
const bool computeForces =
true,
205 const bool computestress =
true,
206 const bool restartGroundStateCalcFromChk =
false);
237 const bool computeNorm);
308 const std::vector<dealii::types::global_dof_index> &
314 const std::vector<dealii::types::global_dof_index> &
320 const std::vector<dealii::types::global_dof_index> &
326 const std::vector<dealii::types::global_dof_index> &
332 const dealii::MatrixFree<3, double> &
353 const std::vector<dealii::Tensor<1, 3, double>> &globalAtomsDisplacements,
354 const double maxJacobianRatioFactor = 1.25,
355 const bool useSingleAtomSolutionsOverride =
false);
398 const std::vector<std::vector<double>> &
404 const std::vector<double> &
411 const std::vector<std::vector<double>> &
417 const std::vector<int> &
424 const std::vector<std::vector<double>> &
435 const std::vector<std::vector<double>> &
448 const std::set<unsigned int> &
454 const std::vector<double> &
460 const dealii::Tensor<2, 3, double> &
486 const std::vector<std::vector<double>> &
506#ifdef DFTFE_WITH_DEVICE
511 chebyshevOrthogonalizedSubspaceIterationSolverDevice *
512 getSubspaceIterationSolverDevice();
525 const unsigned int s,
526 const unsigned int kPointIndex,
528 & kohnShamDFTEigenOperator,
531 std::vector<double> & residualNormWaveFunctions,
532 const bool computeResidual,
533 const bool useMixedPrec =
false,
534 const bool isFirstScf =
false);
537#ifdef DFTFE_WITH_DEVICE
543 const unsigned int s,
544 const unsigned int kPointIndex,
546 & kohnShamDFTEigenOperator,
548 chebyshevOrthogonalizedSubspaceIterationSolverDevice
549 & subspaceIterationSolverDevice,
550 std::vector<double> &residualNormWaveFunctions,
551 const bool computeResidual,
552 const unsigned int numberRayleighRitzAvoidancePasses = 0,
553 const bool useMixedPrec =
false,
554 const bool isFirstScf =
false);
562 const std::vector<std::vector<double>> &eigenValuesInput,
563 const double numElectronsInput);
570 const std::vector<std::vector<double>> &eigenValuesInput,
571 const double numElectronsInput);
579 &kineticEnergyDensityValues);
597 const std::vector<double> &
606 const dealii::MatrixFree<3, double> &
609 dealii::AffineConstraints<double> *
634 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
641 std::shared_ptr<dftfe::linearAlgebra::BLASWrapper<memorySpace>>
662 const std::shared_ptr<
664 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
665 & basisOperationsPtr,
666 const dealii::AffineConstraints<double> &constraintMatrix,
667 const unsigned int dofHandlerId,
668 const unsigned int quadratureId,
670 & quadratureValueData,
684 const std::shared_ptr<
686 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
687 & basisOperationsPtr,
688 const unsigned int dofHandlerId,
689 const unsigned int quadratureId,
692 &quadratureValueData,
694 & quadratureGradValueData,
695 const bool isEvaluateGradData =
false);
698 std::map<dealii::types::global_dof_index, double> &
702 std::map<dealii::CellId, std::vector<double>> &
708 const dealii::AffineConstraints<double> *
711 const std::vector<std::vector<double>> &
726 const std::map<dealii::CellId, std::vector<unsigned int>> &
734 const std::shared_ptr<
736 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
737 & basisOperationsPtr,
738 const unsigned int densityQuadratureId,
741 const std::map<dealii::CellId, std::vector<double>> *bQuadValues);
749 std::shared_ptr<hubbard<dataTypes::number, memorySpace>>
762 outputWfc(
const std::string outputFileName =
"wfcOutput");
767 const std::map<dealii::CellId, std::vector<double>> &
787 const std::vector<std::vector<double>> &atomCoordinates);
817 std::vector<int> & imageIds,
818 std::vector<double> & imageCharges,
819 std::vector<std::vector<double>> &imagePositions);
823 const double pspCutOff,
824 const std::vector<int> & imageIds,
825 const std::vector<std::vector<double>> &imagePositions,
826 std::vector<std::vector<int>> & globalChargeIdToImageIdMap);
846 dealii::Triangulation<3, 3> &triangulationSerial,
847 bool reuseFlag =
false,
848 bool moveSubdivided =
false);
871 dealii::parallel::distributed::Triangulation<3> &triangulation);
874 const bool meshOnlyDeformed =
false,
875 const bool vselfPerturbationUpdateForStress =
false);
887 dealii::parallel::distributed::Triangulation<3> &triangulation);
890 const bool meshOnlyDeformed,
891 const bool vselfPerturbationUpdateForStress =
false);
904 const dealii::DoFHandler<3> & _dofHandler,
905 const dealii::AffineConstraints<double> &onlyHangingNodeConstraints,
906 dealii::AffineConstraints<double> & constraintMatrix);
920 const std::shared_ptr<
922 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
923 & basisOperationsPtr,
924 const unsigned int dofHandlerId,
925 const unsigned int quadratureId,
928 &quadratureValueData,
930 &quadratureGradValueData,
932 & quadratureHessianValueData,
933 const bool isEvaluateGradData =
false,
934 const bool isEvaluateHessianData =
false);
949 const std::shared_ptr<
951 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
952 & basisOperationsPtr,
953 const unsigned int dofHandlerId,
954 const unsigned int quadratureId,
957 &quadratureValueData,
959 & quadratureGradValueData,
960 const bool isEvaluateGradData);
970 &quadratureValueData,
972 & quadratureGradValueData,
973 const bool isConsiderGradData =
false);
985 std::map<dealii::types::global_dof_index, double>
986 &atomNodeIdToChargeValueMap);
1002 const dealii::DoFHandler<3> & _dofHandler,
1003 const dealii::AffineConstraints<double> &constraintMatrixBase,
1004 dealii::AffineConstraints<double> & constraintMatrix);
1045 unsigned int &flag);
1048 const dealii::DoFHandler<3> & _dofHandler,
1049 const unsigned int lpspQuadratureId,
1050 const dealii::MatrixFree<3, double> & _matrix_free_data,
1051 const unsigned int _phiExtDofHandlerIndex,
1052 const dealii::AffineConstraints<double> &phiExtConstraintMatrix,
1053 const std::map<dealii::types::global_dof_index, dealii::Point<3>>
1057 std::map<dealii::CellId, std::vector<double>> & _pseudoValues,
1058 std::map<
unsigned int, std::map<dealii::CellId, std::vector<double>>>
1059 &_pseudoValuesAtoms);
1073 const dealii::DoFHandler<3> & _dofHandler,
1074 const dealii::AffineConstraints<double> &onlyHangingNodeConstraints,
1075 dealii::AffineConstraints<double> & constraintMatrix);
1089 const dealii::DoFHandler<3> & dofHandlerOfField,
1090 const std::map<dealii::CellId, std::vector<double>> *rhoQuadValues);
1094 const dealii::DoFHandler<3> &dofHandlerOfField,
1100 totalCharge(
const dealii::MatrixFree<3, double> &matrixFreeDataObject,
1108 const unsigned int dofHandlerId,
1109 const unsigned int quadratureId);
1113 const dealii::MatrixFree<3, double> &matrixFreeDataObject,
1116 const unsigned int dofHandlerId,
1117 const unsigned int quadratureId);
1130 const std::shared_ptr<
1132 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
1133 & basisOperationsPtr,
1134 const dealii::AffineConstraints<double> &constraintMatrix,
1135 const unsigned int dofHandlerId,
1136 const unsigned int quadratureId,
1138 & quadratureValueData,
1187#ifdef DFTFE_WITH_DEVICE
1189 & kerkerPreconditionedResidualSolverProblemDevice,
1190 linearSolverCGDevice &CGSolverDevice,
1193 & kerkerPreconditionedResidualSolverProblem,
1203 const unsigned int scfIter);
1209 const std::vector<std::vector<double>> &eigenValuesInput);
1217 const std::vector<std::vector<double>> &eigenValuesInput);
1225 const std::string & fileName);
1229 const std::string & fileName);
1261 const bool vselfPerturbationUpdateForStress =
false,
1262 const bool useSingleAtomSolutionsOverride =
false,
1263 const bool print =
true);
1271 std::complex<double>
1275 alphaTimesXPlusY(std::complex<double> alpha,
1296 &gradDensityQuadValues,
1297 const std::map<dealii::CellId, std::vector<double>> &rhoCore,
1298 const std::map<dealii::CellId, std::vector<double>> &gradRhoCore,
1300 & eigenVectorsFlattenedMemSpace,
1301 const std::vector<std::vector<double>> &
eigenValues,
1302 const double fermiEnergy_,
1303 const double fermiEnergyUp_,
1304 const double fermiEnergyDown_,
1325 std::map<unsigned int, unsigned int>
1429 std::map<dealii::CellId, std::vector<unsigned int>>
1434 std::vector<std::map<dealii::CellId, std::vector<unsigned int>>>
1439 std::map<dealii::CellId, std::vector<unsigned int>>
1444 std::vector<std::map<dealii::CellId, std::vector<unsigned int>>>
1451 std::map<
unsigned int,
1452 std::map<
unsigned int,
1453 std::map<unsigned int, alglib::spline1dinterpolant>>>
1455 std::map<
unsigned int,
1456 std::map<unsigned int, std::map<unsigned int, double>>>
1474 std::vector<dealii::Tensor<1, 3, double>>
1520 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
1522#if defined(DFTFE_WITH_DEVICE)
1527 d_basisOperationsPtrDevice;
1530 FEBasisOperations<double, double, dftfe::utils::MemorySpace::DEVICE>>
1531 d_basisOperationsPtrElectroDevice;
1538 std::shared_ptr<dftfe::oncvClass<dataTypes::number, memorySpace>>
1546#if defined(DFTFE_WITH_DEVICE)
1556 std::vector<const dealii::AffineConstraints<double> *>
1563#if defined(DFTFE_WITH_DEVICE)
1564 utils::DeviceCCLWrapper *d_devicecclMpiCommDomainPtr;
1588#ifdef DFTFE_WITH_DEVICE
1589 poissonSolverProblemDevice<FEOrder, FEOrderElectro>
1590 d_phiTotalSolverProblemDevice;
1592 poissonSolverProblemDevice<FEOrder, FEOrderElectro>
1593 d_phiPrimeSolverProblemDevice;
1607#ifdef DFTFE_WITH_DEVICE
1608 chebyshevOrthogonalizedSubspaceIterationSolverDevice
1609 d_subspaceIterationSolverDevice;
1636#ifdef DFTFE_WITH_DEVICE
1638 d_constraintsNoneDataInfoDevice;
1690#ifdef DFTFE_WITH_DEVICE
1693 d_eigenVectorsFlattenedDevice;
1696 d_eigenVectorsDensityMatrixPrimeFlattenedDevice;
1765 std::map<unsigned int, std::map<dealii::CellId, std::vector<double>>>
1797 std::map<unsigned int, std::map<dealii::CellId, std::vector<double>>>
1809 std::map<unsigned int, std::map<dealii::CellId, std::vector<double>>>
1814 std::map<unsigned int, std::map<dealii::CellId, std::vector<double>>>
1907 const std::vector<std::vector<double>>
1908 &residualNormWaveFunctionsAllkPoints,
1909 const std::vector<std::vector<double>> &eigenValuesAllkPoints,
1910 const double _fermiEnergy);
1918 const std::vector<std::vector<double>>
1919 &residualNormWaveFunctionsAllkPoints,
1920 const std::vector<std::vector<double>> &eigenValuesAllkPoints,
1921 const unsigned int highestState);
1925#ifdef DFTFE_WITH_DEVICE
1928 const unsigned int s,
1929 const unsigned int kPointIndex,
1931 & kohnShamDFTEigenOperator,
1933 chebyshevOrthogonalizedSubspaceIterationSolverDevice
1934 &subspaceIterationSolverDevice);
1940 const unsigned int s,
1941 const unsigned int kPointIndex,
1943 & kohnShamDFTEigenOperator,
1948 const unsigned int spinType,
1949 const unsigned int kPointIndex,
1951 & kohnShamDFTEigenOperator,
1953 std::vector<double> & residualNormWaveFunctions,
1954 unsigned int ipass);
Definition AuxDensityMatrix.h:33
Definition KohnShamHamiltonianOperator.h:36
This class performs the anderson mixing in a variable agnostic way This class takes can take differen...
Definition mixingClass.h:48
Definition atomCenteredPostProcessing.h:30
Definition FEBasisOperations.h:84
Concrete class implementing Chebyshev filtered orthogonalized subspace iteration solver.
Definition chebyshevOrthogonalizedSubspaceIterationSolver.h:38
dealii linear solver class wrapper
Definition dealiiLinearSolver.h:32
abstract base class for dft
Definition dftBase.h:34
std::deque< distributedCPUVec< double > > d_vSpin0containerVals
Definition dft.h:1752
double d_atomicRhoScalingFac
Definition dft.h:1009
const std::string d_dftfeScratchFolderName
Definition dft.h:1600
double rhofieldInnerProduct(const dealii::MatrixFree< 3, double > &matrixFreeDataObject, const distributedCPUVec< double > &rhoNodalField1, const distributedCPUVec< double > &rhoNodalField2, const unsigned int dofHandlerId, const unsigned int quadratureId)
double d_freeEnergy
Definition dft.h:1866
unsigned int d_phiExtDofHandlerIndexElectro
Definition dft.h:1490
std::vector< unsigned int > d_nearestAtomIds
nearest atom ids for all domain atoms
Definition dft.h:1364
const std::vector< std::vector< double > > & getLocalVselfs() const
const MPI_Comm & getMPIInterPool() const override
std::map< dealii::CellId, std::vector< unsigned int > > d_bCellNonTrivialAtomImageIds
Definition dft.h:1440
double computeMaximumHighestOccupiedStateResidualNorm(const std::vector< std::vector< double > > &residualNormWaveFunctionsAllkPoints, const std::vector< std::vector< double > > &eigenValuesAllkPoints, const unsigned int highestState)
compute the maximum of the residual norm of the highest state of interest among all k points
unsigned int d_phiTotAXQuadratureIdElectro
Definition dft.h:1505
std::vector< double > d_upperBoundUnwantedSpectrumValues
Definition dft.h:1881
const MPI_Comm d_mpiCommParent
Definition dft.h:1566
unsigned int d_densityDofHandlerIndex
Definition dft.h:1492
distributedCPUVec< double > d_phiTotRhoOut
Definition dft.h:1780
std::vector< std::vector< double > > atomLocationsFractional
Definition dft.h:1322
void compute_tdos(const std::vector< std::vector< double > > &eigenValuesInput, const std::string &fileName)
compute density of states and local density of states
double d_entropicEnergy
entropic energy
Definition dft.h:1869
std::vector< double > d_gaussianConstantsAutoMesh
Definition dft.h:1348
const distributedCPUVec< double > & getRhoNodalOut() const
void initBoundaryConditions(const bool recomputeBasisData=true, const bool meshOnlyDeformed=false, const bool vselfPerturbationUpdateForStress=false)
std::vector< std::vector< double > > d_fracOccupancy
Definition dft.h:1671
std::map< dealii::CellId, std::vector< double > > d_hessianRhoCore
Definition dft.h:1812
void locateAtomCoreNodes(const dealii::DoFHandler< 3 > &_dofHandler, std::map< dealii::types::global_dof_index, double > &atomNodeIdToChargeValueMap)
Finds the global dof ids of the nodes containing atoms.
void writeMesh()
Writes inital density and mesh to file.
void kohnShamEigenSpaceCompute(const unsigned int s, const unsigned int kPointIndex, KohnShamHamiltonianOperator< dftfe::utils::MemorySpace::HOST > &kohnShamDFTEigenOperator, elpaScalaManager &elpaScala, chebyshevOrthogonalizedSubspaceIterationSolver &subspaceIterationSolver, std::vector< double > &residualNormWaveFunctions, const bool computeResidual, const bool useMixedPrec=false, const bool isFirstScf=false)
Function that computes the Eigen space for the Kohn Sham operator.
void initHubbardOperator()
Checks if the Exc functional requires Hubbard correction and sets up the Hubbard class if required.
std::vector< dealii::types::global_dof_index > local_dof_indicesImag
Definition dft.h:1575
const std::vector< double > & getKPointWeights() const
const MPI_Comm mpi_communicator
Definition dft.h:1562
const dftfe::utils::MemoryStorage< dataTypes::number, dftfe::utils::MemorySpace::HOST > & getEigenVectorsHost() const
Get reference the host eigen vectors.
double d_monopole
Definition dft.h:1742
const std::vector< double > & getNearestAtomDistance() const
Gets the nearest atom distance for each atom.
dealii::IndexSet locally_owned_dofs
Definition dft.h:1571
dealii::DoFHandler< 3 > d_dofHandlerRhoNodal
Definition dft.h:1489
const std::map< dealii::CellId, std::vector< double > > & getPseudoVLoc() const
return the pseudo potential field
double numElectronsUp
Definition dft.h:1314
double getFreeEnergy() const
void saveTriaInfoAndRhoNodalData()
save triangulation information and rho quadrature data to checkpoint file for restarts
std::vector< std::vector< double > > d_domainBoundingVectors
Definition dft.h:1323
unsigned int d_phiPrimeDofHandlerIndexElectro
Definition dft.h:1504
dealii::AffineConstraints< double > constraintsNone
Definition dft.h:1642
const dealii::Tensor< 2, 3, double > & getCellStress() const
Gets the current cell stress from dftClass.
void applyHomogeneousDirichletBC(const dealii::DoFHandler< 3 > &_dofHandler, const dealii::AffineConstraints< double > &onlyHangingNodeConstraints, dealii::AffineConstraints< double > &constraintMatrix)
Sets homegeneous dirichlet boundary conditions for total potential constraints on non-periodic bounda...
const distributedCPUVec< double > & getRhoNodalSplitOut() const
double computeResidualNodalData(const distributedCPUVec< double > &outValues, const distributedCPUVec< double > &inValues, distributedCPUVec< double > &residualValues)
dealii::DoFHandler< 3 > d_dofHandlerPRefined
Definition dft.h:1488
void locatePeriodicPinnedNodes(const dealii::DoFHandler< 3 > &_dofHandler, const dealii::AffineConstraints< double > &constraintMatrixBase, dealii::AffineConstraints< double > &constraintMatrix)
Sets homogeneous dirichlet boundary conditions on a node farthest from all atoms (pinned node)....
void writeDomainAndAtomCoordinates(const std::string Path) const
writes the current domain bounding vectors and atom coordinates to files for structural optimization ...
double totalCharge(const dealii::DoFHandler< 3 > &dofHandlerOfField, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &rhoQuadValues)
dealii::IndexSet locally_owned_dofsEigen
Definition dft.h:1571
std::map< unsigned int, std::map< dealii::CellId, std::vector< double > > > d_gradRhoAtomsValuesSeparate
Definition dft.h:1766
std::vector< std::vector< int > > d_globalChargeIdToImageIdMapTrunc
globalChargeId to ImageChargeId Map generated with a truncated pspCutOff
Definition dft.h:1402
std::map< dealii::CellId, std::vector< unsigned int > > d_bCellNonTrivialAtomIds
Definition dft.h:1430
std::vector< dealii::Point< 3 > > d_closestTriaVertexToAtomsLocation
closest tria vertex
Definition dft.h:1848
std::deque< distributedCPUVec< double > > d_fvcontainerVals
Definition dft.h:1751
double fermiEnergyUp
Definition dft.h:1862
std::vector< std::vector< double > > d_densityMatDerFermiEnergy
Definition dft.h:1673
void l2ProjectionQuadDensityMinusAtomicDensity(const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const dealii::AffineConstraints< double > &constraintMatrix, const unsigned int dofHandlerId, const unsigned int quadratureId, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureValueData, distributedCPUVec< double > &nodalField)
l2 projection
poissonSolverProblem< FEOrder, FEOrderElectro > d_phiTotalSolverProblem
Definition dft.h:1585
std::map< unsigned int, std::map< dealii::CellId, std::vector< double > > > d_gradRhoCoreAtoms
Definition dft.h:1810
dealii::AffineConstraints< double > * getDensityConstraint()
void writeStructureEnergyForcesDataPostProcess(const std::string Path) const
writes atomistics data for subsequent post-processing. Related to WRITE STRUCTURE ENERGY FORCES DATA ...
unsigned int d_eigenDofHandlerIndex
Definition dft.h:1490
std::map< dealii::CellId, std::vector< double > > d_bQuadValuesAllAtoms
non-intersecting smeared charges of all atoms at quad points
Definition dft.h:1415
unsigned int d_densityQuadratureIdElectro
Definition dft.h:1509
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_gradDensityResidualQuadValues
Definition dft.h:1772
const MPI_Comm interBandGroupComm
Definition dft.h:1568
std::vector< dealii::types::global_dof_index > local_dof_indicesReal
Definition dft.h:1574
std::vector< std::vector< double > > atomLocations
FIXME: remove atom type atributes from atomLocations.
Definition dft.h:1322
void applyPeriodicBCHigherOrderNodes()
Computes inner Product and Y = alpha*X + Y for complex vectors used during periodic boundary conditio...
std::vector< double > d_kPointCoordinates
kPoint cartesian coordinates
Definition dft.h:1839
std::map< unsigned int, std::map< dealii::CellId, std::vector< double > > > d_rhoAtomsValuesSeparate
Definition dft.h:1766
double fermiEnergyDown
Definition dft.h:1862
void compute_fermienergy_constraintMagnetization_purestate(const std::vector< std::vector< double > > &eigenValuesInput)
Find spin-up and spin-down channel HOMO eigenvalues.
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOST > constraintsNoneEigenDataInfo
Definition dft.h:1623
void deformDomain(const dealii::Tensor< 2, 3, double > &deformationGradient, const bool vselfPerturbationUpdateForStress=false, const bool useSingleAtomSolutionsOverride=false, const bool print=true)
Deforms the domain by the given deformation gradient and reinitializes the dftClass datastructures.
std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, memorySpace > > getBasisOperationsElectroMemSpace()
void loadPSIFiles(unsigned int Z, unsigned int n, unsigned int l, unsigned int &flag)
void generateImageCharges(const double pspCutOff, std::vector< int > &imageIds, std::vector< double > &imageCharges, std::vector< std::vector< double > > &imagePositions)
creates datastructures related to periodic image charges
void outputDensity()
write electron density solution fields
unsigned int d_densityDofHandlerIndexElectro
Definition dft.h:1493
std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > getBasisOperationsElectroHost()
unsigned int d_feOrderPlusOneQuadratureId
Definition dft.h:1500
dealii::AffineConstraints< double > d_constraintsRhoNodal
Definition dft.h:1655
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradPhiResQuadValues
Definition dft.h:1723
double d_residualNormPredicted
Definition dft.h:1759
double lowrankApproxScfDielectricMatrixInvSpinPolarized(const unsigned int scfIter)
void createMasterChargeIdToImageIdMaps(const double pspCutOff, const std::vector< int > &imageIds, const std::vector< std::vector< double > > &imagePositions, std::vector< std::vector< int > > &globalChargeIdToImageIdMap)
void initnscf(KohnShamHamiltonianOperator< memorySpace > &kohnShamDFTEigenOperator, poissonSolverProblem< FEOrder, FEOrderElectro > &phiTotalSolverProblem, dealiiLinearSolver &CGSolver)
void kohnShamEigenSpaceFirstOrderDensityMatResponse(const unsigned int s, const unsigned int kPointIndex, KohnShamHamiltonianOperator< dftfe::utils::MemorySpace::HOST > &kohnShamDFTEigenOperator, elpaScalaManager &elpaScala)
void computeMultipoleMoments(const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const unsigned int densityQuadratureId, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &rhoQuadValues, const std::map< dealii::CellId, std::vector< double > > *bQuadValues)
unsigned int getElectroQuadratureRhsId() const
const std::vector< int > & getImageAtomIDs() const
Gets the current image atom ids from dftClass.
std::shared_ptr< excManager< memorySpace > > d_excManagerPtr
Definition dft.h:1307
std::vector< double > bLow
Definition dft.h:1875
void writeDomainAndAtomCoordinates()
writes the current domain bounding vectors and atom coordinates to files, which are required for geom...
symmetryClass< FEOrder, FEOrderElectro, memorySpace > * symmetryPtr
Definition dft.h:1581
std::vector< std::vector< double > > d_imagePositionsTrunc
Definition dft.h:1399
double d_wfcInitTruncation
init wfc trunctation radius
Definition dft.h:1482
std::vector< double > d_smearedChargeWidths
smeared charge widths for all domain atoms
Definition dft.h:1358
unsigned int lowerBoundKindex
global k index of lower bound of the local k point set
Definition dft.h:1852
double d_groundStateEnergy
Definition dft.h:1862
unsigned int getDensityDofHandlerIndex()
get the index of the DoF Handler corresponding to
void updateAtomPositionsAndMoveMesh(const std::vector< dealii::Tensor< 1, 3, double > > &globalAtomsDisplacements, const double maxJacobianRatioFactor=1.25, const bool useSingleAtomSolutionsOverride=false)
Updates atom positions, remeshes/moves mesh and calls appropriate reinits.
dealii::FESystem< 3 > FEEigen
Definition dft.h:1487
distributedCPUVec< double > d_rhoOutNodalValuesSplit
Definition dft.h:1726
void initLocalPseudoPotential(const dealii::DoFHandler< 3 > &_dofHandler, const unsigned int lpspQuadratureId, const dealii::MatrixFree< 3, double > &_matrix_free_data, const unsigned int _phiExtDofHandlerIndex, const dealii::AffineConstraints< double > &phiExtConstraintMatrix, const std::map< dealii::types::global_dof_index, dealii::Point< 3 > > &supportPoints, const vselfBinsManager< FEOrder, FEOrderElectro > &vselfBinManager, distributedCPUVec< double > &phiExt, std::map< dealii::CellId, std::vector< double > > &_pseudoValues, std::map< unsigned int, std::map< dealii::CellId, std::vector< double > > > &_pseudoValuesAtoms)
const std::vector< dealii::types::global_dof_index > & getLocalProcDofIndicesReal() const
Get local dofs local proc indices real.
double computeVolume(const dealii::DoFHandler< 3 > &_dofHandler)
Computes the volume of the domain.
unsigned int d_smearedChargeQuadratureIdElectro
Definition dft.h:1497
std::map< dealii::CellId, std::vector< double > > d_hessianRhoAtomsValues
Definition dft.h:1764
void trivialSolveForStress()
void setNumElectrons(unsigned int inputNumElectrons)
std::tuple< bool, double > solve(const bool computeForces=true, const bool computestress=true, const bool restartGroundStateCalcFromChk=false)
Kohn-Sham ground-state solve using SCF iteration.
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_phiOutQuadValues
Definition dft.h:1721
std::vector< distributedCPUVec< double > > d_densityInNodalValues
Definition dft.h:1715
double totalCharge(const dealii::DoFHandler< 3 > &dofHandlerOfField, const std::map< dealii::CellId, std::vector< double > > *rhoQuadValues)
std::vector< const dealii::AffineConstraints< double > * > d_constraintsVector
Definition dft.h:1555
const std::vector< double > & getForceonAtoms() const
Gets the current atomic forces from dftClass.
double computeAndPrintKE(dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &kineticEnergyDensityValues)
Computes the kinetic energy.
void readPSIRadialValues()
~dftClass()
dftClass destructor
distributedCPUVec< double > d_rhoNodalFieldRefined
Definition dft.h:1727
std::map< unsigned int, unsigned int > d_atomTypeAtributes
Definition dft.h:1319
const std::map< dealii::CellId, std::vector< unsigned int > > & getbCellNonTrivialAtomIds() const
std::map< unsigned int, unsigned int > d_atomIdPseudopotentialInterestToGlobalId
Definition dft.h:1326
unsigned int d_nOMPThreads
Definition dft.h:1511
std::vector< bool > d_isFirstFilteringCall
Definition dft.h:1879
std::vector< bool > selectedDofsHanging
Definition dft.h:1578
void run()
FIXME: legacy call, move to main.cc.
std::vector< const dealii::AffineConstraints< double > * > d_constraintsVectorElectro
Definition dft.h:1557
const std::vector< std::vector< double > > & getAtomLocationsCart() const
Gets the current atom Locations in cartesian form (origin at center of domain) from dftClass.
double d_nlPSPCutOff
Definition dft.h:1412
std::map< dealii::types::global_dof_index, double > & getAtomNodeToChargeMap()
map of atom node number and atomic weight
std::map< dealii::types::global_dof_index, dealii::Point< 3 > > d_supportPointsPRefined
Definition dft.h:1554
std::vector< distributedCPUVec< double > > d_densityOutNodalValues
Definition dft.h:1716
void writeMesh(std::string meshFileName)
dealii::DoFHandler< 3 > dofHandler
Definition dft.h:1488
virtual void resetRhoNodalSplitIn(distributedCPUVec< double > &OutDensity)
vselfBinsManager< FEOrder, FEOrderElectro > d_vselfBinsManager
vselfBinsManager object
Definition dft.h:1823
const dealii::MatrixFree< 3, double > & getMatrixFreeDataElectro() const
void computeRhoInitialGuessFromPSI(std::vector< std::vector< distributedCPUVec< double > > > eigenVectors)
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradDensityTotalInValuesLpspQuad
Definition dft.h:1736
void finalizeKohnShamDFTOperator()
bool d_isAtomsGaussianDisplacementsReadFromFile
Definition dft.h:1339
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > d_BLASWrapperPtr
Definition dft.h:1551
double d_relativeErrorJacInvApproxPrevScfLRD
Definition dft.h:1758
std::vector< double > d_dipole
Definition dft.h:1743
std::shared_ptr< hubbard< dataTypes::number, memorySpace > > d_hubbardClassPtr
Definition dft.h:1957
const std::vector< std::vector< double > > & getEigenValues() const
Get reference to the eigen values.
unsigned int d_baseDofHandlerIndexElectro
Definition dft.h:1495
std::vector< double > d_gaussianConstantsForce
Definition dft.h:1344
std::shared_ptr< hubbard< dataTypes::number, memorySpace > > getHubbardClassPtr()
Returns the shared ptr to hubbard class.
triangulationManager * getTriangulationManager()
std::vector< double > d_smearedChargeMoments
Definition dft.h:1745
std::map< dealii::CellId, std::vector< double > > d_rhoAtomsValues
for xl-bomd
Definition dft.h:1763
const unsigned int n_mpi_processes
Definition dft.h:1569
std::map< unsigned int, std::map< dealii::CellId, std::vector< double > > > d_hessianRhoCoreAtoms
Definition dft.h:1815
bool d_smearedChargeMomentsComputed
Definition dft.h:1746
double rhofieldl2Norm(const dealii::MatrixFree< 3, double > &matrixFreeDataObject, const distributedCPUVec< double > &rhoNodalField, const unsigned int dofHandlerId, const unsigned int quadratureId)
std::vector< double > d_imageCharges
Definition dft.h:1380
dealii::MatrixFree< 3, double > d_matrixFreeDataPRefined
Definition dft.h:1512
void nscf(KohnShamHamiltonianOperator< memorySpace > &kohnShamDFTEigenOperator, chebyshevOrthogonalizedSubspaceIterationSolver &subspaceIterationSolver)
void updatePRefinedConstraints()
double numElectrons
Definition dft.h:1314
std::vector< orbital > waveFunctionsVector
Definition dft.h:1450
std::vector< std::map< dealii::CellId, std::vector< unsigned int > > > d_bCellNonTrivialAtomImageIdsBins
Definition dft.h:1445
double totalCharge(const dealii::MatrixFree< 3, double > &matrixFreeDataObject, const distributedCPUVec< double > &rhoNodalField)
std::deque< distributedCPUVec< double > > d_groundStateDensityHistory
Definition dft.h:1791
double lowrankApproxScfDielectricMatrixInv(const unsigned int scfIter)
void addAtomicRhoQuadValuesGradients(dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureValueData, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureGradValueData, const bool isConsiderGradData=false)
add atomic densities at quadrature points
const MPI_Comm interpoolcomm
Definition dft.h:1567
void computeVselfFieldGateauxDerFD()
distributedCPUVec< double > d_rhoInNodalValuesRead
Definition dft.h:1726
dealii::TimerOutput computing_timer
compute-time logger
Definition dft.h:1703
std::vector< double > d_imageChargesTrunc
Definition dft.h:1395
unsigned int d_forceDofHandlerIndex
Definition dft.h:1491
void initpRefinedObjects(const bool recomputeBasisData, const bool meshOnlyDeformed, const bool vselfPerturbationUpdateForStress=false)
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< memorySpace > > getBLASWrapperMemSpace()
const MPI_Comm & getMPIParent() const override
void createpRefinedDofHandler(dealii::parallel::distributed::Triangulation< 3 > &triangulation)
const std::vector< dealii::types::global_dof_index > & getLocalDofIndicesReal() const
Get local dofs global indices real.
void solveNoSCF()
compute approximation to ground-state without solving the SCF iteration
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradPhiOutQuadValues
Definition dft.h:1723
void applyKerkerPreconditionerToTotalDensityResidual(kerkerSolverProblem< C_rhoNodalPolyOrder< FEOrder, FEOrderElectro >()> &kerkerPreconditionedResidualSolverProblem, dealiiLinearSolver &CGSolver, const distributedCPUVec< double > &residualRho, distributedCPUVec< double > &preCondTotalDensityResidualVector)
Mixing schemes for mixing electron-density.
std::vector< dealii::types::global_dof_index > localProc_dof_indicesImag
Definition dft.h:1577
std::vector< std::vector< double > > d_atomLocationsAutoMesh
Definition dft.h:1327
double d_autoMeshMaxJacobianRatio
Definition dft.h:1464
const MPI_Comm & getMPIInterBand() const override
void compute_localizationLength(const std::string &locLengthFileName)
compute localization length
std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > getBasisOperationsHost()
std::shared_ptr< dftfe::oncvClass< dataTypes::number, memorySpace > > d_oncvClassPtr
Definition dft.h:1539
std::vector< double > kPointReducedCoordinates
k point crystal coordinates
Definition dft.h:1842
std::shared_ptr< AuxDensityMatrix< memorySpace > > d_auxDensityMatrixXCInPtr
Definition dft.h:1738
std::vector< std::vector< double > > d_imagePositions
Definition dft.h:1384
triangulationManager d_mesh
Definition dft.h:1462
std::map< dealii::types::global_dof_index, dealii::Point< 3 > > d_supportPointsEigen
Definition dft.h:1554
dealii::AffineConstraints< double > d_constraintsPRefined
Definition dft.h:1651
double d_freeEnergyInitial
Definition dft.h:1864
dealii::AffineConstraints< double > d_constraintsForPhiPrimeElectro
Definition dft.h:1647
void normalizeRhoInQuadValues()
normalize the input electron density
void normalizeAtomicRhoQuadValues()
normalize the electron density
unsigned int d_rankCurrentLRD
Definition dft.h:1757
unsigned int getElectroQuadratureAxId() const
chebyshevOrthogonalizedSubspaceIterationSolver d_subspaceIterationSolver
Definition dft.h:1606
std::shared_ptr< dftfe::atomCenteredOrbitalsPostProcessing< dataTypes::number, memorySpace > > d_atomCenteredOrbitalsPostProcessingPtr
Definition dft.h:1543
std::vector< double > d_kPointWeights
k point weights
Definition dft.h:1845
dftClass(const MPI_Comm &mpiCommParent, const MPI_Comm &mpi_comm_domain, const MPI_Comm &interpoolcomm, const MPI_Comm &interBandGroupComm, const std::string &scratchFolderName, dftParameters &dftParams)
dftClass constructor
std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, memorySpace > > getBasisOperationsMemSpace()
void initImageChargesUpdateKPoints(bool flag=true)
generate image charges and update k point cartesian coordinates based on current lattice vectors
std::map< dealii::types::global_dof_index, dealii::Point< 3 > > d_supportPoints
Definition dft.h:1553
elpaScalaManager * getElpaScalaManager() const
double getFermiEnergy() const
Get the value of fermi energy.
double fieldGradl2Norm(const dealii::MatrixFree< 3, double > &matrixFreeDataObject, const distributedCPUVec< double > &field)
distributedCPUVec< double > d_preCondTotalDensityResidualVector
Definition dft.h:1727
distributedCPUVec< double > d_magInNodalValuesRead
Definition dft.h:1731
bool d_useHubbard
Definition dft.h:1958
std::deque< distributedCPUVec< double > > d_vcontainerVals
for low rank jacobian inverse approximation
Definition dft.h:1750
distributedCPUVec< double > d_residualPredicted
Definition dft.h:1756
std::vector< double > a0
Definition dft.h:1874
dealii::Timer d_globalTimer
Definition dft.h:1708
void noRemeshRhoDataInit()
std::vector< double > d_flatTopWidthsAutoMeshMove
Definition dft.h:1355
std::map< dealii::CellId, std::vector< double > > & getBQuadValuesAllAtoms()
non-intersecting smeared charges of all atoms at quad points
std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > d_basisOperationsPtrElectroHost
Definition dft.h:1521
std::map< dealii::types::global_dof_index, double > d_atomNodeIdToChargeMap
map of atom node number and atomic weight
Definition dft.h:1820
std::vector< dealii::Tensor< 1, 3, double > > d_atomsDisplacementsGaussianRead
Gaussian displacements of atoms read from file.
Definition dft.h:1331
unsigned int d_nonPeriodicDensityDofHandlerIndexElectro
Definition dft.h:1494
double d_domainVolume
volume of the domain
Definition dft.h:1479
bool d_isRestartGroundStateCalcFromChk
Definition dft.h:1885
void compute_rhoOut(const bool isGroundState=false)
Computes output electron-density from wavefunctions.
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_densityOutQuadValues
Definition dft.h:1713
dealii::IndexSet d_locallyRelevantDofsRhoNodal
Definition dft.h:1573
dealii::ConditionalOStream pcout
device eigenvectors
Definition dft.h:1700
void calculateNearestAtomDistances()
a
void initUnmovedTriangulation(dealii::parallel::distributed::Triangulation< 3 > &triangulation)
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_gradDensityOutQuadValues
Definition dft.h:1771
unsigned int d_nonAtomicWaveFunctions
Number of random wavefunctions.
Definition dft.h:300
std::map< dealii::CellId, std::vector< double > > d_gradRhoCore
Definition dft.h:1807
distributedCPUVec< double > d_phiExt
Definition dft.h:1788
unsigned int d_highestStateForResidualComputation
Definition dft.h:294
unsigned int getSmearedChargeQuadratureIdElectro()
dealii::AffineConstraints< double > d_constraintsPRefinedOnlyHanging
Definition dft.h:1653
const std::vector< std::vector< double > > & getCell() const
Gets the current cell lattice vectors.
void interpolateDensityNodalDataToQuadratureDataGeneral(const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const unsigned int dofHandlerId, const unsigned int quadratureId, const distributedCPUVec< double > &nodalField, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureValueData, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureGradValueData, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureHessianValueData, const bool isEvaluateGradData=false, const bool isEvaluateHessianData=false)
interpolate rho nodal data to quadrature data using FEEvaluation
unsigned int d_phiTotDofHandlerIndexElectro
Definition dft.h:1503
std::vector< int > d_imageIdsTrunc
Definition dft.h:1391
void totalMagnetization(const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &magQuadValues)
Computes net magnetization from the difference of local spin densities.
dealii::IndexSet d_locallyRelevantDofsPRefined
Definition dft.h:1573
const double d_smearedChargeWidthMin
minimum smeared charge width
Definition dft.h:1448
double getEntropicEnergy() const
std::vector< double > d_nearestAtomDistances
nearest atom distances for all domain atoms
Definition dft.h:1367
unsigned int getNumEigenValues() const
std::vector< std::vector< double > > d_localVselfs
Definition dft.h:1801
dealii::AffineConstraints< double > d_constraintsRhoNodalOnlyHanging
Definition dft.h:1657
std::vector< distributedCPUVec< double > > d_densityResidualNodalValues
Definition dft.h:1716
KohnShamHamiltonianOperator< memorySpace > * d_kohnShamDFTOperatorPtr
Definition dft.h:1598
unsigned int d_densityQuadratureId
Definition dft.h:1508
poissonSolverProblem< FEOrder, FEOrderElectro > d_phiPrimeSolverProblem
Definition dft.h:1587
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > & getDensityInValues()
void calculateSmearedChargeWidths()
a
bool d_kohnShamDFTOperatorsInitialized
Definition dft.h:1596
void projectPreviousGroundStateRho()
project ground state electron density from previous mesh into the new mesh to be used as initial gues...
void aposterioriMeshGenerate()
dftfe::utils::MemoryStorage< dataTypes::number, dftfe::utils::MemorySpace::HOST > d_eigenVectorsDensityMatrixPrimeHost
Definition dft.h:1687
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > d_BLASWrapperPtrHost
Definition dft.h:1536
void recomputeKPointCoordinates()
std::vector< std::vector< double > > d_meshSizes
Definition dft.h:1323
double totalCharge(const dealii::DoFHandler< 3 > &dofHandlerOfField, const distributedCPUVec< double > &rhoNodalField)
Computes total charge by integrating the electron-density.
std::map< dealii::CellId, std::vector< double > > d_gradRhoAtomsValues
Definition dft.h:1764
void initNoRemesh(const bool updateImagesAndKPointsAndVselfBins=true, const bool checkSmearedChargeWidthsForOverlap=true, const bool useSingleAtomSolutionOverride=false, const bool isMeshDeformed=false)
Does KSDFT problem pre-processing steps but without remeshing.
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_densityResidualQuadValues
Definition dft.h:1714
void interpolateDensityNodalDataToQuadratureDataLpsp(const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const unsigned int dofHandlerId, const unsigned int quadratureId, const distributedCPUVec< double > &nodalField, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureValueData, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureGradValueData, const bool isEvaluateGradData)
interpolate rho nodal data to quadrature data using FEEvaluation
std::deque< distributedCPUVec< double > > d_fvSpin1containerVals
Definition dft.h:1755
std::vector< int > d_imageIds
Definition dft.h:1374
double fermiEnergy
fermi energy
Definition dft.h:1862
dftParameters & getParametersObject() const
Get reference to dftParameters object.
std::vector< double > d_netFloatingDispSinceLastCheckForSmearedChargeOverlaps
Definition dft.h:1337
double computeTraceXtKX(unsigned int numberWaveFunctionsEstimate)
std::vector< double > d_netFloatingDispSinceLastBinsUpdate
Definition dft.h:1334
dealii::AffineConstraints< double > d_constraintsForHelmholtzRhoNodal
Definition dft.h:1649
unsigned int numLevels
Definition dft.h:1313
void initializeKohnShamDFTOperator(const bool initializeCublas=true)
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOST > d_constraintsRhoNodalInfo
Definition dft.h:1660
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_phiInQuadValues
Definition dft.h:1721
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_densityTotalInValuesLpspQuad
Definition dft.h:1735
dealii::MatrixFree< 3, double > matrix_free_data
Definition dft.h:1512
void applyMultipoleDirichletBC(const dealii::DoFHandler< 3 > &_dofHandler, const dealii::AffineConstraints< double > &onlyHangingNodeConstraints, dealii::AffineConstraints< double > &constraintMatrix)
Sets inhomegeneous dirichlet boundary conditions upto quadrupole for total potential constraints on n...
void compute_fermienergy(const std::vector< std::vector< double > > &eigenValuesInput, const double numElectronsInput)
Computes Fermi-energy obtained by imposing constraint on the number of electrons.
unsigned int d_lpspQuadratureId
Definition dft.h:1499
const double d_pspCutOffTrunc
distance from the domain till which periodic images will be considered
Definition dft.h:1408
double getInternalEnergy() const
double numElectronsDown
Definition dft.h:1314
chebyshevOrthogonalizedSubspaceIterationSolver * getSubspaceIterationSolverHost()
Get the Ptr to Chebyshev solver in host.
std::vector< std::vector< double > > d_partialOccupancies
Definition dft.h:1666
std::map< unsigned int, std::map< dealii::CellId, std::vector< double > > > d_hessianRhoAtomsValuesSeparate
Definition dft.h:1767
dealii::AffineConstraints< double > d_noConstraints
Definition dft.h:1643
meshMovementGaussianClass d_gaussianMovePar
meshMovementGaussianClass object
Definition dft.h:1472
unsigned int d_nlpspQuadratureId
Definition dft.h:1498
std::map< dealii::CellId, std::vector< double > > d_pseudoVLoc
Definition dft.h:1793
dftfe::utils::MemoryStorage< dataTypes::number, dftfe::utils::MemorySpace::HOST > d_eigenVectorsFlattenedHost
Definition dft.h:1683
unsigned int getDensityQuadratureId()
dataTypes::number computeTraceXtHX(unsigned int numberWaveFunctionsEstimate)
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > getBLASWrapperHost()
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradPhiInQuadValues
Definition dft.h:1723
void initElectronicFields()
void compute_fermienergy_purestate(const std::vector< std::vector< double > > &eigenValuesInput, const double numElectronsInput)
find HOMO eigenvalue for pure state
dealii::AffineConstraints< double > d_constraintsForTotalPotentialElectro
Definition dft.h:1645
dispersionCorrection d_dispersionCorr
Definition dft.h:1308
void reInitializeKohnShamDFTOperator()
std::vector< std::vector< double > > d_atomLocationsInterestPseudopotential
Definition dft.h:1324
std::vector< std::vector< double > > d_imagePositionsAutoMesh
Definition dft.h:1328
dealii::TimerOutput computingTimerStandard
Definition dft.h:1704
meshMovementAffineTransform d_affineTransformMesh
affine transformation object
Definition dft.h:1469
std::map< unsigned int, std::map< dealii::CellId, std::vector< double > > > d_pseudoVLocAtoms
Definition dft.h:1798
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_gradDensityInQuadValues
Definition dft.h:1771
elpaScalaManager * d_elpaScala
Definition dft.h:1583
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_densityInQuadValues
Definition dft.h:1713
unsigned int d_numEigenValues
Number of Kohn-Sham eigen values to be computed.
Definition dft.h:293
std::map< dealii::CellId, std::vector< double > > d_rhoCore
Definition dft.h:1805
distributedCPUVec< double > d_phiPrime
Definition dft.h:1785
unsigned int d_forceDofHandlerIndexElectro
Definition dft.h:1496
void resetRhoNodalIn(distributedCPUVec< double > &OutDensity)
bool scfConverged
Definition dft.h:1891
distributedCPUVec< double > d_rhoOutNodalValuesDistributed
Definition dft.h:1728
const std::vector< std::vector< double > > & getAtomLocationsFrac() const
Gets the current atom Locations in fractional form from dftClass (only applicable for periodic and se...
const dftfe::utils::MemoryStorage< dataTypes::number, memorySpace > & getEigenVectors() const
Get reference the memorySpace templated eigen vectors.
std::map< unsigned int, std::map< unsigned int, std::map< unsigned int, double > > > outerValues
Definition dft.h:1457
const std::vector< std::vector< double > > & getImageAtomLocationsCart() const
Gets the current image atom Locations in cartesian form (origin at center of domain) from dftClass.
void l2ProjectionQuadToNodal(const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const dealii::AffineConstraints< double > &constraintMatrix, const unsigned int dofHandlerId, const unsigned int quadratureId, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureValueData, distributedCPUVec< double > &nodalField)
l2 projection
const dealii::AffineConstraints< double > * getConstraintsVectorElectro()
double computeResidualQuadData(const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &outValues, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &inValues, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &residualValues, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &JxW, const bool computeNorm)
Copies the residual residualValues=outValues-inValues.
const std::set< unsigned int > & getAtomTypes() const
Gets the current atom types from dftClass.
void computeRhoNodalFirstOrderResponseFromPSIAndPSIPrime(distributedCPUVec< double > &fv, distributedCPUVec< double > &fvSpin0, distributedCPUVec< double > &fvSpin1)
void computeRhoNodalMassVector(dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &massVec)
Computes the diagonal mass matrix for rho nodal grid, used for nodal mixing.
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_densityTotalOutValuesLpspQuad
Definition dft.h:1735
void determineOrbitalFilling()
distributedCPUVec< double > d_phiTotRhoIn
Definition dft.h:1776
unsigned int getElectroDofHandlerIndex() const
std::vector< dealii::Point< 3 > > d_controlPointLocationsCurrentMove
Definition dft.h:1476
unsigned int d_lpspQuadratureIdElectro
Definition dft.h:1501
void computeOutputDensityDirectionalDerivative(const distributedCPUVec< double > &v, const distributedCPUVec< double > &vSpin0, const distributedCPUVec< double > &vSpin1, distributedCPUVec< double > &fv, distributedCPUVec< double > &fvSpin0, distributedCPUVec< double > &fvSpin1)
dealii::AffineConstraints< double > constraintsNoneEigen
Definition dft.h:1642
std::vector< double > d_generatorFlatTopWidths
composite generator flat top widths for all domain atoms
Definition dft.h:1351
const dealii::MatrixFree< 3, double > & getMatrixFreeData() const
Get matrix free data object.
const std::vector< dealii::types::global_dof_index > & getLocalDofIndicesImag() const
Get local dofs global indices imag.
std::vector< std::vector< double > > eigenValues
Definition dft.h:1665
void compute_fermienergy_constraintMagnetization(const std::vector< std::vector< double > > &eigenValuesInput)
Computes Fermi-energy obtained by imposing separate constraints on the number of spin-up and spin-dow...
std::vector< dealii::Tensor< 1, 3, double > > d_gaussianMovementAtomsNetDisplacements
Definition dft.h:1475
void determineAtomsOfInterstPseudopotential(const std::vector< std::vector< double > > &atomCoordinates)
void init()
Does KSDFT problem pre-processing steps including mesh generation calls.
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > & getDensityOutValues()
void outputWfc(const std::string outputFileName="wfcOutput")
write wavefunction solution fields
std::vector< std::vector< double > > d_reciprocalLatticeVectors
Definition dft.h:1323
void compute_ldos(const std::vector< std::vector< double > > &eigenValuesInput, const std::string &fileName)
double d_minDist
Definition dft.h:1370
std::vector< std::vector< int > > d_globalChargeIdToImageIdMap
globalChargeId to ImageChargeId Map
Definition dft.h:1387
std::vector< dealii::types::global_dof_index > localProc_dof_indicesReal
Definition dft.h:1576
distributedCPUVec< double > d_tempEigenVec
Definition dft.h:1883
forceClass< FEOrder, FEOrderElectro, memorySpace > * forcePtr
Definition dft.h:1580
void writeBands()
write the KS eigen values for given BZ sampling/path
bool d_tolReached
Definition dft.h:1760
void normalizeRhoOutQuadValues()
normalize the output total electron density in each scf
void moveMeshToAtoms(dealii::Triangulation< 3, 3 > &triangulationMove, dealii::Triangulation< 3, 3 > &triangulationSerial, bool reuseFlag=false, bool moveSubdivided=false)
moves the triangulation vertices using Gaussians such that the all atoms are on triangulation vertice...
double d_pspCutOff
distance from the domain till which periodic images will be considered
Definition dft.h:1405
double getCellVolume() const
Gets the current cell volume.
void loadTriaInfoAndRhoNodalData()
load triangulation information rho quadrature data from checkpoint file for restarted run
std::vector< distributedCPUVec< double > > d_vselfFieldGateauxDerStrainFDBins
Definition dft.h:1828
std::deque< distributedCPUVec< double > > d_fvSpin0containerVals
Definition dft.h:1753
unsigned int d_autoMesh
Definition dft.h:1465
virtual void writeGSElectronDensity(const std::string Path) const
writes quadrature grid information and associated spin-up and spin-down electron-density for post-pro...
std::map< dealii::CellId, std::vector< int > > d_bQuadAtomIdsAllAtomsImages
Definition dft.h:1425
const MPI_Comm & getMPIDomain() const override
const expConfiningPotential & getConfiningPotential() const
const std::vector< dealii::types::global_dof_index > & getLocalProcDofIndicesImag() const
Get local dofs local proc indices imag.
dealii::IndexSet locally_relevant_dofsEigen
Definition dft.h:1572
dealii::IndexSet locally_relevant_dofs
Definition dft.h:1572
double computeMaximumHighestOccupiedStateResidualNorm(const std::vector< std::vector< double > > &residualNormWaveFunctionsAllkPoints, const std::vector< std::vector< double > > &eigenValuesAllkPoints, const double _fermiEnergy)
compute the maximum of the residual norm of the highest occupied state among all k points
unsigned int d_helmholtzDofHandlerIndexElectro
Definition dft.h:1506
unsigned int d_binsStartDofHandlerIndexElectro
Definition dft.h:1507
void initPseudoPotentialAll(const bool updateNonlocalSparsity=true)
void computeRhoNodalFromPSI()
computes density nodal data from wavefunctions
const unsigned int this_mpi_process
Definition dft.h:1570
std::map< dealii::CellId, std::vector< int > > d_bQuadAtomIdsAllAtoms
non-intersecting smeared charges atom ids of all atoms at quad points
Definition dft.h:1421
std::map< unsigned int, std::map< unsigned int, std::map< unsigned int, alglib::spline1dinterpolant > > > radValues
Definition dft.h:1454
std::set< unsigned int > atomTypes
Definition dft.h:1315
dftParameters * d_dftParamsPtr
dftParameters object
Definition dft.h:1836
std::deque< distributedCPUVec< double > > d_vSpin1containerVals
Definition dft.h:1754
double getTotalChargeforRhoSplit()
void kohnShamEigenSpaceComputeNSCF(const unsigned int spinType, const unsigned int kPointIndex, KohnShamHamiltonianOperator< dftfe::utils::MemorySpace::HOST > &kohnShamDFTEigenOperator, chebyshevOrthogonalizedSubspaceIterationSolver &subspaceIterationSolver, std::vector< double > &residualNormWaveFunctions, unsigned int ipass)
void interpolateElectroNodalDataToQuadratureDataGeneral(const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const unsigned int dofHandlerId, const unsigned int quadratureId, const distributedCPUVec< double > &nodalField, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureValueData, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureGradValueData, const bool isEvaluateGradData=false)
interpolate nodal data to quadrature data using FEEvaluation
MixingScheme d_mixingScheme
Definition dft.h:1724
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradDensityTotalOutValuesLpspQuad
Definition dft.h:1736
void updateAuxDensityXCMatrix(const std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > &densityQuadValues, const std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > &gradDensityQuadValues, const std::map< dealii::CellId, std::vector< double > > &rhoCore, const std::map< dealii::CellId, std::vector< double > > &gradRhoCore, const dftfe::utils::MemoryStorage< dataTypes::number, memorySpace > &eigenVectorsFlattenedMemSpace, const std::vector< std::vector< double > > &eigenValues, const double fermiEnergy_, const double fermiEnergyUp_, const double fermiEnergyDown_, std::shared_ptr< AuxDensityMatrix< memorySpace > > auxDensityMatrixXCPtr)
std::map< dealii::CellId, std::vector< double > > d_gradbQuadValuesAllAtoms
non-intersecting smeared charge gradients of all atoms at quad points
Definition dft.h:1418
std::vector< dealii::Tensor< 1, 3, double > > d_dispClosestTriaVerticesToAtoms
Definition dft.h:1849
std::shared_ptr< AuxDensityMatrix< memorySpace > > d_auxDensityMatrixXCOutPtr
Definition dft.h:1739
dealii::FESystem< 3 > FE
Definition dft.h:1487
std::vector< double > d_smearedChargeScaling
smeared charge normalization scaling for all domain atoms
Definition dft.h:1361
expConfiningPotential d_expConfiningPot
Definition dft.h:1956
std::vector< std::map< dealii::CellId, std::vector< unsigned int > > > d_bCellNonTrivialAtomIdsBins
Definition dft.h:1435
unsigned int d_gllQuadratureId
Definition dft.h:1502
void normalizeRhoMagInInitialGuessQuadValues()
normalize input mag electron density to total magnetization for use in constraint magnetization case ...
void set()
atomic system pre-processing steps.
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOST > constraintsNoneDataInfo
Definition dft.h:1633
double getNumElectrons() const
Get the number of electrons.
std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > d_basisOperationsPtrHost
Definition dft.h:1517
bool isHubbardCorrectionsUsed()
Function to check if hubbard corrections is being used.
KohnShamHamiltonianOperator< memorySpace > * getOperatorClass()
get the Ptr to the operator class ( Kohn Sham Operator)
dealii::DoFHandler< 3 > dofHandlerEigen
Definition dft.h:1488
unsigned int d_sparsityPatternQuadratureId
Definition dft.h:1510
std::vector< double > d_quadrupole
Definition dft.h:1744
Namespace which declares the input parameters and the functions to parse them from the input paramete...
Definition dftParameters.h:35
Overloads dealii's distribute and distribute_local_to_global functions associated with constraints cl...
Definition constraintMatrixInfo.h:43
Calculates dispersion correction to energy, force and stress.
Definition dftd.h:37
Manager class for ELPA and ScaLAPACK.
Definition elpaScalaManager.h:38
Definition expConfiningPotential.h:29
computes configurational forces in KSDFT
Definition force.h:52
poisson solver problem class template. template parameter FEOrderElectro is the finite element polyno...
Definition kerkerSolverProblem.h:35
Definition BLASWrapper.h:35
Class to move triangulation nodes using Gaussian functions attached to control points.
Definition meshMovementGaussian.h:30
poisson solver problem class template. template parameter FEOrderElectro is the finite element polyno...
Definition poissonSolverProblem.h:38
density symmetrization based on irreducible Brillouin zone calculation, only relevant for calculation...
Definition symmetry.h:41
This class generates and stores adaptive finite element meshes for the real-space dft problem.
Definition triangulationManager.h:42
Definition MemoryStorage.h:33
Categorizes atoms into bins for efficient solution of nuclear electrostatic self-potential....
Definition vselfBinsManager.h:36
Definition FEBasisOperations.h:30
double number
Definition dftfeDataTypes.h:44
MemorySpace
Definition MemorySpaceType.h:33
@ HOST
Definition MemorySpaceType.h:34
@ DEVICE
Definition MemorySpaceType.h:36
Definition pseudoPotentialToDftfeConverter.cc:34
dealii::LinearAlgebra::distributed::Vector< elem_type, dealii::MemorySpace::Host > distributedCPUVec
Definition headers.h:92
constexpr unsigned int C_rhoNodalPolyOrder()
rho nodal polynomial order
Definition constants.h:133