diff --git a/src/EXTRA-DUMP/dump_yaml.cpp b/src/EXTRA-DUMP/dump_yaml.cpp index d4f3208ffb..be1c9768bf 100644 --- a/src/EXTRA-DUMP/dump_yaml.cpp +++ b/src/EXTRA-DUMP/dump_yaml.cpp @@ -124,6 +124,12 @@ void DumpYAML::write_data(int n, double *mybuf) } fputs("]\n", fp); } +} + +/* ---------------------------------------------------------------------- */ + +void DumpYAML::write_footer() +{ fputs("...\n", fp); } diff --git a/src/EXTRA-DUMP/dump_yaml.h b/src/EXTRA-DUMP/dump_yaml.h index bf621dcb51..60ab894de4 100644 --- a/src/EXTRA-DUMP/dump_yaml.h +++ b/src/EXTRA-DUMP/dump_yaml.h @@ -35,6 +35,7 @@ class DumpYAML : public DumpCustom { void write() override; void write_header(bigint) override; void write_data(int, double *) override; + void write_footer() override; int modify_param(int, char **) override; }; diff --git a/src/dump.cpp b/src/dump.cpp index 3569d32165..a354be4f04 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -517,6 +517,8 @@ void Dump::write() if (refreshflag) modify->compute[irefresh]->refresh(); + if (filewriter && fp != nullptr) write_footer(); + // if file per timestep, close file if I am filewriter if (multifile) { diff --git a/src/dump.h b/src/dump.h index a95029ada8..90866a3567 100644 --- a/src/dump.h +++ b/src/dump.h @@ -153,6 +153,8 @@ class Dump : protected Pointers { virtual void pack(tagint *) = 0; virtual int convert_string(int, double *) { return 0; } virtual void write_data(int, double *) = 0; + virtual void write_footer() {} + void pbc_allocate(); double compute_time();