diff --git a/src/KOKKOS/atom_vec_angle_kokkos.cpp b/src/KOKKOS/atom_vec_angle_kokkos.cpp index 86ef5509a5..0687e7dfb9 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.cpp +++ b/src/KOKKOS/atom_vec_angle_kokkos.cpp @@ -1638,13 +1638,7 @@ void AtomVecAngleKokkos::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); h_tag(nlocal) = atoi(values[0]); - if (h_tag(nlocal) <= 0) - error->one(FLERR,"Invalid atom ID in Atoms section of data file"); - h_molecule(nlocal) = atoi(values[1]); - if (h_molecule(nlocal) <= 0) - error->one(FLERR,"Invalid molecule ID in Atoms section of data file"); - h_type(nlocal) = atoi(values[2]); if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.cpp b/src/KOKKOS/atom_vec_atomic_kokkos.cpp index 9b06a49149..bedda8a0bd 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.cpp +++ b/src/KOKKOS/atom_vec_atomic_kokkos.cpp @@ -1277,9 +1277,6 @@ void AtomVecAtomicKokkos::data_atom(double *coord, tagint imagetmp, if (nlocal == nmax) grow(0); h_tag[nlocal] = atoi(values[0]); - if (tag[nlocal] <= 0) - error->one(FLERR,"Invalid atom ID in Atoms section of data file"); - h_type[nlocal] = atoi(values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_bond_kokkos.cpp b/src/KOKKOS/atom_vec_bond_kokkos.cpp index a1b2c7823c..edac0bcfdc 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.cpp +++ b/src/KOKKOS/atom_vec_bond_kokkos.cpp @@ -1509,13 +1509,7 @@ void AtomVecBondKokkos::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); h_tag(nlocal) = atoi(values[0]); - if (h_tag(nlocal) <= 0) - error->one(FLERR,"Invalid atom ID in Atoms section of data file"); - h_molecule(nlocal) = atoi(values[1]); - if (h_molecule(nlocal) <= 0) - error->one(FLERR,"Invalid molecule ID in Atoms section of data file"); - h_type(nlocal) = atoi(values[2]); if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_charge_kokkos.cpp b/src/KOKKOS/atom_vec_charge_kokkos.cpp index 97f489fb58..3b2f48bb66 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.cpp +++ b/src/KOKKOS/atom_vec_charge_kokkos.cpp @@ -1360,9 +1360,6 @@ void AtomVecChargeKokkos::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); h_tag[nlocal] = atoi(values[0]); - if (tag[nlocal] <= 0) - error->one(FLERR,"Invalid atom ID in Atoms section of data file"); - h_type[nlocal] = atoi(values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_full_kokkos.cpp b/src/KOKKOS/atom_vec_full_kokkos.cpp index 684c81c616..2cb87f9bcb 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.cpp +++ b/src/KOKKOS/atom_vec_full_kokkos.cpp @@ -1972,13 +1972,7 @@ void AtomVecFullKokkos::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); h_tag(nlocal) = atoi(values[0]); - if (h_tag(nlocal) <= 0) - error->one(FLERR,"Invalid atom ID in Atoms section of data file"); - h_molecule(nlocal) = atoi(values[1]); - if (h_molecule(nlocal) <= 0) - error->one(FLERR,"Invalid molecule ID in Atoms section of data file"); - h_type(nlocal) = atoi(values[2]); if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.cpp b/src/KOKKOS/atom_vec_molecular_kokkos.cpp index b75023cd37..4a45fb86d6 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.cpp +++ b/src/KOKKOS/atom_vec_molecular_kokkos.cpp @@ -1897,13 +1897,7 @@ void AtomVecMolecularKokkos::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); h_tag(nlocal) = atoi(values[0]); - if (h_tag(nlocal) <= 0) - error->one(FLERR,"Invalid atom ID in Atoms section of data file"); - h_molecule(nlocal) = atoi(values[1]); - if (h_molecule(nlocal) <= 0) - error->one(FLERR,"Invalid molecule ID in Atoms section of data file"); - h_type(nlocal) = atoi(values[2]); if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/REAX/pair_reax.cpp b/src/REAX/pair_reax.cpp index 5d1a2d78d9..f73973ac66 100644 --- a/src/REAX/pair_reax.cpp +++ b/src/REAX/pair_reax.cpp @@ -557,6 +557,8 @@ void PairREAX::init_style() error->all(FLERR,"Pair style reax requires atom IDs"); if (force->newton_pair == 0) error->all(FLERR,"Pair style reax requires newton pair on"); + if (!atom->q_flag) + error->all(FLERR,"Pair style reax requires atom attribute q"); if (strcmp(update->unit_style,"real") != 0 && comm->me == 0) error->warning(FLERR,"Not using real units with pair reax"); diff --git a/src/USER-REAXC/pair_reax_c.cpp b/src/USER-REAXC/pair_reax_c.cpp index cb8fa0be57..a0f7045961 100644 --- a/src/USER-REAXC/pair_reax_c.cpp +++ b/src/USER-REAXC/pair_reax_c.cpp @@ -330,7 +330,8 @@ void PairReaxC::coeff( int nargs, char **args ) void PairReaxC::init_style( ) { - if (!atom->q_flag) error->all(FLERR,"Pair reax/c requires atom attribute q"); + if (!atom->q_flag) + error->all(FLERR,"Pair style reax/c requires atom attribute q"); // firstwarn = 1; diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index 6606f7cf20..15388e3c5f 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -293,7 +293,7 @@ void AtomVec::pack_dihedral(tagint **buf) if (newton_bond) { for (i = 0; i < nlocal; i++) for (j = 0; j < num_dihedral[i]; j++) { - buf[m][0] = dihedral_type[i][j]; + buf[m][0] = MAX(dihedral_type[i][j],-dihedral_type[i][j]); buf[m][1] = dihedral_atom1[i][j]; buf[m][2] = dihedral_atom2[i][j]; buf[m][3] = dihedral_atom3[i][j]; @@ -304,7 +304,7 @@ void AtomVec::pack_dihedral(tagint **buf) for (i = 0; i < nlocal; i++) for (j = 0; j < num_dihedral[i]; j++) if (tag[i] == dihedral_atom2[i][j]) { - buf[m][0] = dihedral_type[i][j]; + buf[m][0] = MAX(dihedral_type[i][j],-dihedral_type[i][j]); buf[m][1] = dihedral_atom1[i][j]; buf[m][2] = dihedral_atom2[i][j]; buf[m][3] = dihedral_atom3[i][j]; diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index c3b135f0ae..5be798c586 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -109,7 +109,7 @@ void DeleteAtoms::command(int narg, char **arg) atom->map_set(); } - if (mol_flag) recount_topology(); + recount_topology(); // print before and after atom and topology counts @@ -143,9 +143,11 @@ void DeleteAtoms::command(int narg, char **arg) ndelete_impropers,atom->nimpropers); } } - if (logfile) fprintf(logfile,"Deleted " BIGINT_FORMAT - " atoms, new total = " BIGINT_FORMAT "\n", - ndelete,atom->natoms); + + if (logfile) { + fprintf(logfile,"Deleted " BIGINT_FORMAT + " atoms, new total = " BIGINT_FORMAT "\n", + ndelete,atom->natoms); if (mol_flag) { if (nbonds_previous) fprintf(logfile,"Deleted " BIGINT_FORMAT @@ -164,6 +166,7 @@ void DeleteAtoms::command(int narg, char **arg) " impropers, new total = " BIGINT_FORMAT "\n", ndelete_impropers,atom->nimpropers); } + } } } @@ -483,20 +486,21 @@ void DeleteAtoms::recount_topology() } } - if (atom->avec->bonds_allow) + if (atom->avec->bonds_allow) { MPI_Allreduce(&nbonds,&atom->nbonds,1,MPI_LMP_BIGINT,MPI_SUM,world); - if (atom->avec->angles_allow) + if (!force->newton_bond) atom->nbonds /= 2; + } + if (atom->avec->angles_allow) { MPI_Allreduce(&nangles,&atom->nangles,1,MPI_LMP_BIGINT,MPI_SUM,world); - if (atom->avec->dihedrals_allow) + if (!force->newton_bond) atom->nangles /= 3; + } + if (atom->avec->dihedrals_allow) { MPI_Allreduce(&ndihedrals,&atom->ndihedrals,1,MPI_LMP_BIGINT,MPI_SUM,world); - if (atom->avec->impropers_allow) + if (!force->newton_bond) atom->ndihedrals /= 4; + } + if (atom->avec->impropers_allow) { MPI_Allreduce(&nimpropers,&atom->nimpropers,1,MPI_LMP_BIGINT,MPI_SUM,world); - - if (!force->newton_bond) { - atom->nbonds /= 2; - atom->nangles /= 3; - atom->ndihedrals /= 4; - atom->nimpropers /= 4; + if (!force->newton_bond) atom->nimpropers /= 4; } } diff --git a/src/image.cpp b/src/image.cpp index dca9d1dfd3..15d6a5dd5a 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -1007,8 +1007,8 @@ void Image::write_JPG(FILE *fp) cinfo.in_color_space = JCS_RGB; jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo,85,true); - jpeg_start_compress(&cinfo,true); + jpeg_set_quality(&cinfo,85,TRUE); + jpeg_start_compress(&cinfo,TRUE); while (cinfo.next_scanline < cinfo.image_height) { row_pointer = (JSAMPROW)