From 286112ffbc5e3b48620957abb1508078a8326e6c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 28 Feb 2019 11:00:55 -0500 Subject: [PATCH] count each force computation as one simulation step. this avoids accessing uninitialized data, too. --- .../phonon/dynamical_matrix_command/Manual.md | 48 ------------------- src/USER-PHONON/dynamical_matrix.cpp | 4 +- src/USER-PHONON/third_order.cpp | 4 +- 3 files changed, 6 insertions(+), 50 deletions(-) delete mode 100755 examples/USER/phonon/dynamical_matrix_command/Manual.md diff --git a/examples/USER/phonon/dynamical_matrix_command/Manual.md b/examples/USER/phonon/dynamical_matrix_command/Manual.md deleted file mode 100755 index c361f80325..0000000000 --- a/examples/USER/phonon/dynamical_matrix_command/Manual.md +++ /dev/null @@ -1,48 +0,0 @@ -# dynamical_matrix command - -## Syntax - -``` -dynamical_matrix group-ID style args keyword value ... -``` - -* group-ID = ID of group of atoms to displace -* style = *regular* or *eskm* -``` -*regular* args = gamma - gamma = finite difference displacement length -*eskm* args = gamma - gamma = finite difference displacement length -``` -* zero or more keyword/value pairs may be appended -* keyword = *file* or *binary* -``` -*file* value = output_file - output_file = name of file to dump the dynamical matrix into -*binary* values = *yes* or *no* or *gzip* -``` - -## Examples - -``` -dynamical_matrix 1 regular 0.000001 -dynamical_matrix 1 eskm 0.000001 -dynamical_matrix 3 regular 0.00004 file dynmat.dat -dynamical_matrix 5 eskm 0.00000001 file dynamical.dat binary yes -``` - -## Description - -Calculate the dynamical matrix of the selected group. - -## Restrictions - -None - -## Related commands - -None - -## Default - -The option defaults are file = "dynmat.dyn", binary = no diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index da98a23a7d..cef59b3a63 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -258,6 +258,7 @@ void DynamicalMatrix::calculateMatrix() if (comm->me == 0 && screen) fprintf(screen,"Calculating Dynamical Matrix...\n"); + update->nsteps = 0; for (bigint i=1; i<=natoms; i++){ local_idx = atom->map(i); for (bigint alpha=0; alpha<3; alpha++){ @@ -390,6 +391,7 @@ void DynamicalMatrix::update_force() comm->reverse_comm(); timer->stamp(Timer::COMM); } + ++ update->nsteps; } /* ---------------------------------------------------------------------- @@ -545,4 +547,4 @@ void DynamicalMatrix::create_groupmap() delete[] displs; delete[] sub_groupmap; delete[] temp_groupmap; -} \ No newline at end of file +} diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 41382e64cb..b4d2032a04 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -247,6 +247,7 @@ void ThirdOrder::calculateMatrix() if (comm->me == 0 && screen) fprintf(screen,"Calculating Anharmonic Dynamical Matrix...\n"); + update->nsteps = 0; for (bigint i=1; i<=natoms; i++){ local_idx = atom->map(i); for (bigint alpha=0; alpha<3; alpha++){ @@ -411,6 +412,7 @@ void ThirdOrder::update_force() comm->reverse_comm(); timer->stamp(Timer::COMM); } + ++ update->nsteps; } /* ---------------------------------------------------------------------- @@ -551,4 +553,4 @@ void ThirdOrder::create_groupmap() delete[] displs; delete[] sub_groupmap; delete[] temp_groupmap; -} \ No newline at end of file +}