Skip to content

Commit

Permalink
-1.2k LOC in s_mpi_sendrecv_variables_buffers (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryleberre authored May 13, 2024
1 parent 9c60ebf commit 64d9677
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 1,464 deletions.
22 changes: 21 additions & 1 deletion src/common/m_helper.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ module m_helper
f_cross, &
f_create_transform_matrix, &
f_create_bbox, &
s_print_2D_array
s_print_2D_array, &
f_xor, &
f_logical_to_int

contains

Expand Down Expand Up @@ -516,4 +518,22 @@ contains

end function f_create_bbox

function f_xor(lhs, rhs) result(res)
logical, intent(in) :: lhs, rhs
logical :: res

res = (lhs .and. .not. rhs) .or. (.not. lhs .and. rhs)
end function f_xor

function f_logical_to_int(predicate) result(int)
logical, intent(in) :: predicate
integer :: int

if (predicate) then
int = 1
else
int = 0
end if
end function f_logical_to_int

end module m_helper
12 changes: 6 additions & 6 deletions src/simulation/m_boundary_conditions.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ contains
case (-16) ! No-slip wall BC at beginning
call s_no_slip_wall(q_prim_vf, pb, mv, 1, -1)
case default ! Processor BC at beginning
call s_mpi_sendrecv_conservative_variables_buffers( &
call s_mpi_sendrecv_variables_buffers( &
q_prim_vf, pb, mv, 1, -1)
end select

Expand All @@ -61,7 +61,7 @@ contains
case (-16) ! No-slip wall bc at end
call s_no_slip_wall(q_prim_vf, pb, mv, 1, 1)
case default ! Processor BC at end
call s_mpi_sendrecv_conservative_variables_buffers( &
call s_mpi_sendrecv_variables_buffers( &
q_prim_vf, pb, mv, 1, 1)
end select

Expand Down Expand Up @@ -105,7 +105,7 @@ contains
case (-16) ! No-slip wall BC at beginning
call s_no_slip_wall(q_prim_vf, pb, mv, 2, -1)
case default ! Processor BC at beginning
call s_mpi_sendrecv_conservative_variables_buffers( &
call s_mpi_sendrecv_variables_buffers( &
q_prim_vf, pb, mv, 2, -1)
end select

Expand All @@ -121,7 +121,7 @@ contains
case (-16) ! No-slip wall BC at end
call s_no_slip_wall(q_prim_vf, pb, mv, 2, 1)
case default ! Processor BC at end
call s_mpi_sendrecv_conservative_variables_buffers( &
call s_mpi_sendrecv_variables_buffers( &
q_prim_vf, pb, mv, 2, 1)
end select

Expand Down Expand Up @@ -165,7 +165,7 @@ contains
case (-16) ! No-slip wall BC at beginning
call s_no_slip_wall(q_prim_vf, pb, mv, 3, -1)
case default ! Processor BC at beginning
call s_mpi_sendrecv_conservative_variables_buffers( &
call s_mpi_sendrecv_variables_buffers( &
q_prim_vf, pb, mv, 3, -1)
end select

Expand All @@ -181,7 +181,7 @@ contains
case (-16) ! No-slip wall BC at end
call s_no_slip_wall(q_prim_vf, pb, mv, 3, 1)
case default ! Processor BC at end
call s_mpi_sendrecv_conservative_variables_buffers( &
call s_mpi_sendrecv_variables_buffers( &
q_prim_vf, pb, mv, 3, 1)
end select

Expand Down
Loading

0 comments on commit 64d9677

Please sign in to comment.