38 use json_module,
only: json_file
51 real(kind=
rp) :: radius
68 type(json_file),
intent(inout) :: json
69 integer,
intent(in) :: size
71 character(len=:),
allocatable :: str_read
72 real(kind=
rp),
allocatable :: values(:)
73 real(kind=
rp) ::
value
74 real(kind=
rp) :: x0, y0, z0, radius
76 call json_get(json,
"center", values)
82 call json_get(json,
"name", str_read)
98 integer,
intent(in),
optional :: size
99 character(len=*),
intent(in) :: name
100 real(kind=
rp),
intent(in) :: x0
101 real(kind=
rp),
intent(in) :: y0
102 real(kind=
rp),
intent(in) :: z0
103 real(kind=
rp),
intent(in) :: radius
105 call this%init_base(
size, name)
118 call this%free_base()
144 real(kind=
rp),
intent(in) :: x
145 real(kind=
rp),
intent(in) :: y
146 real(kind=
rp),
intent(in) :: z
147 integer,
intent(in) :: j
148 integer,
intent(in) :: k
149 integer,
intent(in) :: l
150 integer,
intent(in) :: e
153 real(kind=
rp) :: dist_from_center
155 dist_from_center = sqrt( (x - this%x0)**2 + (y - this%y0)**2 + (z - this%z0)**2 )
158 is_inside = (dist_from_center .lt. this%radius .or. &
159 abscmp(dist_from_center, this%radius))
Retrieves a parameter by name or throws an error.
Utilities for retrieving parameters from the case files.
integer, parameter, public rp
Global precision used in computations.
subroutine sphere_point_zone_free(this)
Destructor.
subroutine sphere_point_zone_init_from_json(this, json, size)
Constructor from json object file.
subroutine sphere_point_zone_init_common(this, size, name, x0, y0, z0, radius)
Initializes a sphere point zone from its center coordinates and radius.
pure logical function sphere_point_zone_criterion(this, x, y, z, j, k, l, e)
Defines the criterion of selection of a GLL point in the sphere point zone. A GLL point of coordinate...
Base abstract type for point zones.
A sphere-shaped point zone.