add some documentation for the programmer guide and doxygen decorations

This commit is contained in:
Axel Kohlmeyer
2021-01-31 23:06:59 -05:00
parent d5e6bcd9d3
commit 26ea789834
5 changed files with 113 additions and 1 deletions

View File

@ -292,6 +292,50 @@ This code example should produce the following output:
----------
Argument parsing classes
---------------------------
The purpose of argument parsing classes it to simplify and unify how
arguments of commands in LAMMPS are parsed and to make abstractions of
repetitive tasks.
The :cpp:class:`LAMMPS_NS::ArgInfo` class provides an abstraction
for parsing references to compute or fix styles or variables. These
would start with a "c\_", "f\_", "v\_" followed by the ID or name of
than instance and may be postfixed with one or two array indices
"[<number>]" with numbers > 0.
A typical code segment would look like this:
.. code-block:: C++
:caption: Usage example for ArgInfo class
int nvalues = 0;
for (iarg = 0; iarg < nargnew; iarg++) {
ArgInfo argi(arg[iarg]);
which[nvalues] = argi.get_type();
argindex[nvalues] = argi.get_index1();
ids[nvalues] = argi.copy_name();
if ((which[nvalues] == ArgInfo::UNKNOWN)
|| (which[nvalues] == ArgInfo::NONE)
|| (argi.get_dim() > 1))
error->all(FLERR,"Illegal compute XXX command");
nvalues++;
}
----------
.. doxygenclass:: LAMMPS_NS::ArgInfo
:project: progguide
:members:
----------
File reader classes
-------------------