add support for writing a dump file footer
This commit is contained in:
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
@ -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();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user