DFT-EFE
 
Loading...
Searching...
No Matches
RDM1FE.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 Bikash Kanungo
24 */
25
26#ifndef dftefe_RDM1FE_h
27#define dftefe_RDM1FE_h
28
29// C++ standard libraries
30#include <vector>
31#include <set>
32#include <utility>
33#include <unordered_map>
34#include <memory>
35#include <ksdft/RDM1Spectral.h>
40
41namespace dftefe
42{
43 namespace ksdft
44 {
50 template <typename ValueTypeBasisData,
51 typename ValueTypeBasisCoeff,
53 size_type dim>
54 class RDM1FE
55 : public RDM1Spectral<
56 linearAlgebra::blasLapack::scalar_type<ValueTypeBasisData,
57 ValueTypeBasisCoeff>,
58 memorySpace>
59 {
60 public:
61 using ValueType =
63 ValueTypeBasisCoeff>;
65
66 public:
67 virtual ~RDM1FE() = default;
68
69 RDM1FE(std::shared_ptr<
71 feBasisDataStorage,
72 const basis::FEBasisManager<ValueTypeBasisCoeff,
73 ValueTypeBasisData,
74 memorySpace,
75 dim> &feBMPsi,
77 linAlgOpContext,
78 const utils::mpi::MPIComm &mpiCommDomain,
79 const size_type cellBlockSize,
80 const size_type waveFuncBatchSize,
82 const bool isSOC = false,
83 const std::vector<double> &kPointCoords = std::vector<double>{},
84 const std::vector<double> &kPointWeights = std::vector<double>{});
85
86 void
87 reinit(std::shared_ptr<
89 feBasisDataStorage,
90 const basis::FEBasisManager<ValueTypeBasisCoeff,
91 ValueTypeBasisData,
92 memorySpace,
93 dim> &feBMPsi);
94
95 void
96 setEvalDescrFlag(const bool evalFlag) override;
97
98 void
100 const std::set<DensityDescrAttr> & densityAttrs,
101 const std::set<WfcDescrAttr> & wfcAttrs,
102 std::unordered_map<DensityDescrAttr, AttrStorage> &densityAttrVals,
103 std::unordered_map<WfcDescrAttr, AttrStorage> & wfcAttrVals);
104
105 void
107 const std::unordered_map<DensityDescrAttr, AttrStorage>
108 & densityAttrVals,
109 const std::unordered_map<WfcDescrAttr, AttrStorage> &wfcAttrVals);
110
111 void
113 const std::set<DensityObsAttr> &densityObsAttrs,
114 std::unordered_map<DensityObsAttr, std::vector<std::vector<double>>>
115 &densityObsAttrVals);
116
118 spinMode() const;
119
120 bool
121 isSOC() const;
122
124 getnKSOrbs() const;
125
126 std::vector<double>
127 getkPointCoords() const;
128
129 std::vector<double>
130 getkPointWeights() const;
131
132 std::unique_ptr<RDM1<ValueType, memorySpace>>
133 clone() const;
134
135 std::shared_ptr<
137 getFEBasisDataStorage() const;
138
139 const basis::FEBasisManager<ValueTypeBasisCoeff,
140 ValueTypeBasisData,
141 memorySpace,
142 dim> &
143 getFEBasisManager() const;
144
145 private:
146 std::shared_ptr<
149 const basis::FEBasisManager<ValueTypeBasisCoeff,
150 ValueTypeBasisData,
151 memorySpace,
153 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
155 std::shared_ptr<DensityCalculator<ValueTypeBasisData,
156 ValueTypeBasisCoeff,
157 memorySpace,
158 dim>>
160
161 std::vector<double> d_kPointCoords;
162 std::vector<double> d_kPointWeights;
165 std::reference_wrapper<const utils::mpi::MPIComm> d_mpiCommDomain;
168 std::unordered_map<DensityDescrAttr, AttrStorage> d_densityAttrVals;
169 std::unordered_map<WfcDescrAttr, AttrStorage> d_wfcAttrVals;
170 }; // end of RDM1FE class
171
172 } // namespace ksdft
173} // namespace dftefe
174#include "RDM1FE.t.cpp"
175#endif // dftefe_RDM1FE_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: DensityCalculator.h:45
Class to store the one-particle reduced density matrix using its spectral (eigen) representation in t...
Definition: RDM1FE.h:59
bool isSOC() const
Definition: RDM1FE.t.cpp:115
bool d_isSOC
Definition: RDM1FE.h:164
SpinMode spinMode() const
Definition: RDM1FE.t.cpp:105
std::vector< double > getkPointCoords() const
Definition: RDM1FE.t.cpp:138
void setEvalDescrFlag(const bool evalFlag) override
Definition: RDM1FE.t.cpp:160
size_type d_waveFuncBatchSize
Definition: RDM1FE.h:167
std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > d_feBasisDataStorage
Definition: RDM1FE.h:148
void getDescriptors(const std::set< DensityDescrAttr > &densityAttrs, const std::set< WfcDescrAttr > &wfcAttrs, std::unordered_map< DensityDescrAttr, AttrStorage > &densityAttrVals, std::unordered_map< WfcDescrAttr, AttrStorage > &wfcAttrVals)
Definition: RDM1FE.t.cpp:171
std::vector< double > d_kPointWeights
Definition: RDM1FE.h:162
std::shared_ptr< DensityCalculator< ValueTypeBasisData, ValueTypeBasisCoeff, memorySpace, dim > > d_densCalc
Definition: RDM1FE.h:159
void reinit(std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > feBasisDataStorage, const basis::FEBasisManager< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > &feBMPsi)
Definition: RDM1FE.t.cpp:85
void getDensityObs(const std::set< DensityObsAttr > &densityObsAttrs, std::unordered_map< DensityObsAttr, std::vector< std::vector< double > > > &densityObsAttrVals)
Definition: RDM1FE.t.cpp:342
const basis::FEBasisManager< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > * d_feBMPsiPtr
Definition: RDM1FE.h:152
virtual ~RDM1FE()=default
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: RDM1FE.h:154
const basis::FEBasisManager< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > & getFEBasisManager() const
Definition: RDM1FE.t.cpp:521
SpinMode d_spinMode
Definition: RDM1FE.h:163
std::reference_wrapper< const utils::mpi::MPIComm > d_mpiCommDomain
Definition: RDM1FE.h:165
std::unordered_map< DensityDescrAttr, AttrStorage > d_densityAttrVals
Definition: RDM1FE.h:168
std::unique_ptr< RDM1< ValueType, memorySpace > > clone() const
Definition: RDM1FE.t.cpp:319
void setDescriptors(const std::unordered_map< DensityDescrAttr, AttrStorage > &densityAttrVals, const std::unordered_map< WfcDescrAttr, AttrStorage > &wfcAttrVals)
Definition: RDM1FE.t.cpp:301
std::shared_ptr< const basis::FEBasisDataStorage< ValueTypeBasisData, memorySpace > > getFEBasisDataStorage() const
Definition: RDM1FE.t.cpp:508
std::vector< double > d_kPointCoords
Definition: RDM1FE.h:161
linearAlgebra::blasLapack::scalar_type< ValueTypeBasisData, ValueTypeBasisCoeff > ValueType
Definition: RDM1FE.h:63
std::vector< double > getkPointWeights() const
Definition: RDM1FE.t.cpp:149
std::unordered_map< WfcDescrAttr, AttrStorage > d_wfcAttrVals
Definition: RDM1FE.h:169
size_type d_cellBlockSize
Definition: RDM1FE.h:166
typename RDM1< ValueType, memorySpace >::AttrStorage AttrStorage
Definition: RDM1FE.h:64
size_type getnKSOrbs() const
Definition: RDM1FE.t.cpp:127
Intermediate abstract class that stores the spectral (eigen) decomposition of the one-particle reduce...
Definition: RDM1Spectral.h:63
std::vector< dftefe::quadrature::QuadratureValuesContainer< double, dftefe::utils::MemorySpace::HOST > > AttrStorage
Definition: RDM1.h:59
Definition: LinAlgOpContext.h:52
DensityObsAttr
Definition: KSAttributes.h:48
SpinMode
Definition: KSAttributes.h:55
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