Skip to content

Commit

Permalink
starts ref collar (inflate)
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 96742b2 commit c693d08
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/ref_subcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ static void usage(const char *name) {
printf("ref subcommands:\n");
printf(" adapt Adapt a mesh\n");
printf(" bootstrap Create initial mesh from EGADS file\n");
printf(" collar Inflate surface to create swept mesh\n");
printf(" distance Calculate wall distance (for turbulence model)\n");
printf(" examine Report mesh or solution file meta data.\n");
/*printf(" grow Fills surface mesh with volume to debug
Expand Down Expand Up @@ -109,6 +110,15 @@ static void adapt_help(const char *name) {
printf(" 5: native recursive bisection.\n");
printf("\n");
}
static void collar_help(const char *name) {
printf(
"usage: \n %s collar input_mesh.extension"
"nlayers first_thickness total_thickness mach\n",
name);
printf(" --fun3d-mapbc fun3d_format.mapbc\n");
printf(" -x output_mesh.extension\n");
printf("\n");
}
static void bootstrap_help(const char *name) {
printf("usage: \n %s bootstrap project.egads [-t]\n", name);
printf(" -t tecplot movie of surface curvature adaptation\n");
Expand Down Expand Up @@ -1164,6 +1174,36 @@ static REF_STATUS bootstrap(REF_MPI ref_mpi, int argc, char *argv[]) {
return REF_FAILURE;
}

static REF_STATUS collar(REF_MPI ref_mpi, int argc, char *argv[]) {
char *input_filename;
REF_GRID ref_grid = NULL;

if (argc < 7) goto shutdown;
input_filename = argv[2];

ref_mpi_stopwatch_start(ref_mpi);

if (ref_mpi_para(ref_mpi)) {
if (ref_mpi_once(ref_mpi)) printf("part %s\n", input_filename);
RSS(ref_part_by_extension(&ref_grid, ref_mpi, input_filename), "part");
ref_mpi_stopwatch_stop(ref_mpi, "donor part");
} else {
if (ref_mpi_once(ref_mpi)) printf("import %s\n", input_filename);
RSS(ref_import_by_extension(&ref_grid, ref_mpi, input_filename), "import");
ref_mpi_stopwatch_stop(ref_mpi, "donor import");
}
if (ref_mpi_once(ref_mpi))
printf(" read " REF_GLOB_FMT " vertices\n",
ref_node_n_global(ref_grid_node(ref_grid)));

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

return REF_SUCCESS;
shutdown:
if (ref_mpi_once(ref_mpi)) collar_help(argv[0]);
return REF_FAILURE;
}

static REF_STATUS distance(REF_MPI ref_mpi, int argc, char *argv[]) {
REF_GRID ref_grid;
REF_DICT ref_dict_bcs;
Expand Down Expand Up @@ -3461,6 +3501,13 @@ int main(int argc, char *argv[]) {
if (ref_mpi_once(ref_mpi)) bootstrap_help(argv[0]);
goto shutdown;
}
} else if (strncmp(argv[1], "c", 1) == 0) {
if (REF_EMPTY == help_pos) {
RSS(collar(ref_mpi, argc, argv), "collar");
} else {
if (ref_mpi_once(ref_mpi)) collar_help(argv[0]);
goto shutdown;
}
} else if (strncmp(argv[1], "d", 1) == 0) {
if (REF_EMPTY == help_pos) {
RSS(distance(ref_mpi, argc, argv), "distance");
Expand Down

0 comments on commit c693d08

Please sign in to comment.