Skip to content

Commit

Permalink
fix stricter array in reconcile boundaries
Browse files Browse the repository at this point in the history
  • Loading branch information
johnomotani committed Jan 27, 2025
1 parent 5e97463 commit c60ac41
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions moment_kinetics/src/calculus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -528,25 +528,25 @@ end
if irank == 0
if coord.bc == "periodic"
#update the extreme lower endpoint with data from irank = nrank -1
receive_buffer1 .= 0.5*(receive_buffer1 .+ dfdx_lower_endpoints)
@. receive_buffer1 = 0.5*(receive_buffer1 + dfdx_lower_endpoints)
else #directly use value from Cheb
receive_buffer1 .= dfdx_lower_endpoints
end
else # enforce continuity at lower endpoint
receive_buffer1 .= 0.5*(receive_buffer1 .+ dfdx_lower_endpoints)
@. receive_buffer1 = 0.5*(receive_buffer1 + dfdx_lower_endpoints)
end
#now update the df1d array -- using a slice appropriate to the dimension reconciled
assign_endpoint!(df1d,receive_buffer1,"lower",coord)

if irank == nrank-1
if coord.bc == "periodic"
#update the extreme upper endpoint with data from irank = 0
receive_buffer2 .= 0.5*(receive_buffer2 .+ dfdx_upper_endpoints)
@. receive_buffer2 = 0.5*(receive_buffer2 + dfdx_upper_endpoints)
else #directly use value from Cheb
receive_buffer2 .= dfdx_upper_endpoints
end
else # enforce continuity at upper endpoint
receive_buffer2 .= 0.5*(receive_buffer2 .+ dfdx_upper_endpoints)
@. receive_buffer2 = 0.5*(receive_buffer2 + dfdx_upper_endpoints)
end
#now update the df1d array -- using a slice appropriate to the dimension reconciled
assign_endpoint!(df1d,receive_buffer2,"upper",coord)
Expand Down Expand Up @@ -707,28 +707,28 @@ end
if irank == 0
if coord.bc == "periodic"
#update the extreme lower endpoint with data from irank = nrank -1
receive_buffer1 .= 0.5*(receive_buffer1 .+ dfdx_lower_endpoints)
@. receive_buffer1 = 0.5*(receive_buffer1 + dfdx_lower_endpoints)
else #directly use value from Cheb
receive_buffer1 .= dfdx_lower_endpoints
end
else # enforce continuity at lower endpoint
receive_buffer1 .= 0.5*(receive_buffer1 .+ dfdx_lower_endpoints)
@. receive_buffer1 = 0.5*(receive_buffer1 + dfdx_lower_endpoints)
end
#now update the df1d array -- using a slice appropriate to the dimension reconciled
@views df1d[:,:,1] .= receive_buffer1
df1d[:,:,1] .= receive_buffer1

if irank == nrank-1
if coord.bc == "periodic"
#update the extreme upper endpoint with data from irank = 0
receive_buffer2 .= 0.5*(receive_buffer2 .+ dfdx_upper_endpoints)
@. receive_buffer2 = 0.5*(receive_buffer2 + dfdx_upper_endpoints)
else #directly use value from Cheb
receive_buffer2 .= dfdx_upper_endpoints
end
else # enforce continuity at upper endpoint
receive_buffer2 .= 0.5*(receive_buffer2 .+ dfdx_upper_endpoints)
@. receive_buffer2 = 0.5*(receive_buffer2 + dfdx_upper_endpoints)
end
#now update the df1d array -- using a slice appropriate to the dimension reconciled
@views df1d[:,:,end] .= receive_buffer2
df1d[:,:,end] .= receive_buffer2

end
# synchronize buffers
Expand Down Expand Up @@ -796,7 +796,7 @@ end
apply_adv_fac!(receive_buffer1,adv_fac_lower_endpoints,dfdx_lower_endpoints,1)
end
#now update the df1d array -- using a slice appropriate to the dimension reconciled
@views df1d[:,:,1] .= receive_buffer1
df1d[:,:,1] .= receive_buffer1

if irank == nrank-1
if coord.bc == "periodic"
Expand All @@ -809,7 +809,7 @@ end
apply_adv_fac!(receive_buffer2,adv_fac_upper_endpoints,dfdx_upper_endpoints,-1)
end
#now update the df1d array -- using a slice appropriate to the dimension reconciled
@views df1d[:,:,end] .= receive_buffer2
df1d[:,:,end] .= receive_buffer2

end
# synchronize buffers
Expand Down

0 comments on commit c60ac41

Please sign in to comment.