mirror of https://github.com/lammps/lammps.git
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11125 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
16dde18ab2
commit
02cd6e118b
11
src/atom.cpp
11
src/atom.cpp
|
@ -288,7 +288,7 @@ void Atom::settings(Atom *old)
|
|||
|
||||
/* ----------------------------------------------------------------------
|
||||
create an AtomVec style
|
||||
called from input script, restart file, replicate
|
||||
called from lammps.cpp, input script, restart file, replicate
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Atom::create_avec(const char *style, int narg, char **arg, char *suffix)
|
||||
|
@ -308,13 +308,18 @@ void Atom::create_avec(const char *style, int narg, char **arg, char *suffix)
|
|||
vfrac_flag = spin_flag = eradius_flag = ervel_flag = erforce_flag = 0;
|
||||
|
||||
// create instance of AtomVec
|
||||
// use grow to initialize atom-based arrays to length 1
|
||||
// so that x[0][0] can be referenced even if proc has no atoms
|
||||
// use grow() to initialize atom-based arrays to length 1
|
||||
// so that x[0][0] can always be referenced even if proc has no atoms
|
||||
// but reset nmax = 0
|
||||
// so 2d arrays like bond_type will later be allocated correctly
|
||||
// since currently, 2nd dimension bond_per_atom = 0
|
||||
|
||||
int sflag;
|
||||
avec = new_avec(style,suffix,sflag);
|
||||
avec->settings(narg,arg);
|
||||
avec->grow(1);
|
||||
nmax = 0;
|
||||
avec->reset();
|
||||
|
||||
if (sflag) {
|
||||
char estyle[256];
|
||||
|
|
|
@ -54,6 +54,15 @@ void AtomVec::init()
|
|||
error->all(FLERR,"USER-CUDA package requires a cuda enabled atom_style");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
reset nmax = 0, called by Atom::create_avec() when new atom style created
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVec::reset()
|
||||
{
|
||||
nmax = 0;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
unpack one line from Velocities section of data file
|
||||
------------------------------------------------------------------------- */
|
||||
|
|
|
@ -98,6 +98,7 @@ class AtomVec : protected Pointers {
|
|||
virtual void write_vel(FILE *, int, double **);
|
||||
virtual int write_vel_hybrid(FILE *, double *) {return 0;}
|
||||
|
||||
void reset();
|
||||
int pack_bond(int **);
|
||||
void write_bond(FILE *, int, int **, int);
|
||||
int pack_angle(int **);
|
||||
|
|
Loading…
Reference in New Issue