From 3b7123bec2a2e06c4d5afa2f3670af90d8b586b6 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 2 May 2014 22:15:13 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11908 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/CLASS2/dihedral_class2.cpp | 4 +--- src/neighbor.cpp | 16 ++++++++-------- src/write_data.cpp | 34 +++++++++++++++++++--------------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp index e4f58e0560..579e195c2a 100644 --- a/src/CLASS2/dihedral_class2.cpp +++ b/src/CLASS2/dihedral_class2.cpp @@ -230,9 +230,7 @@ void DihedralClass2::compute(int eflag, int vflag) sinphi = sqrt(1.0 - c*c); sinphi = MAX(sinphi,SMALL); - // addition by Andrew Jewett, Jan 2013 - // adjust the sign of phi if necessary for negative input angles - // n123 = vb2 x vb1 + // n123 = vb1 x vb2 double n123x = vb1y*vb2z - vb1z*vb2y; double n123y = vb1z*vb2x - vb1x*vb2z; diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 70807f475e..30ff8b3b0a 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -859,20 +859,20 @@ void Neighbor::init() // set ptrs to topology build functions - if (bond_off) bond_build = &Neighbor::bond_partial; - else if (atom->molecular == 2) bond_build = &Neighbor::bond_template; + if (atom->molecular == 2) bond_build = &Neighbor::bond_template; + else if (bond_off) bond_build = &Neighbor::bond_partial; else bond_build = &Neighbor::bond_all; - if (angle_off) angle_build = &Neighbor::angle_partial; - else if (atom->molecular == 2) angle_build = &Neighbor::angle_template; + if (atom->molecular == 2) angle_build = &Neighbor::angle_template; + else if (angle_off) angle_build = &Neighbor::angle_partial; else angle_build = &Neighbor::angle_all; - if (dihedral_off) dihedral_build = &Neighbor::dihedral_partial; - else if (atom->molecular == 2) dihedral_build = &Neighbor::dihedral_template; + if (atom->molecular == 2) dihedral_build = &Neighbor::dihedral_template; + else if (dihedral_off) dihedral_build = &Neighbor::dihedral_partial; else dihedral_build = &Neighbor::dihedral_all; - if (improper_off) improper_build = &Neighbor::improper_partial; - else if (atom->molecular == 2) improper_build = &Neighbor::improper_template; + if (atom->molecular == 2) improper_build = &Neighbor::improper_template; + else if (improper_off) improper_build = &Neighbor::improper_partial; else improper_build = &Neighbor::improper_all; // set topology neighbor list counts to 0 diff --git a/src/write_data.cpp b/src/write_data.cpp index e9809692c9..6fd239461f 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -218,21 +218,25 @@ void WriteData::header() fprintf(fp,BIGINT_FORMAT " atoms\n",atom->natoms); fprintf(fp,"%d atom types\n",atom->ntypes); - if (atom->nbonds || atom->nbondtypes) { - fprintf(fp,BIGINT_FORMAT " bonds\n",nbonds); - fprintf(fp,"%d bond types\n",atom->nbondtypes); - } - if (atom->nangles || atom->nangletypes) { - fprintf(fp,BIGINT_FORMAT " angles\n",nangles); - fprintf(fp,"%d angle types\n",atom->nangletypes); - } - if (atom->ndihedrals || atom->ndihedraltypes) { - fprintf(fp,BIGINT_FORMAT " dihedrals\n",atom->ndihedrals); - fprintf(fp,"%d dihedral types\n",atom->ndihedraltypes); - } - if (atom->nimpropers || atom->nimpropertypes) { - fprintf(fp,BIGINT_FORMAT " impropers\n",atom->nimpropers); - fprintf(fp,"%d improper types\n",atom->nimpropertypes); + // do not write molecular topology info for atom_style template + + if (atom->molecular == 1) { + if (atom->nbonds || atom->nbondtypes) { + fprintf(fp,BIGINT_FORMAT " bonds\n",nbonds); + fprintf(fp,"%d bond types\n",atom->nbondtypes); + } + if (atom->nangles || atom->nangletypes) { + fprintf(fp,BIGINT_FORMAT " angles\n",nangles); + fprintf(fp,"%d angle types\n",atom->nangletypes); + } + if (atom->ndihedrals || atom->ndihedraltypes) { + fprintf(fp,BIGINT_FORMAT " dihedrals\n",atom->ndihedrals); + fprintf(fp,"%d dihedral types\n",atom->ndihedraltypes); + } + if (atom->nimpropers || atom->nimpropertypes) { + fprintf(fp,BIGINT_FORMAT " impropers\n",atom->nimpropers); + fprintf(fp,"%d improper types\n",atom->nimpropertypes); + } } for (int i = 0; i < modify->nfix; i++)