37#ifdef DFTFE_WITH_DEVICE
51#include <interpolation.h>
85#ifndef DOXYGEN_SHOULD_SKIP_THIS
93 alglib::spline1dinterpolant psi;
97 template <dftfe::utils::MemorySpace memory>
108 template <dftfe::utils::MemorySpace memorySpace>
129 const MPI_Comm &mpi_comm_domain,
132 const std::string &scratchFolderName,
162 const bool checkSmearedChargeWidthsForOverlap =
true,
163 const bool useSingleAtomSolutionOverride =
false,
164 const bool isMeshDeformed =
false);
201 std::tuple<bool, double>
202 solve(
const bool computeForces =
true,
203 const bool computestress =
true,
204 const bool restartGroundStateCalcFromChk =
false);
235 const bool computeNorm);
305 const std::vector<dealii::types::global_dof_index> &
311 const std::vector<dealii::types::global_dof_index> &
317 const std::vector<dealii::types::global_dof_index> &
323 const std::vector<dealii::types::global_dof_index> &
329 const dealii::MatrixFree<3, double> &
350 const std::vector<dealii::Tensor<1, 3, double>> &globalAtomsDisplacements,
351 const double maxJacobianRatioFactor = 1.25,
352 const bool useSingleAtomSolutionsOverride =
false);
395 const std::vector<std::vector<double>> &
401 const std::vector<double> &
408 const std::vector<std::vector<double>> &
414 const std::vector<dftfe::Int> &
421 const std::vector<std::vector<double>> &
432 const std::vector<std::vector<double>> &
445 const std::set<dftfe::uInt> &
451 const std::vector<double> &
457 const dealii::Tensor<2, 3, double> &
483 const std::vector<std::vector<double>> &
503#ifdef DFTFE_WITH_DEVICE
508 chebyshevOrthogonalizedSubspaceIterationSolverDevice *
509 getSubspaceIterationSolverDevice();
525 &kohnShamDFTEigenOperator,
528 std::vector<double> &residualNormWaveFunctions,
529 const bool computeResidual,
530 const bool useMixedPrec =
false,
531 const bool isFirstScf =
false);
534#ifdef DFTFE_WITH_DEVICE
543 &kohnShamDFTEigenOperator,
545 chebyshevOrthogonalizedSubspaceIterationSolverDevice
546 &subspaceIterationSolverDevice,
547 std::vector<double> &residualNormWaveFunctions,
548 const bool computeResidual,
549 const dftfe::uInt numberRayleighRitzAvoidancePasses = 0,
550 const bool useMixedPrec =
false,
551 const bool isFirstScf =
false);
559 const std::vector<std::vector<double>> &eigenValuesInput,
560 const double numElectronsInput);
567 const std::vector<std::vector<double>> &eigenValuesInput,
568 const double numElectronsInput);
576 &kineticEnergyDensityValues);
594 const std::vector<double> &
603 const dealii::MatrixFree<3, double> &
606 dealii::AffineConstraints<double> *
631 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
638 std::shared_ptr<dftfe::linearAlgebra::BLASWrapper<memorySpace>>
659 const std::shared_ptr<
661 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
663 const dealii::AffineConstraints<double> &constraintMatrix,
667 &quadratureValueData,
671 std::map<dealii::types::global_dof_index, double> &
675 std::map<dealii::CellId, std::vector<double>> &
681 const dealii::AffineConstraints<double> *
684 const std::vector<std::vector<double>> &
699 const std::map<dealii::CellId, std::vector<dftfe::uInt>> &
707 const std::shared_ptr<
709 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
714 const std::map<dealii::CellId, std::vector<double>> *bQuadValues);
722 std::shared_ptr<hubbard<dataTypes::number, memorySpace>>
735 outputWfc(
const std::string outputFileName =
"wfcOutput");
740 const std::map<dealii::CellId, std::vector<double>> &
760 const std::vector<std::vector<double>> &atomCoordinates);
802 const std::shared_ptr<
809 &quadratureValueData,
811 const std::string &fieldName,
812 const std::string &folderPath,
813 const MPI_Comm &mpi_comm_parent,
814 const MPI_Comm &mpi_comm_domain,
838 const std::shared_ptr<
845 &quadratureValueData,
847 const std::string &fieldName,
848 const std::string &folderPath,
849 const MPI_Comm &mpi_comm_parent,
850 const MPI_Comm &mpi_comm_domain,
862 std::vector<dftfe::Int> &imageIds,
863 std::vector<double> &imageCharges,
864 std::vector<std::vector<double>> &imagePositions);
868 const double pspCutOff,
869 const std::vector<dftfe::Int> &imageIds,
870 const std::vector<std::vector<double>> &imagePositions,
871 std::vector<std::vector<dftfe::Int>> &globalChargeIdToImageIdMap);
892 dealii::Triangulation<3, 3> &triangulationSerial,
893 bool reuseFlag =
false,
894 bool moveSubdivided =
false);
918 dealii::parallel::distributed::Triangulation<3> &triangulation);
921 const bool meshOnlyDeformed =
false,
922 const bool vselfPerturbationUpdateForStress =
false);
935 dealii::parallel::distributed::Triangulation<3> &triangulation);
938 const bool meshOnlyDeformed,
939 const bool vselfPerturbationUpdateForStress =
false);
952 const dealii::DoFHandler<3> &_dofHandler,
953 const dealii::AffineConstraints<double> &onlyHangingNodeConstraints,
954 dealii::AffineConstraints<double> &constraintMatrix);
964 &quadratureValueData,
966 &quadratureGradValueData,
967 const bool isConsiderGradData =
false);
979 std::map<dealii::types::global_dof_index, double>
980 &atomNodeIdToChargeValueMap);
996 const dealii::DoFHandler<3> &_dofHandler,
997 const dealii::AffineConstraints<double> &constraintMatrixBase,
998 dealii::AffineConstraints<double> &constraintMatrix);
1045 const dealii::DoFHandler<3> &_dofHandler,
1047 const dealii::MatrixFree<3, double> &_matrix_free_data,
1049 const dealii::AffineConstraints<double> &phiExtConstraintMatrix,
1050 const std::map<dealii::types::global_dof_index, dealii::Point<3>>
1054 std::map<dealii::CellId, std::vector<double>> &_pseudoValues,
1055 std::map<
dftfe::uInt, std::map<dealii::CellId, std::vector<double>>>
1056 &_pseudoValuesAtoms);
1070 const dealii::DoFHandler<3> &_dofHandler,
1071 const dealii::AffineConstraints<double> &onlyHangingNodeConstraints,
1072 dealii::AffineConstraints<double> &constraintMatrix);
1086 const dealii::DoFHandler<3> &dofHandlerOfField,
1087 const std::map<dealii::CellId, std::vector<double>> *rhoQuadValues);
1091 const dealii::DoFHandler<3> &dofHandlerOfField,
1097 totalCharge(
const dealii::MatrixFree<3, double> &matrixFreeDataObject,
1110 const dealii::MatrixFree<3, double> &matrixFreeDataObject,
1127 const std::shared_ptr<
1129 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
1130 &basisOperationsPtr,
1131 const dealii::AffineConstraints<double> &constraintMatrix,
1135 &quadratureValueData,
1184#ifdef DFTFE_WITH_DEVICE
1185 kerkerSolverProblemDeviceWrapperClass
1186 &kerkerPreconditionedResidualSolverProblemDevice,
1187 linearSolverCGDevice &CGSolverDevice,
1190 &kerkerPreconditionedResidualSolverProblem,
1205 const std::vector<std::vector<double>> &eigenValuesInput);
1213 const std::vector<std::vector<double>> &eigenValuesInput);
1221 const std::string &fileName);
1225 const std::string &fileName);
1257 const bool vselfPerturbationUpdateForStress =
false,
1258 const bool useSingleAtomSolutionsOverride =
false,
1259 const bool print =
true);
1267 std::complex<double>
1271 alphaTimesXPlusY(std::complex<double> alpha,
1292 &gradDensityQuadValues,
1296 const std::map<dealii::CellId, std::vector<double>> &rhoCore,
1297 const std::map<dealii::CellId, std::vector<double>> &gradRhoCore,
1299 &eigenVectorsFlattenedMemSpace,
1300 const std::vector<std::vector<double>> &
eigenValues,
1301 const double fermiEnergy_,
1302 const double fermiEnergyUp_,
1303 const double fermiEnergyDown_,
1324 std::map<dftfe::uInt, dftfe::uInt>
1424 std::map<dealii::CellId, std::vector<dftfe::Int>>
1433 std::vector<std::map<dealii::CellId, std::vector<dftfe::uInt>>>
1438 std::map<dealii::CellId, std::vector<dftfe::uInt>>
1443 std::vector<std::map<dealii::CellId, std::vector<dftfe::uInt>>>
1452 std::map<dftfe::uInt, std::map<dftfe::uInt, alglib::spline1dinterpolant>>>
1454 std::map<dftfe::uInt, std::map<dftfe::uInt, std::map<dftfe::uInt, double>>>
1472 std::vector<dealii::Tensor<1, 3, double>>
1519 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
1521#if defined(DFTFE_WITH_DEVICE)
1526 d_basisOperationsPtrDevice;
1529 FEBasisOperations<double, double, dftfe::utils::MemorySpace::DEVICE>>
1530 d_basisOperationsPtrElectroDevice;
1537 std::shared_ptr<dftfe::oncvClass<dataTypes::number, memorySpace>>
1545#if defined(DFTFE_WITH_DEVICE)
1555 std::vector<const dealii::AffineConstraints<double> *>
1562#if defined(DFTFE_WITH_DEVICE)
1563 utils::DeviceCCLWrapper *d_devicecclMpiCommDomainPtr;
1587#ifdef DFTFE_WITH_DEVICE
1588 poissonSolverProblemDeviceWrapperClass d_phiTotalSolverProblemDevice;
1590 poissonSolverProblemDeviceWrapperClass d_phiPrimeSolverProblemDevice;
1604#ifdef DFTFE_WITH_DEVICE
1605 chebyshevOrthogonalizedSubspaceIterationSolverDevice
1606 d_subspaceIterationSolverDevice;
1633#ifdef DFTFE_WITH_DEVICE
1635 d_constraintsNoneDataInfoDevice;
1687#ifdef DFTFE_WITH_DEVICE
1690 d_eigenVectorsFlattenedDevice;
1693 d_eigenVectorsDensityMatrixPrimeFlattenedDevice;
1767 std::map<dftfe::uInt, std::map<dealii::CellId, std::vector<double>>>
1799 std::map<dftfe::uInt, std::map<dealii::CellId, std::vector<double>>>
1811 std::map<dftfe::uInt, std::map<dealii::CellId, std::vector<double>>>
1816 std::map<dftfe::uInt, std::map<dealii::CellId, std::vector<double>>>
1904 const std::vector<std::vector<double>>
1905 &residualNormWaveFunctionsAllkPoints,
1906 const std::vector<std::vector<double>> &eigenValuesAllkPoints,
1907 const double _fermiEnergy,
1908 std::vector<double> &maxResidualsAllkPoints);
1916 const std::vector<std::vector<double>>
1917 &residualNormWaveFunctionsAllkPoints,
1918 const std::vector<std::vector<double>> &eigenValuesAllkPoints,
1920 std::vector<double> &maxResidualsAllkPoints);
1924#ifdef DFTFE_WITH_DEVICE
1930 &kohnShamDFTEigenOperator,
1932 chebyshevOrthogonalizedSubspaceIterationSolverDevice
1933 &subspaceIterationSolverDevice);
1942 &kohnShamDFTEigenOperator,
Definition AuxDensityMatrix.h:40
Definition KohnShamDFTBaseOperator.h:36
This class performs the anderson mixing in a variable agnostic way This class takes can take differen...
Definition mixingClass.h:50
Definition atomCenteredPostProcessing.h:30
Definition FEBasisOperations.h:85
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
dftfe::uInt getElectroQuadratureRhsId() const
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...
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_phiOutQuadValues
Definition dft.h:1722
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.
std::vector< std::vector< double > > d_atomLocationsAutoMesh
Definition dft.h:1326
void compute_fermienergy_purestate(const std::vector< std::vector< double > > &eigenValuesInput, const double numElectronsInput)
find HOMO eigenvalue for pure state
dftfe::uInt d_phiPrimeDofHandlerIndexElectro
Definition dft.h:1502
std::shared_ptr< excManager< memorySpace > > d_excManagerPtr
Definition dft.h:1306
dftfe::uInt d_feOrderPlusOneQuadratureId
Definition dft.h:1498
dealii::AffineConstraints< double > d_constraintsForPhiPrimeElectro
Definition dft.h:1644
std::vector< std::vector< double > > d_meshSizes
Definition dft.h:1322
const std::vector< std::vector< double > > & getCell() const
Gets the current cell lattice vectors.
dealii::DoFHandler< 3 > d_dofHandlerRhoNodal
Definition dft.h:1487
std::vector< std::vector< dftfe::Int > > d_globalChargeIdToImageIdMapTrunc
globalChargeId to ImageChargeId Map generated with a truncated pspCutOff
Definition dft.h:1401
std::vector< double > d_kPointWeights
k point weights
Definition dft.h:1847
std::map< dealii::CellId, std::vector< double > > d_rhoAtomsValues
for xl-bomd
Definition dft.h:1765
void computeOutputDensityDirectionalDerivative(distributedCPUVec< double > &v, distributedCPUVec< double > &vSpin0, distributedCPUVec< double > &vSpin1, distributedCPUVec< double > &fv, distributedCPUVec< double > &fvSpin0, distributedCPUVec< double > &fvSpin1)
std::map< dealii::CellId, std::vector< dftfe::uInt > > d_bCellNonTrivialAtomImageIds
Definition dft.h:1439
std::vector< orbital > waveFunctionsVector
Definition dft.h:1449
void kohnShamEigenSpaceFirstOrderDensityMatResponse(const dftfe::uInt s, const dftfe::uInt kPointIndex, KohnShamDFTBaseOperator< dftfe::utils::MemorySpace::HOST > &kohnShamDFTEigenOperator, elpaScalaManager &elpaScala)
bool scfConverged
Definition dft.h:1893
std::vector< distributedCPUVec< double > > d_densityInNodalValues
Definition dft.h:1712
void computeRhoNodalFirstOrderResponseFromPSIAndPSIPrime(distributedCPUVec< double > &fv, distributedCPUVec< double > &fvSpin0, distributedCPUVec< double > &fvSpin1)
std::vector< std::vector< double > > d_localVselfs
Definition dft.h:1803
std::vector< const dealii::AffineConstraints< double > * > d_constraintsVectorElectro
Definition dft.h:1556
void saveTriaInfoAndRhoNodalData()
save triangulation information and rho quadrature data to checkpoint file for restarts
dealii::AffineConstraints< double > d_constraintsPRefinedOnlyHanging
Definition dft.h:1650
const std::vector< std::vector< double > > & getLocalVselfs() const
std::vector< std::vector< double > > d_imagePositionsTrunc
Definition dft.h:1398
std::vector< double > d_upperBoundUnwantedSpectrumValues
Definition dft.h:1883
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > d_BLASWrapperPtr
Definition dft.h:1550
const MPI_Comm & getMPIParent() const override
std::vector< dealii::Tensor< 1, 3, double > > d_gaussianMovementAtomsNetDisplacements
Definition dft.h:1473
distributedCPUVec< double > d_residualPredicted
Definition dft.h:1757
dftfe::uInt d_phiTotDofHandlerIndexElectro
Definition dft.h:1501
std::deque< distributedCPUVec< double > > d_fvcontainerVals
Definition dft.h:1752
dealii::AffineConstraints< double > constraintsNoneEigen
Definition dft.h:1639
double d_pspCutOff
distance from the domain till which periodic images will be considered
Definition dft.h:1404
void compute_localizationLength(const std::string &locLengthFileName)
compute localization length
dealii::IndexSet d_locallyRelevantDofsRhoNodal
Definition dft.h:1572
void generateImageCharges(const double pspCutOff, std::vector< dftfe::Int > &imageIds, std::vector< double > &imageCharges, std::vector< std::vector< double > > &imagePositions)
creates datastructures related to periodic image charges
dftfe::uInt d_baseDofHandlerIndexElectro
Definition dft.h:1493
std::vector< double > d_nearestAtomDistances
nearest atom distances for all domain atoms
Definition dft.h:1366
bool isHubbardCorrectionsUsed()
Function to check if hubbard corrections is being used.
dealii::IndexSet locally_relevant_dofs
Definition dft.h:1571
const dealii::MatrixFree< 3, double > & getMatrixFreeData() const
Get matrix free data object.
void updatePRefinedConstraints()
void initHubbardOperator()
Checks if the Exc functional requires Hubbard correction and sets up the Hubbard class if required.
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...
void determineOrbitalFilling()
const MPI_Comm & getMPIDomain() const override
dftfe::uInt getSmearedChargeQuadratureIdElectro()
std::set< dftfe::uInt > atomTypes
Definition dft.h:1314
forceClass< memorySpace > * forcePtr
Definition dft.h:1579
std::deque< distributedCPUVec< double > > d_vcontainerVals
for low rank jacobian inverse approximation
Definition dft.h:1751
std::shared_ptr< dftfe::groupSymmetryClass > groupSymmetryPtr
Definition dft.h:1580
void noRemeshRhoDataInit()
double numElectronsUp
Definition dft.h:1313
std::shared_ptr< dftfe::atomCenteredOrbitalsPostProcessing< dataTypes::number, memorySpace > > d_atomCenteredOrbitalsPostProcessingPtr
Definition dft.h:1542
double d_entropicEnergy
entropic energy
Definition dft.h:1871
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradPhiInQuadValues
Definition dft.h:1724
void aposterioriMeshGenerate()
double numElectronsDown
Definition dft.h:1313
const double d_smearedChargeWidthMin
minimum smeared charge width
Definition dft.h:1447
dispersionCorrection d_dispersionCorr
Definition dft.h:1307
void initializeKohnShamDFTOperator(const bool initializeCublas=true)
void computeVselfFieldGateauxDerFD()
const std::string d_dftfeScratchFolderName
Definition dft.h:1597
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradDensityTotalInValuesLpspQuad
Definition dft.h:1737
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradPhiOutQuadValues
Definition dft.h:1724
std::vector< double > d_smearedChargeMoments
Definition dft.h:1746
void kohnShamEigenSpaceCompute(const dftfe::uInt s, const dftfe::uInt kPointIndex, KohnShamDFTBaseOperator< 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.
dealii::AffineConstraints< double > d_constraintsForTotalPotentialElectro
Definition dft.h:1642
std::shared_ptr< AuxDensityMatrix< memorySpace > > d_auxDensityMatrixXCInPtr
Definition dft.h:1739
void writeDomainAndAtomCoordinates(const std::string Path) const
writes the current domain bounding vectors and atom coordinates to files for structural optimization ...
double d_freeEnergyInitial
Definition dft.h:1866
void createMasterChargeIdToImageIdMaps(const double pspCutOff, const std::vector< dftfe::Int > &imageIds, const std::vector< std::vector< double > > &imagePositions, std::vector< std::vector< dftfe::Int > > &globalChargeIdToImageIdMap)
double totalCharge(const dealii::DoFHandler< 3 > &dofHandlerOfField, const std::map< dealii::CellId, std::vector< double > > *rhoQuadValues)
std::vector< double > d_smearedChargeWidths
smeared charge widths for all domain atoms
Definition dft.h:1357
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOST > constraintsNoneEigenDataInfo
Definition dft.h:1620
double computeMaximumHighestOccupiedStateResidualNorm(const std::vector< std::vector< double > > &residualNormWaveFunctionsAllkPoints, const std::vector< std::vector< double > > &eigenValuesAllkPoints, const dftfe::uInt highestState, std::vector< double > &maxResidualsAllkPoints)
compute the maximum of the residual norm of the highest state of interest among all k points
dealii::IndexSet locally_owned_dofsEigen
Definition dft.h:1570
std::vector< double > d_gaussianConstantsAutoMesh
Definition dft.h:1347
dftParameters * d_dftParamsPtr
dftParameters object
Definition dft.h:1838
double totalCharge(const dealii::MatrixFree< 3, double > &matrixFreeDataObject, const distributedCPUVec< double > &rhoNodalField)
void compute_rhoOut(const bool isGroundState=false)
Computes output electron-density from wavefunctions.
std::vector< std::vector< dftfe::Int > > d_globalChargeIdToImageIdMap
globalChargeId to ImageChargeId Map
Definition dft.h:1386
std::vector< double > d_flatTopWidthsAutoMeshMove
Definition dft.h:1354
void run()
FIXME: legacy call, move to main.cc.
std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > d_gradRhoAtomsValuesSeparate
Definition dft.h:1768
dealii::TimerOutput computing_timer
compute-time logger
Definition dft.h:1700
distributedCPUVec< double > d_preCondTotalDensityResidualVector
Definition dft.h:1728
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > getBLASWrapperHost()
const distributedCPUVec< double > & getRhoNodalSplitOut() const
void writeBands()
write the KS eigen values for given BZ sampling/path
void projectPreviousGroundStateRho()
project ground state electron density from previous mesh into the new mesh to be used as initial gues...
distributedCPUVec< double > d_rhoOutNodalValuesSplit
Definition dft.h:1727
void loadDensityFromQuadratureValues()
std::map< dealii::CellId, std::vector< double > > d_bQuadValuesAllAtoms
non-intersecting smeared charges of all atoms at quad points
Definition dft.h:1414
double computeMaximumHighestOccupiedStateResidualNorm(const std::vector< std::vector< double > > &residualNormWaveFunctionsAllkPoints, const std::vector< std::vector< double > > &eigenValuesAllkPoints, const double _fermiEnergy, std::vector< double > &maxResidualsAllkPoints)
compute the maximum of the residual norm of the highest occupied state among all k points
void writeMesh()
Writes inital density and mesh to file.
std::map< dealii::CellId, std::vector< double > > & getBQuadValuesAllAtoms()
non-intersecting smeared charges of all atoms at quad points
const std::vector< dealii::types::global_dof_index > & getLocalDofIndicesImag() const
Get local dofs global indices imag.
distributedCPUVec< double > d_rhoOutNodalValuesDistributed
Definition dft.h:1729
std::shared_ptr< AuxDensityMatrix< memorySpace > > d_auxDensityMatrixXCOutPtr
Definition dft.h:1740
std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > d_hessianRhoAtomsValuesSeparate
Definition dft.h:1769
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOST > constraintsNoneDataInfo
Definition dft.h:1630
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > & getDensityOutValues()
distributedCPUVec< double > d_rhoInNodalValuesRead
Definition dft.h:1727
std::map< dftfe::uInt, dftfe::uInt > d_atomTypeAtributes
Definition dft.h:1318
void writeMesh(std::string meshFileName)
void resetRhoNodalIn(distributedCPUVec< double > &OutDensity)
dealii::IndexSet locally_owned_dofs
Definition dft.h:1570
std::vector< dealii::Tensor< 1, 3, double > > d_dispClosestTriaVerticesToAtoms
Definition dft.h:1851
std::map< dftfe::uInt, std::map< dftfe::uInt, std::map< dftfe::uInt, double > > > outerValues
Definition dft.h:1455
std::deque< distributedCPUVec< double > > d_fvSpin1containerVals
Definition dft.h:1756
std::shared_ptr< dftfe::oncvClass< dataTypes::number, memorySpace > > d_oncvClassPtr
Definition dft.h:1538
const MPI_Comm & getMPIInterBand() const override
const distributedCPUVec< double > & getRhoNodalOut() const
std::map< dealii::CellId, std::vector< dftfe::Int > > d_bQuadAtomIdsAllAtomsImages
Definition dft.h:1425
double computeAndPrintKE(dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &kineticEnergyDensityValues)
Computes the kinetic energy.
double d_autoMeshMaxJacobianRatio
Definition dft.h:1462
std::map< dealii::CellId, std::vector< double > > d_hessianRhoCore
Definition dft.h:1814
elpaScalaManager * d_elpaScala
Definition dft.h:1582
void totalMagnetization(const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &magQuadValues)
Computes net magnetization from the difference of local spin densities.
double d_monopole
Definition dft.h:1743
dftfe::uInt d_kerkerAXQuadratureIdElectro
Definition dft.h:1504
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_densityInQuadValues
Definition dft.h:1710
std::map< dealii::CellId, std::vector< double > > d_gradRhoCore
Definition dft.h:1809
void createpRefinedDofHandler(dealii::parallel::distributed::Triangulation< 3 > &triangulation)
double numElectrons
Definition dft.h:1313
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.
dataTypes::number computeTraceXtHX(dftfe::uInt numberWaveFunctionsEstimate)
bool d_smearedChargeMomentsComputed
Definition dft.h:1747
distributedCPUVec< double > d_rhoNodalFieldRefined
Definition dft.h:1728
bool d_tolReached
Definition dft.h:1761
chebyshevOrthogonalizedSubspaceIterationSolver d_subspaceIterationSolver
Definition dft.h:1603
const MPI_Comm mpi_communicator
Definition dft.h:1561
std::vector< dealii::types::global_dof_index > local_dof_indicesImag
Definition dft.h:1574
std::vector< std::vector< double > > d_domainBoundingVectors
Definition dft.h:1322
dftfe::utils::MemoryStorage< dataTypes::number, dftfe::utils::MemorySpace::HOST > d_eigenVectorsDensityMatrixPrimeHost
Definition dft.h:1684
std::vector< double > d_imageCharges
Definition dft.h:1379
void l2ProjectionQuadToNodal(const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const dealii::AffineConstraints< double > &constraintMatrix, const dftfe::uInt dofHandlerId, const dftfe::uInt quadratureId, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureValueData, distributedCPUVec< double > &nodalField)
l2 projection
const dftfe::utils::MemoryStorage< dataTypes::number, dftfe::utils::MemorySpace::HOST > & getEigenVectorsHost() const
Get reference the host eigen vectors.
dftfe::uInt getDensityQuadratureId()
dealii::IndexSet d_locallyRelevantDofsPRefined
Definition dft.h:1572
std::deque< distributedCPUVec< double > > d_vSpin1containerVals
Definition dft.h:1755
std::map< dealii::CellId, std::vector< dftfe::Int > > d_bQuadAtomIdsAllAtoms
non-intersecting smeared charges atom ids of all atoms at quad points
Definition dft.h:1420
void computeRhoNodalFromPSI()
computes density nodal data from wavefunctions
dftfe::uInt d_nOMPThreads
Definition dft.h:1510
distributedCPUVec< double > d_magInNodalValuesRead
Definition dft.h:1732
std::vector< dftfe::Int > d_imageIds
Definition dft.h:1373
std::map< dealii::CellId, std::vector< double > > d_hessianRhoAtomsValues
Definition dft.h:1766
dealii::DoFHandler< 3 > dofHandler
Definition dft.h:1486
dealii::ConditionalOStream pcout
device eigenvectors
Definition dft.h:1697
std::vector< dftfe::uInt > d_nearestAtomIds
nearest atom ids for all domain atoms
Definition dft.h:1363
dftfe::uInt d_gllQuadratureId
Definition dft.h:1500
std::vector< std::vector< double > > d_densityMatDerFermiEnergy
Definition dft.h:1670
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_densityOutQuadValues
Definition dft.h:1710
std::vector< dealii::Point< 3 > > d_controlPointLocationsCurrentMove
Definition dft.h:1474
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_tauResidualQuadValues
Definition dft.h:1717
std::vector< double > d_smearedChargeScaling
smeared charge normalization scaling for all domain atoms
Definition dft.h:1360
dftfe::uInt getElectroQuadratureAxId() const
std::map< dealii::CellId, std::vector< double > > d_gradbQuadValuesAllAtoms
non-intersecting smeared charge gradients of all atoms at quad points
Definition dft.h:1417
void compute_fermienergy_constraintMagnetization_purestate(const std::vector< std::vector< double > > &eigenValuesInput)
Find spin-up and spin-down channel HOMO eigenvalues.
std::map< dealii::types::global_dof_index, dealii::Point< 3 > > d_supportPoints
Definition dft.h:1552
double getInternalEnergy() const
std::vector< distributedCPUVec< double > > d_densityResidualNodalValues
Definition dft.h:1713
std::map< dealii::CellId, std::vector< double > > d_pseudoVLoc
Definition dft.h:1795
void setNumElectrons(dftfe::uInt inputNumElectrons)
void applyKerkerPreconditionerToTotalDensityResidual(kerkerSolverProblemWrapperClass &kerkerPreconditionedResidualSolverProblem, dealiiLinearSolver &CGSolver, distributedCPUVec< double > &residualRho, distributedCPUVec< double > &preCondTotalDensityResidualVector)
Mixing schemes for mixing electron-density.
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.
dftfe::uInt d_autoMesh
Definition dft.h:1463
void loadQuadratureData(const std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const dftfe::uInt quadratureId, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureValueData, const dftfe::uInt fieldDimension, const std::string &fieldName, const std::string &folderPath, const MPI_Comm &mpi_comm_parent, const MPI_Comm &mpi_comm_domain, const MPI_Comm &interpoolcomm, const MPI_Comm &interBandGroupComm)
loads data from quad points of checkpoint file. Used for restart calculations, nscf and bands.
std::vector< bool > d_isFirstFilteringCall
Definition dft.h:1881
std::map< dealii::types::global_dof_index, dealii::Point< 3 > > d_supportPointsPRefined
Definition dft.h:1553
dealii::AffineConstraints< double > * getDensityConstraint()
std::vector< dftfe::Int > d_imageIdsTrunc
Definition dft.h:1390
const MPI_Comm interBandGroupComm
Definition dft.h:1567
const std::vector< std::vector< double > > & getImageAtomLocationsCart() const
Gets the current image atom Locations in cartesian form (origin at center of domain) from dftClass.
double d_wfcInitTruncation
init wfc trunctation radius
Definition dft.h:1480
dftfe::uInt d_densityQuadratureIdElectro
Definition dft.h:1508
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::vector< double > d_kPointCoordinatesFrac
k point crystal coordinates
Definition dft.h:1844
void applyPeriodicBCHigherOrderNodes()
Computes inner Product and Y = alpha*X + Y for complex vectors used during periodic boundary conditio...
double getCellVolume() const
Gets the current cell volume.
std::vector< double > d_quadrupole
Definition dft.h:1745
double rhofieldInnerProduct(const dealii::MatrixFree< 3, double > &matrixFreeDataObject, const distributedCPUVec< double > &rhoNodalField1, const distributedCPUVec< double > &rhoNodalField2, const dftfe::uInt dofHandlerId, const dftfe::uInt quadratureId)
void reInitializeKohnShamDFTOperator()
void initUnmovedTriangulation(dealii::parallel::distributed::Triangulation< 3 > &triangulation)
dealii::AffineConstraints< double > d_noConstraints
Definition dft.h:1640
distributedCPUVec< double > d_phiExt
Definition dft.h:1790
std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > getBasisOperationsHost()
std::vector< std::vector< double > > d_imagePositionsAutoMesh
Definition dft.h:1327
double fermiEnergy
fermi energy
Definition dft.h:1864
const dealii::MatrixFree< 3, double > & getMatrixFreeDataElectro() const
virtual void writeGSElectronDensity(const std::string Path) const
writes quadrature grid information and associated spin-up and spin-down electron-density for post-pro...
const dealii::AffineConstraints< double > * getConstraintsVectorElectro()
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...
const MPI_Comm & getMPIInterPool() const override
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_tauInQuadValues
Definition dft.h:1717
const std::vector< dealii::types::global_dof_index > & getLocalDofIndicesReal() const
Get local dofs global indices real.
std::vector< distributedCPUVec< double > > d_tauOutNodalValues
Definition dft.h:1714
void initpRefinedObjects(const bool recomputeBasisData, const bool meshOnlyDeformed, const bool vselfPerturbationUpdateForStress=false)
dftfe::uInt d_binsStartDofHandlerIndexElectro
Definition dft.h:1506
std::vector< dealii::Tensor< 1, 3, double > > d_atomsDisplacementsGaussianRead
Gaussian displacements of atoms read from file.
Definition dft.h:1330
std::vector< double > bLow
Definition dft.h:1877
const MPI_Comm d_mpiCommParent
Definition dft.h:1565
std::vector< bool > selectedDofsHanging
Definition dft.h:1577
std::shared_ptr< hubbard< dataTypes::number, memorySpace > > getHubbardClassPtr()
Returns the shared ptr to hubbard class.
std::map< dealii::types::global_dof_index, dealii::Point< 3 > > d_supportPointsEigen
Definition dft.h:1553
std::vector< std::vector< double > > eigenValues
Definition dft.h:1662
void writeStructureEnergyForcesDataPostProcess(const std::string Path) const
writes atomistics data for subsequent post-processing. Related to WRITE STRUCTURE ENERGY FORCES DATA ...
const std::vector< dftfe::Int > & getImageAtomIDs() const
Gets the current image atom ids from dftClass.
std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > getBasisOperationsElectroHost()
std::vector< std::vector< double > > d_atomLocationsInterestPseudopotential
Definition dft.h:1323
distributedCPUVec< double > d_phiPrime
Definition dft.h:1787
dftfe::uInt getNumEigenValues() const
double lowrankApproxScfDielectricMatrixInv(const dftfe::uInt scfIter)
dealii::IndexSet locally_relevant_dofsEigen
Definition dft.h:1571
void computeRhoInitialGuessFromPSI(std::vector< std::vector< distributedCPUVec< double > > > eigenVectors)
dftfe::uInt d_forceDofHandlerIndex
Definition dft.h:1489
dftfe::uInt d_forceDofHandlerIndexElectro
Definition dft.h:1494
const dftfe::utils::MemoryStorage< dataTypes::number, memorySpace > & getEigenVectors() const
Get reference the memorySpace templated eigen vectors.
void compute_tdos(const std::vector< std::vector< double > > &eigenValuesInput, const std::string &fileName)
compute density of states and local density of states
std::map< dftfe::uInt, std::map< dftfe::uInt, std::map< dftfe::uInt, alglib::spline1dinterpolant > > > radValues
Definition dft.h:1453
double getFermiEnergy() const
Get the value of fermi energy.
dftfe::uInt d_nonAtomicWaveFunctions
Number of random wavefunctions.
Definition dft.h:297
dftfe::uInt d_rankCurrentLRD
Definition dft.h:1758
dftfe::uInt numLevels
Definition dft.h:1312
void writeDomainAndAtomCoordinates()
writes the current domain bounding vectors and atom coordinates to files, which are required for geom...
double d_freeEnergy
Definition dft.h:1868
dealii::DoFHandler< 3 > d_dofHandlerPRefined
Definition dft.h:1486
void set()
atomic system pre-processing steps.
triangulationManager * getTriangulationManager()
void saveQuadratureData(const std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const dftfe::uInt quadratureId, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureValueData, const dftfe::uInt fieldDimension, const std::string &fieldName, const std::string &folderPath, const MPI_Comm &mpi_comm_parent, const MPI_Comm &mpi_comm_domain, const MPI_Comm &interpoolcomm, const MPI_Comm &interBandGroupComm)
save data of quad points to checkpoint file. Used for restart calculations, nscf and bands.
void initLocalPseudoPotential(const dealii::DoFHandler< 3 > &_dofHandler, const dftfe::uInt lpspQuadratureId, const dealii::MatrixFree< 3, double > &_matrix_free_data, const dftfe::uInt _phiExtDofHandlerIndex, const dealii::AffineConstraints< double > &phiExtConstraintMatrix, const std::map< dealii::types::global_dof_index, dealii::Point< 3 > > &supportPoints, const vselfBinsManager &vselfBinManager, distributedCPUVec< double > &phiExt, std::map< dealii::CellId, std::vector< double > > &_pseudoValues, std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > &_pseudoValuesAtoms)
dealii::AffineConstraints< double > constraintsNone
Definition dft.h:1639
double d_relativeErrorJacInvApproxPrevScfLRD
Definition dft.h:1759
std::vector< std::map< dealii::CellId, std::vector< dftfe::uInt > > > d_bCellNonTrivialAtomIdsBins
Definition dft.h:1434
std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > d_basisOperationsPtrHost
Definition dft.h:1516
std::vector< dealii::types::global_dof_index > localProc_dof_indicesReal
Definition dft.h:1575
const std::vector< dealii::types::global_dof_index > & getLocalProcDofIndicesReal() const
Get local dofs local proc indices real.
const std::vector< std::vector< double > > & getAtomLocationsFrac() const
Gets the current atom Locations in fractional form from dftClass (only applicable for periodic and se...
dftfe::utils::MemoryStorage< dataTypes::number, dftfe::utils::MemorySpace::HOST > d_eigenVectorsFlattenedHost
Definition dft.h:1680
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_phiInQuadValues
Definition dft.h:1722
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > d_BLASWrapperPtrHost
Definition dft.h:1535
std::vector< double > d_dipole
Definition dft.h:1744
double d_domainVolume
volume of the domain
Definition dft.h:1477
void initImageChargesUpdateKPoints(bool flag=true)
generate image charges and update k point cartesian coordinates based on current lattice vectors
std::vector< double > d_generatorFlatTopWidths
composite generator flat top widths for all domain atoms
Definition dft.h:1350
expConfiningPotential d_expConfiningPot
Definition dft.h:1945
void initBoundaryConditions(const bool recomputeBasisData=true, const bool meshOnlyDeformed=false, const bool vselfPerturbationUpdateForStress=false)
void outputDensity()
write electron density solution fields
double d_nlPSPCutOff
Definition dft.h:1411
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_densityResidualQuadValues
Definition dft.h:1711
void solveNoSCF()
compute approximation to ground-state without solving the SCF iteration
const std::vector< dealii::types::global_dof_index > & getLocalProcDofIndicesImag() const
Get local dofs local proc indices imag.
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)....
dealii::Timer d_globalTimer
Definition dft.h:1705
double getEntropicEnergy() const
const std::vector< double > & getNearestAtomDistance() const
Gets the nearest atom distance for each atom.
std::vector< dealii::types::global_dof_index > local_dof_indicesReal
Definition dft.h:1573
poissonSolverProblemWrapperClass d_phiTotalSolverProblem
Definition dft.h:1584
dealii::MatrixFree< 3, double > matrix_free_data
Definition dft.h:1511
dealii::AffineConstraints< double > d_constraintsRhoNodalOnlyHanging
Definition dft.h:1654
double fermiEnergyDown
Definition dft.h:1864
std::vector< std::vector< double > > d_fracOccupancy
Definition dft.h:1668
std::vector< dealii::Point< 3 > > d_closestTriaVertexToAtomsLocation
closest tria vertex
Definition dft.h:1850
std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > d_gradRhoCoreAtoms
Definition dft.h:1812
bool d_isAtomsGaussianDisplacementsReadFromFile
Definition dft.h:1338
poissonSolverProblemWrapperClass d_phiPrimeSolverProblem
Definition dft.h:1586
double d_residualNormPredicted
Definition dft.h:1760
static constexpr double d_tikhonovRegularizationConstantLRD
Definition dft.h:1762
std::map< dftfe::uInt, dftfe::uInt > d_atomIdPseudopotentialInterestToGlobalId
Definition dft.h:1325
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_gradDensityOutQuadValues
Definition dft.h:1773
dftfe::uInt d_lpspQuadratureIdElectro
Definition dft.h:1499
dftfe::uInt d_phiExtDofHandlerIndexElectro
Definition dft.h:1488
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_densityTotalInValuesLpspQuad
Definition dft.h:1736
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< memorySpace > > getBLASWrapperMemSpace()
dftfe::uInt getElectroDofHandlerIndex() const
const std::set< dftfe::uInt > & getAtomTypes() const
Gets the current atom types from dftClass.
std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > d_rhoAtomsValuesSeparate
Definition dft.h:1768
void outputWfc(const std::string outputFileName="wfcOutput")
write wavefunction solution fields
dealii::AffineConstraints< double > d_constraintsPRefined
Definition dft.h:1648
std::map< dealii::CellId, std::vector< double > > d_gradRhoAtomsValues
Definition dft.h:1766
std::map< dealii::CellId, std::vector< dftfe::uInt > > d_bCellNonTrivialAtomIds
Definition dft.h:1429
double getFreeEnergy() const
std::vector< std::vector< double > > d_reciprocalLatticeVectors
Definition dft.h:1322
MixingScheme d_mixingScheme
Definition dft.h:1725
std::map< dealii::types::global_dof_index, double > & getAtomNodeToChargeMap()
map of atom node number and atomic weight
void initElectronicFields()
std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > d_basisOperationsPtrElectroHost
Definition dft.h:1520
meshMovementAffineTransform d_affineTransformMesh
affine transformation object
Definition dft.h:1467
std::vector< double > a0
Definition dft.h:1876
void l2ProjectionQuadDensityMinusAtomicDensity(const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const dealii::AffineConstraints< double > &constraintMatrix, const dftfe::uInt dofHandlerId, const dftfe::uInt quadratureId, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &quadratureValueData, distributedCPUVec< double > &nodalField)
l2 projection
std::vector< std::vector< double > > d_imagePositions
Definition dft.h:1383
std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, memorySpace > > getBasisOperationsMemSpace()
triangulationManager d_mesh
Definition dft.h:1460
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > & getDensityInValues()
std::vector< std::map< dealii::CellId, std::vector< dftfe::uInt > > > d_bCellNonTrivialAtomImageIdsBins
Definition dft.h:1444
double fermiEnergyUp
Definition dft.h:1864
std::map< dealii::types::global_dof_index, double > d_atomNodeIdToChargeMap
map of atom node number and atomic weight
Definition dft.h:1822
std::shared_ptr< hubbard< dataTypes::number, memorySpace > > d_hubbardClassPtr
Definition dft.h:1946
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...
dftfe::uInt d_lpspQuadratureId
Definition dft.h:1497
elpaScalaManager * getElpaScalaManager() const
const std::vector< double > & getKPointWeights() const
std::vector< double > d_imageChargesTrunc
Definition dft.h:1394
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.
void loadTriaInfoAndRhoNodalData()
load triangulation information rho quadrature data from checkpoint file for restarted run
std::deque< distributedCPUVec< double > > d_fvSpin0containerVals
Definition dft.h:1754
bool d_useHubbard
Definition dft.h:1947
dftParameters & getParametersObject() const
Get reference to dftParameters object.
dftfe::uInt d_phiTotAXQuadratureIdElectro
Definition dft.h:1503
dealii::AffineConstraints< double > d_constraintsRhoNodal
Definition dft.h:1652
double fieldGradl2Norm(const dealii::MatrixFree< 3, double > &matrixFreeDataObject, const distributedCPUVec< double > &field)
void normalizeRhoInQuadValues()
normalize the input electron density
double totalCharge(const dealii::DoFHandler< 3 > &dofHandlerOfField, const distributedCPUVec< double > &rhoNodalField)
Computes total charge by integrating the electron-density.
void compute_ldos(const std::vector< std::vector< double > > &eigenValuesInput, const std::string &fileName)
virtual void resetRhoNodalSplitIn(distributedCPUVec< double > &OutDensity)
distributedCPUVec< double > d_tempEigenVec
Definition dft.h:1885
dealii::MatrixFree< 3, double > d_matrixFreeDataPRefined
Definition dft.h:1511
const std::vector< std::vector< double > > & getAtomLocationsCart() const
Gets the current atom Locations in cartesian form (origin at center of domain) from dftClass.
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::uInt d_nonPeriodicDensityDofHandlerIndexElectro
Definition dft.h:1492
double computeTraceXtKX(dftfe::uInt numberWaveFunctionsEstimate)
void normalizeRhoOutQuadValues()
normalize the output total electron density in each scf
double d_groundStateEnergy
Definition dft.h:1864
dftfe::uInt d_smearedChargeQuadratureIdElectro
Definition dft.h:1495
double computeVolume(const dealii::DoFHandler< 3 > &_dofHandler)
Computes the volume of the domain.
const std::map< dealii::CellId, std::vector< double > > & getPseudoVLoc() const
return the pseudo potential field
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradDensityTotalOutValuesLpspQuad
Definition dft.h:1737
const std::map< dealii::CellId, std::vector< dftfe::uInt > > & getbCellNonTrivialAtomIds() const
double lowrankApproxScfDielectricMatrixInvSpinPolarized(const dftfe::uInt scfIter)
dftfe::uInt d_nlpspQuadratureId
Definition dft.h:1496
double getNumElectrons() const
Get the number of electrons.
dealii::FESystem< 3 > FEEigen
Definition dft.h:1485
void recomputeKPointCoordinates()
int lowerBoundKindex
global k index of lower bound of the local k point set
Definition dft.h:1854
std::vector< distributedCPUVec< double > > d_densityOutNodalValues
Definition dft.h:1713
dealii::FESystem< 3 > FE
Definition dft.h:1485
void trivialSolveForStress()
bool d_kohnShamDFTOperatorsInitialized
Definition dft.h:1593
std::vector< const dealii::AffineConstraints< double > * > d_constraintsVector
Definition dft.h:1554
dftfe::uInt getDensityDofHandlerIndex()
get the index of the DoF Handler corresponding to
std::vector< std::vector< double > > atomLocations
FIXME: remove atom type atributes from atomLocations.
Definition dft.h:1321
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::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > &tauQuadValues, 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::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_tauOutQuadValues
Definition dft.h:1717
KohnShamDFTBaseOperator< memorySpace > * getKohnShamDFTBaseOperatorClass()
get the Ptr to the operator class ( Kohn Sham Base Operator)
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_gradDensityResidualQuadValues
Definition dft.h:1774
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
dealii::TimerOutput computingTimerStandard
Definition dft.h:1701
void normalizeAtomicRhoQuadValues()
normalize the electron density
void solveBands()
compute bands without solving the SCF iteration
const dftfe::uInt n_mpi_processes
Definition dft.h:1568
std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > d_pseudoVLocAtoms
Definition dft.h:1800
double d_atomicRhoScalingFac
Definition dft.h:1003
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_gradDensityInQuadValues
Definition dft.h:1773
std::vector< dealii::types::global_dof_index > localProc_dof_indicesImag
Definition dft.h:1576
std::vector< double > d_netFloatingDispSinceLastCheckForSmearedChargeOverlaps
Definition dft.h:1336
std::vector< double > d_kPointCoordinates
kPoint cartesian coordinates
Definition dft.h:1841
std::map< dealii::CellId, std::vector< double > > d_rhoCore
Definition dft.h:1807
KohnShamDFTBaseOperator< memorySpace > * d_kohnShamDFTOperatorPtr
Definition dft.h:1595
dftfe::uInt d_numEigenValues
Number of Kohn-Sham eigen values to be computed.
Definition dft.h:291
const dealii::Tensor< 2, 3, double > & getCellStress() const
Gets the current cell stress from dftClass.
const dftfe::uInt this_mpi_process
Definition dft.h:1569
void computeRhoNodalMassVector(dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &massVec)
Computes the diagonal mass matrix for rho nodal grid, used for nodal mixing.
const std::vector< double > & getForceonAtoms() const
Gets the current atomic forces from dftClass.
void nscf(KohnShamDFTBaseOperator< memorySpace > &kohnShamDFTEigenOperator, chebyshevOrthogonalizedSubspaceIterationSolver &subspaceIterationSolver)
double rhofieldl2Norm(const dealii::MatrixFree< 3, double > &matrixFreeDataObject, const distributedCPUVec< double > &rhoNodalField, const dftfe::uInt dofHandlerId, const dftfe::uInt quadratureId)
double computeResidualNodalData(const distributedCPUVec< double > &outValues, const distributedCPUVec< double > &inValues, distributedCPUVec< double > &residualValues)
void finalizeKohnShamDFTOperator()
void determineAtomsOfInterstPseudopotential(const std::vector< std::vector< double > > &atomCoordinates)
std::vector< double > d_netFloatingDispSinceLastBinsUpdate
Definition dft.h:1333
distributedCPUVec< double > d_phiTotRhoOut
Definition dft.h:1782
bool d_isRestartGroundStateCalcFromChk
Definition dft.h:1887
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOST > d_constraintsRhoNodalInfo
Definition dft.h:1657
dftfe::uInt d_densityDofHandlerIndexElectro
Definition dft.h:1491
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.
const MPI_Comm interpoolcomm
Definition dft.h:1566
double totalCharge(const dealii::DoFHandler< 3 > &dofHandlerOfField, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &rhoQuadValues)
void initPseudoPotentialAll(const bool updateNonlocalSparsity=true)
dftfe::uInt d_helmholtzDofHandlerIndexElectro
Definition dft.h:1505
void computeMultipoleMoments(const std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, dftfe::utils::MemorySpace::HOST > > &basisOperationsPtr, const dftfe::uInt densityQuadratureId, const dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &rhoQuadValues, const std::map< dealii::CellId, std::vector< double > > *bQuadValues)
dftfe::uInt d_densityDofHandlerIndex
Definition dft.h:1490
const expConfiningPotential & getConfiningPotential() const
std::shared_ptr< dftfe::basis::FEBasisOperations< double, double, memorySpace > > getBasisOperationsElectroMemSpace()
~dftClass()
dftClass destructor
std::vector< std::vector< double > > atomLocationsFractional
Definition dft.h:1321
void normalizeRhoMagInInitialGuessQuadValues()
normalize input mag electron density to total magnetization for use in constraint magnetization case ...
std::vector< std::vector< double > > d_partialOccupancies
Definition dft.h:1663
dealii::DoFHandler< 3 > dofHandlerEigen
Definition dft.h:1486
chebyshevOrthogonalizedSubspaceIterationSolver * getSubspaceIterationSolverHost()
Get the Ptr to Chebyshev solver in host.
vselfBinsManager d_vselfBinsManager
vselfBinsManager object
Definition dft.h:1825
std::vector< distributedCPUVec< double > > d_vselfFieldGateauxDerStrainFDBins
Definition dft.h:1830
std::vector< double > d_gaussianConstantsForce
Definition dft.h:1343
dealii::AffineConstraints< double > d_constraintsForHelmholtzRhoNodal
Definition dft.h:1646
std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > d_hessianRhoCoreAtoms
Definition dft.h:1817
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradPhiResQuadValues
Definition dft.h:1724
const std::vector< std::vector< double > > & getEigenValues() const
Get reference to the eigen values.
const double d_pspCutOffTrunc
distance from the domain till which periodic images will be considered
Definition dft.h:1407
distributedCPUVec< double > d_phiTotRhoIn
Definition dft.h:1778
double d_minDist
Definition dft.h:1369
void init()
Does KSDFT problem pre-processing steps including mesh generation calls.
void readPSIRadialValues()
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_densityTotalOutValuesLpspQuad
Definition dft.h:1736
std::deque< distributedCPUVec< double > > d_vSpin0containerVals
Definition dft.h:1753
std::deque< distributedCPUVec< double > > d_groundStateDensityHistory
Definition dft.h:1793
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.
dftfe::uInt d_densityQuadratureId
Definition dft.h:1507
meshMovementGaussianClass d_gaussianMovePar
meshMovementGaussianClass object
Definition dft.h:1470
double getTotalChargeforRhoSplit()
dftfe::uInt d_sparsityPatternQuadratureId
Definition dft.h:1509
void calculateSmearedChargeWidths()
a
dftfe::uInt d_eigenDofHandlerIndex
Definition dft.h:1488
void calculateNearestAtomDistances()
a
void loadPSIFiles(dftfe::uInt Z, dftfe::uInt n, dftfe::uInt l, dftfe::uInt &flag)
Namespace which declares the input parameters and the functions to parse them from the input paramete...
Definition dftParameters.h:36
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:50
Definition kerkerSolverProblemWrapper.h:64
Definition BLASWrapper.h:35
Class to move triangulation nodes using Gaussian functions attached to control points.
Definition meshMovementGaussian.h:30
Definition poissonSolverProblemWrapper.h:66
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:34
Definition FEBasisOperations.h:30
double number
Definition dftfeDataTypes.h:41
@ 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
std::uint32_t uInt
Definition TypeConfig.h:10
std::int32_t Int
Definition TypeConfig.h:11