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 <xc.h>
37
38namespace dftefe
39{
40 namespace ksdft
41 {
42 template <typename ValueTypeBasisData,
43 typename ValueTypeBasisCoeff,
44 utils::MemorySpace memorySpace,
45 size_type dim>
47 : public Hamiltonian<ValueTypeBasisData, memorySpace>,
48 public Energy<linearAlgebra::blasLapack::real_type<
49 linearAlgebra::blasLapack::scalar_type<ValueTypeBasisData,
50 ValueTypeBasisCoeff>>>
51 {
52 public:
53 using ValueType =
55 ValueTypeBasisCoeff>;
56
58
60
61 public:
67 &electronChargeDensity,
68 std::shared_ptr<
70 feBasisDataStorage,
72 linAlgOpContext,
73 const size_type cellBlockSize);
74
76
77 void
79 std::shared_ptr<
81 feBasisDataStorage);
82
83 void
86 &electronChargeDensity);
87
88 void
89 getLocal(Storage &cellWiseStorage) const override;
90
91 void
93
95 getEnergy() const override;
96
99
100 void
104 bool updateGhostX,
105 bool updateGhostY) const override;
106
107 bool
108 hasLocalComponent() const override;
109
110 bool
111 hasNonLocalComponent() const override;
112
113 std::shared_ptr<const basis::FEBasisOperations<ValueTypeBasisCoeff,
114 ValueTypeBasisData,
115 memorySpace,
116 dim>>
118
119 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
120 getLinAlgOpContext() const;
121
122 private:
123 std::shared_ptr<
128 std::shared_ptr<
131 std::shared_ptr<
134 std::shared_ptr<const basis::FEBasisOperations<ValueTypeBasisCoeff,
135 ValueTypeBasisData,
136 memorySpace,
137 dim>>
141 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
143
144 xc_func_type *d_funcX;
145 xc_func_type *d_funcC;
146
148
149 }; // end of class ExchangeCorrelationFE
150 } // end of namespace ksdft
151} // end of namespace dftefe
153#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:57
Definition: Energy.h:35
Definition: ExchangeCorrelationFE.h:51
utils::MemoryStorage< RealType, utils::MemorySpace::HOST > * d_rho
Definition: ExchangeCorrelationFE.h:147
RealType d_energy
Definition: ExchangeCorrelationFE.h:139
linearAlgebra::blasLapack::real_type< ValueType > RealType
Definition: ExchangeCorrelationFE.h:57
bool hasNonLocalComponent() const override
Definition: ExchangeCorrelationFE.t.cpp:454
const quadrature::QuadratureValuesContainer< RealType, memorySpace > * d_electronChargeDensity
Definition: ExchangeCorrelationFE.h:127
RealType getEnergy() const override
Definition: ExchangeCorrelationFE.t.cpp:390
void applyNonLocal(linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > &X, linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > &Y, bool updateGhostX, bool updateGhostY) const override
Definition: ExchangeCorrelationFE.t.cpp:422
std::shared_ptr< const basis::FEBasisDofHandler< ValueTypeBasisCoeff, memorySpace, dim > > d_feBasisDofHandler
Definition: ExchangeCorrelationFE.h:130
~ExchangeCorrelationFE()
Definition: ExchangeCorrelationFE.t.cpp:185
void reinitBasis(std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > feBasisDataStorage)
Definition: ExchangeCorrelationFE.t.cpp:215
xc_func_type * d_funcC
Definition: ExchangeCorrelationFE.h:145
void getLocal(Storage &cellWiseStorage) const override
Definition: ExchangeCorrelationFE.t.cpp:313
linearAlgebra::blasLapack::scalar_type< ValueTypeBasisData, ValueTypeBasisCoeff > ValueType
Definition: ExchangeCorrelationFE.h:55
bool hasLocalComponent() const override
Definition: ExchangeCorrelationFE.t.cpp:441
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > getLinAlgOpContext() const
Definition: ExchangeCorrelationFE.t.cpp:483
const size_type d_cellBlockSize
Definition: ExchangeCorrelationFE.h:140
std::shared_ptr< const basis::FEBasisOperations< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > > getHamiltonianFEBasisOperations() const
Definition: ExchangeCorrelationFE.t.cpp:470
void evalEnergy(const utils::mpi::MPIComm &comm)
Definition: ExchangeCorrelationFE.t.cpp:332
xc_func_type * d_funcX
Definition: ExchangeCorrelationFE.h:144
void reinitField(const quadrature::QuadratureValuesContainer< RealType, memorySpace > &electronChargeDensity)
Definition: ExchangeCorrelationFE.t.cpp:255
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: ExchangeCorrelationFE.h:142
std::shared_ptr< const basis::FEBasisOperations< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > > d_feBasisOp
Definition: ExchangeCorrelationFE.h:138
std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > d_feBasisDataStorage
Definition: ExchangeCorrelationFE.h:133
const quadrature::QuadratureValuesContainer< ValueType, memorySpace > & getFunctionalDerivative() const
Definition: ExchangeCorrelationFE.t.cpp:408
std::shared_ptr< quadrature::QuadratureValuesContainer< RealType, memorySpace > > d_xcPotentialQuad
Definition: ExchangeCorrelationFE.h:125
Definition: Hamiltonian.h:35
Definition: LinAlgOpContext.h:38
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
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
unsigned int size_type
Definition: TypeConfig.h:8