Skip to content

Commit

Permalink
adds initial header
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Park authored and Mike Park committed Apr 27, 2021
1 parent 1270626 commit 9d84e0c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ref_gather.c
Expand Up @@ -2207,9 +2207,20 @@ static REF_STATUS ref_gather_avm(REF_GRID ref_grid, const char *filename) {

file = NULL;
if (ref_mpi_once(ref_mpi)) {
char magic_string[] = "AVMESH";
int magic_number = 1;
int revision_number = 2;
int n_meshes = 1;
file = fopen(filename, "w");
if (NULL == (void *)file) printf("unable to open %s\n", filename);
RNS(file, "unable to open file");

REIS(6, fwrite(magic_string, sizeof(char), 6, file), "magic_string");
REIS(1, fwrite(&magic_number, sizeof(magic_number), 1, file),
"magic_number");
REIS(1, fwrite(&revision_number, sizeof(revision_number), 1, file),
"revision_number");
REIS(1, fwrite(&n_meshes, sizeof(n_meshes), 1, file), "n_meshes");
}
if (ref_mpi_once(ref_mpi)) fclose(file);
return REF_SUCCESS;
Expand Down

0 comments on commit 9d84e0c

Please sign in to comment.