|
| 1 | +// --------------------------------------------------------------------- |
| 2 | +// |
| 3 | +// Copyright (c) 2017-2025 The Regents of the University of Michigan and DFT-FE |
| 4 | +// authors. |
| 5 | +// |
| 6 | +// This file is part of the DFT-FE code. |
| 7 | +// |
| 8 | +// The DFT-FE code is free software; you can use it, redistribute |
| 9 | +// it, and/or modify it under the terms of the GNU Lesser General |
| 10 | +// Public License as published by the Free Software Foundation; either |
| 11 | +// version 2.1 of the License, or (at your option) any later version. |
| 12 | +// The full text of the license can be found in the file LICENSE at |
| 13 | +// the top level of the DFT-FE distribution. |
| 14 | +// |
| 15 | +// --------------------------------------------------------------------- |
| 16 | +// |
| 17 | + |
| 18 | +#ifndef kohnShamHamiltonianOperatorDeviceKernels_H_ |
| 19 | +#define kohnShamHamiltonianOperatorDeviceKernels_H_ |
| 20 | + |
| 21 | + |
| 22 | +#include <DataTypeOverloads.h> |
| 23 | +#include <DeviceAPICalls.h> |
| 24 | +#include <DeviceDataTypeOverloads.h> |
| 25 | +#include <DeviceTypeConfig.h> |
| 26 | +#include <DeviceKernelLauncherHelpers.h> |
| 27 | +#include <MemoryStorage.h> |
| 28 | +#include <memory> |
| 29 | +namespace dftfe |
| 30 | +{ |
| 31 | + namespace internal |
| 32 | + { |
| 33 | + template <dftfe::utils::MemorySpace memorySpace> |
| 34 | + void |
| 35 | + computeVeffJxWEntries( |
| 36 | + const std::pair<dftfe::uInt, dftfe::uInt> cellRange, |
| 37 | + const dftfe::uInt numQuadsPerCell, |
| 38 | + const dftfe::utils::MemoryStorage<double, memorySpace> &phiVector, |
| 39 | + const dftfe::utils::MemoryStorage<double, memorySpace> &pdecVector, |
| 40 | + const dftfe::utils::MemoryStorage<double, memorySpace> &pdexVector, |
| 41 | + const dftfe::utils::MemoryStorage<double, memorySpace> &jxwVector, |
| 42 | + dftfe::utils::MemoryStorage<double, memorySpace> &VeffJxW); |
| 43 | + |
| 44 | + template <dftfe::utils::MemorySpace memorySpace> |
| 45 | + void |
| 46 | + computeInvJacderExcWithSigmaTimesGradRhoJxWEntries( |
| 47 | + const std::pair<dftfe::uInt, dftfe::uInt> cellRange, |
| 48 | + const dftfe::uInt numQuadsPerCell, |
| 49 | + const dftfe::Int spinIndex, |
| 50 | + const dftfe::Int cellsTypeFlag, |
| 51 | + const dftfe::utils::MemoryStorage<double, memorySpace> &pdecVector, |
| 52 | + const dftfe::utils::MemoryStorage<double, memorySpace> &pdexVector, |
| 53 | + const dftfe::utils::MemoryStorage<double, memorySpace> &jxwVector, |
| 54 | + const dftfe::utils::MemoryStorage<double, memorySpace> |
| 55 | + &invJacobianEntries, |
| 56 | + const dftfe::utils::MemoryStorage<double, memorySpace> |
| 57 | + &gradientRhoSpinIndex, |
| 58 | + const dftfe::utils::MemoryStorage<double, memorySpace> |
| 59 | + &gradientRhoOtherSpinIndex, |
| 60 | + dftfe::utils::MemoryStorage<double, memorySpace> |
| 61 | + &invJacderExcWithSigmaTimesGradRhoJxW); |
| 62 | + |
| 63 | + template <dftfe::utils::MemorySpace memorySpace> |
| 64 | + void |
| 65 | + computeHalfInvJacinvJacderExcWithTauJxWEntries( |
| 66 | + const std::pair<dftfe::uInt, dftfe::uInt> cellRange, |
| 67 | + const dftfe::uInt numQuadsPerCell, |
| 68 | + const dftfe::Int cellsTypeFlag, |
| 69 | + const dftfe::utils::MemoryStorage<double, memorySpace> &pdecVector, |
| 70 | + const dftfe::utils::MemoryStorage<double, memorySpace> &pdexVector, |
| 71 | + const dftfe::utils::MemoryStorage<double, memorySpace> &jxwVector, |
| 72 | + const dftfe::utils::MemoryStorage<double, memorySpace> |
| 73 | + &invJacobianEntries, |
| 74 | + dftfe::utils::MemoryStorage<double, memorySpace> |
| 75 | + &invJacinvJacderExcWithTauJxW); |
| 76 | + template <dftfe::utils::MemorySpace memorySpace> |
| 77 | + void |
| 78 | + computeKPointDependenderExcWithTauJxWEntries( |
| 79 | + const std::pair<dftfe::uInt, dftfe::uInt> cellRange, |
| 80 | + const dftfe::uInt numQuadsPerCell, |
| 81 | + const dftfe::Int cellsTypeFlag, |
| 82 | + const dftfe::uInt offset, |
| 83 | + const dftfe::utils::MemoryStorage<double, memorySpace> &kPointCoordinate, |
| 84 | + const dftfe::utils::MemoryStorage<double, memorySpace> &pdecVector, |
| 85 | + const dftfe::utils::MemoryStorage<double, memorySpace> &pdexVector, |
| 86 | + const dftfe::utils::MemoryStorage<double, memorySpace> &jxwVector, |
| 87 | + const dftfe::utils::MemoryStorage<double, memorySpace> |
| 88 | + &invJacobianEntries, |
| 89 | + dftfe::utils::MemoryStorage<double, memorySpace> |
| 90 | + &halfKSquareTimesDerExcwithTauJxW, |
| 91 | + dftfe::utils::MemoryStorage<double, memorySpace> |
| 92 | + &invJacKpointTimesderExcwithTauJxW); |
| 93 | + }; // namespace internal |
| 94 | +} // namespace dftfe |
| 95 | +#endif |
0 commit comments