Skip to content

Commit dceb6e5

Browse files
authored
Merge pull request brucefan1983#1035 from brucefan1983/fix_pimd_bug
fix pimd npt bug
2 parents b97a383 + 04b8626 commit dceb6e5

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/integrate/ensemble_pimd.cu

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ static void cpu_pressure_orthogonal(
619619
} else {
620620
scale_factor[2] = 1.0;
621621
}
622+
box.get_inverse();
622623
}
623624

624625
static void cpu_pressure_isotropic(
@@ -635,17 +636,11 @@ static void cpu_pressure_isotropic(
635636
const double pressure_instant = (p[0] + p[1] + p[2]) * 0.3333333333333333;
636637
const double scale_factor_Berendsen =
637638
1.0 - p_coupling[0] * (target_pressure[0] - pressure_instant);
638-
// The factor 0.666666666666667 is 2/3, where 3 means the number of directions that are coupled
639-
const double scale_factor_stochastic =
640-
sqrt(0.666666666666667 * p_coupling[0] * K_B * target_temperature / box.get_volume()) *
641-
gasdev(rng);
642-
scale_factor = scale_factor_Berendsen + 0.0 * scale_factor_stochastic;
639+
scale_factor = scale_factor_Berendsen;
643640
box.cpu_h[0] *= scale_factor;
644-
box.cpu_h[1] *= scale_factor;
645-
box.cpu_h[2] *= scale_factor;
646-
box.cpu_h[3] = box.cpu_h[0] * 0.5;
647-
box.cpu_h[4] = box.cpu_h[1] * 0.5;
648-
box.cpu_h[5] = box.cpu_h[2] * 0.5;
641+
box.cpu_h[4] *= scale_factor;
642+
box.cpu_h[8] *= scale_factor;
643+
box.get_inverse();
649644
}
650645

651646
static void cpu_pressure_triclinic(

0 commit comments

Comments
 (0)