Skip to content

Commit

Permalink
fix a bug related to small box
Browse files Browse the repository at this point in the history
  • Loading branch information
brucefan1983 committed Feb 13, 2022
1 parent 4543684 commit f3334dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/force/nep3.cu
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,9 @@ static void get_expanded_box(const double rc, const Box& box, NEP3::ExpandedBox&
double thickness_x = volume / box.get_area(0);
double thickness_y = volume / box.get_area(1);
double thickness_z = volume / box.get_area(2);
ebox.num_cells[0] = int(ceil(2.0 * rc / thickness_x));
ebox.num_cells[1] = int(ceil(2.0 * rc / thickness_y));
ebox.num_cells[2] = int(ceil(2.0 * rc / thickness_z));
ebox.num_cells[0] = box.pbc_x ? int(ceil(2.0 * rc / thickness_x)) : 1;
ebox.num_cells[1] = box.pbc_y ? int(ceil(2.0 * rc / thickness_y)) : 1;
ebox.num_cells[2] = box.pbc_z ? int(ceil(2.0 * rc / thickness_z)) : 1;
if (ebox.num_cells[0] * ebox.num_cells[1] * ebox.num_cells[2] > 1) {
if (box.triclinic) {
ebox.h[0] = box.cpu_h[0] * ebox.num_cells[0];
Expand Down
6 changes: 3 additions & 3 deletions src/force/nep4.cu
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,9 @@ static void get_expanded_box(const double rc, const Box& box, NEP4::ExpandedBox&
double thickness_x = volume / box.get_area(0);
double thickness_y = volume / box.get_area(1);
double thickness_z = volume / box.get_area(2);
ebox.num_cells[0] = int(ceil(2.0 * rc / thickness_x));
ebox.num_cells[1] = int(ceil(2.0 * rc / thickness_y));
ebox.num_cells[2] = int(ceil(2.0 * rc / thickness_z));
ebox.num_cells[0] = box.pbc_x ? int(ceil(2.0 * rc / thickness_x)) : 1;
ebox.num_cells[1] = box.pbc_y ? int(ceil(2.0 * rc / thickness_y)) : 1;
ebox.num_cells[2] = box.pbc_z ? int(ceil(2.0 * rc / thickness_z)) : 1;
if (ebox.num_cells[0] * ebox.num_cells[1] * ebox.num_cells[2] > 1) {
if (box.triclinic) {
ebox.h[0] = box.cpu_h[0] * ebox.num_cells[0];
Expand Down

0 comments on commit f3334dd

Please sign in to comment.