Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
dattv committed Jul 13, 2018
1 parent 64cec73 commit 7744b53
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 5 deletions.
23 changes: 19 additions & 4 deletions MODULE_EXSOLVER.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,35 @@ MODULE MODULE_EXSOLVER
use MODULE_PRECISION
use MODULE_CFD_DATA
use MODULE_QUADTREE
use MODULE_GENERICMETHOD
use MODULE_TIMESOLVER

private
public :: second_EX

contains
!==================================================================================================
subroutine Second_EX(first, last, tree, dt)
implicit none
integer(ip), intent(in) :: first, last
real(rp), intent(out) :: dt
real(rp), intent(inout) :: dt
type(quadtree), dimension(first:last), intent(inout) :: tree

call loop_on_quadtree_array(first, last, tree, second_Ex_single)

call compute_dt_array(first, last, tree, dt)

return
end subroutine Second_EX
!==================================================================================================
!==================================================================================================
!==================================================================================================
!==================================================================================================
subroutine second_Ex_single(tree)
implicit none
type(quadtree), pointer, intent(inout) :: tree

return
end subroutine second_EX_single
!==================================================================================================

!==================================================================================================

END MODULE MODULE_EXSOLVER
2 changes: 1 addition & 1 deletion MODULE_SOLVER.f90
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ subroutine solving(first, last, tree, I_solver_type)
! ===> call solver <===

time = zero; iter = 0
do while (l_stop)
do while (.not. l_stop)

iter = iter + 1

Expand Down
38 changes: 38 additions & 0 deletions MODULE_TIMESOLVER.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
MODULE MODULE_TIMESOLVER

use MODULE_PRECISION
use MODULE_CONSTANTS
use MODULE_QUADTREE

contains
!=================================================================================================
subroutine compute_dt_array(first, last, tree, dt)
implicit none
integer(ip), intent(in) :: first, last
type(quadtree), dimensioN(first:last), intent(in) :: tree
real(rp), intent(inout) :: dt
integer(ip) :: i

do i = first, last
call compute_dt_single(tree(i), dt)
end do

return
end subroutine compute_dt_array
!==================================================================================================
recursive subroutine compute_dt_single(tree, dt)
implicit none
type(quadtree), intent(in) :: tree
real(rp), intent(inout) :: dt

if (.not. tree%is_leaf) then
call compute_dt_single(tree%north_west, dt)
call compute_dt_single(tree%north_east, dt)
call compute_dt_single(tree%south_west, dt)
call compute_dt_single(tree%south_east, dt)
else
dt = min(dt, tree%data%dt)
end if
return
end subroutine compute_dt_single
END MODULE MODULE_TIMESOLVER

0 comments on commit 7744b53

Please sign in to comment.