DFT-EFE
 
Loading...
Searching...
No Matches
ElectrostaticONCVNonLocFE.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 dftefeElectrostaticONCVNonLocFE_h
27#define dftefeElectrostaticONCVNonLocFE_h
28
44
45namespace dftefe
46{
47 namespace ksdft
48 {
49 template <typename ValueTypeBasisData,
50 typename ValueTypeBasisCoeff,
51 typename ValueTypeWaveFnBasis,
52 typename ValueTypeWaveFnCoeff,
53 utils::MemorySpace memorySpace,
54 size_type dim>
56 : public ElectrostaticFE<ValueTypeBasisData,
57 ValueTypeBasisCoeff,
58 ValueTypeWaveFnBasis,
59 memorySpace,
60 dim>
61 {
62 public:
63 using ValueType = typename ElectrostaticFE<ValueTypeBasisData,
64 ValueTypeBasisCoeff,
65 ValueTypeWaveFnBasis,
66 memorySpace,
67 dim>::ValueType;
68 using Storage = typename ElectrostaticFE<ValueTypeBasisData,
69 ValueTypeBasisCoeff,
70 ValueTypeWaveFnBasis,
71 memorySpace,
72 dim>::Storage;
73 using RealType = typename ElectrostaticFE<ValueTypeBasisData,
74 ValueTypeBasisCoeff,
75 ValueTypeWaveFnBasis,
76 memorySpace,
77 dim>::RealType;
78
79 public:
83 // used if analytical vself canellation route taken
85 const std::vector<utils::Point> &atomCoordinates,
86 const std::vector<double> & atomCharges,
87 const std::vector<std::string> & atomSymbolVec,
88 const std::shared_ptr<atoms::AtomSphericalDataContainer>
89 atomSphericalDataContainerPSP,
90 const std::vector<double> &smearedChargeRadius,
92 & electronChargeDensity,
93 std::shared_ptr<const basis::FEBasisManager<ValueTypeBasisCoeff,
94 ValueTypeBasisData,
95 memorySpace,
96 dim>> feBMTotalCharge,
97 std::shared_ptr<const basis::FEBasisManager<ValueTypeWaveFnCoeff,
98 ValueTypeWaveFnBasis,
99 memorySpace,
100 dim>> feBMWaveFn,
101 std::shared_ptr<
103 feBDTotalChargeStiffnessMatrix,
104 std::shared_ptr<
106 feBDNuclearChargeRhs,
107 std::shared_ptr<
109 feBDElectronicChargeRhs,
110 std::shared_ptr<
112 feBDHamiltonian,
113 std::shared_ptr<
115 feBDAtomCenterNonLocalOperator,
117 linAlgOpContext,
118 const size_type maxCellBlock,
119 const size_type maxWaveFnBlock,
120 const bool useDealiiMatrixFreePoissonSolve = true);
121
122 // used if delta rho approach is taken with phi total from 1D KS solve
123 // with analytical vself energy cancellation
125 const std::vector<utils::Point> &atomCoordinates,
126 const std::vector<double> & atomCharges,
127 const std::vector<std::string> & atomSymbolVec,
128 const std::shared_ptr<atoms::AtomSphericalDataContainer>
129 atomSphericalDataContainerPSP,
130 const std::vector<double> &smearedChargeRadius,
131 // const quadrature::QuadratureValuesContainer<RealType, memorySpace>
132 // &atomicElectronChargeDensity,
133 // const quadrature::QuadratureValuesContainer<ValueTypeBasisCoeff,
134 // memorySpace>
135 // &atomicTotalElecPotNuclearQuad,
136 // const quadrature::QuadratureValuesContainer<ValueTypeBasisCoeff,
137 // memorySpace>
138 // &atomicTotalElecPotElectronicQuad,
140 &atomicTotalElectroPotentialFunction,
142 &atomicElectronicChargeDensityFunction,
143 std::shared_ptr<const basis::FEBasisManager<ValueTypeBasisCoeff,
144 ValueTypeBasisData,
145 memorySpace,
146 dim>>
147 feBMTotalCharge, // will be same as bc of totalCharge -
148 // atomicTotalCharge
149 std::shared_ptr<const basis::FEBasisManager<ValueTypeWaveFnCoeff,
150 ValueTypeWaveFnBasis,
151 memorySpace,
152 dim>> feBMWaveFn,
153 std::shared_ptr<
155 feBDTotalChargeStiffnessMatrix,
156 std::shared_ptr<
158 feBDNuclearChargeRhs,
159 std::shared_ptr<
161 feBDElectronicChargeRhs,
162 std::shared_ptr<
164 feBDHamiltonian,
165 std::shared_ptr<
167 feBDAtomCenterNonLocalOperator,
169 linAlgOpContext,
170 const size_type maxCellBlock,
171 const size_type maxWaveFnBlock,
172 const bool useDealiiMatrixFreePoissonSolve = true);
173
175
176 // // used if analytical vself canellation route taken
177 void
179 const std::vector<utils::Point> & atomCoordinates,
180 std::shared_ptr<const basis::FEBasisManager<ValueTypeBasisCoeff,
181 ValueTypeBasisData,
182 memorySpace,
183 dim>> feBMTotalCharge,
184 std::shared_ptr<const basis::FEBasisManager<ValueTypeWaveFnCoeff,
185 ValueTypeWaveFnBasis,
186 memorySpace,
187 dim>> feBMWaveFn,
188 std::shared_ptr<
190 feBDTotalChargeStiffnessMatrix,
191 std::shared_ptr<
193 feBDNuclearChargeRhs,
194 std::shared_ptr<
196 feBDElectronicChargeRhs,
197 std::shared_ptr<
199 feBDHamiltonian,
200 std::shared_ptr<
202 feBDAtomCenterNonLocalOperator);
203
204 // used if delta rho approach is taken with phi total from 1D KS solve
205 // with analytical vself energy cancellation
206 void
208 const std::vector<utils::Point> &atomCoordinates,
209 // const quadrature::QuadratureValuesContainer<RealType, memorySpace>
210 // &atomicElectronChargeDensity,
211 // const quadrature::QuadratureValuesContainer<ValueTypeBasisCoeff,
212 // memorySpace>
213 // &atomicTotalElecPotNuclearQuad,
214 // const quadrature::QuadratureValuesContainer<ValueTypeBasisCoeff,
215 // memorySpace>
216 // &atomicTotalElecPotElectronicQuad,
218 &atomicTotalElectroPotentialFunction,
220 &atomicElectronicChargeDensityFunction,
221 std::shared_ptr<const basis::FEBasisManager<ValueTypeBasisCoeff,
222 ValueTypeBasisData,
223 memorySpace,
224 dim>> feBMTotalCharge,
225 std::shared_ptr<const basis::FEBasisManager<ValueTypeWaveFnCoeff,
226 ValueTypeWaveFnBasis,
227 memorySpace,
228 dim>> feBMWaveFn,
229 std::shared_ptr<
231 feBDTotalChargeStiffnessMatrix,
232 std::shared_ptr<
234 feBDNuclearChargeRhs,
235 std::shared_ptr<
237 feBDElectronicChargeRhs,
238 std::shared_ptr<
240 feBDHamiltonian,
241 std::shared_ptr<
243 feBDAtomCenterNonLocalOperator);
244
245 void
248 &electronChargeDensity);
249
250 void
251 getLocal(Storage &cellWiseStorage) const override;
252
253 void
257 bool updateGhostX,
258 bool updateGhostY) const override;
259
260 bool
261 hasLocalComponent() const override;
262
263 bool
264 hasNonLocalComponent() const override;
265
266 void
268 const std::vector<RealType> &occupation,
270
272 getEnergy() const override;
273
275 getFunctionalDerivative() const override;
276
277 std::shared_ptr<
278 const basis::AtomCenterNonLocalOpContextFE<ValueTypeWaveFnBasis,
279 ValueTypeWaveFnCoeff,
280 memorySpace,
281 dim>>
283
284 private:
285 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
287 std::shared_ptr<atoms::AtomSphericalDataContainer>
289 std::shared_ptr<const atoms::AtomSevereFunction<dim>> d_atomVLocFunction;
290 std::shared_ptr<
291 const basis::AtomCenterNonLocalOpContextFE<ValueTypeWaveFnBasis,
292 ValueTypeWaveFnCoeff,
293 memorySpace,
294 dim>>
296 std::shared_ptr<ElectrostaticLocalFE<ValueTypeBasisData,
297 ValueTypeBasisCoeff,
298 ValueTypeWaveFnBasis,
299 memorySpace,
300 dim>>
308 const std::vector<std::string> d_atomSymbolVec;
310
311
312 }; // end of class ElectrostaticONCVNonLocFE
313 } // end of namespace ksdft
314} // end of namespace dftefe
316#endif // dftefeElectrostaticONCVNonLocFE_h
Definition: AtomCenterNonLocalOpContextFE.h:50
An abstract class to store and access data for a given basis, such as the basis function values on a ...
Definition: FEBasisDataStorage.h:54
An abstract class to encapsulate the partitioning of a finite element basis across multiple processor...
Definition: FEBasisManager.h:44
A derived class of linearAlgebra::OperatorContext to encapsulate the action of a discrete operator on...
Definition: ElectrostaticFE.h:65
Definition: ElectrostaticLocalFE.h:57
Definition: ElectrostaticONCVNonLocFE.h:61
bool hasNonLocalComponent() const override
Definition: ElectrostaticONCVNonLocFE.t.cpp:566
utils::ConditionalOStream d_rootCout
Definition: ElectrostaticONCVNonLocFE.h:304
bool hasLocalComponent() const override
Definition: ElectrostaticONCVNonLocFE.t.cpp:549
void getLocal(Storage &cellWiseStorage) const override
Definition: ElectrostaticONCVNonLocFE.t.cpp:504
RealType getEnergy() const override
Definition: ElectrostaticONCVNonLocFE.t.cpp:696
void reinitField(const quadrature::QuadratureValuesContainer< RealType, memorySpace > &electronChargeDensity)
Definition: ElectrostaticONCVNonLocFE.t.cpp:485
std::shared_ptr< const atoms::AtomSevereFunction< dim > > d_atomVLocFunction
Definition: ElectrostaticONCVNonLocFE.h:289
void reinitBasis(const std::vector< utils::Point > &atomCoordinates, std::shared_ptr< const basis::FEBasisManager< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > > feBMTotalCharge, std::shared_ptr< const basis::FEBasisManager< ValueTypeWaveFnCoeff, ValueTypeWaveFnBasis, memorySpace, dim > > feBMWaveFn, std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > feBDTotalChargeStiffnessMatrix, std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > feBDNuclearChargeRhs, std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > feBDElectronicChargeRhs, std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeWaveFnBasis, memorySpace > > feBDHamiltonian, std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeWaveFnBasis, memorySpace > > feBDAtomCenterNonLocalOperator)
Definition: ElectrostaticONCVNonLocFE.t.cpp:315
const utils::mpi::MPIComm d_mpiComm
Definition: ElectrostaticONCVNonLocFE.h:305
std::shared_ptr< const basis::AtomCenterNonLocalOpContextFE< ValueTypeWaveFnBasis, ValueTypeWaveFnCoeff, memorySpace, dim > > getAtomCenterNonLocalOpContextFE() const
Definition: ElectrostaticONCVNonLocFE.t.cpp:740
const size_type d_maxWaveFnBlock
Definition: ElectrostaticONCVNonLocFE.h:307
std::shared_ptr< atoms::AtomSphericalDataContainer > d_atomSphericalDataContainerPSP
Definition: ElectrostaticONCVNonLocFE.h:288
void applyNonLocal(linearAlgebra::MultiVector< ValueTypeWaveFnCoeff, memorySpace > &X, linearAlgebra::MultiVector< ValueTypeWaveFnCoeff, memorySpace > &Y, bool updateGhostX, bool updateGhostY) const override
Definition: ElectrostaticONCVNonLocFE.t.cpp:522
typename ElectrostaticFE< ValueTypeBasisData, ValueTypeBasisCoeff, ValueTypeWaveFnBasis, memorySpace, dim >::RealType RealType
Definition: ElectrostaticONCVNonLocFE.h:77
const std::vector< std::string > d_atomSymbolVec
Definition: ElectrostaticONCVNonLocFE.h:308
const quadrature::QuadratureValuesContainer< ValueType, memorySpace > & getFunctionalDerivative() const override
Definition: ElectrostaticONCVNonLocFE.t.cpp:719
void evalEnergy(const std::vector< RealType > &occupation, linearAlgebra::MultiVector< ValueTypeWaveFnCoeff, memorySpace > &X)
Definition: ElectrostaticONCVNonLocFE.t.cpp:585
RealType d_energy
Definition: ElectrostaticONCVNonLocFE.h:302
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: ElectrostaticONCVNonLocFE.h:286
const size_type d_numComponents
Definition: ElectrostaticONCVNonLocFE.h:303
typename ElectrostaticFE< ValueTypeBasisData, ValueTypeBasisCoeff, ValueTypeWaveFnBasis, memorySpace, dim >::Storage Storage
Definition: ElectrostaticONCVNonLocFE.h:72
bool d_isNonLocPSP
Definition: ElectrostaticONCVNonLocFE.h:309
std::shared_ptr< const basis::AtomCenterNonLocalOpContextFE< ValueTypeWaveFnBasis, ValueTypeWaveFnCoeff, memorySpace, dim > > d_atomNonLocOpContext
Definition: ElectrostaticONCVNonLocFE.h:295
typename ElectrostaticFE< ValueTypeBasisData, ValueTypeBasisCoeff, ValueTypeWaveFnBasis, memorySpace, dim >::ValueType ValueType
Definition: ElectrostaticONCVNonLocFE.h:67
const size_type d_maxCellBlock
Definition: ElectrostaticONCVNonLocFE.h:306
std::shared_ptr< ElectrostaticLocalFE< ValueTypeBasisData, ValueTypeBasisCoeff, ValueTypeWaveFnBasis, memorySpace, dim > > d_electrostaticLocal
Definition: ElectrostaticONCVNonLocFE.h:301
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
Provides an interface to print based on whether a certain condition is met or not....
Definition: ConditionalOStream.h:47
Definition: Function.h:10
int MPIComm
Definition: MPITypes.h:83
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8