DFT-FE 1.3.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
excDensityGGAClass.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#ifndef DFTFE_EXCDENSITYGGACLASS_H
18#define DFTFE_EXCDENSITYGGACLASS_H
19
20#include <xc.h>
22namespace dftfe
23{
24 class NNGGA;
25 template <dftfe::utils::MemorySpace memorySpace>
27 {
28 public:
29 excDensityGGAClass(std::shared_ptr<xc_func_type> &funcXPtr,
30 std::shared_ptr<xc_func_type> &funcCPtr,
31 const bool useLibXC);
32
33
34 excDensityGGAClass(std::shared_ptr<xc_func_type> &funcXPtr,
35 std::shared_ptr<xc_func_type> &funcCPtr,
36 std::string modelXCInputFile,
37 const bool useLibXC);
38
39
41
42
43
44 void
46 AuxDensityMatrix<memorySpace> &auxDensityMatrix,
47 const std::pair<dftfe::uInt, dftfe::uInt> &quadIndexRange,
48 std::unordered_map<
51 &xDataOut,
52 std::unordered_map<
55 &cDataout) const override;
56 void
58 const std::vector<xcRemainderOutputDataAttributes> &outputDataAttributes)
59 const override;
60
61 void
64 &src,
66 const dftfe::uInt inputVecSize,
67 const dftfe::uInt kPointIndex,
68 const dftfe::uInt spinIndex) override;
69
70 /*
71 * @brief The apply function that will be called in HXCheby() with single precision.
72 * The distribute() and updateGhostValues() for src
73 * has to be called before this function.
74 * Similarly for dst, accumulateLocallyOwned() should be called in HX()
75 * after this function is called. param[in] src The input vector param[out]
76 * dst The output vector param[in] inputVecSize The size of the input vector
77 * param[in] kPointIndex the k point for which the HX() is called
78 * param[in] spinIndex the spin index for which the HX() is called
79 */
80 void
83 memorySpace> &src,
85 &dst,
86 const dftfe::uInt inputVecSize,
87 const dftfe::uInt kPointIndex,
88 const dftfe::uInt spinIndex) override;
89
90 void
92 const std::shared_ptr<AuxDensityMatrix<memorySpace>> &auxDensityMatrixPtr,
93 const std::vector<double> &kPointWeights) override;
94 void
96 const std::shared_ptr<AuxDensityMatrix<memorySpace>> &auxDensityMatrix,
97 const std::vector<double> &kPointWeights) override;
98
99 double
101
102 double
104
105 void
107
108 private:
110 std::shared_ptr<xc_func_type> d_funcXPtr;
111 std::shared_ptr<xc_func_type> d_funcCPtr;
112 std::vector<double> d_spacingFDStencil;
114 bool d_useLibXC; ///< Flag to indicate whether to use libxc or not
115 };
116} // namespace dftfe
117#endif // DFTFE_EXCDENSITYGGACLASS_H
Definition AuxDensityMatrix.h:40
ExcSSDFunctionalBaseClass(const ExcFamilyType excFamType, const densityFamilyType densityFamType, const std::vector< DensityDescriptorDataAttributes > &densityDescriptorAttributesList)
Definition ExcSSDFunctionalBaseClass.t.cc:25
void computeRhoTauDependentXCData(AuxDensityMatrix< memorySpace > &auxDensityMatrix, const std::pair< dftfe::uInt, dftfe::uInt > &quadIndexRange, std::unordered_map< xcRemainderOutputDataAttributes, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > &xDataOut, std::unordered_map< xcRemainderOutputDataAttributes, dftfe::utils::MemoryStorage< double, dftfe::utils::MemorySpace::HOST > > &cDataout) const override
excDensityGGAClass(std::shared_ptr< xc_func_type > &funcXPtr, std::shared_ptr< xc_func_type > &funcCPtr, const bool useLibXC)
void checkInputOutputDataAttributesConsistency(const std::vector< xcRemainderOutputDataAttributes > &outputDataAttributes) const override
NNGGA * d_NNGGAPtr
Definition excDensityGGAClass.h:109
std::shared_ptr< xc_func_type > d_funcCPtr
Definition excDensityGGAClass.h:111
void reinitKPointDependentVariables(dftfe::uInt kPointIndex) override
void applyWaveFunctionDependentFuncDerWrtPsi(const dftfe::linearAlgebra::MultiVector< dataTypes::number, memorySpace > &src, dftfe::linearAlgebra::MultiVector< dataTypes::number, memorySpace > &dst, const dftfe::uInt inputVecSize, const dftfe::uInt kPointIndex, const dftfe::uInt spinIndex) override
bool d_useLibXC
Flag to indicate whether to use libxc or not.
Definition excDensityGGAClass.h:114
void updateWaveFunctionDependentFuncDerWrtPsi(const std::shared_ptr< AuxDensityMatrix< memorySpace > > &auxDensityMatrixPtr, const std::vector< double > &kPointWeights) override
void computeWaveFunctionDependentExcEnergy(const std::shared_ptr< AuxDensityMatrix< memorySpace > > &auxDensityMatrix, const std::vector< double > &kPointWeights) override
std::vector< double > d_spacingFDStencil
Definition excDensityGGAClass.h:112
std::shared_ptr< xc_func_type > d_funcXPtr
Definition excDensityGGAClass.h:110
void applyWaveFunctionDependentFuncDerWrtPsi(const dftfe::linearAlgebra::MultiVector< dataTypes::numberFP32, memorySpace > &src, dftfe::linearAlgebra::MultiVector< dataTypes::numberFP32, memorySpace > &dst, const dftfe::uInt inputVecSize, const dftfe::uInt kPointIndex, const dftfe::uInt spinIndex) override
excDensityGGAClass(std::shared_ptr< xc_func_type > &funcXPtr, std::shared_ptr< xc_func_type > &funcCPtr, std::string modelXCInputFile, const bool useLibXC)
double getWaveFunctionDependentExcEnergy() override
dftfe::uInt d_vxcDivergenceTermFDStencilSize
Definition excDensityGGAClass.h:113
double getExpectationOfWaveFunctionDependentExcFuncDerWrtPsi() override
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition MultiVector.h:127
Definition MemoryStorage.h:33
float numberFP32
Definition dftfeDataTypes.h:41
Definition pseudoPotentialToDftfeConverter.cc:34
xcRemainderOutputDataAttributes
Definition ExcSSDFunctionalBaseClass.h:58
std::uint32_t uInt
Definition TypeConfig.h:10