47 type(box_parallelepiped_t),
pointer :: outer_box
48 character(len=1024) :: expression
57 procedure box_user_defined_constructor
64 integer,
intent(in) :: dim
65 real(real64),
intent(in) :: center(dim)
66 real(real64),
intent(in) :: axes(dim, dim)
67 character(len=1024),
intent(in) :: expression
68 real(real64),
intent(in) :: length(dim)
69 type(namespace_t),
intent(in) :: namespace
70 class(box_user_defined_t),
pointer :: box
79 box%expression = expression
83 box%bounding_box_l =
m_half*length + abs(center)
90 type(box_user_defined_t),
intent(inout) :: this
95 safe_deallocate_p(this%outer_box)
102 class(box_user_defined_t),
intent(in) :: this
103 integer,
intent(in) :: nn
104 real(real64),
contiguous,
intent(in) :: xx(:,:)
105 logical :: contained(1:nn)
108 real(real64) :: re, im, rr, xx_centered(this%dim)
110 contained = this%outer_box%contains_points(nn, xx)
113 if (.not. contained(ip))
then
118 xx_centered = xx(ip, :) - this%center
119 rr = norm2(xx_centered)
121 contained(ip) = abs(re) >
m_epsilon .neqv. this%is_inside_out()
128 class(box_user_defined_t),
intent(in) :: this
129 integer,
optional,
intent(in) :: iunit
130 type(namespace_t),
optional,
intent(in) :: namespace
134 write(
message(1),
'(2x,a)')
'Type = user-defined'
147 write(
info,
'(3a)')
'BoxShape = user_defined; BoxShapeUsDef = "', trim(this%expression),
'"'
subroutine, public box_shape_init(this, namespace, dim, center, bounding_box_min, bounding_box_max, axes)
subroutine, public box_shape_end(this)
class(box_user_defined_t) function, pointer box_user_defined_constructor(dim, center, axes, expression, length, namespace)
subroutine box_user_defined_finalize(this)
subroutine box_user_defined_write_info(this, iunit, namespace)
logical function, dimension(1:nn) box_user_defined_shape_contains_points(this, nn, xx)
character(len=box_info_len) function box_user_defined_short_info(this, unit_length)
real(real64), parameter, public m_zero
real(real64), parameter, public m_epsilon
real(real64), parameter, public m_half
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public conv_to_c_string(str)
converts to c string
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Class implementing a parallelepiped box. Currently this is restricted to a rectangular cuboid (all th...
Base class for more specialized boxes that are defined by a shape and have a center and basis vectors...
Class implementing a box defined by a mathematical expression. This box needs to be inside a parallel...