DFT-EFE
 
Loading...
Searching...
No Matches
OrthoEFEOverlapOperatorContext.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 dftefeEFEOverlapOperatorContext_h
27#define dftefeEFEOverlapOperatorContext_h
28
41#include <memory>
42
43namespace dftefe
44{
45 namespace basis
46 {
60 template <typename ValueTypeOperator,
61 typename ValueTypeOperand,
62 utils::MemorySpace memorySpace,
63 size_type dim>
65 : public linearAlgebra::
66 OperatorContext<ValueTypeOperator, ValueTypeOperand, memorySpace>
67 {
68 public:
75 using ValueType =
77 ValueTypeOperand>;
78
79 using Storage =
81
82 public:
96 const FEBasisManager<ValueTypeOperand,
97 ValueTypeOperator,
98 memorySpace,
99 dim> &feBasisManager,
101 &classicalBlockBasisDataStorage,
103 &enrichmentBlockEnrichmentBasisDataStorage,
105 & enrichmentBlockClassicalBasisDataStorage,
106 const size_type maxCellTimesNumVecs,
107 const bool calculateWings = true);
108
122 const FEBasisManager<ValueTypeOperand,
123 ValueTypeOperator,
124 memorySpace,
125 dim> &feBasisManager,
127 &classicalBlockBasisDataStorage,
129 & enrichmentBlockBasisDataStorage,
130 const size_type maxCellTimesNumVecs,
131 const bool calculateWings = true);
132
146 const FEBasisManager<ValueTypeOperand,
147 ValueTypeOperator,
148 memorySpace,
149 dim> &feBasisManager,
151 &classicalBlockGLLBasisDataStorage,
153 &enrichmentBlockBasisDataStorage,
155 linAlgOpContext);
156
170 const FEBasisManager<ValueTypeOperand,
171 ValueTypeOperator,
172 memorySpace,
173 dim> &feBasisManager,
175 &classicalBlockGLLBasisDataStorage,
177 &enrichmentBlockEnrichmentBasisDataStorage,
179 &enrichmentBlockClassicalBasisDataStorage,
181 linAlgOpContext);
182
186 void
187 apply(
190
191 // get overlap of two basis functions in a cell
192 Storage
193 getBasisOverlap(const size_type cellId,
194 const size_type basisId1,
195 const size_type basisId2) const;
196
197 // get overlap of all the basis functions in a cell
198 Storage
199 getBasisOverlapInCell(const size_type cellId) const;
200
201 // get overlap of all the basis functions in all cells
202 const Storage &
204
205
206 private:
207 const FEBasisManager<ValueTypeOperand,
208 ValueTypeOperator,
209 memorySpace,
211 std::shared_ptr<Storage> d_basisOverlap;
212 std::vector<size_type> d_cellStartIdsBasisOverlap;
213 std::vector<size_type> d_dofsInCell;
215
217 std::shared_ptr<linearAlgebra::Vector<ValueTypeOperator, memorySpace>>
219 std::shared_ptr<utils::MemoryStorage<ValueTypeOperator, memorySpace>>
221 const EFEBasisDofHandler<ValueTypeOperand,
222 ValueTypeOperator,
223 memorySpace,
226
227 }; // end of class OrthoEFEOverlapOperatorContext
228 } // end of namespace basis
229} // end of namespace dftefe
231#endif // dftefeEFEOverlapOperatorContext_h
Definition: EFEBasisDofHandler.h:57
An abstract class to store and access data for a given basis, such as the basis function values on a ...
Definition: FEBasisDataStorage.h:53
An abstract class to encapsulate the partitioning of a finite element basis across multiple processor...
Definition: FEBasisManager.h:44
A derived class of linearAlgebra::OperatorContext to encapsulate the action of a discrete operator on...
Definition: OrthoEFEOverlapOperatorContext.h:67
std::shared_ptr< linearAlgebra::Vector< ValueTypeOperator, memorySpace > > d_diagonal
Definition: OrthoEFEOverlapOperatorContext.h:218
const FEBasisManager< ValueTypeOperand, ValueTypeOperator, memorySpace, dim > * d_feBasisManager
Definition: OrthoEFEOverlapOperatorContext.h:210
linearAlgebra::blasLapack::scalar_type< ValueTypeOperator, ValueTypeOperand > ValueType
define ValueType as the superior (bigger set) of the ValueTypeOperator and ValueTypeOperand (e....
Definition: OrthoEFEOverlapOperatorContext.h:77
Storage getBasisOverlap(const size_type cellId, const size_type basisId1, const size_type basisId2) const
Definition: OrthoEFEOverlapOperatorContext.t.cpp:1686
void apply(linearAlgebra::MultiVector< ValueTypeOperand, memorySpace > &X, linearAlgebra::MultiVector< ValueType, memorySpace > &Y) const override
Apply AX = B where A is the discretized matrix, X is the operand and B is the result.
Definition: OrthoEFEOverlapOperatorContext.t.cpp:1485
std::vector< size_type > d_dofsInCell
Definition: OrthoEFEOverlapOperatorContext.h:213
std::shared_ptr< utils::MemoryStorage< ValueTypeOperator, memorySpace > > d_basisOverlapEnrichmentBlock
Definition: OrthoEFEOverlapOperatorContext.h:220
bool d_isMassLumping
Definition: OrthoEFEOverlapOperatorContext.h:216
std::shared_ptr< Storage > d_basisOverlap
Definition: OrthoEFEOverlapOperatorContext.h:211
size_type d_nglobalEnrichmentIds
Definition: OrthoEFEOverlapOperatorContext.h:225
const EFEBasisDofHandler< ValueTypeOperand, ValueTypeOperator, memorySpace, dim > * d_efebasisDofHandler
Definition: OrthoEFEOverlapOperatorContext.h:224
std::vector< size_type > d_cellStartIdsBasisOverlap
Definition: OrthoEFEOverlapOperatorContext.h:212
const Storage & getBasisOverlapInAllCells() const
Definition: OrthoEFEOverlapOperatorContext.t.cpp:1649
const size_type d_maxCellTimesNumVecs
Definition: OrthoEFEOverlapOperatorContext.h:214
Storage getBasisOverlapInCell(const size_type cellId) const
Definition: OrthoEFEOverlapOperatorContext.t.cpp:1662
Definition: LinAlgOpContext.h:38
An class template to encapsulate a MultiVector. A MultiVector is a collection of vectors belonging t...
Definition: MultiVector.h:134
blas::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:70
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8