137 amrex::Real avg1 = 0.; amrex::Real avg2 = 0.; amrex::Real avg3 = 0.;
138 amrex::Real diff1 = 0.; amrex::Real diff2 = 0.; amrex::Real diff3 = 0.;
139 amrex::Real scaled_upw = 0.;
143 scaled_upw = upw / std::abs(upw);
146 avg1 = (qty(i , j, k, qty_index) + qty(i-1, j, k, qty_index));
147 avg1 -= (r0_arr(i,j,k) + r0_arr(i-1,j,k));
148 diff1 = (qty(i , j, k, qty_index) - qty(i-1, j, k, qty_index));
151 avg2 = (qty(i+1, j, k, qty_index) + qty(i-2, j, k, qty_index));
152 avg2 -= (r0_arr(i+1,j,k) + r0_arr(i-2,j,k));
153 diff2 = (qty(i+1, j, k, qty_index) - qty(i-2, j, k, qty_index));
157 avg3 = (qty(i+2, j, k, qty_index) + qty(i-3, j, k, qty_index));
158 avg3 -= (r0_arr(i+2,j,k) + r0_arr(i-3,j,k));
159 diff3 = (qty(i+2, j, k, qty_index) - qty(i-3, j, k, qty_index));
162 avg1 = (qty(i, j , k, qty_index) + qty(i, j-1, k, qty_index));
163 avg1 -= (r0_arr(i,j,k) + r0_arr(i,j-1,k));
164 diff1 = (qty(i, j , k, qty_index) - qty(i, j-1, k, qty_index));
167 avg2 = (qty(i, j+1, k, qty_index) + qty(i, j-2, k, qty_index));
168 avg2 -= (r0_arr(i,j+1,k) + r0_arr(i,j-2,k));
169 diff2 = (qty(i, j+1, k, qty_index) - qty(i, j-2, k, qty_index));
173 avg3 = (qty(i, j+2, k, qty_index) + qty(i, j-3, k, qty_index));
174 avg3 -= (r0_arr(i,j+2,k) + r0_arr(i,j-3,k));
175 diff3 = (qty(i, j+2, k, qty_index) - qty(i, j-3, k, qty_index));
178 avg1 = (qty(i, j, k , qty_index) + qty(i, j, k-1, qty_index));
179 diff1 = (qty(i, j, k , qty_index) - qty(i, j, k-1, qty_index));
180 avg1 -= (r0_arr(i,j,k) + r0_arr(i,j,k-1));
181 diff1 -= (r0_arr(i,j,k) - r0_arr(i,j,k-1));
185 avg2 = (qty(i, j, k+1, qty_index) + qty(i, j, k-2, qty_index));
186 diff2 = (qty(i, j, k+1, qty_index) - qty(i, j, k-2, qty_index));
187 avg2 -= (r0_arr(i,j,k+1) + r0_arr(i,j,k-2));
188 diff2 -= (r0_arr(i,j,k+1) - r0_arr(i,j,k-2));
192 avg3 = (qty(i, j, k+2, qty_index) + qty(i, j, k-3, qty_index));
193 diff3 = (qty(i, j, k+2, qty_index) - qty(i, j, k-3, qty_index));
194 avg3 -= (r0_arr(i,j,k+2) + r0_arr(i,j,k-3));
195 diff3 -= (r0_arr(i,j,k+2) - r0_arr(i,j,k-3));
199 return interpolatedVal(avg1,avg2,avg3,diff1,diff2,diff3,scaled_upw,adv_type);