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
33#include <ksdft/KSAttributes.h>
34#include "Defaults.h"
35
36namespace dftefe
37{
38 namespace ksdft
39 {
40 template <typename ValueTypeBasisData,
41 typename ValueTypeBasisCoeff,
42 utils::MemorySpace memorySpace,
43 size_type dim>
45 {
46 public:
47 using ValueType =
49 ValueTypeBasisCoeff>;
50
52
53 public:
59 std::shared_ptr<
61 feBasisDataStorage,
62 const basis::FEBasisManager<ValueTypeBasisCoeff,
63 ValueTypeBasisData,
64 memorySpace,
65 dim> &feBMPsi,
67 linAlgOpContext,
68 const size_type cellBlockSize,
69 const size_type waveFuncBatchSize);
70
76
77 void
78 reinit(std::shared_ptr<
80 feBasisDataStorage,
81 const basis::FEBasisManager<ValueTypeBasisCoeff,
82 ValueTypeBasisData,
83 memorySpace,
84 dim> &feBMPsi);
85
86 void
88 const std::vector<RealType> &occupation,
90 &waveFunc,
91 std::vector<
93 &rho,
94 std::vector<
96 & gradRho,
97 const bool computeGrad = false,
98 const SpinMode spinMode = SpinMode::Unpolarized);
99
100 private:
101 std::shared_ptr<const quadrature::QuadratureRuleContainer>
103 std::shared_ptr<basis::FEBasisOperations<ValueTypeBasisCoeff,
104 ValueTypeBasisData,
105 memorySpace,
106 dim>>
108 const basis::FEBasisManager<ValueTypeBasisCoeff,
109 ValueTypeBasisData,
110 memorySpace,
114 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
116
118 // quadrature::QuadratureValuesContainer<ValueType, memorySpace>
119 // *d_psiBatchQuad;
120
123
125
126 std::vector<quadrature::QuadratureValuesContainer<RealType, memorySpace>>
128
132 std::vector<quadrature::QuadratureValuesContainer<RealType, memorySpace>>
134
138
141
142 }; // end of class DensityCalculator
143 } // end of namespace ksdft
144} // end of namespace dftefe
146#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:45
linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > * d_psiBatchSmall
Definition: DensityCalculator.h:137
dftefe::utils::MemoryStorage< RealType, memorySpace > * d_rhoBatch
Definition: DensityCalculator.h:124
dftefe::utils::MemoryStorage< RealType, memorySpace > d_modPsiSqBatchQuad
Definition: DensityCalculator.h:121
dftefe::utils::MemoryStorage< RealType, memorySpace > d_occupationInBatch
Definition: DensityCalculator.h:122
linearAlgebra::blasLapack::real_type< ValueType > RealType
Definition: DensityCalculator.h:51
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: DensityCalculator.h:115
std::shared_ptr< const quadrature::QuadratureRuleContainer > d_quadRuleContainer
Definition: DensityCalculator.h:102
dftefe::utils::MemoryStorage< ValueType, memorySpace > * d_gradPsiBatchQuad
Definition: DensityCalculator.h:129
const size_type d_waveFuncBatchSize
Definition: DensityCalculator.h:113
dftefe::utils::MemoryStorage< RealType, memorySpace > d_psiGradPsiBatch
Definition: DensityCalculator.h:131
void computeRho(const std::vector< RealType > &occupation, const linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > &waveFunc, std::vector< quadrature::QuadratureValuesContainer< RealType, memorySpaceHost > * > &rho, std::vector< quadrature::QuadratureValuesContainer< RealType, memorySpaceHost > * > &gradRho, const bool computeGrad=false, const SpinMode spinMode=SpinMode::Unpolarized)
Definition: DensityCalculator.t.cpp:227
~DensityCalculator()
Default Destructor.
Definition: DensityCalculator.t.cpp:75
size_type d_batchSizeSmall
Definition: DensityCalculator.h:139
std::shared_ptr< basis::FEBasisOperations< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > > d_feBasisOp
Definition: DensityCalculator.h:107
const size_type d_cellBlockSize
Definition: DensityCalculator.h:112
size_type d_numLocallyOwnedCells
Definition: DensityCalculator.h:140
std::vector< quadrature::QuadratureValuesContainer< RealType, memorySpace > > d_gradRhoMemspace
Definition: DensityCalculator.h:133
const basis::FEBasisManager< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > * d_feBMPsi
Definition: DensityCalculator.h:111
void reinit(std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > feBasisDataStorage, const basis::FEBasisManager< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > &feBMPsi)
Definition: DensityCalculator.t.cpp:120
dftefe::utils::MemoryStorage< RealType, memorySpace > * d_gradRhoBatch
Definition: DensityCalculator.h:130
std::vector< quadrature::QuadratureValuesContainer< RealType, memorySpace > > d_rhoMemspace
Definition: DensityCalculator.h:127
dftefe::utils::MemoryStorage< ValueType, memorySpace > * d_psiBatchQuad
Definition: DensityCalculator.h:117
linearAlgebra::blasLapack::scalar_type< ValueTypeBasisData, ValueTypeBasisCoeff > ValueType
Definition: DensityCalculator.h:49
linearAlgebra::MultiVector< ValueTypeBasisCoeff, memorySpace > * d_psiBatch
Definition: DensityCalculator.h:135
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
SpinMode
Definition: KSAttributes.h:55
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