replace replicated Dihedral/Improper problem warning with function in base class

This commit is contained in:
Axel Kohlmeyer
2021-05-05 16:54:40 -04:00
parent 9f4da1128b
commit 7f034b2ef7
44 changed files with 137 additions and 823 deletions

View File

@ -12,13 +12,15 @@
------------------------------------------------------------------------- */
#include "improper.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "suffix.h"
#include "atom_masks.h"
#include "memory.h"
#include "comm.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#include "suffix.h"
#include "update.h"
using namespace LAMMPS_NS;
@ -386,6 +388,27 @@ void Improper::ev_tally(int i1, int i2, int i3, int i4,
/* ---------------------------------------------------------------------- */
void Improper::problem(const char *filename, int lineno,
int i1, int i2, int i3, int i4)
{
const auto x = atom->x;
auto warn = fmt::format("Improper problem: {} {} {} {} {} {}\n",
comm->me, update->ntimestep, atom->tag[i1],
atom->tag[i2], atom->tag[i3], atom->tag[i4]);
warn += fmt::format("WARNING: 1st atom: {} {:.8} {:.8} {:.8}\n",
comm->me,x[i1][0],x[i1][1],x[i1][2]);
warn += fmt::format("WARNING: 2nd atom: {} {:.8} {:.8} {:.8}\n",
comm->me,x[i2][0],x[i2][1],x[i2][2]);
warn += fmt::format("WARNING: 3rd atom: {} {:.8} {:.8} {:.8}\n",
comm->me,x[i3][0],x[i3][1],x[i3][2]);
warn += fmt::format("WARNING: 4th atom: {} {:.8} {:.8} {:.8}",
comm->me,x[i4][0],x[i4][1],x[i4][2]);
error->warning(filename, lineno, warn);
}
/* ---------------------------------------------------------------------- */
double Improper::memory_usage()
{
double bytes = (double)comm->nthreads*maxeatom * sizeof(double);