25 use,
intrinsic :: iso_fortran_env
38 integer,
parameter,
public :: BOX_INFO_LEN=200
39 real(real64),
parameter,
public :: BOX_BOUNDARY_DELTA = 1e-12_real64
48 type,
abstract ::
box_t
50 integer,
public :: dim
51 logical :: inside_out = .false.
52 real(real64),
allocatable,
public :: bounding_box_l(:)
56 procedure(box_contains_points),
deferred :: contains_points
57 procedure(box_bounds),
deferred :: bounds
58 procedure(box_write_info),
deferred :: write_info
59 procedure(box_short_info),
deferred :: short_info
73 class(box_t),
intent(in) :: this
74 integer,
intent(in) :: nn
75 real(real64),
contiguous,
intent(in) :: xx(:,:)
80 real(real64),
optional,
intent(in) :: tol
81 logical :: contained(1:nn)
89 class(box_t),
intent(in) :: this
90 class(basis_vectors_t),
optional,
intent(in) :: axes
91 real(real64) :: bounds(2, this%dim)
98 class(box_t),
intent(in) :: this
99 integer,
optional,
intent(in) :: iunit
100 type(namespace_t),
optional,
intent(in) :: namespace
107 import :: box_info_len
108 class(box_t),
intent(in) :: this
109 type(unit_t),
intent(in) :: unit_length
110 character(len=BOX_INFO_LEN) :: box_short_info
134 this%inside_out = .not. this%inside_out
141 class(box_t),
intent(in) :: this
152 real(real64),
target,
intent(in) :: xx(1:this%dim)
153 real(real64),
optional,
intent(in) :: tol
155 real(real64),
pointer,
contiguous :: xx_ptr(:,:)
156 logical :: points_contained(1)
158 xx_ptr(1:1, 1:this%dim) => xx(1:this%dim)
159 points_contained = this%contains_points(1, xx_ptr, tol)
160 contained = points_contained(1)
165 function box_get_surface_points(this, namespace, mesh_spacing, nn, xx, number_of_layers)
result(surface_points)
166 class(
box_t),
intent(in) :: this
168 real(real64),
intent(in) :: mesh_spacing(:)
169 integer,
intent(in) :: nn
170 real(real64),
intent(in) :: xx(:,:)
171 integer,
optional,
intent(in) :: number_of_layers
172 logical :: surface_points(1:nn)
174 surface_points = .false.
181 class(
box_t),
intent(in) :: this
182 real(real64),
intent(in) :: point_coordinates(:)
183 real(real64),
intent(in) :: mesh_spacing(:)
184 real(real64),
intent(out) :: normal_vector(:)
185 real(real64),
intent(out) :: surface_element
201 call this%add_ptr(box)
210 class(box_iterator_t),
intent(inout) :: this
213 select type (ptr => this%get_next_ptr())
Box bounds along some axes.
Given a list of points, this function should return an array indicating for each point if it is insid...
Return a string containing a short description of the box.
Write the complete information about the box to a file.
subroutine box_turn_inside_out(this)
Turn a box inside out.
subroutine box_get_surface_point_info(this, point_coordinates, mesh_spacing, normal_vector, surface_element)
recursive logical function box_contains_point(this, xx, tol)
Convenience function to check if a single point is inside the box when that point is passed as a rank...
logical function, dimension(1:nn) box_get_surface_points(this, namespace, mesh_spacing, nn, xx, number_of_layers)
class(box_t) function, pointer box_iterator_get_next(this)
subroutine box_list_add_node(this, box)
logical function box_is_inside_out(this)
Is the box inside out?
This module implements fully polymorphic linked lists, and some specializations thereof.
subroutine, public messages_not_implemented(feature, namespace)
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Vectors defining a basis in a vector space. This class provides methods to convert vector coordinates...
These classes extends the list and list iterator to create a box list.
class to tell whether a point is inside or outside
This class implements an iterator for the polymorphic linked list.
This class implements a linked list of unlimited polymorphic values.