clarified doc pages for fix property/atom and read_data
This commit is contained in:
@ -180,7 +180,9 @@ atom-ID, the next two are a molecule-ID and a floating point value
|
||||
that will be stored in a new property called "flag". If a per-atom
|
||||
array was specified in the fix property/atom commmand then the *N*
|
||||
values for that array must be specified consecutively for that
|
||||
property on each line.
|
||||
property on each line. Note that the order of values on each line
|
||||
corresponds to the order of custom names in the fix property/atom
|
||||
command.
|
||||
|
||||
Note that the the lines of per-atom properties can be listed in any
|
||||
order. Also note that all the per-atom properties specified by the
|
||||
@ -301,12 +303,14 @@ uninterrupted fashion.
|
||||
|
||||
.. warning::
|
||||
|
||||
When reading data from a restart file, this fix command has to be specified
|
||||
**exactly** the same way as before. LAMMPS will only check whether a
|
||||
fix is of the same style and has the same fix ID and in case of a match
|
||||
will then try to initialize the fix with the data stored in the binary
|
||||
restart file. If the fix property/atom command does not match exactly,
|
||||
data can be corrupted or LAMMPS may crash.
|
||||
When reading data from a restart file, this fix command has to be
|
||||
specified **exactly** the same was in the input script that created
|
||||
the restart file. LAMMPS will only check whether a fix is of the
|
||||
same style and has the same fix ID and in case of a match will then
|
||||
try to initialize the fix with the data stored in the binary
|
||||
restart file. If the names and associated date types in the new
|
||||
fix property/atom command do not match the old one exactly, data
|
||||
can be corrupted or LAMMPS may crash.
|
||||
|
||||
None of the :doc:`fix_modify <fix_modify>` options are relevant to
|
||||
this fix. No global or per-atom quantities are stored by this fix for
|
||||
|
||||
@ -66,8 +66,8 @@ simulation. The file can be ASCII text or a gzipped text file
|
||||
(detected by a .gz suffix). This is one of 3 ways to specify initial
|
||||
atom coordinates; see the :doc:`read_restart <read_restart>` and
|
||||
:doc:`create_atoms <create_atoms>` commands for alternative methods.
|
||||
Also see the explanation of the :doc:`-restart command-line switch <Run_options>` which can convert a restart file to a data
|
||||
file.
|
||||
Also see the explanation of the :doc:`-restart command-line switch
|
||||
<Run_options>` which can convert a restart file to a data file.
|
||||
|
||||
This command can be used multiple times to add new atoms and their
|
||||
properties to an existing system by using the *add*, *offset*, and
|
||||
@ -246,22 +246,22 @@ appear in any order, with a few exceptions as noted below.
|
||||
|
||||
The keyword *fix* can be used one or more times. Each usage specifies
|
||||
a fix that will be used to process a specific portion of the data
|
||||
file. Any header line containing *header-string* and any section with
|
||||
a name containing *section-string* will be passed to the specified
|
||||
file. Any header line containing *header-string* and any section that
|
||||
is an exact match to *section-string* will be passed to the specified
|
||||
fix. See the :doc:`fix property/atom <fix_property_atom>` command for
|
||||
an example of a fix that operates in this manner. The page for
|
||||
the fix defines the syntax of the header line(s) and section(s) that
|
||||
it reads from the data file. Note that the *header-string* can be
|
||||
an example of a fix that operates in this manner. The doc page for
|
||||
the fix defines the syntax of the header line(s) and section that it
|
||||
reads from the data file. Note that the *header-string* can be
|
||||
specified as NULL, in which case no header lines are passed to the
|
||||
fix. This means that it can infer the length of its Section from
|
||||
fix. This means the fix can infer the length of its Section from
|
||||
standard header settings, such as the number of atoms.
|
||||
|
||||
The formatting of individual lines in the data file (indentation,
|
||||
spacing between words and numbers) is not important except that header
|
||||
and section keywords (e.g. atoms, xlo xhi, Masses, Bond Coeffs) must
|
||||
be capitalized as shown and can't have extra white-space between their
|
||||
words - e.g. two spaces or a tab between the 2 words in "xlo xhi" or
|
||||
the 2 words in "Bond Coeffs", is not valid.
|
||||
be capitalized as shown and cannot have extra white-space between
|
||||
their words - e.g. two spaces or a tab between the 2 words in "xlo
|
||||
xhi" or the 2 words in "Bond Coeffs", is not valid.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -1551,8 +1551,6 @@ int DumpCustom::parse_fields(int narg, char **arg)
|
||||
|
||||
n = atom->find_custom(name,flag,cols);
|
||||
|
||||
printf("NAME %s\n",name);
|
||||
|
||||
if (n < 0)
|
||||
error->all(FLERR,"Could not find custom per-atom property ID: {}", name);
|
||||
if (argindex[iarg] == 0) {
|
||||
|
||||
@ -509,21 +509,6 @@ void ReadData::command(int narg, char **arg)
|
||||
|
||||
while (strlen(keyword)) {
|
||||
|
||||
// if special fix matches, it processes section
|
||||
|
||||
if (nfix) {
|
||||
int i;
|
||||
for (i = 0; i < nfix; i++)
|
||||
if (strcmp(keyword,fix_section[i]) == 0) {
|
||||
if (firstpass) fix(fix_index[i],keyword);
|
||||
else skip_lines(modify->fix[fix_index[i]]->
|
||||
read_data_skip_lines(keyword));
|
||||
parse_keyword(0);
|
||||
break;
|
||||
}
|
||||
if (i < nfix) continue;
|
||||
}
|
||||
|
||||
if (strcmp(keyword,"Atoms") == 0) {
|
||||
atomflag = 1;
|
||||
if (firstpass) {
|
||||
@ -728,8 +713,22 @@ void ReadData::command(int narg, char **arg)
|
||||
if (firstpass) impropercoeffs(1);
|
||||
else skip_lines(nimpropertypes);
|
||||
|
||||
} else error->all(FLERR,"Unknown identifier in data file: {}",
|
||||
keyword);
|
||||
// if specified fix matches, it processes section
|
||||
|
||||
} else if (nfix) {
|
||||
int i;
|
||||
for (i = 0; i < nfix; i++)
|
||||
if (strcmp(keyword,fix_section[i]) == 0) {
|
||||
if (firstpass) fix(fix_index[i],keyword);
|
||||
else skip_lines(modify->fix[fix_index[i]]->
|
||||
read_data_skip_lines(keyword));
|
||||
parse_keyword(0);
|
||||
break;
|
||||
}
|
||||
if (i == nfix)
|
||||
error->all(FLERR,"Unknown identifier in data file: {}",keyword);
|
||||
|
||||
} else error->all(FLERR,"Unknown identifier in data file: {}",keyword);
|
||||
|
||||
parse_keyword(0);
|
||||
}
|
||||
|
||||
@ -656,9 +656,9 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, int mod
|
||||
}
|
||||
}
|
||||
|
||||
printf("NEWARG %d\n",newarg);
|
||||
for (int i = 0; i < newarg; i++)
|
||||
printf(" arg %d: %s\n",i,earg[i]);
|
||||
//printf("NEWARG %d\n",newarg);
|
||||
//for (int i = 0; i < newarg; i++)
|
||||
// printf(" arg %d: %s\n",i,earg[i]);
|
||||
|
||||
return newarg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user