git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11125 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
11
src/atom.cpp
11
src/atom.cpp
@ -288,7 +288,7 @@ void Atom::settings(Atom *old)
|
|||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
create an AtomVec style
|
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)
|
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;
|
vfrac_flag = spin_flag = eradius_flag = ervel_flag = erforce_flag = 0;
|
||||||
|
|
||||||
// create instance of AtomVec
|
// create instance of AtomVec
|
||||||
// use grow to initialize atom-based arrays to length 1
|
// use grow() to initialize atom-based arrays to length 1
|
||||||
// so that x[0][0] can be referenced even if proc has no atoms
|
// 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;
|
int sflag;
|
||||||
avec = new_avec(style,suffix,sflag);
|
avec = new_avec(style,suffix,sflag);
|
||||||
avec->settings(narg,arg);
|
avec->settings(narg,arg);
|
||||||
avec->grow(1);
|
avec->grow(1);
|
||||||
|
nmax = 0;
|
||||||
|
avec->reset();
|
||||||
|
|
||||||
if (sflag) {
|
if (sflag) {
|
||||||
char estyle[256];
|
char estyle[256];
|
||||||
|
|||||||
@ -54,6 +54,15 @@ void AtomVec::init()
|
|||||||
error->all(FLERR,"USER-CUDA package requires a cuda enabled atom_style");
|
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
|
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 void write_vel(FILE *, int, double **);
|
||||||
virtual int write_vel_hybrid(FILE *, double *) {return 0;}
|
virtual int write_vel_hybrid(FILE *, double *) {return 0;}
|
||||||
|
|
||||||
|
void reset();
|
||||||
int pack_bond(int **);
|
int pack_bond(int **);
|
||||||
void write_bond(FILE *, int, int **, int);
|
void write_bond(FILE *, int, int **, int);
|
||||||
int pack_angle(int **);
|
int pack_angle(int **);
|
||||||
|
|||||||
Reference in New Issue
Block a user