Add utils::flush_buffers()

This commit is contained in:
Richard Berger
2022-02-04 17:53:36 -05:00
parent ea0f31c997
commit 50a7d4e7fc
3 changed files with 18 additions and 5 deletions

View File

@ -5449,11 +5449,7 @@ to simplify capturing output from LAMMPS library calls.
* \param handle pointer to a previously created LAMMPS instance cast to ``void *``.
*/
void lammps_flush_buffers(void *handle) {
LAMMPS *lmp = (LAMMPS *) handle;
if (lmp->screen) fflush(lmp->screen);
if (lmp->logfile) fflush(lmp->logfile);
if (lmp->universe->uscreen) fflush(lmp->universe->uscreen);
if (lmp->universe->ulogfile) fflush(lmp->universe->ulogfile);
utils::flush_buffers((LAMMPS *) handle);
}
/* ---------------------------------------------------------------------- */