Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyuxie committed Feb 6, 2025
1 parent 5d99cf6 commit 47e97ff
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions src/solvers/dg_3d_kernel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1608,42 +1608,51 @@ function prolong_mortars_large2small_kernel!(tmp_upper_left, tmp_upper_right, tm

@inbounds begin
for j1j1 in axes(forward_lower, 2)
# Short representation of the indexes
# Short representation of the indexes on `large_side = 1`
idx1 = isequal(orientation, 1) * u2 + isequal(orientation, 2) * j1j1 + isequal(orientation, 3) * j1j1
idx2 = isequal(orientation, 1) * j1j1 + isequal(orientation, 2) * u2 + isequal(orientation, 3) * j2
idx3 = isequal(orientation, 1) * j2 + isequal(orientation, 2) * j2 + isequal(orientation, 3) * u2

# Short representation of the indexes on `large_side = 2`
idx4 = isequal(orientation, 1) + isequal(orientation, 2) * j1j1 + isequal(orientation, 3) * j1j1
idx5 = isequal(orientation, 1) * j1j1 + isequal(orientation, 2) + isequal(orientation, 3) * j2
idx6 = isequal(orientation, 1) * j2 + isequal(orientation, 2) * j2 + isequal(orientation, 3)

tmp_upper_left[leftright, i, j1, j2, k] += forward_lower[j1, j1j1] *
u[i, idx1, idx2, idx3, large_element] * (2 - large_side)
(u[i, idx1, idx2, idx3, large_element] * (2 - large_side) +
u[i, idx4, idx5, idx6, large_element] * (large_side - 1))

tmp_upper_right[leftright, i, j1, j2, k] += forward_upper[j1, j1j1] *
u[i, idx1, idx2, idx3, large_element] * (2 - large_side)
(u[i, idx1, idx2, idx3, large_element] * (2 - large_side) +
u[i, idx4, idx5, idx6, large_element] * (large_side - 1))

tmp_lower_left[leftright, i, j1, j2, k] += forward_lower[j1, j1j1] *
u[i, idx1, idx2, idx3, large_element] * (2 - large_side)
(u[i, idx1, idx2, idx3, large_element] * (2 - large_side) +
u[i, idx4, idx5, idx6, large_element] * (large_side - 1))

tmp_lower_right[leftright, i, j1, j2, k] += forward_upper[j1, j1j1] *
u[i, idx1, idx2, idx3, large_element] * (2 - large_side)
(u[i, idx1, idx2, idx3, large_element] * (2 - large_side) +
u[i, idx4, idx5, idx6, large_element] * (large_side - 1))
end

for j1j1 in axes(forward_lower, 2)
# Short representation of the indexes
idx1 = isequal(orientation, 1) + isequal(orientation, 2) * j1j1 + isequal(orientation, 3) * j1j1
idx2 = isequal(orientation, 1) * j1j1 + isequal(orientation, 2) + isequal(orientation, 3) * j2
idx3 = isequal(orientation, 1) * j2 + isequal(orientation, 2) * j2 + isequal(orientation, 3)
# for j1j1 in axes(forward_lower, 2)
# # Short representation of the indexes
# idx4 = isequal(orientation, 1) + isequal(orientation, 2) * j1j1 + isequal(orientation, 3) * j1j1
# idx5 = isequal(orientation, 1) * j1j1 + isequal(orientation, 2) + isequal(orientation, 3) * j2
# idx6 = isequal(orientation, 1) * j2 + isequal(orientation, 2) * j2 + isequal(orientation, 3)

tmp_upper_left[leftright, i, j1, j2, k] += forward_lower[j1, j1j1] *
u[i, idx1, idx2, idx3, large_element] * (large_side - 1)
# tmp_upper_left[leftright, i, j1, j2, k] += forward_lower[j1, j1j1] *
# u[i, idx4, idx5, idx6, large_element] * (large_side - 1)

tmp_upper_right[leftright, i, j1, j2, k] += forward_upper[j1, j1j1] *
u[i, idx1, idx2, idx3, large_element] * (large_side - 1)
# tmp_upper_right[leftright, i, j1, j2, k] += forward_upper[j1, j1j1] *
# u[i, idx4, idx5, idx6, large_element] * (large_side - 1)

tmp_lower_left[leftright, i, j1, j2, k] += forward_lower[j1, j1j1] *
u[i, idx1, idx2, idx3, large_element] * (large_side - 1)
# tmp_lower_left[leftright, i, j1, j2, k] += forward_lower[j1, j1j1] *
# u[i, idx4, idx5, idx6, large_element] * (large_side - 1)

tmp_lower_right[leftright, i, j1, j2, k] += forward_upper[j1, j1j1] *
u[i, idx1, idx2, idx3, large_element] * (large_side - 1)
end
# tmp_lower_right[leftright, i, j1, j2, k] += forward_upper[j1, j1j1] *
# u[i, idx4, idx5, idx6, large_element] * (large_side - 1)
# end
end
end

Expand Down

0 comments on commit 47e97ff

Please sign in to comment.