DFT-FE 1.3.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
excDensityLDAClass.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 DFTFE_EXCDENSIYLDACLASS_H
19#define DFTFE_EXCDENSIYLDACLASS_H
20
21#include <xc.h>
23namespace dftfe
24{
25 class NNLDA;
26 template <dftfe::utils::MemorySpace memorySpace>
28 {
29 public:
30 excDensityLDAClass(std::shared_ptr<xc_func_type> &funcXPtr,
31 std::shared_ptr<xc_func_type> &funcCPtr,
32 const bool useLibXC,
33 std::string XCType);
34
35 excDensityLDAClass(std::shared_ptr<xc_func_type> &funcXPtr,
36 std::shared_ptr<xc_func_type> &funcCPtr,
37 std::string modelXCInputFile,
38 const bool useLibXC,
39 std::string XCType);
40
42
43
44
45 void
47 AuxDensityMatrix<memorySpace> &auxDensityMatrix,
48 const std::pair<dftfe::uInt, dftfe::uInt> &quadIndexRange,
49 std::unordered_map<
52 &xDataOut,
53 std::unordered_map<
56 &cDataout) const override;
57 void
59 const std::vector<xcRemainderOutputDataAttributes> &outputDataAttributes)
60 const override;
61
62 void
65 &src,
67 const dftfe::uInt inputVecSize,
68 const dftfe::uInt kPointIndex,
69 const dftfe::uInt spinIndex) override;
70
71
72 /*
73 * @brief The apply function that will be called in HXCheby() with single precision.
74 * The distribute() and updateGhostValues() for src
75 * has to be called before this function.
76 * Similarly for dst, accumulateLocallyOwned() should be called in HX()
77 * after this function is called. param[in] src The input vector param[out]
78 * dst The output vector param[in] inputVecSize The size of the input vector
79 * param[in] kPointIndex the k point for which the HX() is called
80 * param[in] spinIndex the spin index for which the HX() is called
81 */
82 void
85 memorySpace> &src,
87 &dst,
88 const dftfe::uInt inputVecSize,
89 const dftfe::uInt kPointIndex,
90 const dftfe::uInt spinIndex) override;
91
92 void
94 const std::shared_ptr<AuxDensityMatrix<memorySpace>> &auxDensityMatrixPtr,
95 const std::vector<double> &kPointWeights) override;
96 void
98 const std::shared_ptr<AuxDensityMatrix<memorySpace>> &auxDensityMatrix,
99 const std::vector<double> &kPointWeights) override;
100
101 double
103
104 double
106
107 void
109
110 private:
112 std::shared_ptr<xc_func_type> d_funcXPtr;
113 std::shared_ptr<xc_func_type> d_funcCPtr;
114 bool d_useLibXC; ///< Flag to indicate whether to use libxc or not
115 std::string d_XCType;
116 };
117} // namespace dftfe
118
119#endif // DFTFE_EXCDENSIYLDACLASS_H
Definition AuxDensityMatrix.h:40
ExcSSDFunctionalBaseClass(const ExcFamilyType excFamType, const densityFamilyType densityFamType, const std::vector< DensityDescriptorDataAttributes > &densityDescriptorAttributesList)
Definition ExcSSDFunctionalBaseClass.t.cc:25
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
double getExpectationOfWaveFunctionDependentExcFuncDerWrtPsi() override
void checkInputOutputDataAttributesConsistency(const std::vector< xcRemainderOutputDataAttributes > &outputDataAttributes) const 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
std::shared_ptr< xc_func_type > d_funcXPtr
Definition excDensityLDAClass.h:112
void reinitKPointDependentVariables(dftfe::uInt kPointIndex) override
excDensityLDAClass(std::shared_ptr< xc_func_type > &funcXPtr, std::shared_ptr< xc_func_type > &funcCPtr, const bool useLibXC, std::string XCType)
NNLDA * d_NNLDAPtr
Definition excDensityLDAClass.h:111
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
void computeWaveFunctionDependentExcEnergy(const std::shared_ptr< AuxDensityMatrix< memorySpace > > &auxDensityMatrix, const std::vector< double > &kPointWeights) override
void updateWaveFunctionDependentFuncDerWrtPsi(const std::shared_ptr< AuxDensityMatrix< memorySpace > > &auxDensityMatrixPtr, const std::vector< double > &kPointWeights) override
bool d_useLibXC
Flag to indicate whether to use libxc or not.
Definition excDensityLDAClass.h:114
std::shared_ptr< xc_func_type > d_funcCPtr
Definition excDensityLDAClass.h:113
std::string d_XCType
Definition excDensityLDAClass.h:115
double getWaveFunctionDependentExcEnergy() override
excDensityLDAClass(std::shared_ptr< xc_func_type > &funcXPtr, std::shared_ptr< xc_func_type > &funcCPtr, std::string modelXCInputFile, const bool useLibXC, std::string XCType)
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:42
Definition pseudoPotentialToDftfeConverter.cc:34
xcRemainderOutputDataAttributes
Definition ExcSSDFunctionalBaseClass.h:58
std::uint32_t uInt
Definition TypeConfig.h:10