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
42namespace dftefe
43{
44 namespace ksdft
45 {
57 template <typename ValueTypeElectrostaticsCoeff,
58 typename ValueTypeElectrostaticsBasis,
59 typename ValueTypeWaveFunctionCoeff,
60 typename ValueTypeWaveFunctionBasis,
61 utils::MemorySpace memorySpace,
62 size_type dim>
65 linearAlgebra::blasLapack::scalar_type<ValueTypeElectrostaticsBasis,
66 ValueTypeWaveFunctionBasis>,
67 linearAlgebra::blasLapack::scalar_type<ValueTypeElectrostaticsCoeff,
68 ValueTypeWaveFunctionCoeff>,
69 memorySpace>
70 {
71 public:
80 linearAlgebra::blasLapack::scalar_type<ValueTypeElectrostaticsBasis,
81 ValueTypeWaveFunctionBasis>;
83 linearAlgebra::blasLapack::scalar_type<ValueTypeElectrostaticsCoeff,
84 ValueTypeWaveFunctionCoeff>;
85
86 using ValueType =
89
91
92 using HamiltonianPtrVariant = std::variant<
93 std::shared_ptr<Hamiltonian<float, memorySpace>>,
94 std::shared_ptr<Hamiltonian<double, memorySpace>>,
95 std::shared_ptr<Hamiltonian<std::complex<float>, memorySpace>>,
96 std::shared_ptr<Hamiltonian<std::complex<double>, memorySpace>>>;
97
98 public:
104 ValueTypeWaveFunctionBasis,
105 memorySpace,
106 dim> & feBasisManager,
107 const std::vector<HamiltonianPtrVariant> &hamiltonianComponentsVec,
109 linAlgOpContext,
110 const size_type maxCellBlock,
111 const size_type maxWaveFnBatch,
112 const bool useOptimizedImplement = true);
113
115
116 void
118 ValueTypeWaveFunctionBasis,
119 memorySpace,
120 dim> & feBasisManager,
121 const std::vector<HamiltonianPtrVariant> &hamiltonianVec);
122
123 void
126 bool updateGhostX = false,
127 bool updateGhostY = false) const override;
128
129 private:
131 ValueTypeWaveFunctionBasis,
132 memorySpace,
137 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
139 std::vector<HamiltonianPtrVariant> d_hamiltonianComponentsVec;
140
143
145
147
148 mutable std::shared_ptr<
149 const ElectrostaticONCVNonLocFE<ValueTypeElectrostaticsBasis,
150 ValueTypeElectrostaticsCoeff,
151 ValueTypeWaveFunctionBasis,
152 ValueTypeWaveFunctionCoeff,
153 memorySpace,
154 dim>>
156
157 }; // end of class KohnShamOperatorContextFE
158 } // end of namespace ksdft
159} // end of namespace dftefe
161#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:70
Storage d_hamiltonianInAllCells
Definition: KohnShamOperatorContextFE.h:134
linearAlgebra::blasLapack::scalar_type< ValueTypeElectrostaticsBasis, ValueTypeWaveFunctionBasis > ValueTypeOperator
define ValueType as the superior (bigger set) of the ValueTypeOperator and ValueTypeOperand (e....
Definition: KohnShamOperatorContextFE.h:81
linearAlgebra::blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperand > ValueType
Definition: KohnShamOperatorContextFE.h:88
const size_type d_maxCellBlock
Definition: KohnShamOperatorContextFE.h:135
void reinit(const basis::FEBasisManager< ValueTypeOperand, ValueTypeWaveFunctionBasis, memorySpace, dim > &feBasisManager, const std::vector< HamiltonianPtrVariant > &hamiltonianVec)
Definition: KohnShamOperatorContextFE.t.cpp:1253
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:96
const basis::FEBasisManager< ValueTypeOperand, ValueTypeWaveFunctionBasis, memorySpace, dim > * d_feBasisManager
Definition: KohnShamOperatorContextFE.h:133
std::vector< HamiltonianPtrVariant > d_hamiltonianComponentsVec
Definition: KohnShamOperatorContextFE.h:139
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: KohnShamOperatorContextFE.h:138
linearAlgebra::MultiVector< ValueTypeOperator, memorySpace > d_scratchNonLocPSPApply
Definition: KohnShamOperatorContextFE.h:142
void apply(linearAlgebra::MultiVector< ValueTypeOperand, memorySpace > &X, linearAlgebra::MultiVector< ValueType, memorySpace > &Y, bool updateGhostX=false, bool updateGhostY=false) const override
Definition: KohnShamOperatorContextFE.t.cpp:1326
std::shared_ptr< const ElectrostaticONCVNonLocFE< ValueTypeElectrostaticsBasis, ValueTypeElectrostaticsCoeff, ValueTypeWaveFunctionBasis, ValueTypeWaveFunctionCoeff, memorySpace, dim > > d_electroONCVHamiltonian
Definition: KohnShamOperatorContextFE.h:155
const bool d_useOptimizedImplement
Definition: KohnShamOperatorContextFE.h:144
utils::MemoryStorage< ValueTypeOperand, memorySpace > d_XCellValues
Definition: KohnShamOperatorContextFE.h:146
const size_type d_maxWaveFnBatch
Definition: KohnShamOperatorContextFE.h:136
linearAlgebra::blasLapack::scalar_type< ValueTypeElectrostaticsCoeff, ValueTypeWaveFunctionCoeff > ValueTypeOperand
Definition: KohnShamOperatorContextFE.h:84
Definition: LinAlgOpContext.h:38
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
typeInternal::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:183
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8