diff -Naur lammps-18Dec07/src/CLASS2/improper_class2.cpp lammps-19Dec07/src/CLASS2/improper_class2.cpp --- lammps-18Dec07/src/CLASS2/improper_class2.cpp 2007-12-06 17:11:14.000000000 -0700 +++ lammps-19Dec07/src/CLASS2/improper_class2.cpp 2007-12-19 10:20:01.000000000 -0700 @@ -477,7 +477,7 @@ if (evflag) ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper, - fabcd[i1],fabcd[i3],fabcd[i4], + fabcd[0],fabcd[2],fabcd[3], delr[0][0],delr[0][1],delr[0][2], delr[1][0],delr[1][1],delr[1][2], delr[2][0]-delr[1][0],delr[2][1]-delr[1][1], @@ -821,7 +821,7 @@ if (evflag) ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper, - fabcd[i1],fabcd[i3],fabcd[i4], + fabcd[0],fabcd[2],fabcd[3], delxAB,delyAB,delzAB,delxBC,delyBC,delzBC,delxBD,delyBD,delzBD); } } diff -Naur lammps-18Dec07/src/MOLECULE/atom_vec_molecular.cpp lammps-19Dec07/src/MOLECULE/atom_vec_molecular.cpp --- lammps-18Dec07/src/MOLECULE/atom_vec_molecular.cpp 2007-10-04 11:57:04.000000000 -0600 +++ lammps-19Dec07/src/MOLECULE/atom_vec_molecular.cpp 2007-12-19 10:19:53.000000000 -0700 @@ -344,8 +344,8 @@ int AtomVecMolecular::pack_border_one(int i, double *buf) { - buf[1] = molecule[i]; - return 2; + buf[0] = molecule[i]; + return 1; } /* ---------------------------------------------------------------------- */ @@ -372,8 +372,8 @@ int AtomVecMolecular::unpack_border_one(int i, double *buf) { - molecule[i] = static_cast (buf[1]); - return 2; + molecule[i] = static_cast (buf[0]); + return 1; } /* ---------------------------------------------------------------------- diff -Naur lammps-18Dec07/src/read_data.cpp lammps-19Dec07/src/read_data.cpp --- lammps-18Dec07/src/read_data.cpp 2007-06-22 10:59:17.000000000 -0600 +++ lammps-19Dec07/src/read_data.cpp 2007-12-19 10:20:18.000000000 -0700 @@ -940,36 +940,96 @@ else if (strcmp(keyword,"Atoms") == 0) skip_lines(natoms); else if (strcmp(keyword,"Velocities") == 0) skip_lines(natoms); - else if (strcmp(keyword,"Pair Coeffs") == 0) skip_lines(atom->ntypes); - else if (strcmp(keyword,"Bond Coeffs") == 0) + else if (strcmp(keyword,"Pair Coeffs") == 0) { + if (force->pair == NULL) + error->all("Must define pair_style before Pair Coeffs"); + skip_lines(atom->ntypes); + + } else if (strcmp(keyword,"Bond Coeffs") == 0) { + if (atom->avec->bonds_allow == 0) + error->all("Invalid data file section: Bond Coeffs"); + if (force->bond == NULL) + error->all("Must define bond_style before Bond Coeffs"); skip_lines(atom->nbondtypes); - else if (strcmp(keyword,"Angle Coeffs") == 0) + + } else if (strcmp(keyword,"Angle Coeffs") == 0) { + if (atom->avec->angles_allow == 0) + error->all("Invalid data file section: Angle Coeffs"); + if (force->angle == NULL) + error->all("Must define angle_style before Angle Coeffs"); skip_lines(atom->nangletypes); - else if (strcmp(keyword,"Dihedral Coeffs") == 0) + + } else if (strcmp(keyword,"Dihedral Coeffs") == 0) { skip_lines(atom->ndihedraltypes); - else if (strcmp(keyword,"Improper Coeffs") == 0) + if (atom->avec->dihedrals_allow == 0) + error->all("Invalid data file section: Dihedral Coeffs"); + if (force->dihedral == NULL) + error->all("Must define dihedral_style before Dihedral Coeffs"); + + } else if (strcmp(keyword,"Improper Coeffs") == 0) { + if (atom->avec->impropers_allow == 0) + error->all("Invalid data file section: Improper Coeffs"); + if (force->improper == NULL) + error->all("Must define improper_style before Improper Coeffs"); skip_lines(atom->nimpropertypes); - else if (strcmp(keyword,"BondBond Coeffs") == 0) + } else if (strcmp(keyword,"BondBond Coeffs") == 0) { + if (atom->avec->angles_allow == 0) + error->all("Invalid data file section: BondBond Coeffs"); + if (force->angle == NULL) + error->all("Must define angle_style before BondBond Coeffs"); skip_lines(atom->nangletypes); - else if (strcmp(keyword,"BondAngle Coeffs") == 0) + + } else if (strcmp(keyword,"BondAngle Coeffs") == 0) { + if (atom->avec->angles_allow == 0) + error->all("Invalid data file section: BondAngle Coeffs"); + if (force->angle == NULL) + error->all("Must define angle_style before BondAngle Coeffs"); skip_lines(atom->nangletypes); - else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) + } else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) { + if (atom->avec->dihedrals_allow == 0) + error->all("Invalid data file section: MiddleBondTorsion Coeffs"); + if (force->dihedral == NULL) + error->all("Must define dihedral_style before MiddleBondTorsion Coeffs"); skip_lines(atom->ndihedraltypes); - else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) + + } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) { + if (atom->avec->dihedrals_allow == 0) + error->all("Invalid data file section: EndBondTorsion Coeffs"); + if (force->dihedral == NULL) + error->all("Must define dihedral_style before EndBondTorsion Coeffs"); skip_lines(atom->ndihedraltypes); - else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) + + } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) { + if (atom->avec->dihedrals_allow == 0) + error->all("Invalid data file section: AngleTorsion Coeffs"); + if (force->dihedral == NULL) + error->all("Must define dihedral_style before AngleTorsion Coeffs"); skip_lines(atom->ndihedraltypes); - else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) + + } else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) { + if (atom->avec->dihedrals_allow == 0) + error->all("Invalid data file section: AngleAngleTorsion Coeffs"); + if (force->dihedral == NULL) + error->all("Must define dihedral_style before AngleAngleTorsion Coeffs"); skip_lines(atom->ndihedraltypes); - else if (strcmp(keyword,"BondBond13 Coeffs") == 0) + + } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) { + if (atom->avec->dihedrals_allow == 0) + error->all("Invalid data file section: BondBond13 Coeffs"); + if (force->dihedral == NULL) + error->all("Must define dihedral_style before BondBond13 Coeffs"); skip_lines(atom->ndihedraltypes); - else if (strcmp(keyword,"AngleAngle Coeffs") == 0) + } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) { + if (atom->avec->impropers_allow == 0) + error->all("Invalid data file section: AngleAngle Coeffs"); + if (force->improper == NULL) + error->all("Must define improper_style before AngleAngle Coeffs"); skip_lines(atom->nimpropertypes); - else if (strcmp(keyword,"Bonds") == 0) { + } else if (strcmp(keyword,"Bonds") == 0) { for (i = 1; i < cmax; i++) count[i] = 0; if (force->newton_bond)