18#if defined(DFTFE_WITH_DEVICE)
19# ifndef poissonSolverProblemDevice_H_
20# define poissonSolverProblemDevice_H_
41 template <dftfe::uInt FEOrder, dftfe::uInt FEOrderElectro>
42 class poissonSolverProblemDevice :
public linearSolverProblemDevice
46 poissonSolverProblemDevice(
const MPI_Comm &mpi_comm);
65 const std::shared_ptr<
67 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
69 distributedCPUVec<double> &x,
70 const dealii::AffineConstraints<double> &constraintMatrix,
72 const dftfe::uInt matrixFreeQuadratureComponentRhsDensity,
74 const std::map<dealii::types::global_dof_index, double> &atoms,
75 const std::map<dealii::CellId, std::vector<double>> &smearedChargeValues,
77 const dftfe::utils::MemoryStorage<double, dftfe::utils::MemorySpace::HOST>
79 const std::shared_ptr<
80 dftfe::linearAlgebra::BLASWrapper<dftfe::utils::MemorySpace::DEVICE>>
82 const bool isComputeDiagonalA =
true,
83 const bool isComputeMeanValueConstraints =
false,
84 const bool smearedNuclearCharges =
false,
85 const bool isRhoValues =
true,
86 const bool isGradSmearedChargeRhs =
false,
87 const dftfe::uInt smearedChargeGradientComponentId = 0,
88 const bool storeSmearedChargeRhs =
false,
89 const bool reuseSmearedChargeRhs =
false,
90 const bool reinitializeFastConstraints =
false);
97 computeAX(distributedDeviceVec<double> &Ax,
98 distributedDeviceVec<double> &x);
106 computeRhs(distributedCPUVec<double> &rhs);
113 distributedDeviceVec<double> &
121 distributedDeviceVec<double> &
129 copyXfromDeviceToHost();
141 subscribe(std::atomic<bool> *
const validity,
142 const std::string &identifier =
"")
const {};
147 unsubscribe(std::atomic<bool> *
const validity,
148 const std::string &identifier =
"")
const {};
152 operator!=(
double val)
const
189 computeMeanValueConstraint();
196 meanValueConstraintDistribute(distributedDeviceVec<double> &vec)
const;
203 meanValueConstraintDistributeSlaveToMaster(
204 distributedDeviceVec<double> &vec)
const;
207 meanValueConstraintDistributeSlaveToMaster(
208 distributedCPUVec<double> &vec)
const;
215 meanValueConstraintSetZero(distributedDeviceVec<double> &vec)
const;
218 meanValueConstraintSetZero(distributedCPUVec<double> &vec)
const;
221 distributedCPUVec<double> d_diagonalA;
222 distributedDeviceVec<double> d_diagonalAdevice;
226 distributedCPUVec<double> d_rhsSmearedCharge;
229 const dealii::MatrixFree<3, double> *d_matrixFreeDataPtr;
232 distributedCPUVec<double> *d_xPtr;
233 distributedDeviceVec<double> d_xDevice;
237 dftfe::Int d_nLocalCells, d_xLocalDof, d_xLen;
240 dftfe::utils::MemoryStorage<double, dftfe::utils::MemorySpace::DEVICE>
241 d_shapeFunction, d_jacobianFactor;
242 dftfe::utils::MemoryStorage<dftfe::Int, dftfe::utils::MemorySpace::DEVICE>
247 double *d_shapeFunctionPtr;
248 double *d_jacobianFactorPtr;
253 dftUtils::constraintMatrixInfo<dftfe::utils::MemorySpace::DEVICE>
254 d_constraintsTotalPotentialInfo,
255 d_inhomogenousConstraintsTotalPotentialInfo;
258 const dealii::AffineConstraints<double> *d_constraintMatrixPtr;
265 dftfe::uInt d_matrixFreeQuadratureComponentRhsDensity;
271 const dftfe::utils::MemoryStorage<double, dftfe::utils::MemorySpace::HOST>
275 const std::map<dealii::CellId, std::vector<double>>
276 *d_smearedChargeValuesPtr;
283 const std::map<dealii::types::global_dof_index, double> *d_atomsPtr;
286 std::vector<double> d_cellShapeFunctionGradientIntegralFlattened;
289 distributedCPUVec<double> d_meanValueConstraintVec;
292 distributedDeviceVec<double> d_meanValueConstraintDeviceVec;
296 bool d_isMeanValueConstraintComputed;
299 bool d_isGradSmearedChargeRhs;
302 bool d_isStoreSmearedChargeRhs;
305 bool d_isReuseSmearedChargeRhs;
311 dealii::types::global_dof_index d_meanValueConstraintNodeId;
314 dealii::types::global_dof_index d_meanValueConstraintNodeIdLocal;
321 dftUtils::constraintMatrixInfo<dftfe::utils::MemorySpace::HOST>
325 FEBasisOperations<double, double, dftfe::utils::MemorySpace::HOST>>
326 d_basisOperationsPtr;
329 dftfe::linearAlgebra::BLASWrapper<dftfe::utils::MemorySpace::DEVICE>>
331 bool d_isFastConstraintsInitialized;
332 bool d_isHomogenousConstraintsInitialized;
334 const MPI_Comm mpi_communicator;
337 dealii::ConditionalOStream pcout;
Definition pseudoPotentialToDftfeConverter.cc:34
std::uint32_t uInt
Definition TypeConfig.h:10
std::int32_t Int
Definition TypeConfig.h:11