Make the disk, its circles and its radial lines (1 degree steps), in place of the old.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(RadialPlane), | intent(inout) | :: | self |
subroutine make_plane(self) type(RadialPlane), intent(inout) :: self integer, parameter :: n = 360 ! points around a circle (1 degree) real(wp) :: disk(3, n + 1), circle(3, n), a, r integer :: idx(3, n), i, k real(wp), allocatable :: lines(:,:), main(:,:) type(c_ptr) :: group if (.not. c_associated(self%nodes%contents)) return ! the disk: a fan around the center disk(:, n + 1) = 0.0_wp do i = 1, n a = 2.0_wp * pi * (i - 1) / n disk(:, i) = self%radius_ * [cos(a), sin(a), 0.0_wp] idx(:, i) = [n + 1, i, modulo(i, n) + 1] end do allocate(lines(3, 0), main(3, 0)) ! circles: the edge, and every radial_spacing from the center if (self%radial_spacing > 0.0_wp) then call append(lines, closed_segments(disk(:, 1:n))) k = 1 do while (k * self%radial_spacing < self%radius_ * (1.0_wp - 1.0e-6_wp)) r = k * self%radial_spacing circle = r / self%radius_ * disk(:, 1:n) call append(lines, closed_segments(circle)) k = k + 1 end do end if ! radial lines: along +x (thicker), then every lon_spacing if (self%lon_spacing > 0.0_wp) then k = 0 do while (k * self%lon_spacing < 2.0_wp * pi - 1.0e-6_wp) a = k * self%lon_spacing if (k == 0) then call append(main, reshape([0.0_wp, 0.0_wp, 0.0_wp, self%radius_ * [cos(a), sin(a), 0.0_wp]], [3, 2])) else call append(lines, reshape([0.0_wp, 0.0_wp, 0.0_wp, self%radius_ * [cos(a), sin(a), 0.0_wp]], [3, 2])) end if k = k + 1 end do end if group = vkf_switch_create() call add(group, surface_node(disk, idx, self%plane_color_)) call add(group, line_node(lines, self%line_color_, 1.0_wp, .true.)) call add(group, line_node(main, self%line_color_, 3.0_wp, .true.)) call self%nodes%replace(group) end subroutine make_plane