Merge branch 'develop' into replicate_periodic_box

This commit is contained in:
Jacob Gissinger
2024-01-10 20:01:42 -05:00
committed by GitHub
9108 changed files with 1151239 additions and 445815 deletions

View File

@ -2,7 +2,7 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
LAMMPS development team: developers@lammps.org
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
@ -22,6 +22,7 @@
#include "error.h"
#include "memory.h"
#include "special.h"
#include "label_map.h"
#include <cstring>
@ -47,17 +48,22 @@ void Replicate::command(int narg, char **arg)
int me = comm->me;
int nprocs = comm->nprocs;
if (me == 0) utils::logmesg(lmp,"Replicating atoms ...\n");
// nrep = total # of replications
int nx = utils::inumeric(FLERR,arg[0],false,lmp);
int ny = utils::inumeric(FLERR,arg[1],false,lmp);
int nz = utils::inumeric(FLERR,arg[2],false,lmp);
if ((nx <= 0) || (ny <= 0) || (nz <= 0))
error->all(FLERR, "Illegal replication grid {}x{}x{}. All replications must be > 0",
nx, ny, nz);
int nrep = nx*ny*nz;
allnrep[0] = nx;
allnrep[1] = ny;
allnrep[2] = nz;
if (me == 0)
utils::logmesg(lmp, "Replication is creating a {}x{}x{} = {} times larger system...\n",
nx, ny, nz, nrep);
int bbox_flag = 0;
int bondlist_flag = 0;
@ -235,6 +241,15 @@ void Replicate::command(int narg, char **arg)
atom->extra_improper_per_atom = old->extra_improper_per_atom;
atom->maxspecial = old->maxspecial;
if (old->labelmapflag) {
atom->add_label_map();
atom->lmap->merge_lmap(old->lmap, Atom::ATOM);
atom->lmap->merge_lmap(old->lmap, Atom::BOND);
atom->lmap->merge_lmap(old->lmap, Atom::ANGLE);
atom->lmap->merge_lmap(old->lmap, Atom::DIHEDRAL);
atom->lmap->merge_lmap(old->lmap, Atom::IMPROPER);
}
// store old simulation box
int triclinic = domain->triclinic;
@ -292,7 +307,7 @@ void Replicate::command(int narg, char **arg)
// set bounds for my proc
// if periodic and I am lo/hi proc, adjust bounds by EPSILON
// insures all replicated atoms will be owned even with round-off
// ensures all replicated atoms will be owned even with round-off
double epsilon[3];
if (triclinic) epsilon[0] = epsilon[1] = epsilon[2] = EPSILON;