modified versions of creating atoms on subset of lattice, ditto for set type/fraction
This commit is contained in:
@ -19,6 +19,8 @@
|
||||
#include "error.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "comm.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define DELTA 16384
|
||||
@ -108,6 +110,19 @@ int AtomVec::grow_nmax_bonus(int nmax_bonus)
|
||||
return nmax_bonus;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
roundup N so it is a multiple of DELTA
|
||||
error if N exceeds 32-bit int, since will be used as arg to grow()
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
bigint AtomVec::roundup(bigint n)
|
||||
{
|
||||
if (n % DELTA) n = n/DELTA * DELTA + DELTA;
|
||||
if (n > MAXSMALLINT)
|
||||
error->one(FLERR,"Too many atoms created on one or more procs");
|
||||
return n;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack one line from Velocities section of data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user