From cd846e1bbb754da6599b69b683f061fa7b72b1e4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 10 Sep 2019 09:18:38 -0400 Subject: [PATCH] add ITEM: UNITS line to native text format dumps --- src/dump_atom.cpp | 2 ++ src/dump_custom.cpp | 1 + src/dump_local.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index e2e77cfb77..4c7e465bcf 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -209,6 +209,7 @@ void DumpAtom::header_binary_triclinic(bigint ndump) void DumpAtom::header_item(bigint ndump) { + fprintf(fp,"ITEM: UNITS %s\n",update->unit_style); fprintf(fp,"ITEM: TIMESTEP\n"); fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); @@ -224,6 +225,7 @@ void DumpAtom::header_item(bigint ndump) void DumpAtom::header_item_triclinic(bigint ndump) { + fprintf(fp,"ITEM: UNITS %s\n",update->unit_style); fprintf(fp,"ITEM: TIMESTEP\n"); fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index ce83e442c9..c96bd44358 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -420,6 +420,7 @@ void DumpCustom::header_binary_triclinic(bigint ndump) void DumpCustom::header_item(bigint ndump) { + fprintf(fp,"ITEM: UNITS %s\n",update->unit_style); fprintf(fp,"ITEM: TIMESTEP\n"); fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); diff --git a/src/dump_local.cpp b/src/dump_local.cpp index 9f021a7b6a..fb64012cf1 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -256,6 +256,7 @@ int DumpLocal::modify_param(int narg, char **arg) void DumpLocal::write_header(bigint ndump) { if (me == 0) { + fprintf(fp,"ITEM: UNITS %s\n",update->unit_style); fprintf(fp,"ITEM: TIMESTEP\n"); fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); fprintf(fp,"ITEM: NUMBER OF %s\n",label);