Add triclinic tests for dump atom

This commit is contained in:
Richard Berger
2020-08-11 16:17:36 -04:00
parent 83f81c42b9
commit b08751d65a
2 changed files with 46 additions and 0 deletions

View File

@ -197,6 +197,11 @@ void DumpAtom::header_binary(bigint ndump)
void DumpAtom::header_binary_triclinic(bigint ndump)
{
// use negative ntimestep as marker for new format
bigint fmtlen = strlen("DUMPATOM");
bigint marker = -fmtlen;
fwrite(&marker,sizeof(bigint),1,fp);
fwrite("DUMPATOM",sizeof(char),fmtlen,fp);
fwrite(&update->ntimestep,sizeof(bigint),1,fp);
fwrite(&ndump,sizeof(bigint),1,fp);
fwrite(&domain->triclinic,sizeof(int),1,fp);
@ -211,6 +216,11 @@ void DumpAtom::header_binary_triclinic(bigint ndump)
fwrite(&boxxz,sizeof(double),1,fp);
fwrite(&boxyz,sizeof(double),1,fp);
fwrite(&size_one,sizeof(int),1,fp);
int len = strlen(columns);
fwrite(&len, sizeof(int), 1, fp);
fwrite(columns, sizeof(char), len, fp);
if (multiproc) fwrite(&nclusterprocs,sizeof(int),1,fp);
else fwrite(&nprocs,sizeof(int),1,fp);
}