Unverified Commit 96d94351 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

more output cleanup in MISC, MLIAP, MOLECULE, and POEMS

parent 5e183ecb
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include "fmt/format.h"

using namespace LAMMPS_NS;
using namespace FixConst;
@@ -286,12 +287,9 @@ void FixDeposit::init()
    } else maxradinsert = 0.5;

    double separation = MAX(2.0*maxradinsert,maxradall+maxradinsert);
    if (sqrt(nearsq) < separation && comm->me == 0) {
      char str[128];
      sprintf(str,"Fix deposit near setting < possible overlap separation %g",
              separation);
      error->warning(FLERR,str);
    }
    if (sqrt(nearsq) < separation && comm->me == 0)
      error->warning(FLERR,fmt::format("Fix deposit near setting < possible "
                                       "overlap separation {}",separation));
  }
}

+9 −14
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <cstring>
#include <cstdlib>
#include <mpi.h>
#include <string>
#include "atom.h"
#include "update.h"
#include "respa.h"
@@ -35,6 +36,8 @@
#include "citeme.h"
#include "memory.h"
#include "error.h"
#include "utils.h"
#include "fmt/format.h"

using namespace LAMMPS_NS;
using namespace FixConst;
@@ -450,20 +453,12 @@ void FixOrientBCC::post_force(int /*vflag*/)
    MPI_Allreduce(&maxcount,&max,1,MPI_INT,MPI_MAX,world);

    if (me == 0) {
      if (screen) fprintf(screen,
                          "orient step " BIGINT_FORMAT ": " BIGINT_FORMAT
                          " atoms have %d neighbors\n",
                          update->ntimestep,atom->natoms,total);
      if (logfile) fprintf(logfile,
                           "orient step " BIGINT_FORMAT ": " BIGINT_FORMAT
                           " atoms have %d neighbors\n",
                           update->ntimestep,atom->natoms,total);
      if (screen)
        fprintf(screen,"  neighs: min = %d, max = %d, ave = %g\n",
                min,max,ave);
      if (logfile)
        fprintf(logfile,"  neighs: min = %d, max = %d, ave = %g\n",
      std::string mesg = fmt::format("orient step {}: {} atoms have {} "
                                     "neighbors\n", update->ntimestep,
                                     atom->natoms,total);
      mesg += fmt::format("  neighs: min = {}, max ={}, ave = {}\n",
                          min,max,ave);
      utils::logmesg(lmp,mesg);
    }
  }
}
+9 −14
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <cstring>
#include <cstdlib>
#include <mpi.h>
#include <string>
#include "atom.h"
#include "update.h"
#include "respa.h"
@@ -32,6 +33,8 @@
#include "citeme.h"
#include "memory.h"
#include "error.h"
#include "utils.h"
#include "fmt/format.h"

using namespace LAMMPS_NS;
using namespace FixConst;
@@ -448,20 +451,12 @@ void FixOrientFCC::post_force(int /*vflag*/)
    MPI_Allreduce(&maxcount,&max,1,MPI_INT,MPI_MAX,world);

    if (me == 0) {
      if (screen) fprintf(screen,
                          "orient step " BIGINT_FORMAT ": " BIGINT_FORMAT
                          " atoms have %d neighbors\n",
                          update->ntimestep,atom->natoms,total);
      if (logfile) fprintf(logfile,
                           "orient step " BIGINT_FORMAT ": " BIGINT_FORMAT
                           " atoms have %d neighbors\n",
                           update->ntimestep,atom->natoms,total);
      if (screen)
        fprintf(screen,"  neighs: min = %d, max = %d, ave = %g\n",
                min,max,ave);
      if (logfile)
        fprintf(logfile,"  neighs: min = %d, max = %d, ave = %g\n",
      std::string mesg = fmt::format("orient step {}: {} atoms have {} "
                                     "neighbors\n", update->ntimestep,
                                     atom->natoms,total);
      mesg += fmt::format("  neighs: min = {}, max ={}, ave = {}\n",
                          min,max,ave);
      utils::logmesg(lmp,mesg);
    }
  }
}
+11 −12
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@
#include "random_mars.h"
#include "memory.h"
#include "error.h"
#include "utils.h"
#include "fmt/format.h"

using namespace LAMMPS_NS;
using namespace FixConst;
@@ -66,25 +68,22 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
  nynodes = force->inumeric(FLERR,arg[11]);
  nznodes = force->inumeric(FLERR,arg[12]);

  if (comm->me == 0) {
    fpr = fopen(arg[13],"r");
  if (fpr == NULL) {
    char str[128];
    snprintf(str,128,"Cannot open file %s",arg[13]);
    error->one(FLERR,str);
    if (fpr == NULL)
      error->all(FLERR,fmt::format("Cannot open input file {}: {}",
                                   arg[13], utils::getsyserror()));
  }

  nfileevery = force->inumeric(FLERR,arg[14]);

  if (nfileevery) {
    if (narg != 16) error->all(FLERR,"Illegal fix ttm command");
    MPI_Comm_rank(world,&me);
    if (me == 0) {
    if (comm->me == 0) {
      fp = fopen(arg[15],"w");
      if (fp == NULL) {
        char str[128];
        snprintf(str,128,"Cannot open fix ttm file %s",arg[15]);
        error->one(FLERR,str);
      }
      if (fp == NULL)
        error->one(FLERR,fmt::format("Cannot open output file {}: {}",
                                     arg[15], utils::getsyserror()));
    }
  }

+3 −5
Original line number Diff line number Diff line
@@ -302,11 +302,9 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename)
  FILE *fpparam;
  if (comm->me == 0) {
    fpparam = force->open_potential(paramfilename);
    if (fpparam == NULL) {
      char str[128];
      snprintf(str,128,"Cannot open SNAP parameter file %s",paramfilename);
      error->one(FLERR,str);
    }
    if (fpparam == NULL)
      error->one(FLERR,fmt::format("Cannot open SNAP parameter file {}: {}",
                                   paramfilename, utils::getsyserror()));
  }

  char line[MAXLINE],*ptr;
Loading