DFT-FE 1.1.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
dft.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (c) 2017-2025 The Regents of the University of Michigan and DFT-FE
4// authors.
5//
6// This file is part of the DFT-FE code.
7//
8// The DFT-FE code is free software; you can use it, redistribute
9// it, and/or modify it under the terms of the GNU Lesser General
10// Public License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12// The full text of the license can be found in the file LICENSE at
13// the top level of the DFT-FE distribution.
14//
15// ---------------------------------------------------------------------
16//
17
18#ifndef dft_H_
19#define dft_H_
20#include <constants.h>
22#include <elpaScalaManager.h>
23#include <headers.h>
24#include <MemorySpaceType.h>
25#include <MemoryStorage.h>
26#include <FEBasisOperations.h>
27#include <BLASWrapper.h>
28#include <AuxDensityMatrix.h>
29
30#include <complex>
31#include <deque>
32#include <iomanip>
33#include <iostream>
34#include <numeric>
35#include <sstream>
36
37#ifdef DFTFE_WITH_DEVICE
39# include "deviceKernelsGeneric.h"
40# include <linearSolverCGDevice.h>
42#endif
43
44// ************* For debugging purposes only. Remove afterwards
45#include "hubbardClass.h"
46
48#include <dealiiLinearSolver.h>
49#include <dftParameters.h>
50#include <eigenSolver.h>
51#include <interpolation.h>
57#include <vselfBinsManager.h>
58#include <excManager.h>
59#include <dftd.h>
60#include <force.h>
61#include "dftBase.h"
62#ifdef USE_PETSC
63# include <petsc.h>
64
65# include <slepceps.h>
66#endif
67
68#include <mixingClass.h>
69#include <oncvClass.h>
70#include <AuxDensityMatrix.h>
75namespace dftfe
76{
77 //
78 // Initialize Namespace
79 //
80
81
82
83#ifndef DOXYGEN_SHOULD_SKIP_THIS
84
85 struct orbital
86 {
87 dftfe::uInt atomID;
88 dftfe::uInt waveID;
89 dftfe::uInt Z, n, l;
90 dftfe::Int m;
91 alglib::spline1dinterpolant psi;
92 };
93
94 /* code that must be skipped by Doxygen */
95 // forward declarations
96 template <dftfe::utils::MemorySpace memory>
97 class symmetryClass;
98 template <dftfe::utils::MemorySpace memory>
99 class forceClass;
100#endif /* DOXYGEN_SHOULD_SKIP_THIS */
101
102 /**
103 * @brief This class is the primary interface location of all other parts of the DFT-FE code
104 * for all steps involved in obtaining the Kohn-Sham DFT ground-state
105 * solution.
106 *
107 * @author Shiva Rudraraju, Phani Motamarri, Sambit Das
108 */
109 template <dftfe::utils::MemorySpace memorySpace>
110 class dftClass : public dftBase
111 {
112 friend class forceClass<memorySpace>;
113
114 friend class symmetryClass<memorySpace>;
115
116 public:
117 /**
118 * @brief dftClass constructor
119 *
120 * @param[in] mpi_comm_parent parent communicator
121 * @param[in] mpi_comm_domain mpi_communicator for domain decomposition
122 * parallelization
123 * @param[in] interpoolcomm mpi_communicator for parallelization over k
124 * points
125 * @param[in] interBandGroupComm mpi_communicator for parallelization over
126 * bands
127 * @param[in] scratchFolderName scratch folder name
128 * @param[in] dftParams dftParameters object containg parameter values
129 * parsed from an input parameter file in dftfeWrapper class
130 */
131 dftClass(const MPI_Comm &mpiCommParent,
132 const MPI_Comm &mpi_comm_domain,
133 const MPI_Comm &interpoolcomm,
134 const MPI_Comm &interBandGroupComm,
135 const std::string &scratchFolderName,
136 dftParameters &dftParams);
137
138 /**
139 * @brief dftClass destructor
140 */
142
143 /**
144 * @brief atomic system pre-processing steps.
145 *
146 * Reads the coordinates of the atoms.
147 * If periodic calculation, reads fractional coordinates of atoms in the
148 * unit-cell, lattice vectors, kPoint quadrature rules to be used and also
149 * generates image atoms. Also determines orbital-ordering
150 */
151 void
153
154 /**
155 * @brief Does KSDFT problem pre-processing steps including mesh generation calls.
156 */
157 void
159
160 /**
161 * @brief Does KSDFT problem pre-processing steps but without remeshing.
162 */
163 void
164 initNoRemesh(const bool updateImagesAndKPointsAndVselfBins = true,
165 const bool checkSmearedChargeWidthsForOverlap = true,
166 const bool useSingleAtomSolutionOverride = false,
167 const bool isMeshDeformed = false);
168
169
170
171 /**
172 * @brief FIXME: legacy call, move to main.cc
173 */
174 void
176
177
178 void
180
181 /**
182 * @brief Writes inital density and mesh to file.
183 */
184 void
186
187 /**
188 * @brief compute approximation to ground-state without solving the SCF iteration
189 */
190 void
192 /**
193 * @brief compute bands without solving the SCF iteration
194 */
195 void
197 /**
198 * @brief Kohn-Sham ground-state solve using SCF iteration
199 *
200 * @return tuple of boolean flag on whether scf converged,
201 * and L2 norm of residual electron-density of the last SCF iteration step
202 *
203 */
204 std::tuple<bool, double>
205 solve(const bool computeForces = true,
206 const bool computestress = true,
207 const bool restartGroundStateCalcFromChk = false);
208
209 void
211
212 void
214
215
216 void
224
225 /**
226 * @brief Copies the residual residualValues=outValues-inValues
227 */
228 double
231 &outValues,
233 &inValues,
235 &residualValues,
237 &JxW,
238 const bool computeNorm);
239
240
241 double
243 const distributedCPUVec<double> &inValues,
244 distributedCPUVec<double> &residualValues);
245
246
247 /**
248 * @brief Computes the diagonal mass matrix for rho nodal grid, used for nodal mixing
249 */
250 void
253 &massVec);
254
255 void
256 initializeKohnShamDFTOperator(const bool initializeCublas = true);
257
258
259 void
261
262
263 void
265
266
267 double
269
270 double
272
273 double
275
278
281
282 double
284
285 void
287
288 virtual void
290
291 /**
292 * @brief Number of Kohn-Sham eigen values to be computed
293 */
295
296
297 /**
298 * @brief Number of random wavefunctions
299 */
301
302 void
304
305 /**
306 *@brief Get local dofs global indices real
307 */
308 const std::vector<dealii::types::global_dof_index> &
310
311 /**
312 *@brief Get local dofs global indices imag
313 */
314 const std::vector<dealii::types::global_dof_index> &
316
317 /**
318 *@brief Get local dofs local proc indices real
319 */
320 const std::vector<dealii::types::global_dof_index> &
322
323 /**
324 *@brief Get local dofs local proc indices imag
325 */
326 const std::vector<dealii::types::global_dof_index> &
328
329 /**
330 *@brief Get matrix free data object
331 */
332 const dealii::MatrixFree<3, double> &
334
335
336 /** @brief Updates atom positions, remeshes/moves mesh and calls appropriate reinits.
337 *
338 * Function to update the atom positions and mesh based on the provided
339 * displacement input. Depending on the maximum displacement magnitude this
340 * function decides wether to do auto remeshing or move mesh using Gaussian
341 * functions. Additionaly this function also wraps the atom position across
342 * the periodic boundary if the atom moves across it beyond a certain
343 * magnitude. In case of floating atoms, only the atomic positions are
344 * updated keeping the mesh fixed. This function also calls initNoRemesh to
345 * reinitialize all the required FEM and KSDFT objects.
346 *
347 * @param[in] globalAtomsDisplacements vector containing the displacements
348 * (from current position) of all atoms (global).
349 * @return void.
350 */
351 void
353 const std::vector<dealii::Tensor<1, 3, double>> &globalAtomsDisplacements,
354 const double maxJacobianRatioFactor = 1.25,
355 const bool useSingleAtomSolutionsOverride = false);
356
357
358 /**
359 * @brief writes the current domain bounding vectors and atom coordinates to files, which are required for
360 * geometry relaxation restart
361
362 */
363 void
365
366 /**
367 * @brief writes the current domain bounding vectors and atom coordinates to files for
368 * structural optimization and dynamics restarts. The coordinates are stored
369 * as: 1. fractional for semi-periodic/periodic 2. Cartesian for
370 * non-periodic.
371 * @param[in] Path The folder path to store the atom coordinates required
372 * during restart.
373 */
374 void
375 writeDomainAndAtomCoordinates(const std::string Path) const;
376
377 /**
378 * @brief writes atomistics data for subsequent post-processing. Related to
379 * WRITE STRUCTURE ENERGY FORCES DATA POST PROCESS input parameter.
380 * @param[in] Path The folder path to store the atomistics data.
381 */
382 void
383 writeStructureEnergyForcesDataPostProcess(const std::string Path) const;
384
385 /**
386 * @brief writes quadrature grid information and associated spin-up
387 * and spin-down electron-density for post-processing
388 * @param[in] Path The folder path to store the atomistics data.
389 */
390 virtual void
391 writeGSElectronDensity(const std::string Path) const;
392
393
394 /**
395 * @brief Gets the current atom Locations in cartesian form
396 * (origin at center of domain) from dftClass
397 */
398 const std::vector<std::vector<double>> &
400
401 /**
402 * @brief Gets the nearest atom distance for each atom
403 */
404 const std::vector<double> &
406
407 /**
408 * @brief Gets the current image atom Locations in cartesian form
409 * (origin at center of domain) from dftClass
410 */
411 const std::vector<std::vector<double>> &
413
414 /**
415 * @brief Gets the current image atom ids from dftClass
416 */
417 const std::vector<dftfe::Int> &
419
420 /**
421 * @brief Gets the current atom Locations in fractional form
422 * from dftClass (only applicable for periodic and semi-periodic BCs)
423 */
424 const std::vector<std::vector<double>> &
426
427
428
429 /**
430 * @brief Gets the current cell lattice vectors
431 *
432 * @return std::vector<std::vector<double>> 3 \times 3 matrix,lattice[i][j]
433 * corresponds to jth component of ith lattice vector
434 */
435 const std::vector<std::vector<double>> &
436 getCell() const;
437
438 /**
439 * @brief Gets the current cell volume
440 *
441 */
442 double
444
445 /**
446 * @brief Gets the current atom types from dftClass
447 */
448 const std::set<dftfe::uInt> &
450
451 /**
452 * @brief Gets the current atomic forces from dftClass
453 */
454 const std::vector<double> &
456
457 /**
458 * @brief Gets the current cell stress from dftClass
459 */
460 const dealii::Tensor<2, 3, double> &
462
463 /**
464 * @brief Get reference to dftParameters object
465 */
468
469
470 /**
471 * @brief Get reference the memorySpace templated eigen vectors
472 */
475
476 /**
477 * @brief Get reference the host eigen vectors
478 */
482
483 /**
484 * @brief Get reference to the eigen values
485 */
486 const std::vector<std::vector<double>> &
488
489 /**
490 * @brief Get the value of fermi energy
491 */
492 double
494
495 /**
496 * @brief Get the number of electrons
497 */
498 double
500
501 void
502 setNumElectrons(dftfe::uInt inputNumElectrons);
503
506#ifdef DFTFE_WITH_DEVICE
507
508 /**
509 * @brief Get the Ptr to Chebyshev solver in device
510 */
511 chebyshevOrthogonalizedSubspaceIterationSolverDevice *
512 getSubspaceIterationSolverDevice();
513#endif
514 /**
515 * @brief Get the Ptr to Chebyshev solver in host
516 */
519
520 /**
521 * @brief Function that computes the Eigen space for the Kohn Sham operator.
522 */
523 void
525 const dftfe::uInt s,
526 const dftfe::uInt kPointIndex,
528 &kohnShamDFTEigenOperator,
529 elpaScalaManager &elpaScala,
530 chebyshevOrthogonalizedSubspaceIterationSolver &subspaceIterationSolver,
531 std::vector<double> &residualNormWaveFunctions,
532 const bool computeResidual,
533 const bool useMixedPrec = false,
534 const bool isFirstScf = false);
535
536
537#ifdef DFTFE_WITH_DEVICE
538 /**
539 * @brief Function that computes the Eigen space for the Kohn Sham operator in device.
540 */
541 void
543 const dftfe::uInt s,
544 const dftfe::uInt kPointIndex,
546 &kohnShamDFTEigenOperator,
547 elpaScalaManager &elpaScala,
548 chebyshevOrthogonalizedSubspaceIterationSolverDevice
549 &subspaceIterationSolverDevice,
550 std::vector<double> &residualNormWaveFunctions,
551 const bool computeResidual,
552 const dftfe::uInt numberRayleighRitzAvoidancePasses = 0,
553 const bool useMixedPrec = false,
554 const bool isFirstScf = false);
555#endif
556
557 /**
558 *@brief Computes Fermi-energy obtained by imposing constraint on the number of electrons
559 */
560 void
562 const std::vector<std::vector<double>> &eigenValuesInput,
563 const double numElectronsInput);
564
565 /**
566 *@brief find HOMO eigenvalue for pure state
567 */
568 void
570 const std::vector<std::vector<double>> &eigenValuesInput,
571 const double numElectronsInput);
572
573 /**
574 *@brief Computes the kinetic energy
575 */
576 double
579 &kineticEnergyDensityValues);
580
581 /**
582 *@brief get the Ptr to the operator class ( Kohn Sham Base Operator)
583 */
586
587 /**
588 *@brief get the index of the DoF Handler corresponding to
589 *
590 */
593
596
597 const std::vector<double> &
599
602
605
606 const dealii::MatrixFree<3, double> &
608
609 dealii::AffineConstraints<double> *
611
614
617
620
621
622 std::shared_ptr<
624 double,
627
628 std::shared_ptr<
631
632 std::shared_ptr<
633 dftfe::basis::
634 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
636
637 std::shared_ptr<
640
641 std::shared_ptr<dftfe::linearAlgebra::BLASWrapper<memorySpace>>
643
644
645 std::shared_ptr<
648
649 std::vector<
652
653 std::vector<
656
657 /**
658 *@brief l2 projection
659 */
660 void
662 const std::shared_ptr<
664 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
665 &basisOperationsPtr,
666 const dealii::AffineConstraints<double> &constraintMatrix,
667 const dftfe::uInt dofHandlerId,
668 const dftfe::uInt quadratureId,
670 &quadratureValueData,
671 distributedCPUVec<double> &nodalField);
672
673 /// map of atom node number and atomic weight
674 std::map<dealii::types::global_dof_index, double> &
676
677 /// non-intersecting smeared charges of all atoms at quad points
678 std::map<dealii::CellId, std::vector<double>> &
680
683
684 const dealii::AffineConstraints<double> *
686
687 const std::vector<std::vector<double>> &
689
690 const MPI_Comm &
691 getMPIDomain() const override;
692
693 const MPI_Comm &
694 getMPIParent() const override;
695
696 const MPI_Comm &
697 getMPIInterPool() const override;
698
699 const MPI_Comm &
700 getMPIInterBand() const override;
701
702 const std::map<dealii::CellId, std::vector<dftfe::uInt>> &
704
705 void
707
708 void
710 const std::shared_ptr<
712 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
713 &basisOperationsPtr,
714 const dftfe::uInt densityQuadratureId,
716 &rhoQuadValues,
717 const std::map<dealii::CellId, std::vector<double>> *bQuadValues);
718
721
722 /**
723 *@brief Returns the shared ptr to hubbard class
724 */
725 std::shared_ptr<hubbard<dataTypes::number, memorySpace>>
727
728 /**
729 *@brief Function to check if hubbard corrections is being used
730 */
731 bool
733
734 /**
735 *@brief write wavefunction solution fields
736 */
737 void
738 outputWfc(const std::string outputFileName = "wfcOutput");
739
740 /**
741 *@brief return the pseudo potential field
742 */
743 const std::map<dealii::CellId, std::vector<double>> &
745
746 private:
747 /**
748 * @brief generate image charges and update k point cartesian coordinates based
749 * on current lattice vectors
750 */
751 void
753
754 /**
755 * @brief Checks if the Exc functional requires Hubbard correction
756 * and sets up the Hubbard class if required.
757 */
758 void
760
761 void
763 const std::vector<std::vector<double>> &atomCoordinates);
764
765
766 /**
767 *@brief project ground state electron density from previous mesh into
768 * the new mesh to be used as initial guess for the new ground state solve
769 */
770 void
772
773 /**
774 *@brief save triangulation information and rho quadrature data to checkpoint file for restarts
775 */
776 void
778
779 /**
780 *@brief load triangulation information rho quadrature data from checkpoint file for restarted run
781 */
782 void
784 /**
785 * @brief save data of quad points to checkpoint file. Used for restart calculations, nscf and bands.
786 *
787 * @param[in] basisOperationsPtr basisoperationsPtr object
788 * @param[in] quadratureId quadrature Id of quad point used in checkpoint
789 * file
790 * @param[out] quadratureValueData quadrature data of field that is to be
791 * saved
792 * @param[in] fieldDimension dimension of field.
793 * @param[in] fieldName file name of checkpoint data to be saved
794 * @param[in] folderPath restart folder name
795 * @param[in] mpi_comm_parent parent communicator
796 * @param[in] mpi_comm_domain mpi_communicator for domain decomposition
797 * parallelization
798 * @param[in] interpoolcomm mpi_communicator for parallelization over k
799 * points
800 * @param[in] interBandGroupComm mpi_communicator for parallelization over
801 * bands
802 */
803 void
805 const std::shared_ptr<
807 double,
809 &basisOperationsPtr,
810 const dftfe::uInt quadratureId,
812 &quadratureValueData,
813 const dftfe::uInt fieldDimension,
814 const std::string &fieldName,
815 const std::string &folderPath,
816 const MPI_Comm &mpi_comm_parent,
817 const MPI_Comm &mpi_comm_domain,
818 const MPI_Comm &interpoolcomm,
819 const MPI_Comm &interBandGroupComm);
820 /**
821 * @brief loads data from quad points of checkpoint file. Used for restart calculations, nscf and bands.
822 *
823 * @param[in] basisOperationsPtr basisoperationsPtr object
824 * @param[in] quadratureId quadrature Id of quad point used in checkpoint
825 * file
826 * @param[out] quadratureValueData quadrature data of field that is to be
827 * loaded
828 * @param[in] fieldDimension dimension of field.
829 * @param[in] fieldName file name containing checkpoint data
830 * @param[in] folderPath restart folder name
831 * @param[in] mpi_comm_parent parent communicator
832 * @param[in] mpi_comm_domain mpi_communicator for domain decomposition
833 * parallelization
834 * @param[in] interpoolcomm mpi_communicator for parallelization over k
835 * points
836 * @param[in] interBandGroupComm mpi_communicator for parallelization over
837 * bands
838 */
839 void
841 const std::shared_ptr<
843 double,
845 &basisOperationsPtr,
846 const dftfe::uInt quadratureId,
848 &quadratureValueData,
849 const dftfe::uInt fieldDimension,
850 const std::string &fieldName,
851 const std::string &folderPath,
852 const MPI_Comm &mpi_comm_parent,
853 const MPI_Comm &mpi_comm_domain,
854 const MPI_Comm &interpoolcomm,
855 const MPI_Comm &interBandGroupComm);
856
857 void
859 void
860 writeMesh(std::string meshFileName);
861
862 /// creates datastructures related to periodic image charges
863 void
864 generateImageCharges(const double pspCutOff,
865 std::vector<dftfe::Int> &imageIds,
866 std::vector<double> &imageCharges,
867 std::vector<std::vector<double>> &imagePositions);
868
869 void
871 const double pspCutOff,
872 const std::vector<dftfe::Int> &imageIds,
873 const std::vector<std::vector<double>> &imagePositions,
874 std::vector<std::vector<dftfe::Int>> &globalChargeIdToImageIdMap);
875
876 void
878
879 //
880 // generate mesh using a-posteriori error estimates
881 //
882 void
885 computeTraceXtHX(dftfe::uInt numberWaveFunctionsEstimate);
886 double
887 computeTraceXtKX(dftfe::uInt numberWaveFunctionsEstimate);
888
889
890 /**
891 *@brief moves the triangulation vertices using Gaussians such that the all atoms are on triangulation vertices
892 */
893 void
894 moveMeshToAtoms(dealii::Triangulation<3, 3> &triangulationMove,
895 dealii::Triangulation<3, 3> &triangulationSerial,
896 bool reuseFlag = false,
897 bool moveSubdivided = false);
898
899 /**
900 *@brief a
901 */
902 void
904
905 /**
906 *@brief a
907 */
908 void
910
911 /**
912 * Initializes the guess of electron-density and single-atom wavefunctions
913 * on the mesh, maps finite-element nodes to given atomic positions,
914 * initializes pseudopotential files and exchange-correlation functionals to
915 * be used based on user-choice. In periodic problems, periodic faces are
916 * mapped here. Further finite-element nodes to be pinned for solving the
917 * Poisson problem electro-static potential is set here
918 */
919 void
921 dealii::parallel::distributed::Triangulation<3> &triangulation);
922 void
923 initBoundaryConditions(const bool recomputeBasisData = true,
924 const bool meshOnlyDeformed = false,
925 const bool vselfPerturbationUpdateForStress = false);
926 void
928 void
929 initPseudoPotentialAll(const bool updateNonlocalSparsity = true);
930
931 /**
932 * create a dofHandler containing finite-element interpolating polynomial
933 * twice of the original polynomial required for Kerker mixing and
934 * initialize various objects related to this refined dofHandler
935 */
936 void
938 dealii::parallel::distributed::Triangulation<3> &triangulation);
939 void
940 initpRefinedObjects(const bool recomputeBasisData,
941 const bool meshOnlyDeformed,
942 const bool vselfPerturbationUpdateForStress = false);
943
944
945 /**
946 *@brief Sets inhomegeneous dirichlet boundary conditions upto quadrupole for total potential constraints on
947 * non-periodic boundary (boundary id==0).
948 *
949 * @param[in] dofHandler
950 * @param[out] constraintMatrix dealii::AffineConstraints<double> object
951 *with inhomogeneous Dirichlet boundary condition entries added
952 */
953 void
955 const dealii::DoFHandler<3> &_dofHandler,
956 const dealii::AffineConstraints<double> &onlyHangingNodeConstraints,
957 dealii::AffineConstraints<double> &constraintMatrix);
958
959
960 /**
961 *@brief add atomic densities at quadrature points
962 *
963 */
964 void
967 &quadratureValueData,
969 &quadratureGradValueData,
970 const bool isConsiderGradData = false);
971
972
973 /**
974 *@brief Finds the global dof ids of the nodes containing atoms.
975 *
976 * @param[in] dofHandler
977 * @param[out] atomNodeIdToChargeValueMap local map of global dof id to atom
978 *charge id
979 */
980 void
981 locateAtomCoreNodes(const dealii::DoFHandler<3> &_dofHandler,
982 std::map<dealii::types::global_dof_index, double>
983 &atomNodeIdToChargeValueMap);
984
985 /**
986 *@brief Sets homogeneous dirichlet boundary conditions on a node farthest from
987 * all atoms (pinned node). This is only done in case of periodic boundary
988 *conditions to get an unique solution to the total electrostatic potential
989 *problem.
990 *
991 * @param[in] dofHandler
992 * @param[in] constraintMatrixBase base dealii::AffineConstraints<double>
993 *object
994 * @param[out] constraintMatrix dealii::AffineConstraints<double> object
995 *with homogeneous Dirichlet boundary condition entries added
996 */
997 void
999 const dealii::DoFHandler<3> &_dofHandler,
1000 const dealii::AffineConstraints<double> &constraintMatrixBase,
1001 dealii::AffineConstraints<double> &constraintMatrix);
1002
1003 void
1005
1007
1008 void
1010
1011 void
1013 void
1015 void
1017 std::vector<std::vector<distributedCPUVec<double>>> eigenVectors);
1018 void
1020
1021
1022 /**
1023 *@brief computes density nodal data from wavefunctions
1024 */
1025 void
1027
1028
1029 void
1033 distributedCPUVec<double> &fvSpin1);
1034
1035 void
1037 void
1039 void
1041 void
1043 dftfe::uInt n,
1044 dftfe::uInt l,
1045 dftfe::uInt &flag);
1046 void
1048 const dealii::DoFHandler<3> &_dofHandler,
1049 const dftfe::uInt lpspQuadratureId,
1050 const dealii::MatrixFree<3, double> &_matrix_free_data,
1051 const dftfe::uInt _phiExtDofHandlerIndex,
1052 const dealii::AffineConstraints<double> &phiExtConstraintMatrix,
1053 const std::map<dealii::types::global_dof_index, dealii::Point<3>>
1054 &supportPoints,
1055 const vselfBinsManager &vselfBinManager,
1057 std::map<dealii::CellId, std::vector<double>> &_pseudoValues,
1058 std::map<dftfe::uInt, std::map<dealii::CellId, std::vector<double>>>
1059 &_pseudoValuesAtoms);
1060
1061
1062
1063 /**
1064 *@brief Sets homegeneous dirichlet boundary conditions for total potential constraints on
1065 * non-periodic boundary (boundary id==0).
1066 *
1067 * @param[in] dofHandler
1068 * @param[out] constraintMatrix dealii::AffineConstraints<double> object
1069 *with homogeneous Dirichlet boundary condition entries added
1070 */
1071 void
1073 const dealii::DoFHandler<3> &_dofHandler,
1074 const dealii::AffineConstraints<double> &onlyHangingNodeConstraints,
1075 dealii::AffineConstraints<double> &constraintMatrix);
1076
1077
1078
1079 /**
1080 *@brief Computes total charge by integrating the electron-density
1081 */
1082 double
1083 totalCharge(const dealii::DoFHandler<3> &dofHandlerOfField,
1084 const distributedCPUVec<double> &rhoNodalField);
1085
1086
1087 double
1089 const dealii::DoFHandler<3> &dofHandlerOfField,
1090 const std::map<dealii::CellId, std::vector<double>> *rhoQuadValues);
1091
1092 double
1094 const dealii::DoFHandler<3> &dofHandlerOfField,
1096 &rhoQuadValues);
1097
1098
1099 double
1100 totalCharge(const dealii::MatrixFree<3, double> &matrixFreeDataObject,
1101 const distributedCPUVec<double> &rhoNodalField);
1102
1103
1104
1105 double
1106 rhofieldl2Norm(const dealii::MatrixFree<3, double> &matrixFreeDataObject,
1107 const distributedCPUVec<double> &rhoNodalField,
1108 const dftfe::uInt dofHandlerId,
1109 const dftfe::uInt quadratureId);
1110
1111 double
1113 const dealii::MatrixFree<3, double> &matrixFreeDataObject,
1114 const distributedCPUVec<double> &rhoNodalField1,
1115 const distributedCPUVec<double> &rhoNodalField2,
1116 const dftfe::uInt dofHandlerId,
1117 const dftfe::uInt quadratureId);
1118
1119
1120 double
1121 fieldGradl2Norm(const dealii::MatrixFree<3, double> &matrixFreeDataObject,
1122 const distributedCPUVec<double> &field);
1123
1124
1125 /**
1126 *@brief l2 projection
1127 */
1128 void
1130 const std::shared_ptr<
1131 dftfe::basis::
1132 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
1133 &basisOperationsPtr,
1134 const dealii::AffineConstraints<double> &constraintMatrix,
1135 const dftfe::uInt dofHandlerId,
1136 const dftfe::uInt quadratureId,
1138 &quadratureValueData,
1139 distributedCPUVec<double> &nodalField);
1140
1141 /**
1142 *@brief Computes net magnetization from the difference of local spin densities
1143 */
1144 void
1147 &magQuadValues);
1148
1149 /**
1150 *@brief normalize the input electron density
1151 */
1152 void
1154
1155 /**
1156 *@brief normalize input mag electron density to total magnetization
1157 *for use in constraint magnetization case (only for initial guess)
1158 */
1159 void
1161
1162
1163 /**
1164 *@brief normalize the output total electron density in each scf
1165 */
1166 void
1168
1169 /**
1170 *@brief normalize the electron density
1171 */
1172 void
1174
1175 /**
1176 *@brief Computes output electron-density from wavefunctions
1177 */
1178 void
1179 compute_rhoOut(const bool isGroundState = false);
1180
1181 /**
1182 *@brief Mixing schemes for mixing electron-density
1183 */
1184
1185 void
1187#ifdef DFTFE_WITH_DEVICE
1188 kerkerSolverProblemDeviceWrapperClass
1189 &kerkerPreconditionedResidualSolverProblemDevice,
1190 linearSolverCGDevice &CGSolverDevice,
1191#endif
1193 &kerkerPreconditionedResidualSolverProblem,
1194 dealiiLinearSolver &CGSolver,
1195 distributedCPUVec<double> &residualRho,
1196 distributedCPUVec<double> &preCondTotalDensityResidualVector);
1197
1198 double
1200
1201 double
1203 /**
1204 *@brief Computes Fermi-energy obtained by imposing separate constraints on the number of spin-up and spin-down electrons
1205 */
1206 void
1208 const std::vector<std::vector<double>> &eigenValuesInput);
1209
1210
1211 /**
1212 *@brief Find spin-up and spin-down channel HOMO eigenvalues
1213 */
1214 void
1216 const std::vector<std::vector<double>> &eigenValuesInput);
1217
1218
1219 /**
1220 *@brief compute density of states and local density of states
1221 */
1222 void
1223 compute_tdos(const std::vector<std::vector<double>> &eigenValuesInput,
1224 const std::string &fileName);
1225
1226 void
1227 compute_ldos(const std::vector<std::vector<double>> &eigenValuesInput,
1228 const std::string &fileName);
1229
1230 /**
1231 *@brief compute localization length
1232 */
1233 void
1234 compute_localizationLength(const std::string &locLengthFileName);
1235
1236 /**
1237 *@brief write electron density solution fields
1238 */
1239 void
1241
1242 /**
1243 *@brief write the KS eigen values for given BZ sampling/path
1244 */
1245 void
1247
1248 /**
1249 *@brief Computes the volume of the domain
1250 */
1251 double
1252 computeVolume(const dealii::DoFHandler<3> &_dofHandler);
1253
1254 /**
1255 *@brief Deforms the domain by the given deformation gradient and reinitializes the
1256 * dftClass datastructures.
1257 */
1258 void
1259 deformDomain(const dealii::Tensor<2, 3, double> &deformationGradient,
1260 const bool vselfPerturbationUpdateForStress = false,
1261 const bool useSingleAtomSolutionsOverride = false,
1262 const bool print = true);
1263
1264 /**
1265 *@brief Computes inner Product and Y = alpha*X + Y for complex vectors used during
1266 * periodic boundary conditions
1267 */
1268
1269#ifdef USE_COMPLEX
1270 std::complex<double>
1272
1273 void
1274 alphaTimesXPlusY(std::complex<double> alpha,
1277
1278#endif
1279 /**
1280 *@brief Sets dirichlet boundary conditions for total potential constraints on
1281 * non-periodic boundary (boundary id==0). Currently setting homogeneous bc
1282 *
1283 */
1284 void
1286
1287
1288 void
1290 const std::vector<
1292 &densityQuadValues,
1293 const std::vector<
1295 &gradDensityQuadValues,
1296 const std::vector<
1298 &tauQuadValues,
1299 const std::map<dealii::CellId, std::vector<double>> &rhoCore,
1300 const std::map<dealii::CellId, std::vector<double>> &gradRhoCore,
1302 &eigenVectorsFlattenedMemSpace,
1303 const std::vector<std::vector<double>> &eigenValues,
1304 const double fermiEnergy_,
1305 const double fermiEnergyUp_,
1306 const double fermiEnergyDown_,
1307 std::shared_ptr<AuxDensityMatrix<memorySpace>> auxDensityMatrixXCPtr);
1308
1309 std::shared_ptr<excManager<memorySpace>> d_excManagerPtr;
1311
1312 /**
1313 * stores required data for Kohn-Sham problem
1314 */
1317 std::set<dftfe::uInt> atomTypes;
1318
1319 /// FIXME: eventually it should be a map of atomic number to struct-
1320 /// {valence number, mesh input etc}
1321 std::map<dftfe::uInt, dftfe::uInt> d_atomTypeAtributes;
1322
1323 /// FIXME: remove atom type atributes from atomLocations
1324 std::vector<std::vector<double>> atomLocations, atomLocationsFractional,
1326 std::vector<std::vector<double>> d_atomLocationsInterestPseudopotential;
1327 std::map<dftfe::uInt, dftfe::uInt>
1329 std::vector<std::vector<double>> d_atomLocationsAutoMesh;
1330 std::vector<std::vector<double>> d_imagePositionsAutoMesh;
1331
1332 /// Gaussian displacements of atoms read from file
1333 std::vector<dealii::Tensor<1, 3, double>> d_atomsDisplacementsGaussianRead;
1334
1335 ///
1337
1338 ///
1340
1342
1343 /// Gaussian generator parameter for force computation and Gaussian
1344 /// deformation of atoms and FEM mesh Gaussian generator: Gamma(r)=
1345 /// exp(-(r/d_gaussianConstant)^2) Stored for all domain atoms
1346 std::vector<double> d_gaussianConstantsForce;
1347
1348 /// Gaussian constants for automesh mesh movement stored for all domain
1349 /// atoms
1350 std::vector<double> d_gaussianConstantsAutoMesh;
1351
1352 /// composite generator flat top widths for all domain atoms
1353 std::vector<double> d_generatorFlatTopWidths;
1354
1355 /// flat top widths for all domain atoms in case of automesh mesh movement
1356 /// composite gaussian
1357 std::vector<double> d_flatTopWidthsAutoMeshMove;
1358
1359 /// smeared charge widths for all domain atoms
1360 std::vector<double> d_smearedChargeWidths;
1361
1362 /// smeared charge normalization scaling for all domain atoms
1363 std::vector<double> d_smearedChargeScaling;
1364
1365 /// nearest atom ids for all domain atoms
1366 std::vector<dftfe::uInt> d_nearestAtomIds;
1367
1368 /// nearest atom distances for all domain atoms
1369 std::vector<double> d_nearestAtomDistances;
1370
1371 ///
1373
1374 /// vector of lendth number of periodic image charges with corresponding
1375 /// master chargeIds
1376 std::vector<dftfe::Int> d_imageIds;
1377 // std::vector<dftfe::Int> d_imageIdsAutoMesh;
1378
1379
1380 /// vector of length number of periodic image charges with corresponding
1381 /// charge values
1382 std::vector<double> d_imageCharges;
1383
1384 /// vector of length number of periodic image charges with corresponding
1385 /// positions in cartesian coordinates
1386 std::vector<std::vector<double>> d_imagePositions;
1387
1388 /// globalChargeId to ImageChargeId Map
1389 std::vector<std::vector<dftfe::Int>> d_globalChargeIdToImageIdMap;
1390
1391 /// vector of lendth number of periodic image charges with corresponding
1392 /// master chargeIds , generated with a truncated pspCutoff
1393 std::vector<dftfe::Int> d_imageIdsTrunc;
1394
1395 /// vector of length number of periodic image charges with corresponding
1396 /// charge values , generated with a truncated pspCutoff
1397 std::vector<double> d_imageChargesTrunc;
1398
1399 /// vector of length number of periodic image charges with corresponding
1400 /// positions in cartesian coordinates, generated with a truncated pspCutOff
1401 std::vector<std::vector<double>> d_imagePositionsTrunc;
1402
1403 /// globalChargeId to ImageChargeId Map generated with a truncated pspCutOff
1404 std::vector<std::vector<dftfe::Int>> d_globalChargeIdToImageIdMapTrunc;
1405
1406 /// distance from the domain till which periodic images will be considered
1407 double d_pspCutOff = 15.0;
1408
1409 /// distance from the domain till which periodic images will be considered
1410 const double d_pspCutOffTrunc = 15.0;
1411
1412 /// cut-off distance from atom till which non-local projectors are
1413 /// non-trivial
1414 double d_nlPSPCutOff = 8.0;
1415
1416 /// non-intersecting smeared charges of all atoms at quad points
1417 std::map<dealii::CellId, std::vector<double>> d_bQuadValuesAllAtoms;
1418
1419 /// non-intersecting smeared charge gradients of all atoms at quad points
1420 std::map<dealii::CellId, std::vector<double>> d_gradbQuadValuesAllAtoms;
1421
1422 /// non-intersecting smeared charges atom ids of all atoms at quad points
1423 std::map<dealii::CellId, std::vector<dftfe::Int>> d_bQuadAtomIdsAllAtoms;
1424
1425 /// non-intersecting smeared charges atom ids of all atoms (with image atom
1426 /// ids separately accounted) at quad points
1427 std::map<dealii::CellId, std::vector<dftfe::Int>>
1429
1430 /// map of cell and non-trivial global atom ids (no images) for smeared
1431 /// charges for each bin
1432 std::map<dealii::CellId, std::vector<dftfe::uInt>> d_bCellNonTrivialAtomIds;
1433
1434 /// map of cell and non-trivial global atom ids (no images) for smeared
1435 /// charge for each bin
1436 std::vector<std::map<dealii::CellId, std::vector<dftfe::uInt>>>
1438
1439 /// map of cell and non-trivial global atom and image ids for smeared
1440 /// charges for each bin
1441 std::map<dealii::CellId, std::vector<dftfe::uInt>>
1443
1444 /// map of cell and non-trivial global atom and image ids for smeared charge
1445 /// for each bin
1446 std::vector<std::map<dealii::CellId, std::vector<dftfe::uInt>>>
1448
1449 /// minimum smeared charge width
1450 const double d_smearedChargeWidthMin = 0.4;
1451
1452 std::vector<orbital> waveFunctionsVector;
1453 std::map<
1455 std::map<dftfe::uInt, std::map<dftfe::uInt, alglib::spline1dinterpolant>>>
1457 std::map<dftfe::uInt, std::map<dftfe::uInt, std::map<dftfe::uInt, double>>>
1459
1460 /**
1461 * meshGenerator based object
1462 */
1464
1467
1468
1469 /// affine transformation object
1471
1472 /// meshMovementGaussianClass object
1474
1475 std::vector<dealii::Tensor<1, 3, double>>
1477 std::vector<dealii::Point<3>> d_controlPointLocationsCurrentMove;
1478
1479 /// volume of the domain
1481
1482 /// init wfc trunctation radius
1484
1485 /**
1486 * dealii based FE data structres
1487 */
1488 dealii::FESystem<3> FE, FEEigen;
1513 dealii::MatrixFree<3, double> matrix_free_data, d_matrixFreeDataPRefined;
1514 std::shared_ptr<
1516 double,
1519 std::shared_ptr<
1520 dftfe::basis::
1521 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
1523#if defined(DFTFE_WITH_DEVICE)
1524 std::shared_ptr<
1526 double,
1528 d_basisOperationsPtrDevice;
1529 std::shared_ptr<
1530 dftfe::basis::
1531 FEBasisOperations<double, double, dftfe::utils::MemorySpace::DEVICE>>
1532 d_basisOperationsPtrElectroDevice;
1533#endif
1534
1535 std::shared_ptr<
1538
1539 std::shared_ptr<dftfe::oncvClass<dataTypes::number, memorySpace>>
1541
1542 std::shared_ptr<
1545
1546 std::shared_ptr<
1547#if defined(DFTFE_WITH_DEVICE)
1549#else
1551#endif
1553
1554 std::map<dealii::types::global_dof_index, dealii::Point<3>> d_supportPoints,
1556 std::vector<const dealii::AffineConstraints<double> *> d_constraintsVector;
1557 std::vector<const dealii::AffineConstraints<double> *>
1559
1560 /**
1561 * parallel objects
1562 */
1563 const MPI_Comm mpi_communicator;
1564#if defined(DFTFE_WITH_DEVICE)
1565 utils::DeviceCCLWrapper *d_devicecclMpiCommDomainPtr;
1566#endif
1567 const MPI_Comm d_mpiCommParent;
1568 const MPI_Comm interpoolcomm;
1569 const MPI_Comm interBandGroupComm;
1575 std::vector<dealii::types::global_dof_index> local_dof_indicesReal,
1577 std::vector<dealii::types::global_dof_index> localProc_dof_indicesReal,
1579 std::vector<bool> selectedDofsHanging;
1580
1583
1585
1587
1589#ifdef DFTFE_WITH_DEVICE
1590 poissonSolverProblemDeviceWrapperClass d_phiTotalSolverProblemDevice;
1591
1592 poissonSolverProblemDeviceWrapperClass d_phiPrimeSolverProblemDevice;
1593#endif
1594
1596
1598
1599 const std::string d_dftfeScratchFolderName;
1600
1601 /**
1602 * chebyshev subspace iteration solver objects
1603 *
1604 */
1606#ifdef DFTFE_WITH_DEVICE
1607 chebyshevOrthogonalizedSubspaceIterationSolverDevice
1608 d_subspaceIterationSolverDevice;
1609#endif
1610
1611 /**
1612 * constraint Matrices
1613 */
1614
1615 /**
1616 *object which is used to store dealii constraint matrix information
1617 *using STL vectors. The relevant dealii constraint matrix
1618 *has hanging node constraints and periodic constraints(for periodic
1619 *problems) used in eigen solve
1620 */
1623
1624
1625 /**
1626 *object which is used to store dealii constraint matrix information
1627 *using STL vectors. The relevant dealii constraint matrix
1628 *has hanging node constraints used in Poisson problem solution
1629 *
1630 */
1633
1634
1635#ifdef DFTFE_WITH_DEVICE
1637 d_constraintsNoneDataInfoDevice;
1638#endif
1639
1640
1641 dealii::AffineConstraints<double> constraintsNone, constraintsNoneEigen,
1643
1644 dealii::AffineConstraints<double> d_constraintsForTotalPotentialElectro;
1645
1646 dealii::AffineConstraints<double> d_constraintsForPhiPrimeElectro;
1647
1648 dealii::AffineConstraints<double> d_constraintsForHelmholtzRhoNodal;
1649
1650 dealii::AffineConstraints<double> d_constraintsPRefined;
1651
1652 dealii::AffineConstraints<double> d_constraintsPRefinedOnlyHanging;
1653
1654 dealii::AffineConstraints<double> d_constraintsRhoNodal;
1655
1656 dealii::AffineConstraints<double> d_constraintsRhoNodalOnlyHanging;
1657
1660
1661 /**
1662 * data storage for Kohn-Sham eigenvalues and partial occupancies
1663 */
1664 std::vector<std::vector<double>> eigenValues;
1665 std::vector<std::vector<double>> d_partialOccupancies;
1666
1667 /**
1668 * data storage for the occupancy of Kohn-Sham wavefunctions
1669 */
1670 std::vector<std::vector<double>> d_fracOccupancy;
1671
1672 std::vector<std::vector<double>> d_densityMatDerFermiEnergy;
1673
1674 /**
1675 * The indexing of d_eigenVectorsFlattenedHost and
1676 * d_eigenVectorsFlattenedDevice [kPoint * numSpinComponents *
1677 * numLocallyOwnedNodes * numWaveFunctions + iSpin * numLocallyOwnedNodes *
1678 * numWaveFunctions + iNode * numWaveFunctions + iWaveFunction]
1679 */
1683
1687
1688 /// device eigenvectors
1689#ifdef DFTFE_WITH_DEVICE
1692 d_eigenVectorsFlattenedDevice;
1695 d_eigenVectorsDensityMatrixPrimeFlattenedDevice;
1696#endif
1697
1698 /// parallel message stream
1699 dealii::ConditionalOStream pcout;
1700
1701 /// compute-time logger
1702 dealii::TimerOutput computing_timer;
1703 dealii::TimerOutput computingTimerStandard;
1704
1705 /// A plain global timer to track only the total elapsed time after every
1706 /// ground-state solve
1707 dealii::Timer d_globalTimer;
1708
1709 // dft related objects
1710 std::vector<
1714 std::vector<distributedCPUVec<double>> d_densityInNodalValues,
1716
1717 std::vector<
1720
1721 // std::map<dealii::CellId, std::vector<double>> d_phiInValues,
1722 // d_phiOutValues;
1728
1732
1733
1735
1736
1740
1741 std::shared_ptr<AuxDensityMatrix<memorySpace>> d_auxDensityMatrixXCInPtr;
1742 std::shared_ptr<AuxDensityMatrix<memorySpace>> d_auxDensityMatrixXCOutPtr;
1743
1744 // For multipole boundary conditions
1746 std::vector<double> d_dipole;
1747 std::vector<double> d_quadrupole;
1748 std::vector<double> d_smearedChargeMoments;
1750
1751
1752 /// for low rank jacobian inverse approximation
1753 std::deque<distributedCPUVec<double>> d_vcontainerVals;
1754 std::deque<distributedCPUVec<double>> d_fvcontainerVals;
1755 std::deque<distributedCPUVec<double>> d_vSpin0containerVals;
1756 std::deque<distributedCPUVec<double>> d_fvSpin0containerVals;
1757 std::deque<distributedCPUVec<double>> d_vSpin1containerVals;
1758 std::deque<distributedCPUVec<double>> d_fvSpin1containerVals;
1764 static constexpr double d_tikhonovRegularizationConstantLRD = 1.0e-6;
1765
1766 /// for xl-bomd
1767 std::map<dealii::CellId, std::vector<double>> d_rhoAtomsValues,
1769 std::map<dftfe::uInt, std::map<dealii::CellId, std::vector<double>>>
1772
1773 std::vector<
1777
1778 // storage for total electrostatic potential solution vector corresponding
1779 // to input scf electron density
1781
1782 // storage for total electrostatic potential solution vector corresponding
1783 // to output scf electron density
1785
1786 // storage for electrostatic potential Gateaux derivate corresponding
1787 // to electron number preserving electron-density peturbation (required for
1788 // LRDM)
1790
1791 // storage for sum of nuclear electrostatic potential
1793
1794 // storage of densities for xl-bomd
1795 std::deque<distributedCPUVec<double>> d_groundStateDensityHistory;
1796
1797 std::map<dealii::CellId, std::vector<double>> d_pseudoVLoc;
1798
1799 /// Internal data:: map for cell id to Vpseudo local of individual atoms.
1800 /// Only for atoms whose psp tail intersects the local domain.
1801 std::map<dftfe::uInt, std::map<dealii::CellId, std::vector<double>>>
1803
1804
1805 std::vector<std::vector<double>> d_localVselfs;
1806
1807 // nonlocal pseudopotential related objects used only for pseudopotential
1808 // calculation
1809 std::map<dealii::CellId, std::vector<double>> d_rhoCore;
1810
1811 std::map<dealii::CellId, std::vector<double>> d_gradRhoCore;
1812
1813 std::map<dftfe::uInt, std::map<dealii::CellId, std::vector<double>>>
1815
1816 std::map<dealii::CellId, std::vector<double>> d_hessianRhoCore;
1817
1818 std::map<dftfe::uInt, std::map<dealii::CellId, std::vector<double>>>
1820
1821
1822
1823 /// map of atom node number and atomic weight
1824 std::map<dealii::types::global_dof_index, double> d_atomNodeIdToChargeMap;
1825
1826 /// vselfBinsManager object
1828
1829 /// Gateaux derivative of vself field with respect to affine strain tensor
1830 /// components using central finite difference. This is used for cell stress
1831 /// computation
1832 std::vector<distributedCPUVec<double>> d_vselfFieldGateauxDerStrainFDBins;
1833
1834 /// Compute Gateaux derivative of vself field in bins with respect to affine
1835 /// strain tensor components
1836 void
1838
1839 /// dftParameters object
1841
1842 /// kPoint cartesian coordinates
1843 std::vector<double> d_kPointCoordinates;
1844
1845 /// k point crystal coordinates
1846 std::vector<double> kPointReducedCoordinates;
1847
1848 /// k point weights
1849 std::vector<double> d_kPointWeights;
1850
1851 /// closest tria vertex
1852 std::vector<dealii::Point<3>> d_closestTriaVertexToAtomsLocation;
1853 std::vector<dealii::Tensor<1, 3, double>> d_dispClosestTriaVerticesToAtoms;
1854
1855 /// global k index of lower bound of the local k point set
1857 /**
1858 * Recomputes the k point cartesian coordinates from the crystal k point
1859 * coordinates and the current lattice vectors, which can change in each
1860 * ground state solve dutring cell optimization.
1861 */
1862 void
1864
1865 /// fermi energy
1867
1869
1871
1872 /// entropic energy
1874
1875 // chebyshev filter variables and functions
1876 // dftfe::Int numPass ; // number of filter passes
1877
1878 std::vector<double> a0;
1879 std::vector<double> bLow;
1880
1881 /// stores flag for first ever call to chebyshev filtering for a given FEM
1882 /// mesh vector for each k point and spin
1883 std::vector<bool> d_isFirstFilteringCall;
1884
1886
1888
1890
1891
1892 /**
1893 * @ nscf variables
1894 */
1896 void
1898 KohnShamDFTBaseOperator<memorySpace> &kohnShamDFTEigenOperator,
1899 chebyshevOrthogonalizedSubspaceIterationSolver &subspaceIterationSolver);
1900
1901 /**
1902 * @brief compute the maximum of the residual norm of the highest occupied state among all k points
1903 */
1904 double
1906 const std::vector<std::vector<double>>
1907 &residualNormWaveFunctionsAllkPoints,
1908 const std::vector<std::vector<double>> &eigenValuesAllkPoints,
1909 const double _fermiEnergy,
1910 std::vector<double> &maxResidualsAllkPoints);
1911
1912
1913 /**
1914 * @brief compute the maximum of the residual norm of the highest state of interest among all k points
1915 */
1916 double
1918 const std::vector<std::vector<double>>
1919 &residualNormWaveFunctionsAllkPoints,
1920 const std::vector<std::vector<double>> &eigenValuesAllkPoints,
1921 const dftfe::uInt highestState,
1922 std::vector<double> &maxResidualsAllkPoints);
1923
1924
1925
1926#ifdef DFTFE_WITH_DEVICE
1927 void
1929 const dftfe::uInt s,
1930 const dftfe::uInt kPointIndex,
1932 &kohnShamDFTEigenOperator,
1933 elpaScalaManager &elpaScala,
1934 chebyshevOrthogonalizedSubspaceIterationSolverDevice
1935 &subspaceIterationSolverDevice);
1936
1937#endif
1938
1939 void
1941 const dftfe::uInt s,
1942 const dftfe::uInt kPointIndex,
1944 &kohnShamDFTEigenOperator,
1945 elpaScalaManager &elpaScala);
1946
1948 std::shared_ptr<hubbard<dataTypes::number, memorySpace>> d_hubbardClassPtr;
1950 };
1951
1952} // namespace dftfe
1953
1954#endif
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:1724
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:1329
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:1505
std::shared_ptr< excManager< memorySpace > > d_excManagerPtr
Definition dft.h:1309
dftfe::uInt d_feOrderPlusOneQuadratureId
Definition dft.h:1501
dealii::AffineConstraints< double > d_constraintsForPhiPrimeElectro
Definition dft.h:1646
std::vector< std::vector< double > > d_meshSizes
Definition dft.h:1325
const std::vector< std::vector< double > > & getCell() const
Gets the current cell lattice vectors.
dealii::DoFHandler< 3 > d_dofHandlerRhoNodal
Definition dft.h:1490
std::vector< std::vector< dftfe::Int > > d_globalChargeIdToImageIdMapTrunc
globalChargeId to ImageChargeId Map generated with a truncated pspCutOff
Definition dft.h:1404
std::vector< double > d_kPointWeights
k point weights
Definition dft.h:1849
std::map< dealii::CellId, std::vector< double > > d_rhoAtomsValues
for xl-bomd
Definition dft.h:1767
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:1442
std::vector< orbital > waveFunctionsVector
Definition dft.h:1452
void kohnShamEigenSpaceFirstOrderDensityMatResponse(const dftfe::uInt s, const dftfe::uInt kPointIndex, KohnShamDFTBaseOperator< dftfe::utils::MemorySpace::HOST > &kohnShamDFTEigenOperator, elpaScalaManager &elpaScala)
bool scfConverged
Definition dft.h:1895
std::vector< distributedCPUVec< double > > d_densityInNodalValues
Definition dft.h:1714
void computeRhoNodalFirstOrderResponseFromPSIAndPSIPrime(distributedCPUVec< double > &fv, distributedCPUVec< double > &fvSpin0, distributedCPUVec< double > &fvSpin1)
std::vector< std::vector< double > > d_localVselfs
Definition dft.h:1805
std::vector< const dealii::AffineConstraints< double > * > d_constraintsVectorElectro
Definition dft.h:1558
void saveTriaInfoAndRhoNodalData()
save triangulation information and rho quadrature data to checkpoint file for restarts
dealii::AffineConstraints< double > d_constraintsPRefinedOnlyHanging
Definition dft.h:1652
const std::vector< std::vector< double > > & getLocalVselfs() const
std::vector< std::vector< double > > d_imagePositionsTrunc
Definition dft.h:1401
std::vector< double > d_upperBoundUnwantedSpectrumValues
Definition dft.h:1885
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > d_BLASWrapperPtr
Definition dft.h:1552
const MPI_Comm & getMPIParent() const override
std::vector< dealii::Tensor< 1, 3, double > > d_gaussianMovementAtomsNetDisplacements
Definition dft.h:1476
distributedCPUVec< double > d_residualPredicted
Definition dft.h:1759
dftfe::uInt d_phiTotDofHandlerIndexElectro
Definition dft.h:1504
std::deque< distributedCPUVec< double > > d_fvcontainerVals
Definition dft.h:1754
dealii::AffineConstraints< double > constraintsNoneEigen
Definition dft.h:1641
double d_pspCutOff
distance from the domain till which periodic images will be considered
Definition dft.h:1407
void compute_localizationLength(const std::string &locLengthFileName)
compute localization length
dealii::IndexSet d_locallyRelevantDofsRhoNodal
Definition dft.h:1574
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:1496
std::vector< double > d_nearestAtomDistances
nearest atom distances for all domain atoms
Definition dft.h:1369
bool isHubbardCorrectionsUsed()
Function to check if hubbard corrections is being used.
dealii::IndexSet locally_relevant_dofs
Definition dft.h:1573
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:1317
forceClass< memorySpace > * forcePtr
Definition dft.h:1581
std::deque< distributedCPUVec< double > > d_vcontainerVals
for low rank jacobian inverse approximation
Definition dft.h:1753
void noRemeshRhoDataInit()
double numElectronsUp
Definition dft.h:1316
std::shared_ptr< dftfe::atomCenteredOrbitalsPostProcessing< dataTypes::number, memorySpace > > d_atomCenteredOrbitalsPostProcessingPtr
Definition dft.h:1544
double d_entropicEnergy
entropic energy
Definition dft.h:1873
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradPhiInQuadValues
Definition dft.h:1726
void aposterioriMeshGenerate()
double numElectronsDown
Definition dft.h:1316
const double d_smearedChargeWidthMin
minimum smeared charge width
Definition dft.h:1450
dispersionCorrection d_dispersionCorr
Definition dft.h:1310
void initializeKohnShamDFTOperator(const bool initializeCublas=true)
void computeVselfFieldGateauxDerFD()
const std::string d_dftfeScratchFolderName
Definition dft.h:1599
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradDensityTotalInValuesLpspQuad
Definition dft.h:1739
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradPhiOutQuadValues
Definition dft.h:1726
std::vector< double > d_smearedChargeMoments
Definition dft.h:1748
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:1644
std::shared_ptr< AuxDensityMatrix< memorySpace > > d_auxDensityMatrixXCInPtr
Definition dft.h:1741
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:1868
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:1360
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOST > constraintsNoneEigenDataInfo
Definition dft.h:1622
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:1572
std::vector< double > d_gaussianConstantsAutoMesh
Definition dft.h:1350
dftParameters * d_dftParamsPtr
dftParameters object
Definition dft.h:1840
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:1389
std::vector< double > d_flatTopWidthsAutoMeshMove
Definition dft.h:1357
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:1770
dealii::TimerOutput computing_timer
compute-time logger
Definition dft.h:1702
distributedCPUVec< double > d_preCondTotalDensityResidualVector
Definition dft.h:1730
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:1729
void loadDensityFromQuadratureValues()
std::map< dealii::CellId, std::vector< double > > d_bQuadValuesAllAtoms
non-intersecting smeared charges of all atoms at quad points
Definition dft.h:1417
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:1731
std::shared_ptr< AuxDensityMatrix< memorySpace > > d_auxDensityMatrixXCOutPtr
Definition dft.h:1742
std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > d_hessianRhoAtomsValuesSeparate
Definition dft.h:1771
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOST > constraintsNoneDataInfo
Definition dft.h:1632
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > & getDensityOutValues()
distributedCPUVec< double > d_rhoInNodalValuesRead
Definition dft.h:1729
std::map< dftfe::uInt, dftfe::uInt > d_atomTypeAtributes
Definition dft.h:1321
void writeMesh(std::string meshFileName)
void resetRhoNodalIn(distributedCPUVec< double > &OutDensity)
dealii::IndexSet locally_owned_dofs
Definition dft.h:1572
std::vector< dealii::Tensor< 1, 3, double > > d_dispClosestTriaVerticesToAtoms
Definition dft.h:1853
std::map< dftfe::uInt, std::map< dftfe::uInt, std::map< dftfe::uInt, double > > > outerValues
Definition dft.h:1458
std::deque< distributedCPUVec< double > > d_fvSpin1containerVals
Definition dft.h:1758
std::shared_ptr< dftfe::oncvClass< dataTypes::number, memorySpace > > d_oncvClassPtr
Definition dft.h:1540
const MPI_Comm & getMPIInterBand() const override
const distributedCPUVec< double > & getRhoNodalOut() const
std::map< dealii::CellId, std::vector< dftfe::Int > > d_bQuadAtomIdsAllAtomsImages
Definition dft.h:1428
double computeAndPrintKE(dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > &kineticEnergyDensityValues)
Computes the kinetic energy.
double d_autoMeshMaxJacobianRatio
Definition dft.h:1465
std::map< dealii::CellId, std::vector< double > > d_hessianRhoCore
Definition dft.h:1816
elpaScalaManager * d_elpaScala
Definition dft.h:1584
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:1745
void initAtomicRho()
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_densityInQuadValues
Definition dft.h:1712
std::map< dealii::CellId, std::vector< double > > d_gradRhoCore
Definition dft.h:1811
void createpRefinedDofHandler(dealii::parallel::distributed::Triangulation< 3 > &triangulation)
double numElectrons
Definition dft.h:1316
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:1749
distributedCPUVec< double > d_rhoNodalFieldRefined
Definition dft.h:1730
bool d_tolReached
Definition dft.h:1763
chebyshevOrthogonalizedSubspaceIterationSolver d_subspaceIterationSolver
Definition dft.h:1605
const MPI_Comm mpi_communicator
Definition dft.h:1563
std::vector< dealii::types::global_dof_index > local_dof_indicesImag
Definition dft.h:1576
std::vector< std::vector< double > > d_domainBoundingVectors
Definition dft.h:1325
dftfe::utils::MemoryStorage< dataTypes::number, dftfe::utils::MemorySpace::HOST > d_eigenVectorsDensityMatrixPrimeHost
Definition dft.h:1686
std::vector< double > d_imageCharges
Definition dft.h:1382
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:1574
std::deque< distributedCPUVec< double > > d_vSpin1containerVals
Definition dft.h:1757
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:1423
void computeRhoNodalFromPSI()
computes density nodal data from wavefunctions
dftfe::uInt d_nOMPThreads
Definition dft.h:1512
distributedCPUVec< double > d_magInNodalValuesRead
Definition dft.h:1734
std::vector< dftfe::Int > d_imageIds
Definition dft.h:1376
std::map< dealii::CellId, std::vector< double > > d_hessianRhoAtomsValues
Definition dft.h:1768
dealii::DoFHandler< 3 > dofHandler
Definition dft.h:1489
dealii::ConditionalOStream pcout
device eigenvectors
Definition dft.h:1699
std::vector< dftfe::uInt > d_nearestAtomIds
nearest atom ids for all domain atoms
Definition dft.h:1366
dftfe::uInt d_gllQuadratureId
Definition dft.h:1503
std::vector< std::vector< double > > d_densityMatDerFermiEnergy
Definition dft.h:1672
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_densityOutQuadValues
Definition dft.h:1712
std::vector< dealii::Point< 3 > > d_controlPointLocationsCurrentMove
Definition dft.h:1477
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_tauResidualQuadValues
Definition dft.h:1719
std::vector< double > d_smearedChargeScaling
smeared charge normalization scaling for all domain atoms
Definition dft.h:1363
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:1420
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:1554
double getInternalEnergy() const
std::vector< distributedCPUVec< double > > d_densityResidualNodalValues
Definition dft.h:1715
std::map< dealii::CellId, std::vector< double > > d_pseudoVLoc
Definition dft.h:1797
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:1466
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:1883
std::map< dealii::types::global_dof_index, dealii::Point< 3 > > d_supportPointsPRefined
Definition dft.h:1555
dealii::AffineConstraints< double > * getDensityConstraint()
std::vector< dftfe::Int > d_imageIdsTrunc
Definition dft.h:1393
const MPI_Comm interBandGroupComm
Definition dft.h:1569
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:1483
dftfe::uInt d_densityQuadratureIdElectro
Definition dft.h:1510
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
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:1747
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:1642
distributedCPUVec< double > d_phiExt
Definition dft.h:1792
std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > getBasisOperationsHost()
std::vector< std::vector< double > > d_imagePositionsAutoMesh
Definition dft.h:1330
double fermiEnergy
fermi energy
Definition dft.h:1866
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:1719
const std::vector< dealii::types::global_dof_index > & getLocalDofIndicesReal() const
Get local dofs global indices real.
void initpRefinedObjects(const bool recomputeBasisData, const bool meshOnlyDeformed, const bool vselfPerturbationUpdateForStress=false)
dftfe::uInt d_binsStartDofHandlerIndexElectro
Definition dft.h:1508
std::vector< dealii::Tensor< 1, 3, double > > d_atomsDisplacementsGaussianRead
Gaussian displacements of atoms read from file.
Definition dft.h:1333
std::vector< double > bLow
Definition dft.h:1879
const MPI_Comm d_mpiCommParent
Definition dft.h:1567
std::vector< bool > selectedDofsHanging
Definition dft.h:1579
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:1555
std::vector< std::vector< double > > eigenValues
Definition dft.h:1664
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:1326
distributedCPUVec< double > d_phiPrime
Definition dft.h:1789
dftfe::uInt getNumEigenValues() const
double lowrankApproxScfDielectricMatrixInv(const dftfe::uInt scfIter)
dealii::IndexSet locally_relevant_dofsEigen
Definition dft.h:1573
void computeRhoInitialGuessFromPSI(std::vector< std::vector< distributedCPUVec< double > > > eigenVectors)
dftfe::uInt d_forceDofHandlerIndex
Definition dft.h:1492
dftfe::uInt d_forceDofHandlerIndexElectro
Definition dft.h:1497
std::vector< double > kPointReducedCoordinates
k point crystal coordinates
Definition dft.h:1846
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:1456
double getFermiEnergy() const
Get the value of fermi energy.
dftfe::uInt d_nonAtomicWaveFunctions
Number of random wavefunctions.
Definition dft.h:300
dftfe::uInt d_rankCurrentLRD
Definition dft.h:1760
dftfe::uInt numLevels
Definition dft.h:1315
void writeDomainAndAtomCoordinates()
writes the current domain bounding vectors and atom coordinates to files, which are required for geom...
double d_freeEnergy
Definition dft.h:1870
dealii::DoFHandler< 3 > d_dofHandlerPRefined
Definition dft.h:1489
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:1641
double d_relativeErrorJacInvApproxPrevScfLRD
Definition dft.h:1761
std::vector< std::map< dealii::CellId, std::vector< dftfe::uInt > > > d_bCellNonTrivialAtomIdsBins
Definition dft.h:1437
std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, dftfe::utils::MemorySpace::HOST > > d_basisOperationsPtrHost
Definition dft.h:1518
std::vector< dealii::types::global_dof_index > localProc_dof_indicesReal
Definition dft.h:1577
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:1682
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_phiInQuadValues
Definition dft.h:1724
std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< dftfe::utils::MemorySpace::HOST > > d_BLASWrapperPtrHost
Definition dft.h:1537
std::vector< double > d_dipole
Definition dft.h:1746
double d_domainVolume
volume of the domain
Definition dft.h:1480
void readkPointData()
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:1353
expConfiningPotential d_expConfiningPot
Definition dft.h:1947
void initBoundaryConditions(const bool recomputeBasisData=true, const bool meshOnlyDeformed=false, const bool vselfPerturbationUpdateForStress=false)
void outputDensity()
write electron density solution fields
void runFunctionalTest()
double d_nlPSPCutOff
Definition dft.h:1414
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_densityResidualQuadValues
Definition dft.h:1713
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)....
symmetryClass< memorySpace > * symmetryPtr
Definition dft.h:1582
dealii::Timer d_globalTimer
Definition dft.h:1707
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:1575
poissonSolverProblemWrapperClass d_phiTotalSolverProblem
Definition dft.h:1586
dealii::MatrixFree< 3, double > matrix_free_data
Definition dft.h:1513
dealii::AffineConstraints< double > d_constraintsRhoNodalOnlyHanging
Definition dft.h:1656
double fermiEnergyDown
Definition dft.h:1866
std::vector< std::vector< double > > d_fracOccupancy
Definition dft.h:1670
std::vector< dealii::Point< 3 > > d_closestTriaVertexToAtomsLocation
closest tria vertex
Definition dft.h:1852
std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > d_gradRhoCoreAtoms
Definition dft.h:1814
bool d_isAtomsGaussianDisplacementsReadFromFile
Definition dft.h:1341
void computeStress()
poissonSolverProblemWrapperClass d_phiPrimeSolverProblem
Definition dft.h:1588
double d_residualNormPredicted
Definition dft.h:1762
static constexpr double d_tikhonovRegularizationConstantLRD
Definition dft.h:1764
std::map< dftfe::uInt, dftfe::uInt > d_atomIdPseudopotentialInterestToGlobalId
Definition dft.h:1328
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_gradDensityOutQuadValues
Definition dft.h:1775
dftfe::uInt d_lpspQuadratureIdElectro
Definition dft.h:1502
dftfe::uInt d_phiExtDofHandlerIndexElectro
Definition dft.h:1491
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_densityTotalInValuesLpspQuad
Definition dft.h:1738
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:1770
void outputWfc(const std::string outputFileName="wfcOutput")
write wavefunction solution fields
dealii::AffineConstraints< double > d_constraintsPRefined
Definition dft.h:1650
std::map< dealii::CellId, std::vector< double > > d_gradRhoAtomsValues
Definition dft.h:1768
std::map< dealii::CellId, std::vector< dftfe::uInt > > d_bCellNonTrivialAtomIds
Definition dft.h:1432
double getFreeEnergy() const
std::vector< std::vector< double > > d_reciprocalLatticeVectors
Definition dft.h:1325
MixingScheme d_mixingScheme
Definition dft.h:1727
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:1522
meshMovementAffineTransform d_affineTransformMesh
affine transformation object
Definition dft.h:1470
std::vector< double > a0
Definition dft.h:1878
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:1386
std::shared_ptr< dftfe::basis::FEBasisOperations< dataTypes::number, double, memorySpace > > getBasisOperationsMemSpace()
triangulationManager d_mesh
Definition dft.h:1463
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:1447
double fermiEnergyUp
Definition dft.h:1866
std::map< dealii::types::global_dof_index, double > d_atomNodeIdToChargeMap
map of atom node number and atomic weight
Definition dft.h:1824
std::shared_ptr< hubbard< dataTypes::number, memorySpace > > d_hubbardClassPtr
Definition dft.h:1948
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:1500
elpaScalaManager * getElpaScalaManager() const
const std::vector< double > & getKPointWeights() const
std::vector< double > d_imageChargesTrunc
Definition dft.h:1397
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:1756
bool d_useHubbard
Definition dft.h:1949
dftParameters & getParametersObject() const
Get reference to dftParameters object.
dftfe::uInt d_phiTotAXQuadratureIdElectro
Definition dft.h:1506
dealii::AffineConstraints< double > d_constraintsRhoNodal
Definition dft.h:1654
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:1887
dealii::MatrixFree< 3, double > d_matrixFreeDataPRefined
Definition dft.h:1513
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:1495
double computeTraceXtKX(dftfe::uInt numberWaveFunctionsEstimate)
void normalizeRhoOutQuadValues()
normalize the output total electron density in each scf
double d_groundStateEnergy
Definition dft.h:1866
dftfe::uInt d_smearedChargeQuadratureIdElectro
Definition dft.h:1498
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:1739
const std::map< dealii::CellId, std::vector< dftfe::uInt > > & getbCellNonTrivialAtomIds() const
double lowrankApproxScfDielectricMatrixInvSpinPolarized(const dftfe::uInt scfIter)
dftfe::uInt d_nlpspQuadratureId
Definition dft.h:1499
double getNumElectrons() const
Get the number of electrons.
dealii::FESystem< 3 > FEEigen
Definition dft.h:1488
void recomputeKPointCoordinates()
int lowerBoundKindex
global k index of lower bound of the local k point set
Definition dft.h:1856
std::vector< distributedCPUVec< double > > d_densityOutNodalValues
Definition dft.h:1715
dealii::FESystem< 3 > FE
Definition dft.h:1488
void trivialSolveForStress()
bool d_kohnShamDFTOperatorsInitialized
Definition dft.h:1595
std::vector< const dealii::AffineConstraints< double > * > d_constraintsVector
Definition dft.h:1556
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:1324
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:1719
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:1776
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:1703
void normalizeAtomicRhoQuadValues()
normalize the electron density
void solveBands()
compute bands without solving the SCF iteration
const dftfe::uInt n_mpi_processes
Definition dft.h:1570
std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > d_pseudoVLocAtoms
Definition dft.h:1802
double d_atomicRhoScalingFac
Definition dft.h:1006
std::vector< dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > d_gradDensityInQuadValues
Definition dft.h:1775
std::vector< dealii::types::global_dof_index > localProc_dof_indicesImag
Definition dft.h:1578
std::vector< double > d_netFloatingDispSinceLastCheckForSmearedChargeOverlaps
Definition dft.h:1339
std::vector< double > d_kPointCoordinates
kPoint cartesian coordinates
Definition dft.h:1843
std::map< dealii::CellId, std::vector< double > > d_rhoCore
Definition dft.h:1809
KohnShamDFTBaseOperator< memorySpace > * d_kohnShamDFTOperatorPtr
Definition dft.h:1597
dftfe::uInt d_numEigenValues
Number of Kohn-Sham eigen values to be computed.
Definition dft.h:294
const dealii::Tensor< 2, 3, double > & getCellStress() const
Gets the current cell stress from dftClass.
const dftfe::uInt this_mpi_process
Definition dft.h:1571
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:1336
distributedCPUVec< double > d_phiTotRhoOut
Definition dft.h:1784
bool d_isRestartGroundStateCalcFromChk
Definition dft.h:1889
dftUtils::constraintMatrixInfo< dftfe::utils::MemorySpace::HOST > d_constraintsRhoNodalInfo
Definition dft.h:1659
dftfe::uInt d_densityDofHandlerIndexElectro
Definition dft.h:1494
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:1568
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:1507
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:1493
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:1324
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:1665
dealii::DoFHandler< 3 > dofHandlerEigen
Definition dft.h:1489
chebyshevOrthogonalizedSubspaceIterationSolver * getSubspaceIterationSolverHost()
Get the Ptr to Chebyshev solver in host.
vselfBinsManager d_vselfBinsManager
vselfBinsManager object
Definition dft.h:1827
std::vector< distributedCPUVec< double > > d_vselfFieldGateauxDerStrainFDBins
Definition dft.h:1832
std::vector< double > d_gaussianConstantsForce
Definition dft.h:1346
dealii::AffineConstraints< double > d_constraintsForHelmholtzRhoNodal
Definition dft.h:1648
std::map< dftfe::uInt, std::map< dealii::CellId, std::vector< double > > > d_hessianRhoCoreAtoms
Definition dft.h:1819
dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > d_gradPhiResQuadValues
Definition dft.h:1726
const std::vector< std::vector< double > > & getEigenValues() const
Get reference to the eigen values.
void generateMPGrid()
const double d_pspCutOffTrunc
distance from the domain till which periodic images will be considered
Definition dft.h:1410
distributedCPUVec< double > d_phiTotRhoIn
Definition dft.h:1780
double d_minDist
Definition dft.h:1372
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:1738
std::deque< distributedCPUVec< double > > d_vSpin0containerVals
Definition dft.h:1755
std::deque< distributedCPUVec< double > > d_groundStateDensityHistory
Definition dft.h:1795
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:1509
meshMovementGaussianClass d_gaussianMovePar
meshMovementGaussianClass object
Definition dft.h:1473
double getTotalChargeforRhoSplit()
dftfe::uInt d_sparsityPatternQuadratureId
Definition dft.h:1511
void calculateSmearedChargeWidths()
a
dftfe::uInt d_eigenDofHandlerIndex
Definition dft.h:1491
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 update triangulation under affine transformation.
Definition meshMovementAffineTransform.h:30
Class to move triangulation nodes using Gaussian functions attached to control points.
Definition meshMovementGaussian.h:30
Definition poissonSolverProblemWrapper.h:66
density symmetrization based on irreducible Brillouin zone calculation, only relevant for calculation...
Definition symmetry.h:39
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:42
@ 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