Skip to content

Commit 95f1ac2

Browse files
nandis99dsambit
authored andcommitted
Merged in KSbaseDFTOperatorBugFix (pull request #687)
Resizing related bug fix Approved-by: Phani Motamarri Approved-by: Sambit Das
2 parents 07ecb61 + 8c143b6 commit 95f1ac2

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/dftOperator/KohnShamDFTBaseOperator.cc

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//
1919

2020
#include <KohnShamDFTBaseOperator.h>
21-
# include <KohnShamDFTOperatorKernels.h>
21+
#include <KohnShamDFTOperatorKernels.h>
2222
#include <ExcDFTPlusU.h>
2323
#ifdef _OPENMP
2424
# include <omp.h>
@@ -697,19 +697,23 @@ namespace dftfe
697697
&pdecDensitySpinDown =
698698
cDataOut[xcRemainderOutputDataAttributes::pdeDensitySpinDown];
699699

700-
pdexDensitySpinUp.resize(nCellsPerBatch * totalLocallyOwnedCells, 0.0);
701-
pdecDensitySpinUp.resize(nCellsPerBatch * totalLocallyOwnedCells, 0.0);
702-
pdexDensitySpinDown.resize(nCellsPerBatch * totalLocallyOwnedCells, 0.0);
703-
pdecDensitySpinDown.resize(nCellsPerBatch * totalLocallyOwnedCells, 0.0);
700+
pdexDensitySpinUp.resize(numberQuadraturePointsPerCell * nCellsPerBatch,
701+
0.0);
702+
pdecDensitySpinUp.resize(numberQuadraturePointsPerCell * nCellsPerBatch,
703+
0.0);
704+
pdexDensitySpinDown.resize(numberQuadraturePointsPerCell * nCellsPerBatch,
705+
0.0);
706+
pdecDensitySpinDown.resize(numberQuadraturePointsPerCell * nCellsPerBatch,
707+
0.0);
704708

705709
if (isGGA)
706710
{
707711
xDataOut[xcRemainderOutputDataAttributes::pdeSigma] =
708712
dftfe::utils::MemoryStorage<double, dftfe::utils::MemorySpace::HOST>(
709-
3 * nCellsPerBatch * totalLocallyOwnedCells, 0.0);
713+
3 * numberQuadraturePointsPerCell * nCellsPerBatch, 0.0);
710714
cDataOut[xcRemainderOutputDataAttributes::pdeSigma] =
711715
dftfe::utils::MemoryStorage<double, dftfe::utils::MemorySpace::HOST>(
712-
3 * nCellsPerBatch * totalLocallyOwnedCells, 0.0);
716+
3 * numberQuadraturePointsPerCell * nCellsPerBatch, 0.0);
713717
}
714718
if (isTauMGGA)
715719
{
@@ -906,10 +910,10 @@ namespace dftfe
906910
offsetFactor = kPointIndex * totalLocallyOwnedCells *
907911
numberQuadraturePointsPerCell;
908912
#else
909-
auto &d_halfKSquareTimesDerExcwithTauJxWHost =
913+
auto &d_halfKSquareTimesDerExcwithTauJxWHost =
910914
d_halfKSquareTimesDerExcwithTauJxW[kPointIndex];
911915

912-
auto &d_derExcwithTauTimesinvJacKpointTimesJxWHost =
916+
auto &d_derExcwithTauTimesinvJacKpointTimesJxWHost =
913917
d_derExcwithTauTimesinvJacKpointTimesJxW[kPointIndex];
914918
offsetFactor = 0;
915919

0 commit comments

Comments
 (0)