Skip to content

Commit a6cdd95

Browse files
committed
Remove spurious half-step offset in 2D and 3D delta_x/delta_y calculations
1 parent 843d38f commit a6cdd95

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/common/include/ExtrusionHardcodedIC.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
! Calculate offsets
9999
domain_xstart = x_coords(1)
100100
x_step = x_cc(1) - x_cc(0)
101-
delta_x = merge(x_cc(0) - domain_xstart, x_cc(index_x) - domain_xstart + x_step/2.0, num_dims == 1)
101+
delta_x = merge(x_cc(0) - domain_xstart, x_cc(index_x) - domain_xstart, num_dims == 1)
102102
global_offset_x = nint(abs(delta_x)/x_step)
103103
case (3) ! 3D case - determine grid structure
104104
! Find yRows by counting rows with same x
@@ -158,8 +158,8 @@
158158
! Calculate offsets
159159
x_step = x_cc(1) - x_cc(0)
160160
y_step = y_cc(1) - y_cc(0)
161-
delta_x = x_cc(index_x) - x_coords(1) + x_step/2.0_wp
162-
delta_y = y_cc(index_y) - y_coords(1) + y_step/2.0_wp
161+
delta_x = x_cc(index_x) - x_coords(1)
162+
delta_y = y_cc(index_y) - y_coords(1)
163163
global_offset_x = nint(abs(delta_x)/x_step)
164164
global_offset_y = nint(abs(delta_y)/y_step)
165165
end select

0 commit comments

Comments
 (0)