65 subroutine mask_exterior_const_vec(vec, zone, const)
66 type(vector_t),
intent(inout) :: vec
67 class(point_zone_t),
intent(inout) :: zone
68 real(kind=rp),
intent(in) :: const
69 type(field_t),
pointer :: work
70 integer :: temp_indices(1), i
85 call neko_scratch_registry%request_field(work, temp_indices(1), .false.)
87 if (vec%size() .ne. work%size())
then
88 call neko_error(
'vector and field are of incompatible dimension')
92 call field_cfill(work, const)
95 if (neko_bcknd_device .eq. 1)
then
96 call device_masked_copy_0(work%x_d, vec%x_d, &
97 zone%mask%get_d(), work%size(), zone%size)
100 work%x(zone%mask%get(i), 1, 1, 1) = vec%x(zone%mask%get(i))
105 if (neko_bcknd_device .eq. 1)
then
106 call device_copy(vec%x_d, work%x_d, work%size())
108 call copy(vec%x, work%x, work%size())
111 call neko_scratch_registry%relinquish_field(temp_indices)
119 subroutine mask_exterior_const_fld(fld, zone, const)
120 type(field_t),
intent(inout) :: fld
121 class(point_zone_t),
intent(inout) :: zone
122 real(kind=rp),
intent(in) :: const
123 type(field_t),
pointer :: work
124 integer :: temp_indices(1)
126 call neko_scratch_registry%request_field(work, temp_indices(1), .false.)
129 call field_cfill(work, const)
132 if (neko_bcknd_device .eq. 1)
then
133 call device_masked_copy_0(work%x_d, fld%x_d, &
134 zone%mask%get_d(), fld%size(), zone%size)
136 call copy_mask(work%x, fld%x, fld%size(), zone%mask%get(), zone%size)
140 call field_copy(fld, work)
142 call neko_scratch_registry%relinquish_field(temp_indices)
151 type(field_t),
intent(inout) :: fld
152 class(point_zone_t),
intent(inout) :: zone
153 type(field_t),
intent(inout) :: background
154 type(field_t),
pointer :: work
155 integer :: temp_indices(1)
157 call neko_scratch_registry%request_field(work, temp_indices(1), .false.)
160 call field_copy(work, background)
163 if (neko_bcknd_device .eq. 1)
then
164 call device_masked_copy_0(work%x_d, fld%x_d, &
165 zone%mask%get_d(), fld%size(), zone%size)
167 call copy_mask(work%x, fld%x, fld%size(), zone%mask%get(), zone%size)
171 call field_copy(fld, work)
173 call neko_scratch_registry%relinquish_field(temp_indices)
181 class(point_zone_t),
intent(inout) :: mask
182 class(coef_t),
intent(in) :: coef
184 type(field_t),
pointer :: work
185 integer :: temp_indices(1)
192 call neko_scratch_registry%request_field(work, temp_indices(1), .false.)
194 call field_rone(work)
195 call mask_exterior_const_fld(work, mask, 0.0_rp)
196 if (neko_bcknd_device .eq. 1)
then
197 tmp = device_glsc2(work%x_d, coef%B_d, n)
199 tmp = glsc2(work%x, coef%B, n)
201 call neko_scratch_registry%relinquish_field(temp_indices)