82 type(json_file),
intent(inout) :: json
83 integer,
intent(in) :: size
86 type(json_core) :: core
88 type(json_value),
pointer :: source_object, source_pointer
90 character(len=:),
allocatable :: buffer
92 type(json_file) :: source_subdict
93 character(len=:),
allocatable :: type_name
94 character(len=:),
allocatable :: type_string
96 character(len=:),
allocatable :: str_read
97 integer :: i, n_zones, i_internal, i_external
98 logical :: found, invert, full_elements
100 call json_get(json,
"name", str_read)
103 call this%init_base(
size, trim(str_read), invert, full_elements)
105 call json%get_core(core)
106 call json%get(
'subsets', source_object, found)
108 if (.not. found)
call neko_error(
"No subsets found")
110 this%n_zones = core%count(source_object)
113 if (this%n_zones .gt. 0)
then
114 allocate(this%zones(this%n_zones))
119 do i = 1, this%n_zones
121 call core%get_child(source_object, i, source_pointer, found)
122 call core%print_to_string(source_pointer,
buffer)
123 call source_subdict%load_from_string(
buffer)
125 if (.not. source_subdict%valid_path(
"geometry"))
then
126 this%n_external_zones = this%n_external_zones + 1
130 this%n_internal_zones = this%n_zones - this%n_external_zones
131 if (this%n_external_zones .gt. 0) &
132 allocate(this%names(this%n_external_zones))
133 if (this%n_internal_zones .gt. 0) &
134 allocate(this%internal_zones(this%n_internal_zones))
141 do i = 1, this%n_zones
144 call core%get_child(source_object, i, source_pointer, found)
145 call core%print_to_string(source_pointer,
buffer)
146 call source_subdict%load_from_string(
buffer)
148 if (source_subdict%valid_path(
"geometry"))
then
149 call point_zone_factory(this%internal_zones(i_internal)%pz, &
152 this%internal_zones(i_internal)%pz)
153 i_internal = i_internal + 1
155 call json_get(source_subdict,
"name", type_name)
156 this%names(i_external) = trim(type_name)
157 i_external = i_external + 1
163 call json_get(json,
"operator", this%operator)
164 select case (trim(this%operator))
169 call neko_error(
"Unknown operator " // trim(this%operator))
225 real(kind=
rp),
intent(in) :: x
226 real(kind=
rp),
intent(in) :: y
227 real(kind=
rp),
intent(in) :: z
228 integer,
intent(in) :: j
229 integer,
intent(in) :: k
230 integer,
intent(in) :: l
231 integer,
intent(in) :: e
236 is_inside = this%zones(1)%pz%criterion(x, &
237 y, z, j, k, l, e) .neqv. this%zones(1)%pz%invert
239 do i = 2, this%n_zones
240 select case (trim(this%operator))
242 is_inside = is_inside .or. (this%zones(i)%pz%criterion(x, &
243 y, z, j, k, l, e) .neqv. this%zones(i)%pz%invert)
246 is_inside = is_inside .and. (this%zones(i)%pz%criterion(x, &
247 y, z, j, k, l, e) .neqv. this%zones(i)%pz%invert)
250 is_inside = is_inside .neqv. (this%zones(i)%pz%criterion(x, &
251 y, z, j, k, l, e).neqv. this%zones(i)%pz%invert)
pure logical function combine_point_zone_criterion(this, x, y, z, j, k, l, e)
Defines the criterion of selection of a GLL point in the combined point zone.
character(:) function, allocatable, public concat_string_array(array, sep, prepend)
Concatenate an array of strings into one string with array items separated by spaces.