Skip to content

Commit

Permalink
hard codes the twod COFFE variable positions
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 c2cd674 commit 165bff8
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/ref_subcommand.c
Expand Up @@ -1732,11 +1732,19 @@ static REF_STATUS avm_field_scalar(REF_GRID ref_grid, REF_INT ldim,
RAS(5 <= ldim, "expected 5 or more variables per vertex for compressible");
each_ref_node_valid_node(ref_grid_node(ref_grid), node) {
REF_DBL rho, u, v, w, press, temp, u2, mach2;
rho = initial_field[0 + ldim * node];
u = initial_field[1 + ldim * node];
v = initial_field[2 + ldim * node];
w = initial_field[3 + ldim * node];
temp = initial_field[4 + ldim * node];
if (ref_grid_twod(ref_grid)) {
rho = initial_field[0 + ldim * node];
u = initial_field[1 + ldim * node];
v = initial_field[2 + ldim * node];
w = 0.0;
temp = initial_field[3 + ldim * node];
} else {
rho = initial_field[0 + ldim * node];
u = initial_field[1 + ldim * node];
v = initial_field[2 + ldim * node];
w = initial_field[3 + ldim * node];
temp = initial_field[4 + ldim * node];
}
press = rho * temp / gamma;
u2 = u * u + v * v + w * w;
RAB(ref_math_divisible(u2, temp), "can not divide by temp", {
Expand Down

0 comments on commit 165bff8

Please sign in to comment.