Unverified Commit fdf72820 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

simplify output creation

parent a7d2b792
Loading
Loading
Loading
Loading
+5 −14
Original line number Diff line number Diff line
@@ -313,15 +313,9 @@ void Thermo::header()
{
  if (lineflag == MULTILINE) return;

  int loc = 0;
  for (int i = 0; i < nfield; i++)
    loc += sprintf(&line[loc],"%s ",keyword[i]);
  sprintf(&line[loc],"\n");

  if (me == 0) {
    if (screen) fprintf(screen,"%s",line);
    if (logfile) fprintf(logfile,"%s",line);
  }
  std::string hdr;
  for (int i = 0; i < nfield; i++) hdr +=  keyword[i] + std::string(" ");
  if (me == 0) utils::logmesg(lmp,hdr);
}

/* ---------------------------------------------------------------------- */
@@ -385,11 +379,8 @@ void Thermo::compute(int flag)
  // print line to screen and logfile

  if (me == 0) {
    if (screen) fprintf(screen,"%s",line);
    if (logfile) {
      fprintf(logfile,"%s",line);
      if (flushflag) fflush(logfile);
    }
    utils::logmesg(lmp,line);
    if (logfile && flushflag) fflush(logfile);
  }

  // set to 1, so that subsequent invocations of CPU time will be non-zero