modernize

This commit is contained in:
Axel Kohlmeyer
2021-10-16 21:40:17 -04:00
parent cfdf9cee5d
commit f392b089a4
3 changed files with 11 additions and 21 deletions

View File

@ -549,12 +549,9 @@ void FixShardlow::initial_integrate(int /*vflag*/)
error->all(FLERR,"Fix shardlow does not yet support triclinic geometries");
if (rcut >= bbx || rcut >= bby || rcut>= bbz )
{
char fmt[] = {"Shardlow algorithm requires sub-domain length > 2*(rcut+skin). Either reduce the number of processors requested, or change the cutoff/skin: rcut= %e bbx= %e bby= %e bbz= %e\n"};
char *msg = (char *) malloc(sizeof(fmt) + 4*15);
sprintf(msg, fmt, rcut, bbx, bby, bbz);
error->one(FLERR, msg);
}
error->one(FLERR,"Shardlow algorithm requires sub-domain length > 2*(rcut+skin). "
"Either reduce the number of processors requested, or change the cutoff/skin: "
"rcut= {} bbx= {} bby= {} bbz= {}\n", rcut, bbx, bby, bbz);
NPairHalfBinNewtonSSA *np_ssa = dynamic_cast<NPairHalfBinNewtonSSA*>(list->np);
if (!np_ssa) error->one(FLERR, "NPair wasn't a NPairHalfBinNewtonSSA object");

View File

@ -676,16 +676,11 @@ void FixPIMD::comm_exec(double **ptr)
int index = atom->map(tag_send[i]);
if (index < 0) {
char error_line[256];
sprintf(error_line,
"Atom " TAGINT_FORMAT " is missing at world [%d] "
"rank [%d] required by rank [%d] (" TAGINT_FORMAT ", " TAGINT_FORMAT
", " TAGINT_FORMAT ").\n",
tag_send[i], universe->iworld, comm->me, plan_recv[iplan], atom->tag[0],
atom->tag[1], atom->tag[2]);
error->universe_one(FLERR, error_line);
auto mesg = fmt::format("Atom {} is missing at world [{}] rank [{}] "
"required by rank [{}] ({}, {}, {}).\n",
tag_send[i], universe->iworld, comm->me,
plan_recv[iplan], atom->tag[0], atom->tag[1], atom->tag[2]);
error->universe_one(FLERR, mesg);
}
memcpy(wrap_ptr, ptr[index], ncpy);

View File

@ -840,11 +840,9 @@ void TAD::initialize_event_list() {
void TAD::delete_event_list() {
for (int i = 0; i < n_event_list; i++) {
char str[128];
sprintf(str,"tad_event_%d",i);
modify->delete_fix(str);
}
for (int i = 0; i < n_event_list; i++)
modify->delete_fix(fmt::format("tad_event_{}",i));
memory->sfree(fix_event_list);
fix_event_list = nullptr;
n_event_list = 0;