From 2a0ca446ebe54f81daa00ab61edee1b06c412236 Mon Sep 17 00:00:00 2001 From: brucefan1983 Date: Mon, 24 Jun 2024 21:52:44 +0800 Subject: [PATCH] improve printing message and doc --- doc/gpumd/input_parameters/velocity.rst | 2 +- src/main_gpumd/run.cu | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/gpumd/input_parameters/velocity.rst b/doc/gpumd/input_parameters/velocity.rst index 77492308c..69071fbd4 100644 --- a/doc/gpumd/input_parameters/velocity.rst +++ b/doc/gpumd/input_parameters/velocity.rst @@ -33,4 +33,4 @@ Caveats This is, however, not a problem since during the MD simulation, the Maxwell distribution will be achieved automatically within a short time. * The total linear and angular momenta are set to zero. * If there are already velocity data in the :ref:`simulation model file `, the initial temperature will not be used and the velocities will be initialized as those in the simulation model file. -* If this keyword is missing, velocities will be initialized with a default temperature of 300 K. +* If there are not velocity data in the :ref:`simulation model file `, and this keyword is missing, velocities will be initialized with a default temperature of 300 K. diff --git a/src/main_gpumd/run.cu b/src/main_gpumd/run.cu index 8c29bbcf5..c406d2d17 100644 --- a/src/main_gpumd/run.cu +++ b/src/main_gpumd/run.cu @@ -113,7 +113,7 @@ Run::Run() allocate_memory_gpu(group, atom, thermo); velocity.initialize( - false, + has_velocity_in_xyz, 300, atom.cpu_mass, atom.cpu_position_per_atom, @@ -121,7 +121,11 @@ Run::Run() atom.velocity_per_atom, true, 123); - printf("Initialized velocities with default T = 300 K.\n"); + if (has_velocity_in_xyz) { + printf("Initialized velocities with data in model.xyz.\n"); + } else { + printf("Initialized velocities with default T = 300 K.\n"); + } print_line_1(); printf("Finished initializing positions and related parameters.\n"); @@ -498,7 +502,9 @@ void Run::parse_velocity(const char** param, int num_param) atom.velocity_per_atom, use_seed, seed); - printf("Initialized velocities with input T = %g K.\n", initial_temperature); + if (!has_velocity_in_xyz) { + printf("Initialized velocities with input T = %g K.\n", initial_temperature); + } } void Run::parse_correct_velocity(const char** param, int num_param)