type label support for pair_write

This commit is contained in:
Jacob Gissinger
2024-08-06 23:51:49 -04:00
parent 3833309725
commit c4510ba1ed
2 changed files with 22 additions and 20 deletions

View File

@ -10,7 +10,7 @@ Syntax
pair_write itype jtype N style inner outer file keyword Qi Qj
* itype,jtype = 2 atom types
* itype,jtype = 2 atom types (numeric or type label)
* N = # of values
* style = *r* or *rsq* or *bitmap*
* inner,outer = inner and outer cutoff (distance units)
@ -26,6 +26,9 @@ Examples
pair_write 1 3 500 r 1.0 10.0 table.txt LJ
pair_write 1 1 1000 rsq 2.0 8.0 table.txt Yukawa_1_1 -0.5 0.5
labelmap atom 1 C 2 H
pair_write C H 500 r 1.0 10.0 table.txt LJ
Description
"""""""""""
@ -42,7 +45,7 @@ compared against the entry in the file, if present, and pair_write
will refuse to add a table if the units are not the same.
The energy and force values are computed at distances from inner to
outer for 2 interacting atoms of type itype and jtype, using the
outer for 2 interacting atoms of type *itype* and *jtype*, using the
appropriate :doc:`pair_coeff <pair_coeff>` coefficients. If the style
is *r*, then N distances are used, evenly spaced in r; if the style is
*rsq*, N distances are used, evenly spaced in r\^2.

View File

@ -1794,8 +1794,8 @@ void Pair::write_file(int narg, char **arg)
// parse arguments
int itype = utils::inumeric(FLERR,arg[0],false,lmp);
int jtype = utils::inumeric(FLERR,arg[1],false,lmp);
int itype = utils::expand_type_int(FLERR, arg[0], Atom::ATOM, lmp);
int jtype = utils::expand_type_int(FLERR, arg[1], Atom::ATOM, lmp);
if (itype < 1 || itype > atom->ntypes || jtype < 1 || jtype > atom->ntypes)
error->all(FLERR,"Invalid atom types in pair_write command");
@ -2009,4 +2009,3 @@ double Pair::memory_usage()
bytes += (double)comm->nthreads*maxcvatom*9 * sizeof(double);
return bytes;
}