DFT-EFE
 
Loading...
Searching...
No Matches
KohnShamOperatorContextFE.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 dftefeKohnShamOperatorContextFE_h
27#define dftefeKohnShamOperatorContextFE_h
28
35#include <ksdft/Hamiltonian.h>
36#include <memory>
37#include <variant>
38#include <type_traits>
41#include <ksdft/KSAttributes.h>
42
43namespace dftefe
44{
45 namespace ksdft
46 {
58 template <typename ValueTypeElectrostaticsCoeff,
59 typename ValueTypeElectrostaticsBasis,
60 typename ValueTypeWaveFunctionCoeff,
61 typename ValueTypeWaveFunctionBasis,
62 utils::MemorySpace memorySpace,
63 size_type dim>
66 linearAlgebra::blasLapack::scalar_type<ValueTypeElectrostaticsBasis,
67 ValueTypeWaveFunctionBasis>,
68 linearAlgebra::blasLapack::scalar_type<ValueTypeElectrostaticsCoeff,
69 ValueTypeWaveFunctionCoeff>,
70 memorySpace>
71 {
72 public:
81 linearAlgebra::blasLapack::scalar_type<ValueTypeElectrostaticsBasis,
82 ValueTypeWaveFunctionBasis>;
84 linearAlgebra::blasLapack::scalar_type<ValueTypeElectrostaticsCoeff,
85 ValueTypeWaveFunctionCoeff>;
86
87 using ValueType =
90
92
93 using HamiltonianPtrVariant = std::variant<
94 std::shared_ptr<Hamiltonian<float, memorySpace>>,
95 std::shared_ptr<Hamiltonian<double, memorySpace>>,
96 std::shared_ptr<Hamiltonian<std::complex<float>, memorySpace>>,
97 std::shared_ptr<Hamiltonian<std::complex<double>, memorySpace>>>;
98
99 public:
105 ValueTypeWaveFunctionBasis,
106 memorySpace,
107 dim> & feBasisManager,
108 const std::vector<HamiltonianPtrVariant> &hamiltonianComponentsVec,
110 linAlgOpContext,
111 const size_type maxCellBlock,
112 const size_type maxWaveFnBatch,
113 const bool useOptimizedImplement = true,
114 const SpinMode spinMode = SpinMode::Unpolarized);
115
117
118 void
120 ValueTypeWaveFunctionBasis,
121 memorySpace,
122 dim> & feBasisManager,
123 const std::vector<HamiltonianPtrVariant> &hamiltonianVec);
124
125 void
128 bool updateGhostX = false,
129 bool updateGhostY = false) const override;
130
131 const Storage &
133 {
135 }
136
137 private:
139 ValueTypeWaveFunctionBasis,
140 memorySpace,
145 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
147 std::vector<HamiltonianPtrVariant> d_hamiltonianComponentsVec;
148
151
155
156 mutable std::shared_ptr<
159
160 mutable std::shared_ptr<
161 const ElectrostaticONCVNonLocFE<ValueTypeElectrostaticsBasis,
162 ValueTypeElectrostaticsCoeff,
163 ValueTypeWaveFunctionBasis,
164 ValueTypeWaveFunctionCoeff,
165 memorySpace,
166 dim>>
168
169 }; // end of class KohnShamOperatorContextFE
170 } // end of namespace ksdft
171} // end of namespace dftefe
173#endif // dftefeKohnShamOperatorContextFE_h
An abstract class to encapsulate the partitioning of a finite element basis across multiple processor...
Definition: FEBasisManager.h:44
Definition: ElectrostaticONCVNonLocFE.h:61
A derived class of linearAlgebra::OperatorContext to encapsulate the action of a discrete Kohn-Sham o...
Definition: KohnShamOperatorContextFE.h:71
Storage d_hamiltonianInAllCells
Definition: KohnShamOperatorContextFE.h:142
linearAlgebra::blasLapack::scalar_type< ValueTypeElectrostaticsBasis, ValueTypeWaveFunctionBasis > ValueTypeOperator
define ValueType as the superior (bigger set) of the ValueTypeOperator and ValueTypeOperand (e....
Definition: KohnShamOperatorContextFE.h:82
const SpinMode d_spinMode
Definition: KohnShamOperatorContextFE.h:153
const size_type d_S
Definition: KohnShamOperatorContextFE.h:154
linearAlgebra::blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperand > ValueType
Definition: KohnShamOperatorContextFE.h:89
const size_type d_maxCellBlock
Definition: KohnShamOperatorContextFE.h:143
void reinit(const basis::FEBasisManager< ValueTypeOperand, ValueTypeWaveFunctionBasis, memorySpace, dim > &feBasisManager, const std::vector< HamiltonianPtrVariant > &hamiltonianVec)
Definition: KohnShamOperatorContextFE.t.cpp:1387
std::shared_ptr< utils::MemoryStorage< ValueTypeOperand, memorySpace > > d_XCellValues
Definition: KohnShamOperatorContextFE.h:158
std::variant< std::shared_ptr< Hamiltonian< float, memorySpace > >, std::shared_ptr< Hamiltonian< double, memorySpace > >, std::shared_ptr< Hamiltonian< std::complex< float >, memorySpace > >, std::shared_ptr< Hamiltonian< std::complex< double >, memorySpace > > > HamiltonianPtrVariant
Definition: KohnShamOperatorContextFE.h:97
const basis::FEBasisManager< ValueTypeOperand, ValueTypeWaveFunctionBasis, memorySpace, dim > * d_feBasisManager
Definition: KohnShamOperatorContextFE.h:141
std::vector< HamiltonianPtrVariant > d_hamiltonianComponentsVec
Definition: KohnShamOperatorContextFE.h:147
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: KohnShamOperatorContextFE.h:146
std::shared_ptr< utils::MemoryStorage< ValueTypeOperand, memorySpace > > d_YCellValues
Definition: KohnShamOperatorContextFE.h:158
linearAlgebra::MultiVector< ValueTypeOperator, memorySpace > d_scratchNonLocPSPApply
Definition: KohnShamOperatorContextFE.h:150
void apply(linearAlgebra::MultiVector< ValueTypeOperand, memorySpace > &X, linearAlgebra::MultiVector< ValueType, memorySpace > &Y, bool updateGhostX=false, bool updateGhostY=false) const override
Definition: KohnShamOperatorContextFE.t.cpp:1478
std::shared_ptr< const ElectrostaticONCVNonLocFE< ValueTypeElectrostaticsBasis, ValueTypeElectrostaticsCoeff, ValueTypeWaveFunctionBasis, ValueTypeWaveFunctionCoeff, memorySpace, dim > > d_electroONCVHamiltonian
Definition: KohnShamOperatorContextFE.h:167
const Storage & getHamiltonianInAllCells() const
Definition: KohnShamOperatorContextFE.h:132
const bool d_useOptimizedImplement
Definition: KohnShamOperatorContextFE.h:152
const size_type d_maxWaveFnBatch
Definition: KohnShamOperatorContextFE.h:144
linearAlgebra::blasLapack::scalar_type< ValueTypeElectrostaticsCoeff, ValueTypeWaveFunctionCoeff > ValueTypeOperand
Definition: KohnShamOperatorContextFE.h:85
Definition: LinAlgOpContext.h:52
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
Abstract class to encapsulate the action of a discrete operator on vectors, matrices,...
Definition: OperatorContext.h:51
SpinMode
Definition: KSAttributes.h:55
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