39 real(c_double) :: x, y, z
44 type(c_ptr) :: AABB_tree
45 type(c_ptr) :: polyhedron
53 type(c_ptr),
intent(out) :: ptree
54 character(kind=c_char),
intent(in) :: fname(*)
55 integer(c_int),
value :: verbose
56 integer(c_int),
intent(out) :: ierr
59 subroutine polyhedron_build_aabb_tree(tree, poly)
bind(C,name="polyhedron_build_AABB_tree")
61 type(c_ptr),
intent(out) :: tree
62 type(c_ptr),
intent(in) :: poly
67 logical(c_bool) :: res
68 type(c_ptr),
intent(in) :: tree
69 type(d3),
intent(in) :: vec
72 subroutine polyhedron_finalize_aabb_tree(tree)
bind(C,name="polyhedron_finalize_AABB_tree")
74 type(c_ptr),
intent(inout) :: tree
79 type(c_ptr),
intent(inout) :: polyhedron
90 type(cgal_polyhedra_t),
intent(inout) :: cgal_poly
91 character(*),
intent(in) :: fname
92 logical,
intent(in) :: verbose
105 type(cgal_polyhedra_t),
intent(inout) :: cgal_poly
106 character(*),
intent(in) :: fname
107 logical,
intent(in) :: verbose
109 integer(c_int) :: verb, ierr
116 if (verbose) verb = 1
126 message(1) =
"Info: finished reading polyhedron from file " // fname
127 call messages_info(1)
129 message(1) =
"Error reading file " // fname //
", it appears to be empty."
130 call messages_fatal(1)
132 message(1) =
"Error reading file " // fname //
"."
133 call messages_fatal(1)
135 message(1) =
"You are trying to read polyhedron data from " // fname
136 message(2) =
"For this feature Octopus has to be linked with the CGAL library."
137 call messages_fatal(2)
139 message(1) =
"Error: Error status not implemented in CGAL Fortran interface."
140 call messages_fatal(1)
154 call polyhedron_build_aabb_tree(cgal_poly%AABB_tree, cgal_poly%polyhedron)
165 real(c_double),
intent(in) :: xq, yq, zq
171 query =
d3(xq, yq, zq)
185 call polyhedron_finalize_aabb_tree(cgal_poly%AABB_tree)
subroutine, public cgal_polyhedron_build_aabb_tree(cgal_poly)
subroutine, public cgal_polyhedron_init(cgal_poly, fname, verbose)
logical function, public cgal_polyhedron_point_inside(cgal_poly, xq, yq, zq)
subroutine, public cgal_polyhedron_end(cgal_poly)
subroutine, public cgal_polyhedron_read(cgal_poly, fname, verbose)