count each force computation as one simulation step. this avoids accessing uninitialized data, too.

This commit is contained in:
Axel Kohlmeyer
2019-02-28 11:00:55 -05:00
parent 4b8621e7ef
commit 286112ffbc
3 changed files with 6 additions and 50 deletions

View File

@ -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

View File

@ -258,6 +258,7 @@ void DynamicalMatrix::calculateMatrix()
if (comm->me == 0 && screen) fprintf(screen,"Calculating Dynamical Matrix...\n"); if (comm->me == 0 && screen) fprintf(screen,"Calculating Dynamical Matrix...\n");
update->nsteps = 0;
for (bigint i=1; i<=natoms; i++){ for (bigint i=1; i<=natoms; i++){
local_idx = atom->map(i); local_idx = atom->map(i);
for (bigint alpha=0; alpha<3; alpha++){ for (bigint alpha=0; alpha<3; alpha++){
@ -390,6 +391,7 @@ void DynamicalMatrix::update_force()
comm->reverse_comm(); comm->reverse_comm();
timer->stamp(Timer::COMM); timer->stamp(Timer::COMM);
} }
++ update->nsteps;
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -545,4 +547,4 @@ void DynamicalMatrix::create_groupmap()
delete[] displs; delete[] displs;
delete[] sub_groupmap; delete[] sub_groupmap;
delete[] temp_groupmap; delete[] temp_groupmap;
} }

View File

@ -247,6 +247,7 @@ void ThirdOrder::calculateMatrix()
if (comm->me == 0 && screen) fprintf(screen,"Calculating Anharmonic Dynamical Matrix...\n"); if (comm->me == 0 && screen) fprintf(screen,"Calculating Anharmonic Dynamical Matrix...\n");
update->nsteps = 0;
for (bigint i=1; i<=natoms; i++){ for (bigint i=1; i<=natoms; i++){
local_idx = atom->map(i); local_idx = atom->map(i);
for (bigint alpha=0; alpha<3; alpha++){ for (bigint alpha=0; alpha<3; alpha++){
@ -411,6 +412,7 @@ void ThirdOrder::update_force()
comm->reverse_comm(); comm->reverse_comm();
timer->stamp(Timer::COMM); timer->stamp(Timer::COMM);
} }
++ update->nsteps;
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
@ -551,4 +553,4 @@ void ThirdOrder::create_groupmap()
delete[] displs; delete[] displs;
delete[] sub_groupmap; delete[] sub_groupmap;
delete[] temp_groupmap; delete[] temp_groupmap;
} }