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.
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 num_types, only: rp
6 implicit none
7
8contains
9
19 subroutine scalar_z_split_ic(s, params)
20 type(field_t), intent(inout) :: s
21 type(json_file), intent(inout) :: params
22
23 real(kind=rp) :: z_value, split_value
24 integer :: i
25
26 call json_get_or_default(params, &
27 'case.scalar.initial_condition.value', &
28 split_value, 0.0_rp)
29
30 do i = 1, s%dof%size()
31 z_value = s%dof%z(i, 1, 1, 1)
32
33 if (z_value .gt. 0.0_rp) then
34 s%x(i, 1, 1, 1) = 0.0_rp
35 else
36 s%x(i, 1, 1, 1) = 1.0_rp
37 end if
38
39 end do
40
41 end subroutine scalar_z_split_ic
42
43end module initial_conditions
subroutine scalar_z_split_ic(s, params)
Set the initial condition for the scalar field.