@@ -784,6 +784,7 @@ contains
784784 & 0._wp])
785785 if (f_is_inside_cuboid(xyz_local(1), xyz_local(2), 0._wp, [length_x, length_y, &
786786 & 0._wp]) .and. patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, 0))) then
787+ call s_assign_patch_primitive_variables(patch_id, i, j, 0, eta, q_prim_vf, patch_id_fp)
787788 @:analytical()
788789 if (patch_icpp(patch_id)%hcid /= dflt_int) then
789790 @:Hardcoded2D()
@@ -1298,12 +1299,11 @@ contains
12981299 integer , dimension (0 :m,0 :n,0 :p), intent (inout ) :: patch_id_fp
12991300#endif
13001301 type(scalar_field), dimension (1 :sys_size), intent (inout ) :: q_prim_vf
1301- integer :: i, j, k !< loop iterators
1302- integer :: model_id !< Index into the preloading stl_models(:)
1303- real (wp) :: threshold !< Inside/ outside cutoff for this model
1304- real (wp), dimension (1 :3 ) :: point !< Cell- center query point
1305- real (wp), dimension (1 :3 ) :: point_local !< Query point transformed into the model frame
1306- logical :: in_box !< Whether the cell center lies in the model' s bounding box
1302+ integer :: i, j, k !< loop iterators
1303+ integer :: model_id !< Index into the preloading stl_models(:)
1304+ real (wp) :: threshold !< Inside/ outside cutoff for this model
1305+ real (wp), dimension (1 :3 ) :: point !< Cell- center query point
1306+ logical :: in_box !< Whether the cell center lies in the model' s bounding box
13071307
13081308 model_id = patch_icpp(patch_id)%model_id
13091309 threshold = stl_models(model_id)%model_threshold
@@ -1313,20 +1313,16 @@ contains
13131313 if (p > 0) point(3) = z_cc(k)
13141314 if (grid_geometry == 3) point = f_convert_cyl_to_cart(point)
13151315
1316- ! Transform the query point into the model frame: centroid-relative, then rotate
1317- point_local = matmul(patch_icpp(patch_id)%rotation_matrix_inverse, [point(1) - patch_icpp(patch_id)%x_centroid, &
1318- & point(2) - patch_icpp(patch_id)%y_centroid, point(3) - patch_icpp(patch_id)%z_centroid])
1319-
1320- ! Run the winding test only on cells whose transformed point lies inside the bounding box, else skip the calculation
1321- in_box = point_local(1) >= stl_bounding_boxes(model_id, 1, 1) .and. point_local(1) <= stl_bounding_boxes(model_id, 1, &
1322- & 3) .and. point_local(2) >= stl_bounding_boxes(model_id, 2, &
1323- & 1) .and. point_local(2) <= stl_bounding_boxes(model_id, 2, 3)
1316+ ! Run the winding test only on cells whose Cartesian point lies inside the bounding box, else skip the calculation
1317+ in_box = point(1) >= stl_bounding_boxes(model_id, 1, 1) .and. point(1) <= stl_bounding_boxes(model_id, 1, &
1318+ & 3) .and. point(2) >= stl_bounding_boxes(model_id, 2, &
1319+ & 1) .and. point(2) <= stl_bounding_boxes(model_id, 2, 3)
13241320 if (p > 0 .or. grid_geometry == 3) then
1325- in_box = in_box .and. point_local (3) >= stl_bounding_boxes(model_id, 3, &
1326- & 1) .and. point_local (3) <= stl_bounding_boxes(model_id, 3, 3)
1321+ in_box = in_box .and. point (3) >= stl_bounding_boxes(model_id, 3, &
1322+ & 1) .and. point (3) <= stl_bounding_boxes(model_id, 3, 3)
13271323 end if
13281324 if (in_box) then
1329- eta = f_model_is_inside(gpu_ntrs(model_id), model_id, point_local )
1325+ eta = f_model_is_inside(gpu_ntrs(model_id), model_id, point )
13301326 else
13311327 eta = 0._wp
13321328 end if
0 commit comments