Skip to content

Commit

Permalink
starts ref_gather_avm
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 b6b339d commit 1270626
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/ref_gather.c
Expand Up @@ -2194,6 +2194,27 @@ static REF_STATUS ref_gather_meshb(REF_GRID ref_grid, const char *filename) {
return REF_SUCCESS;
}

static REF_STATUS ref_gather_avm(REF_GRID ref_grid, const char *filename) {
FILE *file;
REF_MPI ref_mpi = ref_grid_mpi(ref_grid);
REF_NODE ref_node = ref_grid_node(ref_grid);
REF_LONG ntri, ntet;

RSS(ref_node_synchronize_globals(ref_node), "sync");

RSS(ref_cell_ncell(ref_grid_tri(ref_grid), ref_node, &ntri), "ntri");
RSS(ref_cell_ncell(ref_grid_tet(ref_grid), ref_node, &ntet), "ntet");

file = NULL;
if (ref_mpi_once(ref_mpi)) {
file = fopen(filename, "w");
if (NULL == (void *)file) printf("unable to open %s\n", filename);
RNS(file, "unable to open file");
}
if (ref_mpi_once(ref_mpi)) fclose(file);
return REF_SUCCESS;
}

static REF_STATUS ref_gather_bin_ugrid(REF_GRID ref_grid, const char *filename,
REF_BOOL swap_endian,
REF_BOOL sixty_four_bit) {
Expand Down Expand Up @@ -2334,6 +2355,11 @@ REF_STATUS ref_gather_by_extension(REF_GRID ref_grid, const char *filename) {
RSS(ref_gather_tec(ref_grid, filename), "scalar tec");
return REF_SUCCESS;
}
if (end_of_string > 4 &&
(strcmp(&filename[end_of_string - 4], ".avm") == 0)) {
RSS(ref_gather_avm(ref_grid, filename), "scalar plt");
return REF_SUCCESS;
}
if (end_of_string > 4 &&
(strcmp(&filename[end_of_string - 4], ".plt") == 0)) {
RSS(ref_gather_scalar_by_extension(ref_grid, 0, NULL, NULL, filename),
Expand Down

0 comments on commit 1270626

Please sign in to comment.