Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
initial_conditions.f90
1module user_initial_conditions
2 use field, only: field_t
3 use json_file_module, only: json_file
4 use json_utils, only: json_get_or_default
5 use device, only: host_to_device
6 use num_types, only: rp
7 implicit none
8
9contains
10
20 subroutine scalar_z_split_ic(s, split_value, value_below, value_above)
21 type(field_t), intent(inout) :: s
22 real(kind=rp), intent(in) :: split_value
23 real(kind=rp), intent(in) :: value_below, value_above
24
25 real(kind=rp) :: z_value
26 integer :: i
27
28 do i = 1, s%dof%size()
29 z_value = s%dof%z(i, 1, 1, 1)
30
31 if (z_value .gt. split_value) then
32 s%x(i, 1, 1, 1) = value_above
33 else
34 s%x(i, 1, 1, 1) = value_below
35 end if
36
37 end do
38
39 call s%copy_from(host_to_device, .true.)
40
41 end subroutine scalar_z_split_ic
42
43end module user_initial_conditions