18#if defined(DFTFE_WITH_DEVICE)
19# ifndef poissonSolverProblemDevice_H_
20# define poissonSolverProblemDevice_H_
39 template <dftfe::uInt FEOrderElectro>
40 class poissonSolverProblemDevice :
public linearSolverProblemDevice
44 poissonSolverProblemDevice(
const MPI_Comm &mpi_comm);
63 const std::shared_ptr<
65 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
67 distributedCPUVec<double> &x,
68 const dealii::AffineConstraints<double> &constraintMatrix,
70 const dftfe::uInt matrixFreeQuadratureComponentRhsDensity,
72 const std::map<dealii::types::global_dof_index, double> &atoms,
73 const std::map<dealii::CellId, std::vector<double>> &smearedChargeValues,
75 const dftfe::utils::MemoryStorage<double, dftfe::utils::MemorySpace::HOST>
77 const std::shared_ptr<
78 dftfe::linearAlgebra::BLASWrapper<dftfe::utils::MemorySpace::DEVICE>>
80 const bool isComputeDiagonalA =
true,
81 const bool isComputeMeanValueConstraints =
false,
82 const bool smearedNuclearCharges =
false,
83 const bool isRhoValues =
true,
84 const bool isGradSmearedChargeRhs =
false,
85 const dftfe::uInt smearedChargeGradientComponentId = 0,
86 const bool storeSmearedChargeRhs =
false,
87 const bool reuseSmearedChargeRhs =
false,
88 const bool reinitializeFastConstraints =
false);
95 computeAX(distributedDeviceVec<double> &Ax,
96 distributedDeviceVec<double> &x);
104 computeRhs(distributedCPUVec<double> &rhs);
111 distributedDeviceVec<double> &
119 distributedDeviceVec<double> &
127 copyXfromDeviceToHost();
169 computeMeanValueConstraint();
176 meanValueConstraintDistribute(distributedDeviceVec<double> &vec)
const;
183 meanValueConstraintDistributeSlaveToMaster(
184 distributedDeviceVec<double> &vec)
const;
187 meanValueConstraintDistributeSlaveToMaster(
188 distributedCPUVec<double> &vec)
const;
195 meanValueConstraintSetZero(distributedDeviceVec<double> &vec)
const;
198 meanValueConstraintSetZero(distributedCPUVec<double> &vec)
const;
201 distributedCPUVec<double> d_diagonalA;
202 distributedDeviceVec<double> d_diagonalAdevice;
206 distributedCPUVec<double> d_rhsSmearedCharge;
209 const dealii::MatrixFree<3, double> *d_matrixFreeDataPtr;
212 distributedCPUVec<double> *d_xPtr;
213 distributedDeviceVec<double> d_xDevice;
217 dftfe::Int d_nLocalCells, d_xLocalDof, d_xLen;
220 dftfe::utils::MemoryStorage<double, dftfe::utils::MemorySpace::DEVICE>
221 d_shapeFunction, d_jacobianFactor;
222 dftfe::utils::MemoryStorage<dftfe::Int, dftfe::utils::MemorySpace::DEVICE>
227 double *d_shapeFunctionPtr;
228 double *d_jacobianFactorPtr;
233 dftUtils::constraintMatrixInfo<dftfe::utils::MemorySpace::DEVICE>
234 d_constraintsTotalPotentialInfo,
235 d_inhomogenousConstraintsTotalPotentialInfo;
238 const dealii::AffineConstraints<double> *d_constraintMatrixPtr;
245 dftfe::uInt d_matrixFreeQuadratureComponentRhsDensity;
251 const dftfe::utils::MemoryStorage<double, dftfe::utils::MemorySpace::HOST>
255 const std::map<dealii::CellId, std::vector<double>>
256 *d_smearedChargeValuesPtr;
263 const std::map<dealii::types::global_dof_index, double> *d_atomsPtr;
266 std::vector<double> d_cellShapeFunctionGradientIntegralFlattened;
269 distributedCPUVec<double> d_meanValueConstraintVec;
272 distributedDeviceVec<double> d_meanValueConstraintDeviceVec;
276 bool d_isMeanValueConstraintComputed;
279 bool d_isGradSmearedChargeRhs;
282 bool d_isStoreSmearedChargeRhs;
285 bool d_isReuseSmearedChargeRhs;
291 dealii::types::global_dof_index d_meanValueConstraintNodeId;
294 dealii::types::global_dof_index d_meanValueConstraintNodeIdLocal;
301 dftUtils::constraintMatrixInfo<dftfe::utils::MemorySpace::HOST>
305 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
306 d_basisOperationsPtr;
309 dftfe::linearAlgebra::BLASWrapper<dftfe::utils::MemorySpace::DEVICE>>
311 bool d_isFastConstraintsInitialized;
312 bool d_isHomogenousConstraintsInitialized;
314 const MPI_Comm mpi_communicator;
317 dealii::ConditionalOStream pcout;
Definition pseudoPotentialToDftfeConverter.cc:34
std::uint32_t uInt
Definition TypeConfig.h:10
std::int32_t Int
Definition TypeConfig.h:11