Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
initial_conditions.f90
Go to the documentation of this file.
1
34
35module user_initial_conditions
36 use field, only: field_t
37 use json_file_module, only: json_file
38 use json_utils, only: json_get_or_default
39 use device, only: host_to_device
40 use num_types, only: rp
41 implicit none
42
43contains
44
56 subroutine scalar_z_split_ic(s, split_value, value_below, value_above)
57 type(field_t), intent(inout) :: s
58 real(kind=rp), intent(in) :: split_value
59 real(kind=rp), intent(in) :: value_below, value_above
60
61 real(kind=rp) :: z_value
62 integer :: i
63
64 do i = 1, s%dof%size()
65 z_value = s%dof%z(i, 1, 1, 1)
66
67 if (z_value .gt. split_value) then
68 s%x(i, 1, 1, 1) = value_above
69 else
70 s%x(i, 1, 1, 1) = value_below
71 end if
72
73 end do
74
75 call s%copy_from(host_to_device, .true.)
76
77 end subroutine scalar_z_split_ic
78
79end module user_initial_conditions