add utils::logical() function to complement the *numeric() functions
This commit is contained in:
@ -60,6 +60,9 @@ silently returning the result of a partial conversion or zero in cases
|
||||
where the string is not a valid number. This behavior allows to more
|
||||
easily detect typos or issues when processing input files.
|
||||
|
||||
Similarly the :cpp:func:`logical() <LAMMPS_NS::utils::logical>` function
|
||||
will convert a string into a boolean and will only accept certain words.
|
||||
|
||||
The *do_abort* flag should be set to ``true`` in case this function
|
||||
is called only on a single MPI rank, as that will then trigger the
|
||||
a call to ``Error::one()`` for errors instead of ``Error::all()``
|
||||
@ -83,6 +86,9 @@ strings for compliance without conversion.
|
||||
.. doxygenfunction:: tnumeric
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: logical
|
||||
:project: progguide
|
||||
|
||||
|
||||
String processing
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Reference in New Issue
Block a user