diff --git a/doc/src/pg_lib_config.rst b/doc/src/pg_lib_config.rst index f0ff7cbc43..d33afe3b5b 100644 --- a/doc/src/pg_lib_config.rst +++ b/doc/src/pg_lib_config.rst @@ -15,7 +15,7 @@ enabling :ref:`exceptions `, avoiding them proactively is a safer approach. .. code-block:: C - :caption: Handle errors using a LAMMPS library with exceptions + :caption: Example for using configuration settings functions #include "library.h" #include @@ -33,6 +33,16 @@ a safer approach. fprintf(stderr, "LAMMPS failed with error: %s\n", errmsg); return 1; } + /* write compressed dump file depending on available of options */ + if (lammps_has_style(handle, "dump", "atom/zstd")) { + lammps_command(handle, "dump d1 all atom/zstd 100 dump.zst"); + } else if (lammps_has_style(handle, "dump", "atom/gz")) { + lammps_command(handle, "dump d1 all atom/gz 100 dump.gz"); + } else if (lammps_config_has_gzip_support()) { + lammps_command(handle, "dump d1 all atom 100 dump.gz"); + } else { + lammps_command(handle, "dump d1 all atom 100 dump"); + } lammps_close(handle); return 0; }