DFT-EFE
 
Loading...
Searching...
No Matches
DensityCalculator.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 dftefeDensityCalculator_h
27#define dftefeDensityCalculator_h
28
32#include "Defaults.h"
33
34namespace dftefe
35{
36 namespace ksdft
37 {
38 template <typename ValueTypeBasisData,
39 typename ValueTypeBasisCoeff,
40 utils::MemorySpace memorySpace,
41 size_type dim>
43 {
44 public:
45 using ValueType =
47 ValueTypeBasisCoeff>;
48
50
51 public:
57 std::shared_ptr<
59 feBasisDataStorage,
60 const basis::FEBasisManager<ValueTypeBasisCoeff,
61 ValueTypeBasisData,
62 memorySpace,
63 dim> &feBMPsi,
65 linAlgOpContext,
66 const size_type cellBlockSize,
67 const size_type waveFuncBatchSize);
68
74
75 void
76 reinit(std::shared_ptr<
78 feBasisDataStorage,
79 const basis::FEBasisManager<ValueTypeBasisCoeff,
80 ValueTypeBasisData,
81 memorySpace,
82 dim> &feBMPsi);
83
84 void
86 const std::vector<RealType> &occupation,
88 &waveFunc,
91 & gradRho,
92 const bool computeGrad = false);
93
94 private:
95 std::shared_ptr<const quadrature::QuadratureRuleContainer>
97 std::shared_ptr<basis::FEBasisOperations<ValueTypeBasisCoeff,
98 ValueTypeBasisData,
99 memorySpace,
100 dim>>
102 const basis::FEBasisManager<ValueTypeBasisCoeff,
103 ValueTypeBasisData,
104 memorySpace,
108 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
110
112 // quadrature::QuadratureValuesContainer<ValueType, memorySpace>
113 // *d_psiBatchQuad;
114
117
119
122
128
132
135
136 }; // end of class DensityCalculator
137 } // end of namespace ksdft
138} // end of namespace dftefe
140#endif // dftefeDensityCalculator_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
An abstract class to encapsulate the partitioning of a finite element basis across multiple processor...
Definition: FEBasisManager.h:44
Definition: FEBasisOperations.h:64
Definition: DensityCalculator.h:43
linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > * d_psiBatchSmall
Definition: DensityCalculator.h:131
quadrature::QuadratureValuesContainer< RealType, memorySpace > * d_rhoMemspace
Definition: DensityCalculator.h:121
dftefe::utils::MemoryStorage< RealType, memorySpace > * d_rhoBatch
Definition: DensityCalculator.h:118
dftefe::utils::MemoryStorage< RealType, memorySpace > d_modPsiSqBatchQuad
Definition: DensityCalculator.h:115
dftefe::utils::MemoryStorage< RealType, memorySpace > d_occupationInBatch
Definition: DensityCalculator.h:116
linearAlgebra::blasLapack::real_type< ValueType > RealType
Definition: DensityCalculator.h:49
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: DensityCalculator.h:109
std::shared_ptr< const quadrature::QuadratureRuleContainer > d_quadRuleContainer
Definition: DensityCalculator.h:96
dftefe::utils::MemoryStorage< ValueType, memorySpace > * d_gradPsiBatchQuad
Definition: DensityCalculator.h:123
const size_type d_waveFuncBatchSize
Definition: DensityCalculator.h:107
dftefe::utils::MemoryStorage< RealType, memorySpace > d_psiGradPsiBatch
Definition: DensityCalculator.h:125
~DensityCalculator()
Default Destructor.
Definition: DensityCalculator.t.cpp:76
size_type d_batchSizeSmall
Definition: DensityCalculator.h:133
void computeRho(const std::vector< RealType > &occupation, const linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > &waveFunc, quadrature::QuadratureValuesContainer< RealType, memorySpaceHost > &rho, quadrature::QuadratureValuesContainer< RealType, memorySpaceHost > &gradRho, const bool computeGrad=false)
Definition: DensityCalculator.t.cpp:203
std::shared_ptr< basis::FEBasisOperations< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > > d_feBasisOp
Definition: DensityCalculator.h:101
const size_type d_cellBlockSize
Definition: DensityCalculator.h:106
size_type d_numLocallyOwnedCells
Definition: DensityCalculator.h:134
const basis::FEBasisManager< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > * d_feBMPsi
Definition: DensityCalculator.h:105
quadrature::QuadratureValuesContainer< RealType, memorySpace > * d_gradRhoMemspace
Definition: DensityCalculator.h:127
void reinit(std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > feBasisDataStorage, const basis::FEBasisManager< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > &feBMPsi)
Definition: DensityCalculator.t.cpp:129
dftefe::utils::MemoryStorage< RealType, memorySpace > * d_gradRhoBatch
Definition: DensityCalculator.h:124
dftefe::utils::MemoryStorage< ValueType, memorySpace > * d_psiBatchQuad
Definition: DensityCalculator.h:111
linearAlgebra::blasLapack::scalar_type< ValueTypeBasisData, ValueTypeBasisCoeff > ValueType
Definition: DensityCalculator.h:47
linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > * d_psiBatch
Definition: DensityCalculator.h:129
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
typeInternal::real_type< ValueType > real_type
Definition: BlasLapackTypedef.h:177
typeInternal::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:183
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
std::uint64_t size_type
Definition: TypeConfig.h:9