DFT-EFE
 
Loading...
Searching...
No Matches
AtomCenterNonLocalOpContextFE.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 dftefeAtomCenterNonLocalOpContextFE_h
27#define dftefeAtomCenterNonLocalOpContextFE_h
28
36#include <vector>
37#include <memory>
38
39namespace dftefe
40{
41 namespace basis
42 {
43 template <typename ValueTypeOperator,
44 typename ValueTypeOperand,
45 utils::MemorySpace memorySpace,
46 size_type dim>
48 : public linearAlgebra::
49 OperatorContext<ValueTypeOperator, ValueTypeOperand, memorySpace>
50 {
51 public:
52 using ValueType =
54 ValueTypeOperand>;
56
57 public:
63 const FEBasisManager<ValueTypeOperand,
64 ValueTypeOperator,
65 memorySpace,
66 dim> &feBasisManager,
68 &feBasisDataStorage,
69 std::shared_ptr<const atoms::AtomSphericalDataContainer>
70 atomSphericalDataContainer,
71 const double atomPartitionTolerance,
72 const std::vector<std::string> & atomSymbolVec,
73 const std::vector<utils::Point> &atomCoordinatesVec,
74 const size_type maxCellBlock,
75 const size_type maxFieldBlock,
77 linAlgOpContext,
78 const utils::mpi::MPIComm &comm);
79
85
86 void
89 bool updateGhostX = false,
90 bool updateGhostY = false) const override;
91
92 void
93 reinitCX(size_type waveFuncBlockSize) const;
94
95 void
96 setCXToZero() const;
97
98 void
99 applyCconjtransOnX(std::pair<size_type, size_type> cellRange,
100 const ValueTypeOperand *xCellValuesBegin) const;
101
102 void
104
105 void
106 applyVOnCconjtransX() const;
107
108 void
109 applyCOnVCconjtransX(std::pair<size_type, size_type> cellRange,
110 ValueTypeOperand *yCellValuesBegin) const;
111
112 private:
113 // gets the projector values with quad pts as fastest index
114 // and proj Id as second index in a cell. Assumption:
115 // m values ar consecutive for all l,p pairs.
116 std::vector<double>
117 getProjectorValues(const size_type cellId,
118 const std::vector<dftefe::utils::Point> &points) const;
119
120 // // size is proj x nProj accumulated overcells
121 // utils::MemoryStorage<ValueTypeOperator, utils::memorySpace::HOST>
122 // d_projectorQuadStorage; // cell->quad->proj
123
124 // size is proj x nDofs accumulated over cells
126 d_cellWiseC; // cell->dofs->kpt->proj
127
128 // size is localProjNum(numDofs partiitoned) x numVec(numComp)
129 // mutable so that it can be reinited inside apply if block size changes
130 mutable std::shared_ptr<
133
134 // size id localProjNum x localProjNum
136
139
140 // num proj in cells and max proj in cell
141 std::vector<size_type> d_numProjsInCells;
144
145 std::shared_ptr<const utils::mpi::MPIPatternP2P<memorySpace>>
147
148 const FEBasisManager<ValueTypeOperand,
149 ValueTypeOperator,
150 memorySpace,
154 std::shared_ptr<const EnrichmentIdsPartition<dim>>
156 std::vector<std::vector<global_size_type>>
158 const std::shared_ptr<const atoms::AtomSphericalDataContainer>
160
161 std::unordered_map<std::string, std::vector<double>>
163 std::unordered_map<std::string, int> d_atomSymbolToNumProjMap;
164 std::unordered_map<std::string, std::vector<int>>
166
167 const std::vector<std::string> & d_atomSymbolVec;
168 const std::vector<utils::Point> &d_atomCoordinatesVec;
169 const std::string d_fieldNameProjector;
170 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
173 std::vector<size_type> d_numCellDofs;
175 };
176 } // namespace basis
177} // end of namespace dftefe
179#endif // dftefeAtomCenterNonLocalOpContextFE_h
Definition: AtomCenterNonLocalOpContextFE.h:50
void setCXToZero() const
Definition: AtomCenterNonLocalOpContextFE.t.cpp:887
void apply(linearAlgebra::MultiVector< ValueTypeOperand, memorySpace > &X, linearAlgebra::MultiVector< ValueType, memorySpace > &Y, bool updateGhostX=false, bool updateGhostY=false) const override
Definition: AtomCenterNonLocalOpContextFE.t.cpp:733
std::unordered_map< std::string, std::vector< double > > d_atomSymbolToCouplingConstVecMap
Definition: AtomCenterNonLocalOpContextFE.h:162
std::vector< std::vector< global_size_type > > d_overlappingProjectorIdsInCells
Definition: AtomCenterNonLocalOpContextFE.h:157
std::shared_ptr< const EnrichmentIdsPartition< dim > > d_projectorIdsPartition
Definition: AtomCenterNonLocalOpContextFE.h:155
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: AtomCenterNonLocalOpContextFE.h:171
std::unordered_map< std::string, int > d_atomSymbolToNumProjMap
Definition: AtomCenterNonLocalOpContextFE.h:163
std::vector< double > getProjectorValues(const size_type cellId, const std::vector< dftefe::utils::Point > &points) const
Definition: AtomCenterNonLocalOpContextFE.t.cpp:654
void applyCOnVCconjtransX(std::pair< size_type, size_type > cellRange, ValueTypeOperand *yCellValuesBegin) const
Definition: AtomCenterNonLocalOpContextFE.t.cpp:1008
linearAlgebra::blasLapack::real_type< ValueType > RealType
Definition: AtomCenterNonLocalOpContextFE.h:55
const size_type d_maxWaveFnBatch
Definition: AtomCenterNonLocalOpContextFE.h:153
const std::string d_fieldNameProjector
Definition: AtomCenterNonLocalOpContextFE.h:169
void applyCconjtransOnX(std::pair< size_type, size_type > cellRange, const ValueTypeOperand *xCellValuesBegin) const
Definition: AtomCenterNonLocalOpContextFE.t.cpp:901
const std::vector< std::string > & d_atomSymbolVec
Definition: AtomCenterNonLocalOpContextFE.h:167
std::vector< size_type > d_numProjsInCells
Definition: AtomCenterNonLocalOpContextFE.h:141
utils::MemoryStorage< ValueTypeOperator, memorySpace > d_cellWiseC
Definition: AtomCenterNonLocalOpContextFE.h:126
void applyAllReduceOnCconjtransX() const
Definition: AtomCenterNonLocalOpContextFE.t.cpp:960
~AtomCenterNonLocalOpContextFE()=default
Default Destructor.
std::shared_ptr< linearAlgebra::MultiVector< ValueType, memorySpace > > d_CX
Definition: AtomCenterNonLocalOpContextFE.h:132
linearAlgebra::blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperand > ValueType
Definition: AtomCenterNonLocalOpContextFE.h:54
void applyVOnCconjtransX() const
Definition: AtomCenterNonLocalOpContextFE.t.cpp:974
const size_type d_maxCellBlock
Definition: AtomCenterNonLocalOpContextFE.h:152
void reinitCX(size_type waveFuncBlockSize) const
Definition: AtomCenterNonLocalOpContextFE.t.cpp:868
dftefe::utils::MemoryStorage< size_type, memorySpace > d_locallyOwnedCellLocalProjectorIds
Definition: AtomCenterNonLocalOpContextFE.h:138
size_type d_totProjInProc
Definition: AtomCenterNonLocalOpContextFE.h:143
std::unordered_map< std::string, std::vector< int > > d_atomSymbolToBetaIndexVecMap
Definition: AtomCenterNonLocalOpContextFE.h:165
const std::shared_ptr< const atoms::AtomSphericalDataContainer > d_atomSphericalDataContainer
Definition: AtomCenterNonLocalOpContextFE.h:159
utils::MemoryStorage< ValueType, memorySpace > d_CXCellValues
Definition: AtomCenterNonLocalOpContextFE.h:174
std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > d_mpiPatternP2PProj
Definition: AtomCenterNonLocalOpContextFE.h:146
const std::vector< utils::Point > & d_atomCoordinatesVec
Definition: AtomCenterNonLocalOpContextFE.h:168
std::vector< size_type > d_numCellDofs
Definition: AtomCenterNonLocalOpContextFE.h:173
size_type d_maxProjInCell
Definition: AtomCenterNonLocalOpContextFE.h:142
utils::MemoryStorage< ValueTypeOperator, memorySpace > d_V
Definition: AtomCenterNonLocalOpContextFE.h:135
const FEBasisManager< ValueTypeOperand, ValueTypeOperator, memorySpace, dim > * d_feBasisManager
Definition: AtomCenterNonLocalOpContextFE.h:151
size_type d_numLocallyOwnedCells
Definition: AtomCenterNonLocalOpContextFE.h:172
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: LinAlgOpContext.h:38
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
Definition: MemoryStorage.h:38
blas::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:70
blas::real_type< ValueType > real_type
Definition: BlasLapackTypedef.h:64
int MPIComm
Definition: MPITypes.h:83
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8