Skip to content

Commit

Permalink
Fix attempt for BGW wfns scale factor
Browse files Browse the repository at this point in the history
  • Loading branch information
shankar1729 committed Oct 12, 2017
1 parent 9aa0645 commit 7a2db8b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jdftx/electronic/DumpBGW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ void Dump::dumpBGW()
//Loop over k, bands and spin/spinors:
hsize_t offset[4] = { 0, 0, 0, 0 };
hsize_t count[4] = { 1, 1, 1, 2 };
std::vector<complex> buffer(*std::max_element(nBasis.begin(), nBasis.end()));
double volScaleFac = sqrt(gInfo.detR);
for(int iSpin=0; iSpin<nSpins; iSpin++)
for(int iSpinor=0; iSpinor<nSpinor; iSpinor++)
{ offset[1] = iSpin*nSpinor + iSpinor;
Expand All @@ -199,7 +201,11 @@ void Dump::dumpBGW()
{ offset[0] = b;
sid = H5Dget_space(did);
H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, NULL, count, NULL);
H5Dwrite(did, H5T_NATIVE_DOUBLE, sidMem, sid, plid, eVars.C[q].data()+eVars.C[q].index(b, iSpinor*nBasis[ik]));
//Copy to buffer and scale:
eblas_copy(buffer.data(), eVars.C[q].data()+eVars.C[q].index(b, iSpinor*nBasis[ik]), nBasis[ik]);
eblas_zdscal(nBasis[ik], volScaleFac, buffer.data(), 1);
//Write buffer to HDF5:
H5Dwrite(did, H5T_NATIVE_DOUBLE, sidMem, sid, plid, buffer.data());
}
H5Sclose(sidMem);
}
Expand Down

0 comments on commit 7a2db8b

Please sign in to comment.