Skip to content

Commit

Permalink
improve printing message and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
brucefan1983 committed Jun 24, 2024
1 parent 6396341 commit 2a0ca44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/gpumd/input_parameters/velocity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <model_xyz>`, 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 <model_xyz>`, and this keyword is missing, velocities will be initialized with a default temperature of 300 K.
12 changes: 9 additions & 3 deletions src/main_gpumd/run.cu
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,19 @@ Run::Run()
allocate_memory_gpu(group, atom, thermo);

velocity.initialize(
false,
has_velocity_in_xyz,
300,
atom.cpu_mass,
atom.cpu_position_per_atom,
atom.cpu_velocity_per_atom,
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");
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2a0ca44

Please sign in to comment.