diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2010-04-27 10:16:51 -0500 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2011-12-14 16:45:47 +0000 |
commit | 3f7767c069382381aef55e4c336d97f56881882a (patch) | |
tree | a8b607b5249dfff39159846882922bd2ca6a47e2 | |
parent | 30578a4c08429e920893869c3ad9d663c7bb896f (diff) |
Carpet: Use switch instead of if statement
Use a switch statement instead of an if statement to distinguish
between vertex and cell centered cases.
-rw-r--r-- | Carpet/Carpet/src/SetupGH.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc index 4961cec3b..f8fd5a7fc 100644 --- a/Carpet/Carpet/src/SetupGH.cc +++ b/Carpet/Carpet/src/SetupGH.cc @@ -1583,7 +1583,8 @@ namespace Carpet { baseextents.AT(ml).AT(rl) = baseextent; } else { // Refine next coarser refinement level - if (refcentering == vertex_centered) { + switch (refcentering) { + case vertex_centered: { ibbox const & cbox = baseextents.AT(ml).AT(rl-1); assert (not any (any (is_staggered))); i2vect const bnd_shift = @@ -1595,7 +1596,9 @@ namespace Carpet { ibbox (cbox_phys.lower(), cbox_phys.upper(), fstride); ibbox const fbox = fbox_phys.expand (bnd_shift); baseextents.AT(ml).AT(rl) = fbox; - } else { + break; + } + case cell_centered: { ibbox const & cbox = baseextents.AT(ml).AT(rl-1); assert (all (all (is_staggered))); ivect const cstride = cbox.stride(); @@ -1621,6 +1624,10 @@ namespace Carpet { fbox_phys.upper() + bnd_shift_fstride[1], fbox_phys.stride()); baseextents.AT(ml).AT(rl) = fbox; + break; + } + default: + assert (0); } } } else { |