modifications to correctly print modified dihedrals, impropers

This commit is contained in:
jrgissing
2018-01-22 23:56:11 -07:00
parent 5e9d257ec2
commit d2da49cdf9
4 changed files with 50 additions and 26 deletions

View File

@ -152,8 +152,8 @@ void WriteData::write(char *file)
if (natoms != atom->natoms && output->thermo->lostflag == ERROR)
error->all(FLERR,"Atom count is inconsistent, cannot write data file");
// sum up bond,angle counts
// may be different than atom->nbonds,nangles if broken/turned-off
// sum up bond,angle,dihedral,improper counts
// may be different than atom->nbonds,nangles, etc. if broken/turned-off
if (atom->molecular == 1 && (atom->nbonds || atom->nbondtypes)) {
nbonds_local = atom->avec->pack_bond(NULL);
@ -164,6 +164,16 @@ void WriteData::write(char *file)
MPI_Allreduce(&nangles_local,&nangles,1,MPI_LMP_BIGINT,MPI_SUM,world);
}
if (atom->molecular == 1 && (atom->ndihedrals || atom->ndihedraltypes)) {
ndihedrals_local = atom->avec->pack_dihedral(NULL);
MPI_Allreduce(&ndihedrals_local,&ndihedrals,1,MPI_LMP_BIGINT,MPI_SUM,world);
}
if (atom->molecular == 1 && (atom->nimpropers || atom->nimpropertypes)) {
nimpropers_local = atom->avec->pack_improper(NULL);
MPI_Allreduce(&nimpropers_local,&nimpropers,1,MPI_LMP_BIGINT,MPI_SUM,world);
}
// open data file
if (me == 0) {