Skip to content

Commit

Permalink
adds argument for inflate faces
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Park authored and Mike Park committed Jun 23, 2021
1 parent 41e288a commit 535fbe6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion acceptance/inflate/collar/inflate.sh
Expand Up @@ -19,6 +19,7 @@ ${src}/ref collar \
10 \
0.1 \
2.0 \
1.68
1.68 \
--fun3d-mapbc poly-vol.mapbc

exit
24 changes: 24 additions & 0 deletions src/ref_subcommand.c
Expand Up @@ -1181,6 +1181,8 @@ static REF_STATUS collar(REF_MPI ref_mpi, int argc, char *argv[]) {
REF_INT nlayers;
REF_DBL first_thickness, total_thickness, mach, mach_angle_rad;
REF_DBL rate;
REF_DICT faceids;
REF_INT pos;

if (argc < 7) goto shutdown;
input_filename = argv[2];
Expand Down Expand Up @@ -1226,6 +1228,28 @@ static REF_STATUS collar(REF_MPI ref_mpi, int argc, char *argv[]) {
printf("rate %f\n", rate);
}

RSS(ref_dict_create(&faceids), "create");

RXS(ref_args_find(argc, argv, "--fun3d-mapbc", &pos), REF_NOT_FOUND,
"arg search");
if (REF_EMPTY != pos && pos < argc - 1) {
const char *mapbc;
mapbc = argv[pos + 1];
if (ref_mpi_once(ref_mpi)) {
printf("reading fun3d bc map %s\n", mapbc);
RSS(ref_phys_read_mapbc_token(faceids, mapbc, "inflate"),
"unable to read fun3d formatted mapbc");
}
RSS(ref_dict_bcast(faceids, ref_mpi), "bcast");
}

if (ref_mpi_once(ref_mpi)) {
printf("inflating %d faces\n", ref_dict_n(faceids));
}
RAS(ref_dict_n(faceids) > 0, "no faces to inflate, use --fun3d-mapbc");

RSS(ref_dict_free(faceids), "free");

RSS(ref_grid_free(ref_grid), "grid");

return REF_SUCCESS;
Expand Down

0 comments on commit 535fbe6

Please sign in to comment.