DFT-EFE
 
Loading...
Searching...
No Matches
ExchangeCorrelationFE.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2021. *
3 * The Regents of the University of Michigan and DFT-EFE developers. *
4 * *
5 * This file is part of the DFT-EFE code. *
6 * *
7 * DFT-EFE is free software: you can redistribute it and/or modify *
8 * it under the terms of the Lesser GNU General Public License as *
9 * published by the Free Software Foundation, either version 3 of *
10 * the License, or (at your option) any later version. *
11 * *
12 * DFT-EFE is distributed in the hope that it will be useful, but *
13 * WITHOUT ANY WARRANTY; without even the implied warranty *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
15 * See the Lesser GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License at the top level of DFT-EFE distribution. If not, see *
19 * <https://www.gnu.org/licenses/>. *
20 ******************************************************************************/
21
22/*
23 * @author Avirup Sircar
24 */
25
26#ifndef dftefeExchangeCorrelationFE_h
27#define dftefeExchangeCorrelationFE_h
28
30#include <ksdft/Hamiltonian.h>
31#include <ksdft/Energy.h>
35#include <ksdft/Defaults.h>
36#include <ksdft/RDM1.h>
37#include <ksdft/ExcManager.h>
39#include <utils/Point.h>
40
41namespace dftefe
42{
43 namespace ksdft
44 {
45 template <typename ValueTypeBasisData,
46 typename ValueTypeBasisCoeff,
47 utils::MemorySpace memorySpace,
48 size_type dim>
50 : public Hamiltonian<ValueTypeBasisData, memorySpace>,
51 public Energy<linearAlgebra::blasLapack::real_type<
52 linearAlgebra::blasLapack::scalar_type<ValueTypeBasisData,
53 ValueTypeBasisCoeff>>>
54 {
55 public:
56 using ValueType =
58 ValueTypeBasisCoeff>;
59
61
63
64 public:
65 // No NLCC.
67 const std::string xcType,
70 linAlgOpContext,
71 const size_type cellBlockSize);
72
73 // With NLCC. Core correction is added internally before every libxc call.
75 const std::string xcType,
78 linAlgOpContext,
79 const size_type cellBlockSize,
80 std::shared_ptr<const atoms::AtomSphericalDataContainer>
81 atomSphericalDataContainerPSP,
82 const std::vector<std::string> & atomSymbolVec,
83 const std::vector<utils::Point> &atomCoordinates);
84
86
87 void
89
90 void
92
93 void
94 getLocal(Storage &cellWiseStorage) const override;
95
96 void
98 const utils::mpi::MPIComm & comm);
99
101 getEnergy() const override;
102
105
106 void
110 bool updateGhostX,
111 bool updateGhostY) const override;
112
113 bool
114 hasLocalComponent() const override;
115
116 bool
117 hasNonLocalComponent() const override;
118
119 std::shared_ptr<const basis::FEBasisOperations<ValueTypeBasisCoeff,
120 ValueTypeBasisData,
121 memorySpace,
122 dim>>
124
125 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
126 getLinAlgOpContext() const;
127
129 getExcFamilyType() const;
130
131 private:
132 std::shared_ptr<
135 // GGA only: returns the dim-component field
136 // f_d = 2*(dEx/dσ_αα+dEc/dσ_αα)*∇ρ↑_d + (dEx/dσ_αβ+dEc/dσ_αβ)*∇ρ↓_d
137 // used by getLocal to assemble ∫ f·∇(φ_iφ_j) dV
138 std::shared_ptr<
141 std::shared_ptr<
144 std::shared_ptr<
147 std::shared_ptr<const basis::FEBasisOperations<ValueTypeBasisCoeff,
148 ValueTypeBasisData,
149 memorySpace,
150 dim>>
154 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
156
159
160 std::shared_ptr<
163 // GGA + NLCC: dim-component gradient ∇ρ_core at each quad point.
164 std::shared_ptr<
167
168 }; // end of class ExchangeCorrelationFE
169 } // end of namespace ksdft
170} // end of namespace dftefe
172#endif // dftefeExchangeCorrelationFE_h
An abstract class to store and access data for a given basis, such as the basis function values on a ...
Definition: FEBasisDataStorage.h:54
Definition: FEBasisDofHandler.h:57
Definition: FEBasisOperations.h:64
Definition: Energy.h:35
Definition: ExcManager.h:30
Definition: ExchangeCorrelationFE.h:54
std::shared_ptr< quadrature::QuadratureValuesContainer< RealType, memorySpace > > d_derExcWithSigmaTimesGradRhoQuadMemspace
Definition: ExchangeCorrelationFE.h:140
RealType d_energy
Definition: ExchangeCorrelationFE.h:152
std::shared_ptr< quadrature::QuadratureValuesContainer< RealType, memorySpaceHost > > d_coreCorrectionUPF
Definition: ExchangeCorrelationFE.h:162
linearAlgebra::blasLapack::real_type< ValueType > RealType
Definition: ExchangeCorrelationFE.h:60
bool hasNonLocalComponent() const override
Definition: ExchangeCorrelationFE.t.cpp:814
RealType getEnergy() const override
Definition: ExchangeCorrelationFE.t.cpp:750
ExcManager< memorySpace > d_excManager
Definition: ExchangeCorrelationFE.h:157
void applyNonLocal(linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > &X, linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > &Y, bool updateGhostX, bool updateGhostY) const override
Definition: ExchangeCorrelationFE.t.cpp:782
std::shared_ptr< const basis::FEBasisDofHandler< ValueTypeBasisCoeff, memorySpace, dim > > d_feBasisDofHandler
Definition: ExchangeCorrelationFE.h:143
~ExchangeCorrelationFE()
Definition: ExchangeCorrelationFE.t.cpp:149
void evalEnergy(RDM1< ValueType, memorySpace > &rdm1, const utils::mpi::MPIComm &comm)
Definition: ExchangeCorrelationFE.t.cpp:568
void getLocal(Storage &cellWiseStorage) const override
Definition: ExchangeCorrelationFE.t.cpp:524
void reinitField(RDM1< ValueType, memorySpace > &rdm1)
Definition: ExchangeCorrelationFE.t.cpp:230
Storage d_sigmaGradRhoCellStorage
Definition: ExchangeCorrelationFE.h:158
linearAlgebra::blasLapack::scalar_type< ValueTypeBasisData, ValueTypeBasisCoeff > ValueType
Definition: ExchangeCorrelationFE.h:58
bool hasLocalComponent() const override
Definition: ExchangeCorrelationFE.t.cpp:801
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > getLinAlgOpContext() const
Definition: ExchangeCorrelationFE.t.cpp:843
const size_type d_cellBlockSize
Definition: ExchangeCorrelationFE.h:153
std::shared_ptr< const basis::FEBasisOperations< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > > getHamiltonianFEBasisOperations() const
Definition: ExchangeCorrelationFE.t.cpp:830
void reinitBasis(RDM1< ValueType, memorySpace > &rdm1)
Definition: ExchangeCorrelationFE.t.cpp:160
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: ExchangeCorrelationFE.h:155
std::shared_ptr< const basis::FEBasisOperations< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > > d_feBasisOp
Definition: ExchangeCorrelationFE.h:151
ExcFamilyType getExcFamilyType() const
Definition: ExchangeCorrelationFE.t.cpp:856
std::shared_ptr< quadrature::QuadratureValuesContainer< RealType, memorySpace > > d_xcPotentialQuadMemspace
Definition: ExchangeCorrelationFE.h:134
std::shared_ptr< quadrature::QuadratureValuesContainer< RealType, memorySpaceHost > > d_coreCorrectionGradUPF
Definition: ExchangeCorrelationFE.h:166
std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > d_feBasisDataStorage
Definition: ExchangeCorrelationFE.h:146
const quadrature::QuadratureValuesContainer< ValueType, memorySpace > & getFunctionalDerivative() const
Definition: ExchangeCorrelationFE.t.cpp:768
Definition: Hamiltonian.h:35
Abstract class for the one-particle reduced density matrix.
Definition: RDM1.h:52
Definition: LinAlgOpContext.h:52
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
Definition: QuadratureValuesContainer.h:39
Definition: MemoryStorage.h:38
ExcFamilyType
Definition: ExcSSDFunctionalBaseClass.h:35
typeInternal::real_type< ValueType > real_type
Definition: BlasLapackTypedef.h:177
typeInternal::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:183
int MPIComm
Definition: MPITypes.h:84
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
std::uint64_t size_type
Definition: TypeConfig.h:9