vertices_sphere Subroutine

private pure subroutine vertices_sphere(v, center, radius)

A sphere around points v (3, n): their box's center, out to the farthest (zero for none).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: v(:,:)

(3, n) points

real(kind=wp), intent(out) :: center(3)

the sphere's center and radius

real(kind=wp), intent(out) :: radius

the sphere's center and radius


Called by

proc~~vertices_sphere~~CalledByGraph proc~vertices_sphere vertices_sphere proc~make_polyhedron make_polyhedron proc~make_polyhedron->proc~vertices_sphere proc~poly_bound Polyhedron%poly_bound proc~poly_bound->proc~vertices_sphere proc~poly_build_contents Polyhedron%poly_build_contents proc~poly_build_contents->proc~make_polyhedron proc~poly_set_draw_mode Polyhedron%poly_set_draw_mode proc~poly_set_draw_mode->proc~make_polyhedron proc~poly_set_line_color Polyhedron%poly_set_line_color proc~poly_set_line_color->proc~make_polyhedron proc~poly_set_line_width Polyhedron%poly_set_line_width proc~poly_set_line_width->proc~make_polyhedron proc~poly_set_opacity Polyhedron%poly_set_opacity proc~poly_set_opacity->proc~make_polyhedron proc~remove_vertex_colors Polyhedron%remove_vertex_colors proc~remove_vertex_colors->proc~make_polyhedron proc~set_edges Polyhedron%set_edges proc~set_edges->proc~make_polyhedron proc~set_face_color Polyhedron%set_face_color proc~set_face_color->proc~make_polyhedron proc~set_faces Polyhedron%set_faces proc~set_faces->proc~make_polyhedron proc~set_grid Polyhedron%set_grid proc~set_grid->proc~make_polyhedron proc~set_lit Polyhedron%set_lit proc~set_lit->proc~make_polyhedron proc~set_point_color Polyhedron%set_point_color proc~set_point_color->proc~make_polyhedron proc~set_point_size Polyhedron%set_point_size proc~set_point_size->proc~make_polyhedron proc~set_smooth Polyhedron%set_smooth proc~set_smooth->proc~make_polyhedron proc~set_triangles Polyhedron%set_triangles proc~set_triangles->proc~make_polyhedron proc~set_two_sided Polyhedron%set_two_sided proc~set_two_sided->proc~make_polyhedron proc~set_vertex_colors Polyhedron%set_vertex_colors proc~set_vertex_colors->proc~make_polyhedron proc~set_vertices Polyhedron%set_vertices proc~set_vertices->proc~make_polyhedron

Source Code

    pure subroutine vertices_sphere(v, center, radius)
        real(wp), intent(in) :: v(:,:)                      !! (3, n) points
        real(wp), intent(out) :: center(3), radius          !! the sphere's center and radius
        integer :: i
        center = 0.0_wp
        radius = 0.0_wp
        if (size(v, 2) == 0) return
        center = 0.5_wp * (minval(v, dim=2) + maxval(v, dim=2))
        do i = 1, size(v, 2)
            radius = max(radius, norm2(v(:, i) - center))
        end do
    end subroutine vertices_sphere