diff --git a/src/domain.cpp b/src/domain.cpp index f38e50ede0..71c220dd07 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -1222,6 +1222,26 @@ void Domain::print_box(const char *str) } } +/* ---------------------------------------------------------------------- + format boundary string for output + assume str is 9 chars or more in length +------------------------------------------------------------------------- */ + +void Domain::boundary_string(char *str) +{ + int m = 0; + for (int idim = 0; idim < 3; idim++) { + for (int iside = 0; iside < 2; iside++) { + if (boundary[idim][iside] == 0) str[m++] = 'p'; + else if (boundary[idim][iside] == 1) str[m++] = 'f'; + else if (boundary[idim][iside] == 2) str[m++] = 's'; + else if (boundary[idim][iside] == 3) str[m++] = 'm'; + } + str[m++] = ' '; + } + str[8] = '\0'; +} + /* ---------------------------------------------------------------------- convert triclinic 0-1 lamda coords to box coords for all N atoms x = H lamda + x0; diff --git a/src/domain.h b/src/domain.h index ad638bcb59..a449449d58 100644 --- a/src/domain.h +++ b/src/domain.h @@ -110,6 +110,7 @@ class Domain : protected Pointers { int find_region(char *); void set_boundary(int, char **, int); void print_box(const char *); + void boundary_string(char *); virtual void lamda2x(int); virtual void x2lamda(int); diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index 13930a50c6..fa951c8fcf 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -59,17 +59,7 @@ void DumpAtom::init_style() // setup boundary string - int m = 0; - for (int idim = 0; idim < 3; idim++) { - for (int iside = 0; iside < 2; iside++) { - if (domain->boundary[idim][iside] == 0) boundstr[m++] = 'p'; - else if (domain->boundary[idim][iside] == 1) boundstr[m++] = 'f'; - else if (domain->boundary[idim][iside] == 2) boundstr[m++] = 's'; - else if (domain->boundary[idim][iside] == 3) boundstr[m++] = 'm'; - } - boundstr[m++] = ' '; - } - boundstr[8] = '\0'; + domain->boundary_string(boundstr); // setup column string diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 5eb2ec1a6a..c5ed749f08 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -218,17 +218,7 @@ void DumpCustom::init_style() // setup boundary string - int m = 0; - for (int idim = 0; idim < 3; idim++) { - for (int iside = 0; iside < 2; iside++) { - if (domain->boundary[idim][iside] == 0) boundstr[m++] = 'p'; - else if (domain->boundary[idim][iside] == 1) boundstr[m++] = 'f'; - else if (domain->boundary[idim][iside] == 2) boundstr[m++] = 's'; - else if (domain->boundary[idim][iside] == 3) boundstr[m++] = 'm'; - } - boundstr[m++] = ' '; - } - boundstr[8] = '\0'; + domain->boundary_string(boundstr); // setup function ptrs diff --git a/src/lmptype.h b/src/lmptype.h index f5739c3934..3e015a9aa8 100644 --- a/src/lmptype.h +++ b/src/lmptype.h @@ -1,4 +1,4 @@ -/* -*- c++ -*- ---------------------------------------------------------- +/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov diff --git a/src/neighbor.cpp b/src/neighbor.cpp index f14188fc7a..106b4f26b7 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -1606,7 +1606,8 @@ void Neighbor::modify_params(int narg, char **arg) error->all(FLERR,"Invalid group ID in neigh_modify command"); if (includegroup && (atom->firstgroupname == NULL || strcmp(arg[iarg+1],atom->firstgroupname) != 0)) - error->all(FLERR,"Neigh_modify include group != atom_modify first group"); + error->all(FLERR, + "Neigh_modify include group != atom_modify first group"); iarg += 2; } else if (strcmp(arg[iarg],"exclude") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); diff --git a/src/update.cpp b/src/update.cpp index fa59ef60e6..e2132cecfb 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -360,13 +360,17 @@ void Update::reset_timestep(int narg, char **arg) for (int i = 0; i < output->ndump; i++) if (output->last_dump[i] >= 0) - error->all(FLERR,"Cannot reset timestep with dump file already written to"); + error->all(FLERR, + "Cannot reset timestep with dump file already written to"); + if (output->restart && output->last_restart >= 0) - error->all(FLERR,"Cannot reset timestep with restart file already written"); + error->all(FLERR, + "Cannot reset timestep with restart file already written"); for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->time_depend) - error->all(FLERR,"Cannot reset timestep with a time-dependent fix defined"); + error->all(FLERR, + "Cannot reset timestep with a time-dependent fix defined"); for (int i = 0; i < domain->nregion; i++) if (domain->regions[i]->dynamic_check())