Skip to content

Commit

Permalink
format DiagProbe
Browse files Browse the repository at this point in the history
  • Loading branch information
baperry2 committed Nov 7, 2024
1 parent 78a51c9 commit 48d77a0
Showing 1 changed file with 34 additions and 24 deletions.
58 changes: 34 additions & 24 deletions Source/Utility/Diagnostics/DiagProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,30 +259,39 @@ DiagProbe::processDiag(
if (m_interpType_d == Linear) {

#if (AMREX_SPACEDIM == 1)
{
neighbour_cells(0, 0, 0) = state(low_cell_idx_d[0], 0, 0, stIdx);
neighbour_cells(1, 0, 0) =
state(low_cell_idx_d[0] + 1, 0, 0, stIdx);
}
neighbour_cells(0, 0, 0) = state(low_cell_idx_d[0], 0, 0, stIdx);
neighbour_cells(1, 0, 0) = state(low_cell_idx_d[0] + 1, 0, 0, stIdx);
#elif (AMREX_SPACEDIM == 2)
{
neighbour_cells(0, 0, 0) = state(low_cell_idx_d[0], low_cell_idx_d[1], 0, stIdx);
neighbour_cells(1, 0, 0) = state(low_cell_idx_d[0] + 1, low_cell_idx_d[1], 0, stIdx);
neighbour_cells(0, 1, 0) = state(low_cell_idx_d[0], low_cell_idx_d[1] + 1, 0, stIdx);
neighbour_cells(1, 1, 0) = state(low_cell_idx_d[0] + 1, low_cell_idx_d[1] + 1, 0, stIdx);
}
neighbour_cells(0, 0, 0) =
state(low_cell_idx_d[0], low_cell_idx_d[1], 0, stIdx);
neighbour_cells(1, 0, 0) =
state(low_cell_idx_d[0] + 1, low_cell_idx_d[1], 0, stIdx);
neighbour_cells(0, 1, 0) =
state(low_cell_idx_d[0], low_cell_idx_d[1] + 1, 0, stIdx);
neighbour_cells(1, 1, 0) =
state(low_cell_idx_d[0] + 1, low_cell_idx_d[1] + 1, 0, stIdx);
#else
{
neighbour_cells(0, 0, 0) = state(low_cell_idx_d[0], low_cell_idx_d[1], low_cell_idx_d[2], stIdx);
neighbour_cells(1, 0, 0) = state(low_cell_idx_d[0] + 1, low_cell_idx_d[1], low_cell_idx_d[2], stIdx);
neighbour_cells(0, 1, 0) = state(low_cell_idx_d[0], low_cell_idx_d[1] + 1, low_cell_idx_d[2], stIdx);
neighbour_cells(1, 1, 0) = state(low_cell_idx_d[0] + 1, low_cell_idx_d[1] + 1, low_cell_idx_d[2], stIdx);

neighbour_cells(0, 0, 1) = state(low_cell_idx_d[0], low_cell_idx_d[1], low_cell_idx_d[2] + 1, stIdx);
neighbour_cells(1, 0, 1) = state(low_cell_idx_d[0] + 1, low_cell_idx_d[1], low_cell_idx_d[2] + 1, stIdx);
neighbour_cells(0, 1, 1) = state(low_cell_idx_d[0], low_cell_idx_d[1] + 1, low_cell_idx_d[2] + 1, stIdx);
neighbour_cells(1, 1, 1) = state(low_cell_idx_d[0] + 1, low_cell_idx_d[1] + 1, low_cell_idx_d[2] + 1, stIdx);
}
neighbour_cells(0, 0, 0) = state(
low_cell_idx_d[0], low_cell_idx_d[1], low_cell_idx_d[2], stIdx);
neighbour_cells(1, 0, 0) = state(
low_cell_idx_d[0] + 1, low_cell_idx_d[1], low_cell_idx_d[2], stIdx);
neighbour_cells(0, 1, 0) = state(
low_cell_idx_d[0], low_cell_idx_d[1] + 1, low_cell_idx_d[2], stIdx);
neighbour_cells(1, 1, 0) = state(
low_cell_idx_d[0] + 1, low_cell_idx_d[1] + 1, low_cell_idx_d[2],
stIdx);

neighbour_cells(0, 0, 1) = state(
low_cell_idx_d[0], low_cell_idx_d[1], low_cell_idx_d[2] + 1, stIdx);
neighbour_cells(1, 0, 1) = state(
low_cell_idx_d[0] + 1, low_cell_idx_d[1], low_cell_idx_d[2] + 1,
stIdx);
neighbour_cells(0, 1, 1) = state(
low_cell_idx_d[0], low_cell_idx_d[1] + 1, low_cell_idx_d[2] + 1,
stIdx);
neighbour_cells(1, 1, 1) = state(
low_cell_idx_d[0] + 1, low_cell_idx_d[1] + 1, low_cell_idx_d[2] + 1,
stIdx);
#endif
tmp_values_d[n] = LinearInterpolate(
m_probe_loc_d, x_low_cell_d, neighbour_cells,
Expand All @@ -291,9 +300,10 @@ DiagProbe::processDiag(
#if (AMREX_SPACEDIM == 1)
tmp_values_d[n] = state(m_probe_idx_d[0], 0, 0, stIdx);
#elif (AMREX_SPACEDIM == 2)
tmp_values_d[n] = state(m_probe_idx_d[0], m_probe_idx_d[1], 0, stIdx);
tmp_values_d[n] = state(m_probe_idx_d[0], m_probe_idx_d[1], 0, stIdx);
#else
tmp_values_d[n] = state(m_probe_idx_d[0], m_probe_idx_d[1], m_probe_idx_d[2], stIdx);
tmp_values_d[n] =
state(m_probe_idx_d[0], m_probe_idx_d[1], m_probe_idx_d[2], stIdx);
#endif
}
});
Expand Down

0 comments on commit 48d77a0

Please sign in to comment.