@@ -1613,24 +1613,24 @@ contains
16131613 - radius))* (- 0.5_wp ) + 0.5_wp
16141614 end if
16151615
1616- if (((x_cc(i) - x_centroid)** 2 &
1617- + (cart_y - y_centroid)** 2 &
1618- + (cart_z - z_centroid)** 2 <= radius** 2 ) .or. &
1619- patch_id_fp(i, j, k) == smooth_patch_id) &
1620- then
1621-
1622- if (present (ib)) then
1623- ! Updating the patch identities bookkeeping variable
1616+ if (present (ib)) then
1617+ ! Updating the patch identities bookkeeping variable
1618+ if (((x_cc(i) - x_centroid)** 2 &
1619+ + (cart_y - y_centroid)** 2 &
1620+ + (cart_z - z_centroid)** 2 <= radius** 2 )) then
16241621 patch_id_fp(i, j, k) = patch_id
1625- else
1626- if (patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, k)) .or. &
1627- patch_id_fp(i, j, k) == smooth_patch_id) then
1622+ end if
1623+ else
1624+ if ((((x_cc(i) - x_centroid)** 2 &
1625+ + (cart_y - y_centroid)** 2 &
1626+ + (cart_z - z_centroid)** 2 <= radius** 2 ) .and. &
1627+ patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, k))) .or. &
1628+ patch_id_fp(i, j, k) == smooth_patch_id) then
16281629
1629- call s_assign_patch_primitive_variables(patch_id, i, j, k, &
1630- eta, q_prim_vf, patch_id_fp)
1630+ call s_assign_patch_primitive_variables(patch_id, i, j, k, &
1631+ eta, q_prim_vf, patch_id_fp)
16311632
1632- @:analytical()
1633- end if
1633+ @:analytical()
16341634 end if
16351635 end if
16361636 end do
@@ -1829,39 +1829,57 @@ contains
18291829 end if
18301830 end if
18311831
1832- if (((.not. f_is_default(length_x) .and. &
1833- (cart_y - y_centroid)** 2 &
1834- + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1835- x_boundary%beg <= x_cc(i) .and. &
1836- x_boundary%end >= x_cc(i)) &
1837- .or. &
1838- (.not. f_is_default(length_y) .and. &
1839- (x_cc(i) - x_centroid)** 2 &
1840- + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1841- y_boundary%beg <= cart_y .and. &
1842- y_boundary%end >= cart_y) &
1843- .or. &
1844- (.not. f_is_default(length_z) .and. &
1845- (x_cc(i) - x_centroid)** 2 &
1846- + (cart_y - y_centroid)** 2 <= radius** 2 .and. &
1847- z_boundary%beg <= cart_z .and. &
1848- z_boundary%end >= cart_z)) .or. patch_id_fp(i, j, k) == smooth_patch_id) then
1832+ if (present (ib)) then
1833+ if (((.not. f_is_default(length_x) .and. &
1834+ (cart_y - y_centroid)** 2 &
1835+ + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1836+ x_boundary%beg <= x_cc(i) .and. &
1837+ x_boundary%end >= x_cc(i)) &
1838+ .or. &
1839+ (.not. f_is_default(length_y) .and. &
1840+ (x_cc(i) - x_centroid)** 2 &
1841+ + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1842+ y_boundary%beg <= cart_y .and. &
1843+ y_boundary%end >= cart_y) &
1844+ .or. &
1845+ (.not. f_is_default(length_z) .and. &
1846+ (x_cc(i) - x_centroid)** 2 &
1847+ + (cart_y - y_centroid)** 2 <= radius** 2 .and. &
1848+ z_boundary%beg <= cart_z .and. &
1849+ z_boundary%end >= cart_z))) then
18491850
1850- if (present (ib)) then
18511851 ! Updating the patch identities bookkeeping variable
18521852 patch_id_fp(i, j, k) = patch_id
1853- else
1854- if (patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, k)) &
1855- .or. patch_id_fp(i, j, k) == smooth_patch_id) then
1853+ end if
18561854
1857- call s_assign_patch_primitive_variables(patch_id, i, j, k, &
1858- eta, q_prim_vf, patch_id_fp)
1855+ else
1856+ if (((.not. f_is_default(length_x) .and. &
1857+ (cart_y - y_centroid)** 2 &
1858+ + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1859+ x_boundary%beg <= x_cc(i) .and. &
1860+ x_boundary%end >= x_cc(i)) &
1861+ .or. &
1862+ (.not. f_is_default(length_y) .and. &
1863+ (x_cc(i) - x_centroid)** 2 &
1864+ + (cart_z - z_centroid)** 2 <= radius** 2 .and. &
1865+ y_boundary%beg <= cart_y .and. &
1866+ y_boundary%end >= cart_y) &
1867+ .or. &
1868+ (.not. f_is_default(length_z) .and. &
1869+ (x_cc(i) - x_centroid)** 2 &
1870+ + (cart_y - y_centroid)** 2 <= radius** 2 .and. &
1871+ z_boundary%beg <= cart_z .and. &
1872+ z_boundary%end >= cart_z) .and. &
1873+ patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, k))) .or. &
1874+ patch_id_fp(i, j, k) == smooth_patch_id) then
18591875
1860- @:analytical()
1876+ call s_assign_patch_primitive_variables(patch_id, i, j, k, &
1877+ eta, q_prim_vf, patch_id_fp)
18611878
1862- ! Updating the patch identities bookkeeping variable
1863- if (1._wp - eta < 1e-16_wp ) patch_id_fp(i, j, k) = patch_id
1864- end if
1879+ @:analytical()
1880+
1881+ ! Updating the patch identities bookkeeping variable
1882+ if (1._wp - eta < 1e-16_wp ) patch_id_fp(i, j, k) = patch_id
18651883 end if
18661884 end if
18671885 end do
0 commit comments