66 subroutine mask_exterior_const_vec(vec, zone, const)
67 type(vector_t),
intent(inout) :: vec
68 class(point_zone_t),
intent(inout) :: zone
69 real(kind=rp),
intent(in) :: const
70 type(field_t),
pointer :: work
71 integer :: temp_indices(1), i
86 call neko_scratch_registry%request_field(work, temp_indices(1), .false.)
88 if (vec%size() .ne. work%size())
then
89 call neko_error(
'vector and field are of incompatible dimension')
93 call field_cfill(work, const)
96 if (neko_bcknd_device .eq. 1)
then
97 call device_copy_mask(work%x_d, vec%x_d, work%size(), zone%mask%get_d(), &
101 work%x(zone%mask%get(i), 1, 1, 1) = vec%x(zone%mask%get(i))
106 if (neko_bcknd_device .eq. 1)
then
107 call device_copy(vec%x_d, work%x_d, work%size())
109 call copy(vec%x, work%x, work%size())
112 call neko_scratch_registry%relinquish_field(temp_indices)
120 subroutine mask_exterior_const_fld(fld, zone, const)
121 type(field_t),
intent(inout) :: fld
122 class(point_zone_t),
intent(inout) :: zone
123 real(kind=rp),
intent(in) :: const
124 type(field_t),
pointer :: work
125 integer :: temp_indices(1)
127 call neko_scratch_registry%request_field(work, temp_indices(1), .false.)
130 call field_cfill(work, const)
133 if (neko_bcknd_device .eq. 1)
then
134 call device_copy_mask(work%x_d, fld%x_d, fld%size(), zone%mask%get_d(), &
137 call copy_mask(work%x, fld%x, fld%size(), zone%mask%get(), zone%size)
141 call field_copy(fld, work)
143 call neko_scratch_registry%relinquish_field(temp_indices)
152 type(field_t),
intent(inout) :: fld
153 class(point_zone_t),
intent(inout) :: zone
154 type(field_t),
intent(inout) :: background
155 type(field_t),
pointer :: work
156 integer :: temp_indices(1)
158 call neko_scratch_registry%request_field(work, temp_indices(1), .false.)
161 call field_copy(work, background)
164 if (neko_bcknd_device .eq. 1)
then
165 call device_copy_mask(work%x_d, fld%x_d, fld%size(), zone%mask%get_d(), &
168 call copy_mask(work%x, fld%x, fld%size(), zone%mask%get(), zone%size)
172 call field_copy(fld, work)
174 call neko_scratch_registry%relinquish_field(temp_indices)
182 class(point_zone_t),
intent(inout) :: mask
183 class(coef_t),
intent(in) :: coef
185 type(field_t),
pointer :: work
186 integer :: temp_indices(1)
193 call neko_scratch_registry%request_field(work, temp_indices(1), .false.)
195 call field_rone(work)
196 call mask_exterior_const_fld(work, mask, 0.0_rp)
197 if (neko_bcknd_device .eq. 1)
then
198 tmp = device_glsc2(work%x_d, coef%B_d, n)
200 tmp = glsc2(work%x, coef%B, n)
202 call neko_scratch_registry%relinquish_field(temp_indices)