enable and apply clang-format

This commit is contained in:
Axel Kohlmeyer
2022-05-22 07:04:35 -04:00
parent 9a973e67fa
commit cd8bef3b0b
30 changed files with 202 additions and 246 deletions

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -34,41 +33,39 @@ using namespace LAMMPS_NS;
void WriteDump::command(int narg, char **arg)
{
if (narg < 3) error->all(FLERR,"Illegal write_dump command");
if (narg < 3) error->all(FLERR, "Illegal write_dump command");
// modindex = index in args of "modify" keyword
// will be narg if "modify" is not present
int modindex;
for (modindex = 0; modindex < narg; modindex++)
if (strcmp(arg[modindex],"modify") == 0) break;
if (strcmp(arg[modindex], "modify") == 0) break;
// create the Dump instance
// create dump command line with extra required args
auto dumpargs = new char*[modindex+2];
dumpargs[0] = (char *) "WRITE_DUMP"; // dump id
dumpargs[1] = arg[0]; // group
dumpargs[2] = arg[1]; // dump style
std::string ntimestep = std::to_string(MAX(update->ntimestep,1));
dumpargs[3] = (char *) ntimestep.c_str(); // dump frequency
auto dumpargs = new char *[modindex + 2];
dumpargs[0] = (char *) "WRITE_DUMP"; // dump id
dumpargs[1] = arg[0]; // group
dumpargs[2] = arg[1]; // dump style
std::string ntimestep = std::to_string(MAX(update->ntimestep, 1));
dumpargs[3] = (char *) ntimestep.c_str(); // dump frequency
for (int i = 2; i < modindex; ++i) dumpargs[i+2] = arg[i];
for (int i = 2; i < modindex; ++i) dumpargs[i + 2] = arg[i];
Dump *dump = output->add_dump(modindex+2, dumpargs);
if (modindex < narg) dump->modify_params(narg-modindex-1,&arg[modindex+1]);
Dump *dump = output->add_dump(modindex + 2, dumpargs);
if (modindex < narg) dump->modify_params(narg - modindex - 1, &arg[modindex + 1]);
// write out one frame and then delete the dump again
// set multifile_override for DumpImage so that filename needs no "*"
if (strcmp(arg[1],"image") == 0)
(dynamic_cast<DumpImage *>( dump))->multifile_override = 1;
if (strcmp(arg[1], "image") == 0) (dynamic_cast<DumpImage *>(dump))->multifile_override = 1;
if (strcmp(arg[1],"cfg") == 0)
(dynamic_cast<DumpCFG *>( dump))->multifile_override = 1;
if (strcmp(arg[1], "cfg") == 0) (dynamic_cast<DumpCFG *>(dump))->multifile_override = 1;
if ((update->first_update == 0) && (comm->me == 0))
error->warning(FLERR,"Calling write_dump before a full system init.");
error->warning(FLERR, "Calling write_dump before a full system init.");
dump->init();
dump->write();