From e3a6afe1ab9d87e9a237c106a6e4d3f6b0d49516 Mon Sep 17 00:00:00 2001 From: Jacob Gissinger Date: Fri, 29 Jan 2021 23:38:25 -0500 Subject: [PATCH] labelmap map/assign docs --- doc/src/labelmap.rst | 30 ++++++++++++++++++++++++++---- doc/src/molecule.rst | 4 ++-- doc/src/write_data.rst | 0 src/input.cpp | 2 +- 4 files changed, 29 insertions(+), 7 deletions(-) mode change 100644 => 100755 doc/src/write_data.rst diff --git a/doc/src/labelmap.rst b/doc/src/labelmap.rst index c64d7b3fb5..7d9ec89166 100755 --- a/doc/src/labelmap.rst +++ b/doc/src/labelmap.rst @@ -8,10 +8,16 @@ Syntax .. code-block:: LAMMPS - labelmap interaction numeric-type type-label ... + labelmap interaction numeric-type type-label ... keyword values * interaction = *atom* or *bond* or *angle* or *dihedral* or *improper* * one or more numeric-type/type-label pairs may be appended +* keyword = *map/assign* + + .. parsed-literal:: + + *map/assign* value = mapID + mapID = name of auxiliary label map Examples """""""" @@ -31,9 +37,9 @@ numeric type used by LAMMPS with a character-based type can be helpful in a variety of situations. For example, type labels can make various inputs more readable and compatible with other inputs (data files, molecule templates, etc.), particularly if your model's force -field uses alphanumeric atom types. Type label maps can also be -defined by :doc:`data files ` using the relevant Type Label -sections. +field uses alphanumeric atom types. The default type label map can +also be defined by :doc:`data files ` using the relevant +Type Label sections. .. note:: @@ -67,6 +73,22 @@ atom type 'C' and 'H' is written as: bond_style harmonic bond_coeff [C][H] 80.0 1.2 +In some circumstances, it may be helpful to define extra label maps in +addition to the default one. An auxiliary label map can be created and +populated using the *map/assign* keyword. Type labels of auxiliary +label maps can be referenced by prefixing the type label with the +mapID followed by "::". For example, a type label "C" assigned to a +label map named "Map2" can be created and referenced as follows: + +.. code-block:: LAMMPS + + labelmap bond 1 [C][H] map/assign Map2 + bond_coeff Map2::[C][H] 80.0 1.2 + +Auxiliary label maps are not written to restart or data files. Due to +the syntax for auxiliary maps, type labels cannot contain the +substring "::". The default label map has no prefix. + ---------- Restrictions diff --git a/doc/src/molecule.rst b/doc/src/molecule.rst index bc16aeb9a4..a1c215cb63 100755 --- a/doc/src/molecule.rst +++ b/doc/src/molecule.rst @@ -175,8 +175,8 @@ These are the allowed section keywords for the body of the file. For the Types, Bonds, Angles, Dihedrals, and Impropers sections, each atom, bond, etc. type can be listed either as a number (numeric type) -or as an alphanumeric :doc:`type label `. Type labels must -begin with letter, and a label map must have previously been defined +or as an alphanumeric :doc:`type label `. Type labels cannot +start with a number, and a label map must have previously been defined by a :doc:`labelmap ` or :doc:`read_data ` command. diff --git a/doc/src/write_data.rst b/doc/src/write_data.rst old mode 100644 new mode 100755 diff --git a/src/input.cpp b/src/input.cpp index f80f7d9415..a260d01ef2 100755 --- a/src/input.cpp +++ b/src/input.cpp @@ -1601,7 +1601,7 @@ void Input::labelmap() int ilmap = 0; std::string mapid; for (int i = 1; i < narg; i++) { - if (strcmp(arg[i],"mapID") == 0) { + if (strcmp(arg[i],"map/assign") == 0) { mapid = arg[i+1]; ilmap = atom->find_labelmap(mapid); if (ilmap == -1) ilmap = atom->add_label_map(mapid);