Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cell and virial transpose bug in dp_ipi #1353

Merged
merged 3 commits into from
Dec 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/ipi/driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ int main(int argc, char * argv[])
readbuffer_ (&socket, (char *)(cell_h), 9*sizeof(double));
readbuffer_ (&socket, (char *)(cell_ih), 9*sizeof(double));
for (int dd = 0; dd < 9; ++dd){
dbox[dd] = cell_h[dd] * cvt_len;
dbox[dd] = cell_ih[dd] * cvt_len;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you checked what is cell_ih? does it the transpose of cell_h or the inverse of cell_h?

Copy link
Member Author

@njzjz njzjz Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh the manual said it is the inverse matrix... I didn't realize the difference between them.

The serversocket will then send a string “POSDATA”, then nine floats for the cell vectormatrix, then another nine floats for the inverse matrix.

(page 33)

}
region.reinitBox (&dbox[0]);

Expand Down Expand Up @@ -209,7 +209,7 @@ int main(int argc, char * argv[])
msg_buff[ii] = dforce[ii] * icvt_f;
}
for (int ii = 0; ii < 9; ++ii){
virial[ii] = dvirial[ii] * icvt_ener * (1.0);
virial[ii] = dvirial[(ii%3)*3+(ii/3)] * icvt_ener * (1.0);
}
if (b_verb) std::cout << "# energy of sys. : " << std::scientific << std::setprecision(10) << dener << std::endl;
writebuffer_ (&socket, msg_forceready, MSGLEN);
Expand Down