From b1e0990c46a91be3d98702e2ca0c249d0f9d1fbe Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 14 Sep 2020 17:11:27 -0400 Subject: [PATCH] update lammps config settings calls example --- doc/src/pg_lib_config.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; }