DFT-EFE
 
Loading...
Searching...
No Matches
CFEBasisDataStorageDealii.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 Bikash Kanungo, Vishal Subramanian
24 */
25
26#ifndef dftefeCFEBasisDataStorageDealii_h
27#define dftefeCFEBasisDataStorageDealii_h
28
29#include <utils/TypeConfig.h>
31#include <utils/MemoryStorage.h>
39#include <memory>
40#include <map>
41#include <vector>
42namespace dftefe
43{
44 namespace basis
45 {
51 template <typename ValueTypeBasisCoeff,
52 typename ValueTypeBasisData,
54 size_type dim>
56 : public FEBasisDataStorage<ValueTypeBasisData, memorySpace>
57 {
58 public:
61 using Storage =
63
65 std::shared_ptr<const BasisDofHandler> feBDH,
66 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
67 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap);
68
70
71 std::shared_ptr<const BasisDofHandler>
72 getBasisDofHandler() const override;
73
74 void
76 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
77 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)
78 override;
79
80 void
82 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
83 std::shared_ptr<const quadrature::QuadratureRuleContainer>
84 quadratureRuleContainer,
85 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)
86 override;
87
88 void
90 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
91 std::vector<std::shared_ptr<const quadrature::QuadratureRule>>
92 quadratureRuleVec,
93 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)
94 override;
95
96 void
98 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
99 std::shared_ptr<const quadrature::QuadratureRule>
100 baseQuadratureRuleAdaptive,
101 std::vector<std::shared_ptr<const utils::ScalarSpatialFunctionReal>>
102 & functions,
103 const std::vector<double> & absoluteTolerances,
104 const std::vector<double> & relativeTolerances,
105 const std::vector<double> & integralThresholds,
106 const double smallestCellVolume,
107 const unsigned int maxRecursion,
108 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)
109 override;
110
111
112 // void
113 // evaluateBasisData(
114 // std::shared_ptr<const quadrature::QuadratureRuleContainer>
115 // quadratureRuleContainer,
116 // const QuadratureRuleAttributes & quadratureRuleAttributes,
117 // const BasisStorageAttributesBoolMap boolBasisStorageFlagsObj)
118 // override;
119
120 void
121 deleteBasisData() override;
122
123
124
125 // std::shared_ptr<const quadrature::QuadratureRuleContainer>
126 // getCellQuadratureRuleContainer(std::shared_ptr<Storage>>
127 // const QuadratureRuleAttributes &quadratureRuleAttributes) const
128 // override;
129 // functions to get data for a basis function on a given quad point in a
130 // cell
131 Storage
132 getBasisData(const QuadraturePointAttributes &attributes,
133 const size_type basisId) const override;
134 Storage
136 const size_type basisId) const override;
137 Storage
139 const size_type basisId) const override;
140
141 // functions to get data for a basis function on all quad points in a cell
142 Storage
143 getBasisDataInCell(const size_type cellId,
144 const size_type basisId) const override;
145 Storage
147 const size_type basisId) const override;
148 Storage
150 const size_type basisId) const override;
151
152 // functions to get data for all basis functions on all quad points in a
153 // cell
154 Storage
155 getBasisDataInCell(const size_type cellId) const override;
156 Storage
157 getBasisGradientDataInCell(const size_type cellId) const override;
158 Storage
159 getBasisHessianDataInCell(const size_type cellId) const override;
160
161 Storage
162 getJxWInCell(const size_type cellId) const override;
163
164 // functions to get data for all basis functions on all quad points in all
165 // cells
166 const Storage &
167 getBasisDataInAllCells() const override;
168 const Storage &
169 getBasisGradientDataInAllCells() const override;
170 const Storage &
171 getBasisHessianDataInAllCells() const override;
172
173 const Storage &
174 getJxWInAllCells() const override;
175
176 // get overlap of two basis functions in a cell
177 Storage
178 getBasisOverlap(const size_type cellId,
179 const size_type basisId1,
180 const size_type basisId2) const override;
181
182 // get overlap of all the basis functions in a cell
183 Storage
184 getBasisOverlapInCell(const size_type cellId) const override;
185
186 // get overlap of all the basis functions in all cells
187 const Storage &
188 getBasisOverlapInAllCells() const override;
189
190
191 // get the laplace operator in a cell
192 Storage
193 getBasisGradNiGradNjInCell(const size_type cellId) const override;
194
195 // get laplace operator in all cells
196 const Storage &
197 getBasisGradNiGradNjInAllCells() const override;
198
199
200 std::shared_ptr<const quadrature::QuadratureRuleContainer>
201 getQuadratureRuleContainer() const override;
202
203 private:
205 std::shared_ptr<
208 std::shared_ptr<const quadrature::QuadratureRuleContainer>
212 std::shared_ptr<Storage> d_basisQuadStorage;
213 std::shared_ptr<Storage> d_JxWStorage;
214 std::shared_ptr<Storage> d_basisGradNiGradNj;
215 std::shared_ptr<Storage> d_basisGradientQuadStorage;
216 std::shared_ptr<Storage> d_basisHessianQuadStorage;
217 std::shared_ptr<Storage> d_basisOverlap;
218 std::vector<size_type> d_dofsInCell;
219 std::vector<size_type> d_cellStartIdsBasisOverlap;
220 std::vector<size_type> d_nQuadPointsIncell;
221 std::vector<size_type> d_cellStartIdsBasisQuadStorage;
224 std::vector<size_type> d_cellStartIdsGradNiGradNj;
225
226 }; // end of CFEBasisDataStorageDealii
227 } // end of namespace basis
228} // end of namespace dftefe
230#endif // dftefeCFEBasisDataStorageDealii_h
An abstract class to store and access data for a given basis, such as the basis function values on a ...
Definition: CFEBasisDataStorageDealii.h:57
const Storage & getBasisGradNiGradNjInAllCells() const override
Definition: CFEBasisDataStorageDealii.t.cpp:2493
const Storage & getBasisHessianDataInAllCells() const override
Definition: CFEBasisDataStorageDealii.t.cpp:1938
const Storage & getBasisDataInAllCells() const override
Definition: CFEBasisDataStorageDealii.t.cpp:1894
const Storage & getBasisOverlapInAllCells() const override
Definition: CFEBasisDataStorageDealii.t.cpp:2260
std::shared_ptr< const quadrature::QuadratureRuleContainer > d_quadratureRuleContainer
Definition: CFEBasisDataStorageDealii.h:209
BasisStorageAttributesBoolMap d_basisStorageAttributesBoolMap
Definition: CFEBasisDataStorageDealii.h:211
std::vector< size_type > d_cellStartIdsBasisQuadStorage
Definition: CFEBasisDataStorageDealii.h:221
std::shared_ptr< const CFEBasisDofHandlerDealii< ValueTypeBasisCoeff, memorySpace, dim > > d_feBDH
Definition: CFEBasisDataStorageDealii.h:207
Storage getBasisData(const QuadraturePointAttributes &attributes, const size_type basisId) const override
Definition: CFEBasisDataStorageDealii.t.cpp:2127
QuadratureRuleAttributes d_quadratureRuleAttributes
Definition: CFEBasisDataStorageDealii.h:210
Storage getJxWInCell(const size_type cellId) const override
Definition: CFEBasisDataStorageDealii.t.cpp:2093
std::shared_ptr< Storage > d_basisQuadStorage
Definition: CFEBasisDataStorageDealii.h:212
std::shared_ptr< Storage > d_basisGradNiGradNj
Definition: CFEBasisDataStorageDealii.h:214
Storage getBasisHessianData(const QuadraturePointAttributes &attributes, const size_type basisId) const override
Definition: CFEBasisDataStorageDealii.t.cpp:2212
Storage getBasisGradientDataInCell(const size_type cellId, const size_type basisId) const override
Definition: CFEBasisDataStorageDealii.t.cpp:2403
std::vector< size_type > d_cellStartIdsBasisOverlap
Definition: CFEBasisDataStorageDealii.h:219
bool d_evaluateBasisData
Definition: CFEBasisDataStorageDealii.h:204
Storage getBasisHessianDataInCell(const size_type cellId, const size_type basisId) const override
Definition: CFEBasisDataStorageDealii.t.cpp:2423
void evaluateBasisData(const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes, const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap) override
Definition: CFEBasisDataStorageDealii.t.cpp:1216
std::shared_ptr< Storage > d_JxWStorage
Definition: CFEBasisDataStorageDealii.h:213
void deleteBasisData() override
Definition: CFEBasisDataStorageDealii.t.cpp:2351
std::vector< size_type > d_nQuadPointsIncell
Definition: CFEBasisDataStorageDealii.h:220
std::shared_ptr< const BasisDofHandler > getBasisDofHandler() const override
Definition: CFEBasisDataStorageDealii.t.cpp:2515
std::shared_ptr< Storage > d_basisOverlap
Definition: CFEBasisDataStorageDealii.h:217
typename BasisDataStorage< ValueTypeBasisData, memorySpace >::Storage Storage
Definition: CFEBasisDataStorageDealii.h:62
std::shared_ptr< Storage > d_basisHessianQuadStorage
Definition: CFEBasisDataStorageDealii.h:216
const Storage & getBasisGradientDataInAllCells() const override
Definition: CFEBasisDataStorageDealii.t.cpp:1916
Storage getBasisGradientData(const QuadraturePointAttributes &attributes, const size_type basisId) const override
Definition: CFEBasisDataStorageDealii.t.cpp:2168
Storage getBasisOverlapInCell(const size_type cellId) const override
Definition: CFEBasisDataStorageDealii.t.cpp:2282
Storage getBasisDataInCell(const size_type cellId, const size_type basisId) const override
Definition: CFEBasisDataStorageDealii.t.cpp:2382
std::shared_ptr< Storage > d_basisGradientQuadStorage
Definition: CFEBasisDataStorageDealii.h:215
Storage getBasisOverlap(const size_type cellId, const size_type basisId1, const size_type basisId2) const override
Definition: CFEBasisDataStorageDealii.t.cpp:2315
std::vector< size_type > d_dofsInCell
Definition: CFEBasisDataStorageDealii.h:218
const Storage & getJxWInAllCells() const override
Definition: CFEBasisDataStorageDealii.t.cpp:1960
std::vector< size_type > d_cellStartIdsBasisHessianQuadStorage
Definition: CFEBasisDataStorageDealii.h:223
std::shared_ptr< const quadrature::QuadratureRuleContainer > getQuadratureRuleContainer() const override
Definition: CFEBasisDataStorageDealii.t.cpp:2442
Storage getBasisGradNiGradNjInCell(const size_type cellId) const override
Definition: CFEBasisDataStorageDealii.t.cpp:2459
std::vector< size_type > d_cellStartIdsGradNiGradNj
Definition: CFEBasisDataStorageDealii.h:224
std::vector< size_type > d_cellStartIdsBasisGradientQuadStorage
Definition: CFEBasisDataStorageDealii.h:222
Definition: CFEBasisDofHandlerDealii.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
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