48#ifndef MatrixFreeWrapper_H_
49#define MatrixFreeWrapper_H_
63#define MatrixFreeWrapperTemplates(NDOFSPERDIM) \
64 std::shared_ptr<dftefe::MatrixFree<double, \
65 dftefe::operatorList::Laplace, \
66 dftefe::utils::MemorySpace::DEVICE, \
72 std::shared_ptr<dftefe::MatrixFree<double, \
73 dftefe::operatorList::Helmholtz, \
74 dftefe::utils::MemorySpace::DEVICE, \
80#define MatrixFreeWrapperTemplatesL(NDOFSPERDIM) \
81 std::shared_ptr<dftefe::MatrixFree<double, \
82 dftefe::operatorList::Laplace, \
83 dftefe::utils::MemorySpace::DEVICE, \
89 std::shared_ptr<dftefe::MatrixFree<double, \
90 dftefe::operatorList::Helmholtz, \
91 dftefe::utils::MemorySpace::DEVICE, \
97#include "MatrixFreeWrapper.def"
98#undef MatrixFreeWrapperTemplates
99#undef MatrixFreeWrapperTemplatesL
106 template <
typename T,
116#define MatrixFreeWrapperTemplates(NDOFSPERDIM) \
118 return MatrixFreeObject( \
119 std::make_shared<dftefe::MatrixFree<T, \
126 1>>(std::forward<Args>(args)...));
127#define MatrixFreeWrapperTemplatesL(NDOFSPERDIM) \
129 return MatrixFreeObject( \
130 std::make_shared<dftefe::MatrixFree<T, \
137 1>>(std::forward<Args>(args)...));
138#include "MatrixFreeWrapper.def"
139#undef MatrixFreeWrapperTemplates
140#undef MatrixFreeWrapperTemplatesL
142 throw std::logic_error{
"createMatrixFreeObject dispatch failed"};
150 template <
typename T,
159 std::uint32_t nDofsPerDim,
160 const MPI_Comm & mpi_comm,
161 const dealii::MatrixFree<3, double> * matrixFreeDataPtr,
162 const dealii::AffineConstraints<double> &constraintMatrix,
163 const std::uint32_t dofHandlerID,
164 const std::uint32_t quadratureID,
194 std::visit([&](
auto &t) { t->initOperatorCoeffs(coeffHelmholtz); },
215 std::visit([&](
auto &t) { t->constraintsDistribute(src); },
226 std::visit([&](
auto &t) { t->constraintsDistributeTranspose(dst, src); },
MatrixFreeWrapper class.
Definition: MatrixFreeWrapper.h:155
MatrixFreeWrapperClass(std::uint32_t nDofsPerDim, const MPI_Comm &mpi_comm, const dealii::MatrixFree< 3, double > *matrixFreeDataPtr, const dealii::AffineConstraints< double > &constraintMatrix, const std::uint32_t dofHandlerID, const std::uint32_t quadratureID, const dftefe::uInt nVectors)
Constructor.
Definition: MatrixFreeWrapper.h:158
MatrixFreeObject d_MatrixFreeObject
Definition: MatrixFreeWrapper.h:231
void init()
Initialize data structures for MatrixFree class.
Definition: MatrixFreeWrapper.h:182
void computeAX(T *dst, T *src)
Compute Laplace operator multipled by X.
Definition: MatrixFreeWrapper.h:203
void constraintsDistributeTranspose(T *dst, T *src)
Distribute transpose constraints on vector src.
Definition: MatrixFreeWrapper.h:224
void constraintsDistribute(T *src)
Distribute constraints on vector src.
Definition: MatrixFreeWrapper.h:213
void initOperatorCoeffs(T coeffHelmholtz)
Initialize Helmholtz operator coefficient.
Definition: MatrixFreeWrapper.h:192
MemorySpace
Definition: MemorySpaceType.h:37
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
std::variant< #define MatrixFreeWrapperTemplates(NDOFSPERDIM) #define MatrixFreeWrapperTemplatesL(NDOFSPERDIM) # 97 "/github/workspace/src/electrostatics/MatrixFreeWrapper.h" 2 > MatrixFreeObject
Datastructure to hold different MatrixFree class objects.
Definition: MatrixFreeWrapper.h:100
std::uint64_t uInt
Definition: TypeConfig.h:11
MatrixFreeObject createMatrixFreeObject(std::uint32_t nDofsPerDim, Args &&...args)
Factory function to create MatrixFree object.
Definition: MatrixFreeWrapper.h:112
operatorList
Definition: MatrixFreeDevice.h:33