DFT-EFE
 
Loading...
Searching...
No Matches
BasisDataStorage.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
24 */
25
26#ifndef dftefeBasisDataStorage_h
27#define dftefeBasisDataStorage_h
28
29#include <utils/TypeConfig.h>
34#include <memory>
35namespace dftefe
36{
37 namespace basis
38 {
40 {
47 };
48
49 typedef std::map<BasisStorageAttributes, bool>
51
57 template <typename ValueTypeBasisData, utils::MemorySpace memorySpace>
59 {
60 public:
61 //
62 // typedefs
63 //
64 using Storage =
66 using pointer = typename Storage::pointer;
67 using reference = typename Storage::reference;
69 using iterator = typename Storage::iterator;
73
74 public:
75 virtual ~BasisDataStorage() = default;
76
77 virtual std::shared_ptr<const BasisDofHandler>
78 getBasisDofHandler() const = 0;
79
80 virtual void
82 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
83 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap) = 0;
84
85 virtual void
87 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
88 std::shared_ptr<const quadrature::QuadratureRuleContainer>
89 quadratureRuleContainer,
90 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap) = 0;
91
92 virtual void
94 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
95 std::vector<std::shared_ptr<const quadrature::QuadratureRule>>
96 quadratureRuleVec,
97 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap) = 0;
98
99 virtual void
101 const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes,
102 std::shared_ptr<const quadrature::QuadratureRule>
103 baseQuadratureRuleAdaptive,
104 std::vector<std::shared_ptr<const utils::ScalarSpatialFunctionReal>>
105 & functions,
106 const std::vector<double> & absoluteTolerances,
107 const std::vector<double> & relativeTolerances,
108 const std::vector<double> & integralThresholds,
109 const double smallestCellVolume,
110 const unsigned int maxRecursion,
111 const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap) = 0;
112
113 virtual void
115
116 // virtual std::shared_ptr<const quadrature::QuadratureRuleContainer>
117 // getCellQuadratureRuleContainer(
118 // const QuadratureRuleAttributes &quadratureRuleAttributes) const
119 // = 0;
120
121
122 // functions to get data for a basis function on a given quad point in a
123 // cell
124 virtual Storage
126 const size_type basisId) const = 0;
127 virtual Storage
129 const size_type basisId) const = 0;
130 virtual Storage
132 const size_type basisId) const = 0;
133
134 // functions to get data for a basis function on all quad points in a cell
135 virtual Storage
137 const size_type basisId) const = 0;
138 virtual Storage
140 const size_type basisId) const = 0;
141 virtual Storage
143 const size_type basisId) const = 0;
144
145 // functions to get data for all basis functions on all quad points in a
146 // cell
147 virtual Storage
148 getBasisDataInCell(const size_type cellId) const = 0;
149 virtual Storage
150 getBasisGradientDataInCell(const size_type cellId) const = 0;
151 virtual Storage
152 getBasisHessianDataInCell(const size_type cellId) const = 0;
153
154 virtual Storage
155 getJxWInCell(const size_type cellId) const = 0;
156
157 // functions to get data for all basis functions on all quad points in all
158 // cells
159 virtual const Storage &
161 virtual const Storage &
163 virtual const Storage &
165
166 virtual const Storage &
167 getJxWInAllCells() const = 0;
168
169 // get overlap of two basis functions in a cell
170 virtual Storage
172 const size_type basisId1,
173 const size_type basisId2) const = 0;
174
175 // get overlap of all the basis functions in a cell
176 virtual Storage
177 getBasisOverlapInCell(const size_type cellId) const = 0;
178
179 // get the laplace operator in a cell
180 virtual Storage
181 getBasisGradNiGradNjInCell(const size_type cellId) const = 0;
182
183 // get laplace operator in all cells
184 virtual const Storage &
186
187 // get overlap of all the basis functions in all cells
188 virtual const Storage &
190
191 virtual std::shared_ptr<const quadrature::QuadratureRuleContainer>
193
194 }; // end of BasisDataStorage
195 } // end of namespace basis
196} // end of namespace dftefe
197#endif // dftefeBasisDataStorage_h
An abstract class to store and access data for a given basis, such as the basis function values on a ...
Definition: BasisDataStorage.h:59
virtual Storage getBasisDataInCell(const size_type cellId) const =0
typename Storage::reference reference
Definition: BasisDataStorage.h:67
virtual void evaluateBasisData(const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes, std::shared_ptr< const quadrature::QuadratureRule > baseQuadratureRuleAdaptive, std::vector< std::shared_ptr< const utils::ScalarSpatialFunctionReal > > &functions, const std::vector< double > &absoluteTolerances, const std::vector< double > &relativeTolerances, const std::vector< double > &integralThresholds, const double smallestCellVolume, const unsigned int maxRecursion, const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)=0
virtual Storage getBasisData(const QuadraturePointAttributes &attributes, const size_type basisId) const =0
virtual Storage getBasisHessianDataInCell(const size_type cellId) const =0
virtual Storage getBasisGradientData(const QuadraturePointAttributes &attributes, const size_type basisId) const =0
virtual const Storage & getBasisDataInAllCells() const =0
virtual Storage getJxWInCell(const size_type cellId) const =0
virtual Storage getBasisHessianDataInCell(const size_type cellId, const size_type basisId) const =0
virtual Storage getBasisGradientDataInCell(const size_type cellId) const =0
typename Storage::const_iterator const_iterator
Definition: BasisDataStorage.h:70
virtual void evaluateBasisData(const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes, std::shared_ptr< const quadrature::QuadratureRuleContainer > quadratureRuleContainer, const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)=0
virtual Storage getBasisHessianData(const QuadraturePointAttributes &attributes, const size_type basisId) const =0
virtual const Storage & getBasisOverlapInAllCells() const =0
virtual void evaluateBasisData(const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes, const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)=0
virtual void deleteBasisData()=0
virtual void evaluateBasisData(const quadrature::QuadratureRuleAttributes &quadratureRuleAttributes, std::vector< std::shared_ptr< const quadrature::QuadratureRule > > quadratureRuleVec, const BasisStorageAttributesBoolMap basisStorageAttributesBoolMap)=0
typename Storage::pointer pointer
Definition: BasisDataStorage.h:66
virtual const Storage & getBasisGradNiGradNjInAllCells() const =0
virtual std::shared_ptr< const BasisDofHandler > getBasisDofHandler() const =0
virtual const Storage & getBasisGradientDataInAllCells() const =0
virtual ~BasisDataStorage()=default
virtual Storage getBasisDataInCell(const size_type cellId, const size_type basisId) const =0
virtual Storage getBasisGradNiGradNjInCell(const size_type cellId) const =0
virtual Storage getBasisOverlapInCell(const size_type cellId) const =0
virtual Storage getBasisGradientDataInCell(const size_type cellId, const size_type basisId) const =0
virtual Storage getBasisOverlap(const size_type cellId, const size_type basisId1, const size_type basisId2) const =0
virtual const Storage & getBasisHessianDataInAllCells() const =0
typename Storage::const_reference const_reference
Definition: BasisDataStorage.h:68
virtual const Storage & getJxWInAllCells() const =0
typename Storage::iterator iterator
Definition: BasisDataStorage.h:69
virtual std::shared_ptr< const quadrature::QuadratureRuleContainer > getQuadratureRuleContainer() const =0
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
const ValueType & const_reference
Definition: MemoryStorage.h:58
const ValueType * const_iterator
Definition: MemoryStorage.h:60
ValueType * iterator
Definition: MemoryStorage.h:59
ValueType * pointer
Definition: MemoryStorage.h:56
ValueType & reference
Definition: MemoryStorage.h:57
BasisStorageAttributes
Definition: BasisDataStorage.h:40
std::map< BasisStorageAttributes, bool > BasisStorageAttributesBoolMap
Definition: BasisDataStorage.h:50
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8