-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMODULE_INITIALCONDITION.f90
78 lines (66 loc) · 2.74 KB
/
MODULE_INITIALCONDITION.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
!=================================================================================================
!> CARTESIAN QUADTREE ADAPTIVE MESH REFINEMENT LIBRARY
!> AUTHOR: VAN-DAT THANG
!> E-MAIL: [email protected]
!> E-MAIL: [email protected]
!> SOURCE CODE LINK: https://github.com/dattv/QTAdaptive
!=================================================================================================
MODULE MODULE_INITIALCONDITION
use MODULE_PRECISION
use MODULE_NODECOORD
use MODULE_CONSTANTS
use MODULE_QUADTREE
use MODULE_GENERICMETHOD
contains
!==================================================================================================
subroutine initial_2D_simle_check_grid(nelm, tree)
implicit none
integer(ip), intent(in) :: nelm
type(quadtree), dimension(:), intent(inout), target :: tree
integer(ip) :: i
!call loop_on_quadtree_array(1, nelm, tree, initial_2d_dambreak_single_level)
call loop_on_quadtree_array(1, nelm, tree, initial_2d_01_simple)
return
end subroutine initial_2D_simle_check_grid
!==================================================================================================
subroutine initial_2d_dambreak_single_level(tree)
implicit none
type(quadtree), pointer, intent(inout) :: tree
if (tree%pts(5)%coord(1) >= half .and. tree%pts(5)%coord(2) <= half) then
tree%data%u(:) = one
tree%data%w(:) = one
else
tree%data%u(:) = zero
tree%data%w(:) = zero
endif
return
end subroutine initial_2d_dambreak_single_level
!==================================================================================================
subroutine initial_2d_01_simple(tree)
implicit none
type(quadtree), pointer, intent(inout) :: tree
if (tree%pts(5)%coord(1) >= half ) then
tree%data%u(:) = one
tree%data%w(:) = one
else
tree%data%u(:) = zero
tree%data%w(:) = zero
endif
return
end subroutine initial_2d_01_simple
!==================================================================================================
subroutine initial_2d_02_simple(tree)
implicit none
type(quadtree), pointer, intent(inout) :: tree
if (tree%pts(5)%coord(1) >= 0.7_rp) then
tree%data%u(:) = one
tree%data%w(:) = one
else
tree%data%u(:) = zero
tree%data%w(:) = zero
endif
return
end subroutine initial_2d_02_simple
!==================================================================================================
!==================================================================================================
END MODULE MODULE_INITIALCONDITION