diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 88ebe6d343..0d82dd327b 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -1002,6 +1002,34 @@ void AtomVecHybrid::write_vel(FILE *fp, int n, double **buf) } } +/* ---------------------------------------------------------------------- + assign an index to named atom property and return index + returned value encodes which sub-style and index returned by sub-style + return -1 if name is unknown to any sub-styles +------------------------------------------------------------------------- */ + +int AtomVecHybrid::property_atom(char *name) +{ + for (int k = 0; k < nstyles; k++) { + int index = styles[k]->property_atom(name); + if (index >= 0) return index*nstyles + k; + } + return -1; +} + +/* ---------------------------------------------------------------------- + pack per-atom data into buf for ComputePropertyAtom + index maps to data specific to this atom style +------------------------------------------------------------------------- */ + +void AtomVecHybrid::pack_property_atom(int multiindex, double *buf, + int nvalues, int groupbit) +{ + int k = multiindex % nstyles; + int index = multiindex/nstyles; + styles[k]->pack_property_atom(index,buf,nvalues,groupbit); +} + /* ---------------------------------------------------------------------- allstyles = list of all atom styles in this LAMMPS executable ------------------------------------------------------------------------- */ diff --git a/src/atom_vec_hybrid.h b/src/atom_vec_hybrid.h index b5d2826c9a..90358525ed 100644 --- a/src/atom_vec_hybrid.h +++ b/src/atom_vec_hybrid.h @@ -63,6 +63,8 @@ class AtomVecHybrid : public AtomVec { void write_data(FILE *, int, double **); void pack_vel(double **); void write_vel(FILE *, int, double **); + int property_atom(char *); + void pack_property_atom(int, double *, int, int); bigint memory_usage(); private: