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 logical :: contained(1:nn)
88 class(box_t),
intent(in) :: this
89 class(basis_vectors_t),
optional,
intent(in) :: axes
90 real(real64) :: bounds(2, this%dim)
97 class(box_t),
intent(in) :: this
98 integer,
optional,
intent(in) :: iunit
99 type(namespace_t),
optional,
intent(in) :: namespace
106 import :: box_info_len
107 class(box_t),
intent(in) :: this
108 type(unit_t),
intent(in) :: unit_length
109 character(len=BOX_INFO_LEN) :: box_short_info
133 this%inside_out = .not. this%inside_out
140 class(
box_t),
intent(in) :: this
151 real(real64),
target,
intent(in) :: xx(1:this%dim)
153 real(real64),
pointer,
contiguous :: xx_ptr(:,:)
154 logical :: points_contained(1)
156 xx_ptr(1:1, 1:this%dim) => xx(1:this%dim)
157 points_contained = this%contains_points(1, xx_ptr)
158 contained = points_contained(1)
164 class(
box_t),
intent(in) :: this
166 real(real64),
intent(in) :: mesh_spacing(:)
167 integer,
intent(in) :: nn
168 real(real64),
intent(in) :: xx(:,:)
169 integer,
optional,
intent(in) :: number_of_layers
170 logical :: surface_points(1:nn)
172 surface_points = .false.
179 class(
box_t),
intent(in) :: this
180 real(real64),
intent(in) :: point_coordinates(:)
181 real(real64),
intent(in) :: mesh_spacing(:)
182 real(real64),
intent(out) :: normal_vector(:)
183 real(real64),
intent(out) :: surface_element
195 class(
box_t),
target :: box
199 call this%add_ptr(box)
208 class(box_iterator_t),
intent(inout) :: this
209 class(box_t),
pointer :: box
211 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)
logical function, dimension(1:nn) box_get_surface_points(this, namespace, mesh_spacing, nn, xx, number_of_layers)
recursive logical function box_contains_point(this, xx)
Convenience function to check if a single point is inside the box when that point is passed as a rank...
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.