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 Original line Diff line number Diff line
@@ -313,15 +313,9 @@ void Thermo::header()
{
{
  if (lineflag == MULTILINE) return;
  if (lineflag == MULTILINE) return;


  int loc = 0;
  std::string hdr;
  for (int i = 0; i < nfield; i++)
  for (int i = 0; i < nfield; i++) hdr +=  keyword[i] + std::string(" ");
    loc += sprintf(&line[loc],"%s ",keyword[i]);
  if (me == 0) utils::logmesg(lmp,hdr);
  sprintf(&line[loc],"\n");

  if (me == 0) {
    if (screen) fprintf(screen,"%s",line);
    if (logfile) fprintf(logfile,"%s",line);
  }
}
}


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


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


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