Skip to content

Commit 564fd3d

Browse files
authored
Merge pull request brucefan1983#1144 from MoseyQAQ/mttk_pperiod
Enforce minimum pperiod value in ensemble `mttk`
2 parents 4821546 + 56507ca commit 564fd3d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

doc/gpumd/input_parameters/ensemble_mttk.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Using ``x``, ``y``, ``z``, ``xy``, ``yz``, ``xz`` allows one to specify each str
3636

3737
The parameters :attr:`<p_1>` and :attr:`<p_2>` specify the initial and final pressure, respectively.
3838
Finally, the optional parameter :attr:`<tau_press>`, which defaults to ``1000``, determines the period of the barostat in units of the timestep.
39-
It determines how strongly the system is coupled to the barostat.
39+
It determines how strongly the system is coupled to the barostat and should be :math:`\geq 200` timesteps.
4040

4141
The :attr:`nph_mttk` keyword can be used in analoguous fashion to run simulations in the isenthalpic (NPH) ensemble::
4242

src/integrate/ensemble_mttk.cu

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ Ensemble_MTTK::Ensemble_MTTK(const char** params, int num_params)
110110
} else if (strcmp(params[i], "pperiod") == 0) {
111111
if (!is_valid_real(params[i + 1], &p_period[0][0]))
112112
PRINT_INPUT_ERROR("Wrong inputs for pperiod keyword.");
113+
if (p_period[0][0] < 200) {
114+
PRINT_INPUT_ERROR("pperiod should >= 200 timestep.");
115+
}
113116
i += 2;
114117
for (int i = 0; i < 3; i++) {
115118
for (int j = 0; j < 3; j++) {

0 commit comments

Comments
 (0)