38 use json_module,
only: json_file
49 real(kind=
rp),
dimension(3) :: p0
50 real(kind=
rp),
dimension(3) :: p1
51 real(kind=
rp) :: radius
68 type(json_file),
intent(inout) :: json
69 integer,
intent(in) :: size
71 character(len=:),
allocatable :: name
72 real(kind=
rp),
dimension(:),
allocatable :: p0, p1
73 real(kind=
rp) :: radius
78 call json_get(json,
"radius", radius)
81 if (all(shape(p0) .ne. (/3/)))
then
82 call neko_error(
"Cylinder point zone: invalid start point")
85 if (all(shape(p1) .ne. (/3/)))
then
86 call neko_error(
"Cylinder point zone: invalid end point")
89 if (radius .lt. 0.0_rp)
then
90 call neko_error(
"Cylinder point zone: invalid radius")
106 integer,
intent(in),
optional :: size
107 character(len=*),
intent(in) :: name
108 real(kind=
rp),
intent(in),
dimension(3) :: p0
109 real(kind=
rp),
intent(in),
dimension(3) :: p1
110 real(kind=
rp),
intent(in) :: radius
112 call this%init_base(
size, name)
124 call this%free_base()
157 real(kind=
rp),
intent(in) :: x
158 real(kind=
rp),
intent(in) :: y
159 real(kind=
rp),
intent(in) :: z
160 integer,
intent(in) :: j
161 integer,
intent(in) :: k
162 integer,
intent(in) :: l
163 integer,
intent(in) :: e
166 real(kind=
rp),
dimension(3) :: p
167 real(kind=
rp),
dimension(3) :: centerline
168 real(kind=
rp),
dimension(3) :: vec_p
171 real(kind=
rp) :: distance
175 centerline = this%p1 - this%p0
177 t = dot_product(vec_p, centerline) / dot_product(centerline, centerline)
182 is_inside = t >= 0.0_rp .and. t <= 1.0_rp .and. distance <= this%radius
Retrieves a parameter by name or throws an error.
Implements a cylinder geometry subset.
subroutine cylinder_point_zone_init_common(this, size, name, p0, p1, radius)
Initializes a cylinder point zone from its endpoint coordinates and radius.
subroutine cylinder_point_zone_free(this)
Destructor.
pure logical function cylinder_point_zone_criterion(this, x, y, z, j, k, l, e)
Defines the criterion of selection of a GLL point in the cylinder point zone.
subroutine cylinder_point_zone_init_from_json(this, json, size)
Constructor from json object file.
Utilities for retrieving parameters from the case files.
integer, parameter, public rp
Global precision used in computations.
Project x onto X, the space of old solutions and back again.
A cylindrical point zone.
Base abstract type for point zones.