23#ifndef MatrixFreeWrapper_H_
24#define MatrixFreeWrapper_H_
40#define MatrixFreeWrapperTemplates(NDOFSPERDIM) \
41 std::shared_ptr<dftfe::MatrixFree<double, \
42 dftfe::operatorList::Laplace, \
43 dftfe::utils::MemorySpace::DEVICE, \
49 std::shared_ptr<dftfe::MatrixFree<double, \
50 dftfe::operatorList::Helmholtz, \
51 dftfe::utils::MemorySpace::DEVICE, \
57#define MatrixFreeWrapperTemplatesL(NDOFSPERDIM) \
58 std::shared_ptr<dftfe::MatrixFree<double, \
59 dftfe::operatorList::Laplace, \
60 dftfe::utils::MemorySpace::DEVICE, \
66 std::shared_ptr<dftfe::MatrixFree<double, \
67 dftfe::operatorList::Helmholtz, \
68 dftfe::utils::MemorySpace::DEVICE, \
74#include "MatrixFreeWrapper.def"
75#undef MatrixFreeWrapperTemplates
76#undef MatrixFreeWrapperTemplatesL
93#define MatrixFreeWrapperTemplates(NDOFSPERDIM) \
95 return MatrixFreeObject( \
96 std::make_shared<dftfe::MatrixFree<T, \
103 1>>(std::forward<Args>(args)...));
104#define MatrixFreeWrapperTemplatesL(NDOFSPERDIM) \
106 return MatrixFreeObject( \
107 std::make_shared<dftfe::MatrixFree<T, \
114 1>>(std::forward<Args>(args)...));
115#include "MatrixFreeWrapper.def"
116#undef MatrixFreeWrapperTemplates
117#undef MatrixFreeWrapperTemplatesL
119 throw std::logic_error{
"createMatrixFreeObject dispatch failed"};
127 template <
typename T,
136 std::uint32_t nDofsPerDim,
137 const MPI_Comm &mpi_comm,
138 const dealii::MatrixFree<3, double> *matrixFreeDataPtr,
139 const dealii::AffineConstraints<double> &constraintMatrix,
142 const std::uint32_t dofHandlerID,
143 const std::uint32_t quadratureID,
174 std::visit([&](
auto &t) { t->initOperatorCoeffs(coeffHelmholtz); },
195 std::visit([&](
auto &t) { t->constraintsDistribute(src); },
206 std::visit([&](
auto &t) { t->constraintsDistributeTranspose(dst, src); },
MatrixFreeWrapperClass(std::uint32_t nDofsPerDim, const MPI_Comm &mpi_comm, const dealii::MatrixFree< 3, double > *matrixFreeDataPtr, const dealii::AffineConstraints< double > &constraintMatrix, const std::shared_ptr< dftfe::linearAlgebra::BLASWrapper< memorySpace > > BLASWrapperPtr, const std::uint32_t dofHandlerID, const std::uint32_t quadratureID, const dftfe::uInt nVectors)
Constructor.
Definition MatrixFreeWrapper.h:135
void initOperatorCoeffs(T coeffHelmholtz)
Initialize Helmholtz operator coefficient.
Definition MatrixFreeWrapper.h:172
void computeAX(T *dst, T *src)
Compute Laplace operator multipled by X.
Definition MatrixFreeWrapper.h:183
void constraintsDistribute(T *src)
Distribute constraints on vector src.
Definition MatrixFreeWrapper.h:193
void constraintsDistributeTranspose(T *dst, T *src)
Distribute transpose constraints on vector src.
Definition MatrixFreeWrapper.h:204
MatrixFreeObject d_MatrixFreeObject
Definition MatrixFreeWrapper.h:211
void init()
Initialize data structures for MatrixFree class.
Definition MatrixFreeWrapper.h:162
Definition BLASWrapper.h:35
MemorySpace
Definition MemorySpaceType.h:33
Definition pseudoPotentialToDftfeConverter.cc:34
std::variant< #define MatrixFreeWrapperTemplates(NDOFSPERDIM) \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ #define MatrixFreeWrapperTemplatesL(NDOFSPERDIM) \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ # 1 "/github/workspace/include/MatrixFreeWrapper.def" 1 MatrixFreeWrapperTemplates(2) MatrixFreeWrapperTemplates(3) MatrixFreeWrapperTemplates(4) MatrixFreeWrapperTemplates(5) MatrixFreeWrapperTemplates(6) MatrixFreeWrapperTemplates(7) MatrixFreeWrapperTemplates(8) MatrixFreeWrapperTemplates(9) MatrixFreeWrapperTemplates(10) MatrixFreeWrapperTemplates(11) MatrixFreeWrapperTemplates(12) MatrixFreeWrapperTemplates(13) MatrixFreeWrapperTemplates(14) MatrixFreeWrapperTemplates(15) MatrixFreeWrapperTemplates(16) MatrixFreeWrapperTemplatesL(17) # 74 "/github/workspace/include/MatrixFreeWrapper.h" 2 > MatrixFreeObject
Datastructure to hold different MatrixFree class objects.
Definition MatrixFreeWrapper.h:39
std::uint32_t uInt
Definition TypeConfig.h:10
operatorList
Definition MatrixFreeDevice.h:37
MatrixFreeObject createMatrixFreeObject(std::uint32_t nDofsPerDim, Args &&...args)
Factory function to create MatrixFree object.
Definition MatrixFreeWrapper.h:106