Skip to content

Commit

Permalink
winds (flips) the tri written to avm
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Park authored and Mike Park committed Jul 26, 2021
1 parent 2e102af commit b734491
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ref_gather.c
Original file line number Diff line number Diff line change
Expand Up @@ -2623,10 +2623,23 @@ static REF_STATUS ref_gather_avm(REF_GRID ref_grid, const char *filename) {
REF_BOOL select_faceid = REF_FALSE;
REF_INT faceid = 0;
REF_BOOL pad = REF_TRUE;
REF_INT cell, temp_node;
/* avm winds tri different than EGADS */
each_ref_cell_valid_cell(ref_cell, cell) {
temp_node = ref_cell_c2n(ref_cell, 2, cell);
ref_cell_c2n(ref_cell, 2, cell) = ref_cell_c2n(ref_cell, 1, cell);
ref_cell_c2n(ref_cell, 1, cell) = temp_node;
}
RSS(ref_gather_cell(ref_node, ref_cell, faceid_insted_of_c2n, always_id,
swap_endian, sixty_four_bit, select_faceid, faceid, pad,
file),
"nodes");
/* wind back (flip) after write */
each_ref_cell_valid_cell(ref_cell, cell) {
temp_node = ref_cell_c2n(ref_cell, 2, cell);
ref_cell_c2n(ref_cell, 2, cell) = ref_cell_c2n(ref_cell, 1, cell);
ref_cell_c2n(ref_cell, 1, cell) = temp_node;
}
} else {
REF_CELL ref_cell = ref_grid_tet(ref_grid);
REF_BOOL faceid_insted_of_c2n = REF_FALSE;
Expand Down
7 changes: 7 additions & 0 deletions src/ref_part.c
Original file line number Diff line number Diff line change
Expand Up @@ -1706,9 +1706,16 @@ static REF_STATUS ref_part_avm(REF_GRID *ref_grid_ptr, REF_MPI ref_mpi,
REF_CELL ref_cell = ref_grid_tri(ref_grid);
REF_INT version = 0;
REF_BOOL pad = REF_FALSE;
REF_INT cell, temp_node;
RSS(ref_part_meshb_cell(ref_cell, ntet, ref_node, nnode, version, pad,
file),
"read tri");
/* avm winds tri different than EGADS */
each_ref_cell_valid_cell(ref_cell, cell) {
temp_node = ref_cell_c2n(ref_cell, 2, cell);
ref_cell_c2n(ref_cell, 2, cell) = ref_cell_c2n(ref_cell, 1, cell);
ref_cell_c2n(ref_cell, 1, cell) = temp_node;
}
} else {
REF_FILEPOS conn_offset, faceid_offset;
REF_BOOL swap_endian = REF_FALSE;
Expand Down

0 comments on commit b734491

Please sign in to comment.