DFT-EFE
 
Loading...
Searching...
No Matches
EnrichmentClassicalInterfaceSpherical.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 dftefeEnrichmentClassicalInterfaceSpherical_h
27#define dftefeEnrichmentClassicalInterfaceSpherical_h
28
29#include <utils/Point.h>
30#include <utils/TypeConfig.h>
31#include <vector>
32#include <string>
33#include <unordered_map>
35#include <utils/MPITypes.h>
36#include <utils/MPIWrapper.h>
37#include <memory>
38#include <utils/TypeConfig.h>
50#include <basis/Defaults.h>
51
52namespace dftefe
53{
54 namespace basis
55 {
69 template <typename ValueTypeBasisData,
70 utils::MemorySpace memorySpace,
71 size_type dim>
73 {
74 public:
111 std::shared_ptr<
113 cfeBasisDataStorageOverlapMatrix,
114 std::shared_ptr<
116 cfeBasisDataStorageRhs,
117 std::shared_ptr<const atoms::AtomSphericalDataContainer>
118 atomSphericalDataContainer,
119 const double atomPartitionTolerance,
120 const std::vector<std::string> & atomSymbolVec,
121 const std::vector<utils::Point> &atomCoordinatesVec,
122 const std::string fieldName,
124 linAlgOpContext,
125 const utils::mpi::MPIComm &comm,
126 const size_type enrichmentBatchSize =
128 const size_type cellBlockSize =
130
140 std::shared_ptr<const TriangulationBase> triangulation,
141 size_type feOrder,
142 std::shared_ptr<const atoms::AtomSphericalDataContainer>
143 atomSphericalDataContainer,
144 const double atomPartitionTolerance,
145 const std::vector<std::string> & atomSymbolVec,
146 const std::vector<utils::Point> &atomCoordinatesVec,
147 const std::string fieldName,
148 const utils::mpi::MPIComm & comm);
149
154
158 std::shared_ptr<const atoms::AtomSphericalDataContainer>
160
164 std::shared_ptr<const EnrichmentIdsPartition<dim>>
166
167 std::shared_ptr<const AtomIdsPartition<dim>>
168 getAtomIdsPartition() const;
169
170 std::shared_ptr<const BasisManager<ValueTypeBasisData, memorySpace>>
171 getCFEBasisManager() const;
172
173 std::vector<ValueTypeBasisData>
175
176 std::vector<ValueTypeBasisData>
178
179 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
180 getLinAlgOpContext() const;
181
182 bool
183 isOrthogonalized() const;
184
185 std::vector<std::string>
186 getAtomSymbolVec() const;
187
188 std::vector<utils::Point>
189 getAtomCoordinatesVec() const;
190
191 std::string
192 getFieldName() const;
193
194 std::shared_ptr<const TriangulationBase>
195 getTriangulation() const;
196
197 // no p refinement assumed
199 getFEOrder() const;
200
208 getEnrichmentId(size_type cellId, size_type enrichmentCellLocalId) const;
209
211 getEnrichmentLocalId(global_size_type enrichmentId) const;
212
215 size_type enrichmentCellLocalId) const;
216
217 std::vector<double>
218 getEnrichmentValue(const size_type cellId,
219 const std::vector<dftefe::utils::Point> &points) const;
220
221 std::vector<double>
223 const size_type cellId,
224 const std::vector<dftefe::utils::Point> &points) const;
225
226 std::vector<double>
228 const size_type cellId,
229 const std::vector<dftefe::utils::Point> &points) const;
230
231 void
233 bool storeValues,
234 bool storeGradients,
235 const quadrature::QuadratureRuleContainer &quadRuleContainer,
236 double *basisEnrichQuadStorageStartPtr,
237 double *basisGradientEnrichQuadStorageStartPtr,
239 const size_type enrichBlock = 500) const;
240
241 void
243 const quadrature::QuadratureRuleContainer & quadRuleContainer,
244 double * basisEnrichQuadStoragePtr,
246 const std::pair<size_type, size_type> cellRange) const;
247
248 void
250 const quadrature::QuadratureRuleContainer &quadRuleContainer,
251 double *basisGradientEnrichQuadStoragePtr,
253 const std::pair<size_type, size_type> cellRange) const;
254
255 private:
256 const std::unordered_map<global_size_type,
259
260 const std::unordered_map<global_size_type,
261 std::vector<ValueTypeBasisData>> &
263
264 std::shared_ptr<const BasisDofHandler>
265 getCFEBasisDofHandler() const;
266
267 void
269
270 std::shared_ptr<EnrichmentIdsPartition<dim>> d_enrichmentIdsPartition;
271 std::shared_ptr<const AtomIdsPartition<dim>> d_atomIdsPartition;
272 std::shared_ptr<const atoms::AtomSphericalDataContainer>
274 std::shared_ptr<const TriangulationBase> d_triangulation;
276 std::shared_ptr<
279 std::shared_ptr<const FEBasisManager<ValueTypeBasisData,
280 ValueTypeBasisData,
281 memorySpace,
282 dim>>
284 const std::vector<std::string> d_atomSymbolVec;
285 const std::vector<utils::Point> d_atomCoordinatesVec;
286 const std::string d_fieldName;
287 std::vector<std::vector<global_size_type>>
289
290 std::unordered_map<global_size_type, utils::OptimizedIndexSet<size_type>>
292
293 std::unordered_map<global_size_type, std::vector<ValueTypeBasisData>>
295
296 std::shared_ptr<linearAlgebra::LinAlgOpContext<memorySpace>>
298
300
302
305
307 std::vector<size_type> d_numEnrichInAllCells;
310
311 }; // end of class
312 } // end of namespace basis
313} // end of namespace dftefe
315#endif // dftefeEnrichmentClassicalInterfaceSpherical_h
Definition: SphericalDataNumerical.h:57
static const size_type ENRICHMENT_BATCH_SIZE
Definition: Defaults.h:92
Class to get the interface between Classical and Enrichment basis. It takes as the classical basis as...
Definition: EnrichmentClassicalInterfaceSpherical.h:73
std::vector< utils::Point > getAtomCoordinatesVec() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1221
const std::vector< std::string > d_atomSymbolVec
Definition: EnrichmentClassicalInterfaceSpherical.h:284
size_type d_feOrder
Definition: EnrichmentClassicalInterfaceSpherical.h:299
bool isOrthogonalized() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1199
const utils::mpi::MPIComm d_comm
Definition: EnrichmentClassicalInterfaceSpherical.h:301
std::vector< ValueTypeBasisData > getClassicalComponentCoeffsInCellOEFE(const size_type cellIndex) const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:996
std::shared_ptr< const AtomIdsPartition< dim > > d_atomIdsPartition
Definition: EnrichmentClassicalInterfaceSpherical.h:271
std::unordered_map< global_size_type, std::vector< ValueTypeBasisData > > d_enrichmentIdToInterfaceCoeffMap
Definition: EnrichmentClassicalInterfaceSpherical.h:294
const std::unordered_map< global_size_type, std::vector< ValueTypeBasisData > > & getClassicalComponentCoeffMap() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:978
~EnrichmentClassicalInterfaceSpherical()
Destructor for the class.
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:875
std::vector< double > getEnrichmentDerivative(const size_type cellId, const std::vector< dftefe::utils::Point > &points) const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1481
void getOverlappingEnrichmentInCellsAdditionalData()
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1942
bool d_isOrthogonalized
Definition: EnrichmentClassicalInterfaceSpherical.h:275
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > d_linAlgOpContext
Definition: EnrichmentClassicalInterfaceSpherical.h:297
std::vector< double > getEnrichmentValue(const size_type cellId, const std::vector< dftefe::utils::Point > &points) const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1398
global_size_type getEnrichmentId(size_type cellId, size_type enrichmentCellLocalId) const
The localid is determined by the storage pattern of the components of basisInterfaceCoeff multivector...
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1266
std::shared_ptr< const atoms::AtomSphericalDataContainer > getAtomSphericalDataContainer() const
Function to return AtomSphericalDataContainerObject.
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:892
std::shared_ptr< const atoms::AtomSphericalDataContainer > d_atomSphericalDataContainer
Definition: EnrichmentClassicalInterfaceSpherical.h:273
std::vector< double > getEnrichmentHessian(const size_type cellId, const std::vector< dftefe::utils::Point > &points) const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1590
std::vector< size_type > d_numEnrichInAllCells
Definition: EnrichmentClassicalInterfaceSpherical.h:307
size_type d_enrichBatchSize
Definition: EnrichmentClassicalInterfaceSpherical.h:303
std::shared_ptr< const AtomIdsPartition< dim > > getAtomIdsPartition() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:916
std::vector< ValueTypeBasisData > getClassicalComponentCoeffsInAllCellsOEFE() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1082
const std::string d_fieldName
Definition: EnrichmentClassicalInterfaceSpherical.h:286
std::shared_ptr< EnrichmentIdsPartition< dim > > d_enrichmentIdsPartition
Definition: EnrichmentClassicalInterfaceSpherical.h:270
void getEnrichmentValuesInCellRangeAtQuadPts(const quadrature::QuadratureRuleContainer &quadRuleContainer, double *basisEnrichQuadStoragePtr, linearAlgebra::LinAlgOpContext< memorySpace > &linAlgOpContext, const std::pair< size_type, size_type > cellRange) const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:2014
std::shared_ptr< const BasisDofHandler > getCFEBasisDofHandler() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:943
size_type getEnrichmentLocalId(global_size_type enrichmentId) const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1342
std::shared_ptr< const EnrichmentIdsPartition< dim > > getEnrichmentIdsPartition() const
Function to return EnrichmentIDsObject.
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:904
size_type d_cellBlockSize
Definition: EnrichmentClassicalInterfaceSpherical.h:304
std::shared_ptr< const FEBasisManager< ValueTypeBasisData, ValueTypeBasisData, memorySpace, dim > > d_cfeBasisManager
Definition: EnrichmentClassicalInterfaceSpherical.h:283
const std::vector< utils::Point > d_atomCoordinatesVec
Definition: EnrichmentClassicalInterfaceSpherical.h:285
size_type getFEOrder() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1254
std::shared_ptr< const FEBasisDofHandler< ValueTypeBasisData, memorySpace, dim > > d_cfeBasisDofHandler
Definition: EnrichmentClassicalInterfaceSpherical.h:278
void getEnrichmentGradientsInCellRangeAtQuadPts(const quadrature::QuadratureRuleContainer &quadRuleContainer, double *basisGradientEnrichQuadStoragePtr, linearAlgebra::LinAlgOpContext< memorySpace > &linAlgOpContext, const std::pair< size_type, size_type > cellRange) const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:2052
std::vector< std::string > getAtomSymbolVec() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1210
std::shared_ptr< const TriangulationBase > d_triangulation
Definition: EnrichmentClassicalInterfaceSpherical.h:274
std::vector< std::vector< global_size_type > > d_overlappingEnrichmentIdsInCells
Definition: EnrichmentClassicalInterfaceSpherical.h:288
utils::MemoryStorage< double, memorySpace > d_originMemSpace
Definition: EnrichmentClassicalInterfaceSpherical.h:306
atoms::SphericalDataNumerical::Func< memorySpace > * d_sphericalDataNumericalFuncPtrVec
Definition: EnrichmentClassicalInterfaceSpherical.h:309
std::shared_ptr< const BasisManager< ValueTypeBasisData, memorySpace > > getCFEBasisManager() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:927
std::shared_ptr< const TriangulationBase > getTriangulation() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1243
void getEnrichmentDataInAllCellsAtQuadPts(bool storeValues, bool storeGradients, const quadrature::QuadratureRuleContainer &quadRuleContainer, double *basisEnrichQuadStorageStartPtr, double *basisGradientEnrichQuadStorageStartPtr, linearAlgebra::LinAlgOpContext< memorySpace > &linAlgOpContext, const size_type enrichBlock=500) const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1610
const std::unordered_map< global_size_type, utils::OptimizedIndexSet< size_type > > & getClassicalComponentLocalIdsMap() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:961
std::unordered_map< global_size_type, utils::OptimizedIndexSet< size_type > > d_enrichmentIdToClassicalLocalIdMap
Definition: EnrichmentClassicalInterfaceSpherical.h:291
std::string getFieldName() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1232
std::shared_ptr< linearAlgebra::LinAlgOpContext< memorySpace > > getLinAlgOpContext() const
Definition: EnrichmentClassicalInterfaceSpherical.t.cpp:1183
An abstract class to store and access data for a given basis, such as the basis function values on a ...
Definition: FEBasisDataStorage.h:54
Definition: FEBasisDofHandler.h:57
An abstract class to encapsulate the partitioning of a finite element basis across multiple processor...
Definition: FEBasisManager.h:44
Definition: LinAlgOpContext.h:52
Definition: QuadratureRuleContainer.h:27
Definition: MemoryStorage.h:38
Definition: OptimizedIndexSet.h:48
int MPIComm
Definition: MPITypes.h:84
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
std::uint64_t size_type
Definition: TypeConfig.h:9
std::uint64_t global_size_type
Definition: TypeConfig.h:10