DFT-EFE
 
Loading...
Searching...
No Matches
EFEBasisDataStorageDealii.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 dftefeEFEBasisDataStorageDealii_h
27#define dftefeEFEBasisDataStorageDealii_h
28
29#include <utils/TypeConfig.h>
31#include <utils/MemoryStorage.h>
42#include <memory>
43#include <map>
44#include <vector>
45
46namespace dftefe
47{
48 namespace basis
49 {
55 template <typename ValueTypeBasisCoeff,
56 typename ValueTypeBasisData,
58 size_type dim>
60 : public EFEBasisDataStorage<ValueTypeBasisData, memorySpace>
61 {
62 public:
65 using Storage =
67
69 std::shared_ptr<const BasisDofHandler> efeBDH,
70 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
71 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap);
72
74
75 std::shared_ptr<const BasisDofHandler>
76 getBasisDofHandler() const override;
77
78 void
80 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
81 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)
82 override;
83
84 void
86 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
87 std::shared_ptr<const quadrature::QuadratureRuleContainer>
88 quadratureRuleContainer,
89 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)
90 override;
91
92 void
94 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
95 std::vector<std::shared_ptr<const quadrature::QuadratureRule>>
96 quadratureRuleVec,
97 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)
98 override;
99
100 void
102 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
103 std::shared_ptr<const quadrature::QuadratureRule>
104 baseQuadratureRuleAdaptive,
105 std::vector<std::shared_ptr<const utils::ScalarSpatialFunctionReal>>
106 & functions,
107 const std::vector<double> & absoluteTolerances,
108 const std::vector<double> & relativeTolerances,
109 const std::vector<double> & integralThresholds,
110 const double smallestCellVolume,
111 const unsigned int maxRecursion,
112 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)
113 override;
114
115 void
116 deleteBasisData() override;
117
118 // functions to get data for a basis function on a given quad point in a
119 // cell
120 Storage
121 getBasisData(const QuadraturePointAttributes &attributes,
122 const size_type basisId) const override;
123 Storage
125 const size_type basisId) const override;
126 Storage
128 const size_type basisId) const override;
129
130 // functions to get data for a basis function on all quad points in a cell
131 // The evaluation of functions
132 Storage
133 getBasisDataInCell(const size_type cellId,
134 const size_type basisId) const override;
135 Storage
137 const size_type basisId) const override;
138 Storage
140 const size_type basisId) const override;
141
142 // functions to get data for all basis functions on all quad points in a
143 // cell
144 Storage
145 getBasisDataInCell(const size_type cellId) const override;
146 Storage
147 getBasisGradientDataInCell(const size_type cellId) const override;
148 Storage
149 getBasisHessianDataInCell(const size_type cellId) const override;
150
151 Storage
152 getJxWInCell(const size_type cellId) const override;
153
154 // functions to get data for all basis functions on all quad points in all
155 // cells
156 const Storage &
157 getBasisDataInAllCells() const override;
158 const Storage &
159 getBasisGradientDataInAllCells() const override;
160 const Storage &
161 getBasisHessianDataInAllCells() const override;
162
163 const Storage &
164 getJxWInAllCells() const override;
165
166 // get overlap of two basis functions in a cell
167 Storage
168 getBasisOverlap(const size_type cellId,
169 const size_type basisId1,
170 const size_type basisId2) const override;
171
172 // get overlap of all the basis functions in a cell
173 Storage
174 getBasisOverlapInCell(const size_type cellId) const override;
175
176 // get overlap of all the basis functions in all cells
177 const Storage &
178 getBasisOverlapInAllCells() const override;
179
180 // get the laplace operator in a cell
181 Storage
182 getBasisGradNiGradNjInCell(const size_type cellId) const override;
183
184 // get laplace operator in all cells
185 const Storage &
186 getBasisGradNiGradNjInAllCells() const override;
187
188 std::shared_ptr<const quadrature::QuadratureRuleContainer>
189 getQuadratureRuleContainer() const override;
190
191 private:
193 std::shared_ptr<const EFEBasisDofHandlerDealii<ValueTypeBasisCoeff,
194 ValueTypeBasisData,
195 memorySpace,
196 dim>>
198 std::shared_ptr<const quadrature::QuadratureRuleContainer>
202 std::shared_ptr<Storage> d_basisQuadStorage;
203 std::shared_ptr<Storage> d_JxWStorage;
204 std::shared_ptr<Storage> d_basisGradNiGradNj;
205 std::shared_ptr<Storage> d_basisGradientQuadStorage;
206 std::shared_ptr<Storage> d_basisHessianQuadStorage;
207 std::shared_ptr<Storage> d_basisOverlap;
208 std::vector<size_type> d_dofsInCell;
209 std::vector<size_type> d_cellStartIdsBasisOverlap;
210 std::vector<size_type> d_nQuadPointsIncell;
211 std::vector<size_type> d_cellStartIdsBasisQuadStorage;
214 std::vector<size_type> d_cellStartIdsGradNiGradNj;
215 };
216 } // end of namespace basis
217} // end of namespace dftefe
219#endif
An abstract class to store and access data for enriched fe basis, such as the basis function values o...
Definition: EFEBasisDataStorageDealii.h:61
std::vector< size_type > d_cellStartIdsGradNiGradNj
Definition: EFEBasisDataStorageDealii.h:214
std::vector< size_type > d_cellStartIdsBasisGradientQuadStorage
Definition: EFEBasisDataStorageDealii.h:212
std::vector< size_type > d_nQuadPointsIncell
Definition: EFEBasisDataStorageDealii.h:210
Storage getBasisDataInCell(const size_type cellId, const size_type basisId) const override
Definition: EFEBasisDataStorageDealii.t.cpp:3912
std::vector< size_type > d_cellStartIdsBasisHessianQuadStorage
Definition: EFEBasisDataStorageDealii.h:213
const Storage & getBasisHessianDataInAllCells() const override
Definition: EFEBasisDataStorageDealii.t.cpp:3468
const Storage & getBasisDataInAllCells() const override
Definition: EFEBasisDataStorageDealii.t.cpp:3424
Storage getBasisHessianData(const QuadraturePointAttributes &attributes, const size_type basisId) const override
Definition: EFEBasisDataStorageDealii.t.cpp:3742
Storage getBasisData(const QuadraturePointAttributes &attributes, const size_type basisId) const override
Definition: EFEBasisDataStorageDealii.t.cpp:3657
QuadratureRuleAttributes d_quadratureRuleAttributes
Definition: EFEBasisDataStorageDealii.h:200
std::shared_ptr< const EFEBasisDofHandlerDealii< ValueTypeBasisCoeff, ValueTypeBasisData, memorySpace, dim > > d_efeBDH
Definition: EFEBasisDataStorageDealii.h:197
void evaluateBasisData(const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes, const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap) override
Definition: EFEBasisDataStorageDealii.t.cpp:2363
Storage getBasisGradientData(const QuadraturePointAttributes &attributes, const size_type basisId) const override
Definition: EFEBasisDataStorageDealii.t.cpp:3698
std::vector< size_type > d_cellStartIdsBasisQuadStorage
Definition: EFEBasisDataStorageDealii.h:211
BasisStorageAttributesBoolMap d_basisStorageAttributesBoolMap
Definition: EFEBasisDataStorageDealii.h:201
std::shared_ptr< Storage > d_JxWStorage
Definition: EFEBasisDataStorageDealii.h:203
std::shared_ptr< Storage > d_basisQuadStorage
Definition: EFEBasisDataStorageDealii.h:202
std::shared_ptr< Storage > d_basisGradNiGradNj
Definition: EFEBasisDataStorageDealii.h:204
Storage getBasisHessianDataInCell(const size_type cellId, const size_type basisId) const override
Definition: EFEBasisDataStorageDealii.t.cpp:3953
const Storage & getBasisOverlapInAllCells() const override
Definition: EFEBasisDataStorageDealii.t.cpp:3790
std::vector< size_type > d_dofsInCell
Definition: EFEBasisDataStorageDealii.h:208
std::shared_ptr< Storage > d_basisHessianQuadStorage
Definition: EFEBasisDataStorageDealii.h:206
std::shared_ptr< const quadrature::QuadratureRuleContainer > d_quadratureRuleContainer
Definition: EFEBasisDataStorageDealii.h:199
std::vector< size_type > d_cellStartIdsBasisOverlap
Definition: EFEBasisDataStorageDealii.h:209
std::shared_ptr< Storage > d_basisOverlap
Definition: EFEBasisDataStorageDealii.h:207
const Storage & getBasisGradNiGradNjInAllCells() const override
Definition: EFEBasisDataStorageDealii.t.cpp:4023
bool d_evaluateBasisData
Definition: EFEBasisDataStorageDealii.h:192
Storage getBasisOverlapInCell(const size_type cellId) const override
Definition: EFEBasisDataStorageDealii.t.cpp:3812
Storage getBasisGradNiGradNjInCell(const size_type cellId) const override
Definition: EFEBasisDataStorageDealii.t.cpp:3989
std::shared_ptr< Storage > d_basisGradientQuadStorage
Definition: EFEBasisDataStorageDealii.h:205
void deleteBasisData() override
Definition: EFEBasisDataStorageDealii.t.cpp:3881
const Storage & getBasisGradientDataInAllCells() const override
Definition: EFEBasisDataStorageDealii.t.cpp:3446
Storage getBasisGradientDataInCell(const size_type cellId, const size_type basisId) const override
Definition: EFEBasisDataStorageDealii.t.cpp:3933
Storage getJxWInCell(const size_type cellId) const override
Definition: EFEBasisDataStorageDealii.t.cpp:3623
std::shared_ptr< const BasisDofHandler > getBasisDofHandler() const override
Definition: EFEBasisDataStorageDealii.t.cpp:4045
Storage getBasisOverlap(const size_type cellId, const size_type basisId1, const size_type basisId2) const override
Definition: EFEBasisDataStorageDealii.t.cpp:3845
const Storage & getJxWInAllCells() const override
Definition: EFEBasisDataStorageDealii.t.cpp:3490
std::shared_ptr< const quadrature::QuadratureRuleContainer > getQuadratureRuleContainer() const override
Definition: EFEBasisDataStorageDealii.t.cpp:3972
typename BasisDataStorage< ValueTypeBasisData, memorySpace >::Storage Storage
Definition: EFEBasisDataStorageDealii.h:66
An abstract class to store and access data for a given basis, such as the basis function values on a ...
Definition: EFEBasisDataStorage.h:52
Definition: EFEBasisDofHandlerDealii.h:61
Class to store the attributes of a quad point, such as the cell Id it belongs, the quadPointId within...
Definition: QuadratureAttributes.h:171
Definition: QuadratureAttributes.h:135
Definition: MemoryStorage.h:38
std::map< BasisStorageAttributes, bool > BasisStorageAttributesBoolMap
Definition: BasisDataStorage.h:50
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8