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
69 type(json_file),
intent(inout) :: json
70 integer,
intent(in) :: size
72 character(len=:),
allocatable :: name
73 real(kind=
rp),
dimension(:),
allocatable :: p0, p1
74 real(kind=
rp) :: radius
76 logical :: full_elements
84 if (all(shape(p0) .ne. (/3/)))
then
85 call neko_error(
"Cylinder point zone: invalid start point")
88 if (all(shape(p1) .ne. (/3/)))
then
89 call neko_error(
"Cylinder point zone: invalid end point")
92 if (radius .lt. 0.0_rp)
then
93 call neko_error(
"Cylinder point zone: invalid radius")
115 integer,
intent(in),
optional :: size
116 character(len=*),
intent(in) :: name
117 logical,
intent(in) :: invert
118 logical,
intent(in) :: full_elements
119 real(kind=
rp),
intent(in),
dimension(3) :: p0
120 real(kind=
rp),
intent(in),
dimension(3) :: p1
121 real(kind=
rp),
intent(in) :: radius
124 call this%init_base(
size, name, invert, full_elements)
136 call this%free_base()
170 real(kind=
rp),
intent(in) :: x
171 real(kind=
rp),
intent(in) :: y
172 real(kind=
rp),
intent(in) :: z
173 integer,
intent(in) :: j
174 integer,
intent(in) :: k
175 integer,
intent(in) :: l
176 integer,
intent(in) :: e
179 real(kind=
rp),
dimension(3) :: p
180 real(kind=
rp),
dimension(3) :: centerline
181 real(kind=
rp),
dimension(3) :: vec_p
184 real(kind=
rp) :: distance
188 centerline = this%p1 - this%p0
190 t = dot_product(vec_p, centerline) / dot_product(centerline, centerline)
195 is_inside = t >= 0.0_rp .and. t <= 1.0_rp .and. distance <= this%radius
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Retrieves a parameter by name or throws an error.
Implements a cylinder geometry subset.
subroutine cylinder_point_zone_init_common(this, size, name, invert, full_elements, 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.