add support for writing a dump file footer

This commit is contained in:
Axel Kohlmeyer
2022-06-17 15:53:04 -04:00
parent fe1feb58d8
commit b46773e398
4 changed files with 11 additions and 0 deletions

View File

@ -124,6 +124,12 @@ void DumpYAML::write_data(int n, double *mybuf)
} }
fputs("]\n", fp); fputs("]\n", fp);
} }
}
/* ---------------------------------------------------------------------- */
void DumpYAML::write_footer()
{
fputs("...\n", fp); fputs("...\n", fp);
} }

View File

@ -35,6 +35,7 @@ class DumpYAML : public DumpCustom {
void write() override; void write() override;
void write_header(bigint) override; void write_header(bigint) override;
void write_data(int, double *) override; void write_data(int, double *) override;
void write_footer() override;
int modify_param(int, char **) override; int modify_param(int, char **) override;
}; };

View File

@ -517,6 +517,8 @@ void Dump::write()
if (refreshflag) modify->compute[irefresh]->refresh(); if (refreshflag) modify->compute[irefresh]->refresh();
if (filewriter && fp != nullptr) write_footer();
// if file per timestep, close file if I am filewriter // if file per timestep, close file if I am filewriter
if (multifile) { if (multifile) {

View File

@ -153,6 +153,8 @@ class Dump : protected Pointers {
virtual void pack(tagint *) = 0; virtual void pack(tagint *) = 0;
virtual int convert_string(int, double *) { return 0; } virtual int convert_string(int, double *) { return 0; }
virtual void write_data(int, double *) = 0; virtual void write_data(int, double *) = 0;
virtual void write_footer() {}
void pbc_allocate(); void pbc_allocate();
double compute_time(); double compute_time();