DFT-EFE
 
Loading...
Searching...
No Matches
QuadratureValuesContainer.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#ifndef dftefeQuadratureValuesContainer_h
26#define dftefeQuadratureValuesContainer_h
27
28#include <utils/TypeConfig.h>
30#include <utils/MemoryStorage.h>
33namespace dftefe
34{
35 namespace quadrature
36 {
37 template <typename ValueType, utils::MemorySpace memorySpace>
39 {
40 public:
43 using pointer =
45 using reference =
46 typename dftefe::utils::MemoryStorage<ValueType,
47 memorySpace>::reference;
49 typename dftefe::utils::MemoryStorage<ValueType,
50 memorySpace>::const_reference;
51 using iterator =
54 typename dftefe::utils::MemoryStorage<ValueType,
55 memorySpace>::const_iterator;
56
57 public:
60 std::shared_ptr<const QuadratureRuleContainer> quadratureRuleContainer,
61 const size_type numberComponents,
62 const ValueType initVal = ValueType());
63
64 void
65 reinit(
66 std::shared_ptr<const QuadratureRuleContainer> quadratureRuleContainer,
67 const size_type numberComponents,
68 const ValueType initVal = ValueType());
69
72
75
78
79 template <utils::MemorySpace memorySpaceSrc>
80 void
81 setCellValues(const size_type cellId, const ValueType *values);
82
83 template <utils::MemorySpace memorySpaceSrc>
84 void
85 setCellQuadValues(const size_type cellId,
86 const size_type componentId,
87 const ValueType *values);
88
89 void
90 setValue(const ValueType value);
91
92 template <utils::MemorySpace memorySpaceDst>
93 void
94 getCellValues(const size_type cellId, ValueType *values) const;
95
96 template <utils::MemorySpace memorySpaceDst>
97 void
98 getCellQuadValues(const size_type cellId,
99 const size_type componentId,
100 ValueType * values) const;
101
102 std::shared_ptr<const QuadratureRuleContainer>
104
106 getNumberComponents() const;
107
109 nCells() const;
111 nQuadraturePoints() const;
113 nEntries() const;
114
116 nCellQuadraturePoints(const size_type cellId) const;
118 nCellEntries(const size_type cellId) const;
120 cellStartId(const size_type cellId) const;
121
122 const SizeTypeVector &
123 getCellStartIds() const;
124 const SizeTypeVector &
125 getNumberCellEntries() const;
126
128 begin();
129
131 begin() const;
132
134 end();
135
137 end() const;
138
140 begin(const size_type cellId);
141
143 begin(const size_type cellId) const;
144
146 end(const size_type cellId);
147
149 end(const size_type cellId) const;
150
151 // ValueType
152 // dotProduct() const;
153
154 private:
159 std::shared_ptr<const QuadratureRuleContainer> d_quadratureRuleContainer;
160 }; // end of QuadratureValuesContainer
161
162
163 //
164 // Helper functions
165 //
166
175 template <typename ValueType1,
176 typename ValueType2,
177 dftefe::utils::MemorySpace memorySpace>
178 void
185 memorySpace> & w,
187
196 template <typename ValueType, dftefe::utils::MemorySpace memorySpace>
198 add(ValueType a,
200 ValueType b,
203
210 template <typename ValueType1,
211 typename ValueType2,
212 dftefe::utils::MemorySpace memorySpace>
213 void
214 scale(ValueType1 alpha,
218 memorySpace> & w,
220
227 template <typename ValueType, dftefe::utils::MemorySpace memorySpace>
228 void
229 scale(ValueType alpha,
232
233 } // end of namespace quadrature
234} // end of namespace dftefe
236#endif // dftefeQuadratureValuesContainer_h
Definition: LinAlgOpContext.h:38
Definition: QuadratureValuesContainer.h:39
size_type nCells() const
Definition: QuadratureValuesContainer.t.cpp:278
void setValue(const ValueType value)
Definition: QuadratureValuesContainer.t.cpp:214
typename dftefe::utils::MemoryStorage< ValueType, memorySpace >::const_iterator const_iterator
Definition: QuadratureValuesContainer.h:55
QuadratureValuesContainer & operator=(const QuadratureValuesContainer &rhs)
Definition: QuadratureValuesContainer.t.cpp:173
void reinit(std::shared_ptr< const QuadratureRuleContainer > quadratureRuleContainer, const size_type numberComponents, const ValueType initVal=ValueType())
Definition: QuadratureValuesContainer.t.cpp:123
void getCellValues(const size_type cellId, ValueType *values) const
Definition: QuadratureValuesContainer.t.cpp:237
size_type nCellQuadraturePoints(const size_type cellId) const
Definition: QuadratureValuesContainer.t.cpp:300
SizeTypeVector d_numCellEntries
Definition: QuadratureValuesContainer.h:157
typename dftefe::utils::MemoryStorage< ValueType, memorySpace >::pointer pointer
Definition: QuadratureValuesContainer.h:44
SizeTypeVector d_cellStartIds
Definition: QuadratureValuesContainer.h:156
const SizeTypeVector & getNumberCellEntries() const
Definition: QuadratureValuesContainer.t.cpp:335
typename dftefe::utils::MemoryStorage< ValueType, memorySpace >::reference reference
Definition: QuadratureValuesContainer.h:47
void getCellQuadValues(const size_type cellId, const size_type componentId, ValueType *values) const
Definition: QuadratureValuesContainer.t.cpp:249
size_type d_numberComponents
Definition: QuadratureValuesContainer.h:155
QuadratureValuesContainer(std::shared_ptr< const QuadratureRuleContainer > quadratureRuleContainer, const size_type numberComponents, const ValueType initVal=ValueType())
std::shared_ptr< const QuadratureRuleContainer > getQuadratureRuleContainer() const
Definition: QuadratureValuesContainer.t.cpp:263
size_type cellStartId(const size_type cellId) const
Definition: QuadratureValuesContainer.t.cpp:317
iterator end()
Definition: QuadratureValuesContainer.t.cpp:357
typename dftefe::utils::MemoryStorage< ValueType, memorySpace >::iterator iterator
Definition: QuadratureValuesContainer.h:52
typename dftefe::utils::MemoryStorage< ValueType, memorySpace >::const_reference const_reference
Definition: QuadratureValuesContainer.h:50
iterator begin()
Definition: QuadratureValuesContainer.t.cpp:343
void setCellQuadValues(const size_type cellId, const size_type componentId, const ValueType *values)
Definition: QuadratureValuesContainer.t.cpp:223
const SizeTypeVector & getCellStartIds() const
Definition: QuadratureValuesContainer.t.cpp:327
void setCellValues(const size_type cellId, const ValueType *values)
Definition: QuadratureValuesContainer.t.cpp:203
size_type nCellEntries(const size_type cellId) const
Definition: QuadratureValuesContainer.t.cpp:308
size_type nEntries() const
Definition: QuadratureValuesContainer.t.cpp:292
size_type getNumberComponents() const
Definition: QuadratureValuesContainer.t.cpp:270
std::shared_ptr< const QuadratureRuleContainer > d_quadratureRuleContainer
Definition: QuadratureValuesContainer.h:159
Storage d_storage
Definition: QuadratureValuesContainer.h:158
QuadratureValuesContainer()
Definition: QuadratureValuesContainer.t.cpp:87
size_type nQuadraturePoints() const
Definition: QuadratureValuesContainer.t.cpp:285
Definition: MemoryStorage.h:38
ValueType * iterator
Definition: MemoryStorage.h:59
ValueType * pointer
Definition: MemoryStorage.h:56
blas::scalar_type< ValueType1, ValueType2 > scalar_type
Definition: BlasLapackTypedef.h:70
void scale(ValueType1 alpha, const QuadratureValuesContainer< ValueType2, memorySpace > &u, QuadratureValuesContainer< linearAlgebra::blasLapack::scalar_type< ValueType1, ValueType2 >, memorySpace > &w, linearAlgebra::LinAlgOpContext< memorySpace > &linAlgOpContext)
Perform .
Definition: QuadratureValuesContainer.t.cpp:482
void add(linearAlgebra::blasLapack::scalar_type< ValueType1, ValueType2 > a, const QuadratureValuesContainer< ValueType1, memorySpace > &u, linearAlgebra::blasLapack::scalar_type< ValueType1, ValueType2 > b, const QuadratureValuesContainer< ValueType2, memorySpace > &v, QuadratureValuesContainer< linearAlgebra::blasLapack::scalar_type< ValueType1, ValueType2 >, memorySpace > &w, linearAlgebra::LinAlgOpContext< memorySpace > &linAlgOpContext)
Perform .
Definition: QuadratureValuesContainer.t.cpp:435
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8