Basic shapes: circle and rectangle More...
Data Types | |
type | mod_shape_basic::t_shape_circle |
Circle/sphere shape. More... | |
type | mod_shape_basic::t_shape_rectangle |
Rectangle/rectangular cuboid shape. More... | |
type | mod_shape_basic::t_shape_halfspace |
Half-space shape. More... | |
type | mod_shape_basic::t_shape_cylinder |
Cylinder shape (3D only) More... | |
type | mod_shape_basic::t_shape_torus |
Torus shape around Z-axis (3D only) More... | |
type | mod_shape_basic::t_shape_universe |
Represents the whole space. More... | |
Functions/Subroutines | |
subroutine | mod_shape_basic::initialize_shape_circle (shape) |
Initialize the circle/sphere. | |
subroutine | mod_shape_basic::copy_shape_circle (shape, copy) |
Copy the circle/sphere. | |
logical pure function | mod_shape_basic::shape_circle_is_inside (shape, point) |
Check if a point lies inside the circle/sphere. | |
subroutine | mod_shape_basic::shape_circle_get_samples_inside (shape, i, j, k, n, n_samples, samples) |
Check if a given number of point lies in a circle/sphere. | |
pure subroutine | mod_shape_basic::shape_circle_get_distance (shape, point, distance, direction) |
Compute the signed distance and the signed direction from a point to the circle/sphere. | |
subroutine | mod_shape_basic::initialize_shape_rectangle (shape) |
Initialize the rectangle/rectangular cuboid. | |
subroutine | mod_shape_basic::copy_shape_rectangle (shape, copy) |
Copy the rectangle. | |
logical pure function | mod_shape_basic::shape_rectangle_is_inside (shape, point) |
Check if a point lies inside the rectangle/rectangular cuboid. | |
subroutine | mod_shape_basic::shape_rectangle_get_samples_inside (shape, i, j, k, n, n_samples, samples) |
Check if a given number of point lies in a rectrangle/rectangular cuboid. | |
pure subroutine | mod_shape_basic::shape_rectangle_get_distance (shape, point, distance, direction) |
Compute the signed distance and the signed direction from a point to the rectangle/rectangular cuboid. | |
subroutine | mod_shape_basic::initialize_shape_halfspace (shape) |
Initialize the half-space. | |
subroutine | mod_shape_basic::copy_shape_halfspace (shape, copy) |
Copy the half-space. | |
logical pure function | mod_shape_basic::shape_halfspace_is_inside (shape, point) |
Check if a point lies inside the half-space. | |
subroutine | mod_shape_basic::shape_halfspace_get_samples_inside (shape, i, j, k, n, n_samples, samples) |
Check if a given number of point lies in a half-space. | |
pure subroutine | mod_shape_basic::shape_halfspace_get_distance (shape, point, distance, direction) |
Compute the signed distance and the signed direction from a point to the half-space. | |
subroutine | mod_shape_basic::initialize_shape_cylinder (shape) |
Initialize the cylinder. | |
subroutine | mod_shape_basic::copy_shape_cylinder (shape, copy) |
Copy the cylinder. | |
logical pure function | mod_shape_basic::shape_cylinder_is_inside (shape, point) |
Check if a point lies inside the cylinder (3D only) | |
subroutine | mod_shape_basic::shape_cylinder_get_samples_inside (shape, i, j, k, n, n_samples, samples) |
Check if a given number of point lies in a cylinder. | |
pure subroutine | mod_shape_basic::shape_cylinder_get_distance (shape, point, distance, direction) |
Compute the signed distance and the signed direction from a point to the cylinder. | |
subroutine | mod_shape_basic::initialize_shape_torus (shape) |
Initialize the torus. | |
subroutine | mod_shape_basic::copy_shape_torus (shape, copy) |
Copy the torus. | |
logical pure function | mod_shape_basic::shape_torus_is_inside (shape, point) |
Check if a point lies inside the torus (3D only) | |
subroutine | mod_shape_basic::shape_torus_get_samples_inside (shape, i, j, k, n, n_samples, samples) |
Check if a given number of point lies in a torus. | |
pure subroutine | mod_shape_basic::shape_torus_get_distance (shape, point, distance, direction) |
Compute the signed distance and the signed direction from a point to the torus. | |
subroutine | mod_shape_basic::initialize_shape_universe (shape) |
Initialize the universe. | |
subroutine | mod_shape_basic::copy_shape_universe (shape, copy) |
Copy the universe. | |
logical pure function | mod_shape_basic::shape_universe_is_inside (shape, point) |
Check if a point lies inside the universe (always true) | |
subroutine | mod_shape_basic::shape_universe_get_samples_inside (shape, i, j, k, n, n_samples, samples) |
Check if a given number of point lies in the universe (yes, they do!) | |
pure subroutine | mod_shape_basic::shape_universe_get_distance (shape, point, distance, direction) |
Compute the signed distance and the signed direction from a point to the universe. | |
subroutine mod_shape_basic::copy_shape_circle | ( | class(t_shape_circle), intent(in) | shape, |
class(t_shape), allocatable | copy ) |
[in] | shape | circle/sphere shape |
[out] | copy | copied circle/sphere |
subroutine mod_shape_basic::copy_shape_cylinder | ( | class(t_shape_cylinder), intent(in) | shape, |
class(t_shape), allocatable | copy ) |
[in] | shape | cylinder shape |
[out] | copy | copied cylinder |
subroutine mod_shape_basic::copy_shape_halfspace | ( | class(t_shape_halfspace), intent(in) | shape, |
class(t_shape), allocatable | copy ) |
[in] | shape | half-space shape |
[out] | copy | copied half-space |
subroutine mod_shape_basic::copy_shape_rectangle | ( | class(t_shape_rectangle), intent(in) | shape, |
class(t_shape), allocatable | copy ) |
[in] | shape | rectangle shape |
[out] | copy | copied rectangle |
subroutine mod_shape_basic::copy_shape_torus | ( | class(t_shape_torus), intent(in) | shape, |
class(t_shape), allocatable | copy ) |
[in] | shape | torus shape |
[out] | copy | copied torus |
subroutine mod_shape_basic::copy_shape_universe | ( | class(t_shape_universe), intent(in) | shape, |
class(t_shape), allocatable | copy ) |
[in] | shape | universe shape |
[out] | copy | copied universe |
subroutine mod_shape_basic::initialize_shape_circle | ( | class(t_shape_circle), intent(inout) | shape | ) |
[in,out] | shape | circle/sphere shape |
subroutine mod_shape_basic::initialize_shape_cylinder | ( | class(t_shape_cylinder), intent(inout) | shape | ) |
[in,out] | shape | cylinder shape |
subroutine mod_shape_basic::initialize_shape_halfspace | ( | class(t_shape_halfspace), intent(inout) | shape | ) |
[in,out] | shape | half-space shape |
subroutine mod_shape_basic::initialize_shape_rectangle | ( | class(t_shape_rectangle), intent(inout) | shape | ) |
[in,out] | shape | rectangle shape |
subroutine mod_shape_basic::initialize_shape_torus | ( | class(t_shape_torus), intent(inout) | shape | ) |
[in,out] | shape | torus shape |
subroutine mod_shape_basic::initialize_shape_universe | ( | class(t_shape_universe), intent(inout) | shape | ) |
[in,out] | shape | universe shape |
pure subroutine mod_shape_basic::shape_circle_get_distance | ( | class(t_shape_circle), intent(in) | shape, |
double precision, dimension(3), intent(in) | point, | ||
double precision, intent(out) | distance, | ||
double precision, dimension(3), intent(out) | direction ) |
If the point lies inside the circle/sphere, the distance is negative and the direction points to the closest point on the circle/sphere. If the point lies outiside the circle/sphere, the distance is positive and the direction points in the opposite direction to the closest point on the circle/sphere.
[in] | shape | circle/sphere shape |
[in] | point | any point |
[out] | distance | signed closest distance from the point to the circle/sphere |
[out] | direction | signed direction from the point to the closest point on the circle/sphere |
subroutine mod_shape_basic::shape_circle_get_samples_inside | ( | class(t_shape_circle), intent(inout) | shape, |
integer, intent(in) | i, | ||
integer, intent(in) | j, | ||
integer, intent(in) | k, | ||
integer, intent(in) | n, | ||
integer, intent(in) | n_samples, | ||
integer, dimension(:,:,:), intent(inout) | samples ) |
Sample a cell of coordinates (i
,j
,k
) with (2*n_samples+1)^d samples, where d denotes the dimension of the cell. Return a integer array samples
containing the value n
where the sample is inside the shape.
n_samples
is called the sampling level and can take its value in range [0,∞].
Example of sampling for various sampling level:
!! n_samples = 0 n_samples = 1 n_samples = 2 !! ┏━━━━━━━┓ ×━━━×━━━× ×━×━×━×━× !! ┃ ┃ ┃ ┃ × × × × × !! ┃ × ┃ × × × × × × × × ... !! ┃ ┃ ┃ ┃ × × × × × !! ┗━━━━━━━┛ ×━━━×━━━× ×━×━×━×━× !!
[in,out] | shape | circle/sphere shape |
[in] | i,j,k | coordinates of the cell |
[in] | n | value to put where the sample is inside the circle/sphere |
[in] | n_samples | sampling level (see description) |
[in,out] | samples | array of the (2*n_samples+1)^d samples |
logical pure function mod_shape_basic::shape_circle_is_inside | ( | class(t_shape_circle), intent(in) | shape, |
double precision, dimension(3), intent(in) | point ) |
[in] | shape | circle/sphere shape |
[in] | point | any point |
pure subroutine mod_shape_basic::shape_cylinder_get_distance | ( | class(t_shape_cylinder), intent(in) | shape, |
double precision, dimension(3), intent(in) | point, | ||
double precision, intent(out) | distance, | ||
double precision, dimension(3), intent(out) | direction ) |
If the point lies inside the cylinder, the distance is negative and the direction points to the closest point on the cylinder. If the point lies outiside the cylinder, the distance is positive and the direction points in the opposite direction to the closest point on the cylinder.
[in] | shape | cylinder shape |
[in] | point | any point |
[out] | distance | signed closest distance from the point to the cylinder |
[out] | direction | signed direction from the point to the closest point on the cylinder |
subroutine mod_shape_basic::shape_cylinder_get_samples_inside | ( | class(t_shape_cylinder), intent(inout) | shape, |
integer, intent(in) | i, | ||
integer, intent(in) | j, | ||
integer, intent(in) | k, | ||
integer, intent(in) | n, | ||
integer, intent(in) | n_samples, | ||
integer, dimension(:,:,:), intent(inout) | samples ) |
Sample a cell of coordinates (i
,j
,k
) with (2*n_samples+1)^d samples, where d denotes the dimension of the cell. Return a integer array samples
containing the value n
where the sample is inside the shape.
n_samples
is called the sampling level and can take its value in range [0,∞].
Example of sampling for various sampling level:
!! n_samples = 0 n_samples = 1 n_samples = 2 !! ┏━━━━━━━┓ ×━━━×━━━× ×━×━×━×━× !! ┃ ┃ ┃ ┃ × × × × × !! ┃ × ┃ × × × × × × × × ... !! ┃ ┃ ┃ ┃ × × × × × !! ┗━━━━━━━┛ ×━━━×━━━× ×━×━×━×━× !!
[in,out] | shape | cylinder shape |
[in] | i,j,k | coordinates of the cell |
[in] | n | value to put where the sample is inside the cylinder |
[in] | n_samples | sampling level (see description) |
[in,out] | samples | array of the (2*n_samples+1)^d samples |
logical pure function mod_shape_basic::shape_cylinder_is_inside | ( | class(t_shape_cylinder), intent(in) | shape, |
double precision, dimension(3), intent(in) | point ) |
[in] | shape | cylinder shape |
[in] | point | any point |
pure subroutine mod_shape_basic::shape_halfspace_get_distance | ( | class(t_shape_halfspace), intent(in) | shape, |
double precision, dimension(3), intent(in) | point, | ||
double precision, intent(out) | distance, | ||
double precision, dimension(3), intent(out) | direction ) |
If the point lies inside the half-space, the distance is negative and the direction points to the closest point on the half-space. If the point lies outiside the half-space, the distance is positive and the direction points in the opposite direction to the closest point on the half-space.
[in] | shape | half-space shape |
[in] | point | any point |
[out] | distance | signed closest distance from the point to the half-space |
[out] | direction | signed direction from the point to the closest point on the half-space |
subroutine mod_shape_basic::shape_halfspace_get_samples_inside | ( | class(t_shape_halfspace), intent(inout) | shape, |
integer, intent(in) | i, | ||
integer, intent(in) | j, | ||
integer, intent(in) | k, | ||
integer, intent(in) | n, | ||
integer, intent(in) | n_samples, | ||
integer, dimension(:,:,:), intent(inout) | samples ) |
Sample a cell of coordinates (i
,j
,k
) with (2*n_samples+1)^d samples, where d denotes the dimension of the cell. Return a integer array samples
containing the value n
where the sample is inside the shape.
n_samples
is called the sampling level and can take its value in range [0,∞].
Example of sampling for various sampling level:
!! n_samples = 0 n_samples = 1 n_samples = 2 !! ┏━━━━━━━┓ ×━━━×━━━× ×━×━×━×━× !! ┃ ┃ ┃ ┃ × × × × × !! ┃ × ┃ × × × × × × × × ... !! ┃ ┃ ┃ ┃ × × × × × !! ┗━━━━━━━┛ ×━━━×━━━× ×━×━×━×━× !!
[in,out] | shape | half-space shape |
[in] | i,j,k | coordinates of the cell |
[in] | n | value to put where the sample is inside the half-space |
[in] | n_samples | sampling level (see description) |
[in,out] | samples | array of the (2*n_samples+1)^d samples |
logical pure function mod_shape_basic::shape_halfspace_is_inside | ( | class(t_shape_halfspace), intent(in) | shape, |
double precision, dimension(3), intent(in) | point ) |
[in] | shape | half-space shape |
[in] | point | any point |
pure subroutine mod_shape_basic::shape_rectangle_get_distance | ( | class(t_shape_rectangle), intent(in) | shape, |
double precision, dimension(3), intent(in) | point, | ||
double precision, intent(out) | distance, | ||
double precision, dimension(3), intent(out) | direction ) |
If the point lies inside the rectangle/rectangular cuboid, the distance is negative and the direction points to the closest point on the rectangle/rectangular cuboid. If the point lies outside the rectangle/rectangular cuboid, the distance is positive and the direction points in the opposite direction to the closest point on the rectangle/rectangular cuboid.
[in] | shape | rectangle/rectangular cuboid shape |
[in] | point | any point |
[out] | distance | signed closest distance from the point to the rectangle/rectangular cuboid |
[out] | direction | signed direction from the point to the closest point on the rectangle/rectangular cuboid |
subroutine mod_shape_basic::shape_rectangle_get_samples_inside | ( | class(t_shape_rectangle), intent(inout) | shape, |
integer, intent(in) | i, | ||
integer, intent(in) | j, | ||
integer, intent(in) | k, | ||
integer, intent(in) | n, | ||
integer, intent(in) | n_samples, | ||
integer, dimension(:,:,:), intent(inout) | samples ) |
Sample a cell of coordinates (i
,j
,k
) with (2*n_samples+1)^d samples, where d denotes the dimension of the cell. Return a integer array samples
containing the value n
where the sample is inside the shape.
n_samples
is called the sampling level and can take its value in range [0,∞].
Example of sampling for various sampling level:
!! n_samples = 0 n_samples = 1 n_samples = 2 !! ┏━━━━━━━┓ ×━━━×━━━× ×━×━×━×━× !! ┃ ┃ ┃ ┃ × × × × × !! ┃ × ┃ × × × × × × × × ... !! ┃ ┃ ┃ ┃ × × × × × !! ┗━━━━━━━┛ ×━━━×━━━× ×━×━×━×━× !!
[in,out] | shape | rectangle/rectangular cuboid shape |
[in] | i,j,k | coordinates of the cell |
[in] | n | value to put where the sample is inside the rectangle/rectangular cuboid |
[in] | n_samples | sampling level (see description) |
[in,out] | samples | array of the (2*n_samples+1)^d samples |
logical pure function mod_shape_basic::shape_rectangle_is_inside | ( | class(t_shape_rectangle), intent(in) | shape, |
double precision, dimension(3), intent(in) | point ) |
[in] | shape | rectangle/rectangular cuboid shape |
[in] | point | any point |
pure subroutine mod_shape_basic::shape_torus_get_distance | ( | class(t_shape_torus), intent(in) | shape, |
double precision, dimension(3), intent(in) | point, | ||
double precision, intent(out) | distance, | ||
double precision, dimension(3), intent(out) | direction ) |
If the point lies inside the torus, the distance is negative and the direction points to the closest point on the torus. If the point lies outiside the torus, the distance is positive and the direction points in the opposite direction to the closest point on the torus.
[in] | shape | torus shape |
[in] | point | any point |
[out] | distance | signed closest distance from the point to the torus |
[out] | direction | signed direction from the point to the closest point on the torus |
subroutine mod_shape_basic::shape_torus_get_samples_inside | ( | class(t_shape_torus), intent(inout) | shape, |
integer, intent(in) | i, | ||
integer, intent(in) | j, | ||
integer, intent(in) | k, | ||
integer, intent(in) | n, | ||
integer, intent(in) | n_samples, | ||
integer, dimension(:,:,:), intent(inout) | samples ) |
Sample a cell of coordinates (i
,j
,k
) with (2*n_samples+1)^d samples, where d denotes the dimension of the cell. Return a integer array samples
containing the value n
where the sample is inside the shape.
n_samples
is called the sampling level and can take its value in range [0,∞].
Example of sampling for various sampling level:
!! n_samples = 0 n_samples = 1 n_samples = 2 !! ┏━━━━━━━┓ ×━━━×━━━× ×━×━×━×━× !! ┃ ┃ ┃ ┃ × × × × × !! ┃ × ┃ × × × × × × × × ... !! ┃ ┃ ┃ ┃ × × × × × !! ┗━━━━━━━┛ ×━━━×━━━× ×━×━×━×━× !!
[in,out] | shape | torus shape |
[in] | i,j,k | coordinates of the cell |
[in] | n | value to put where the sample is inside the torus |
[in] | n_samples | sampling level (see description) |
[in,out] | samples | array of the (2*n_samples+1)^d samples |
logical pure function mod_shape_basic::shape_torus_is_inside | ( | class(t_shape_torus), intent(in) | shape, |
double precision, dimension(3), intent(in) | point ) |
[in] | shape | torus shape |
[in] | point | any point |
pure subroutine mod_shape_basic::shape_universe_get_distance | ( | class(t_shape_universe), intent(in) | shape, |
double precision, dimension(3), intent(in) | point, | ||
double precision, intent(out) | distance, | ||
double precision, dimension(3), intent(out) | direction ) |
If the point lies inside the universe, the distance is negative and the direction points to the closest point on the universe. If the point lies outside the universe (Wait, what?), the distance is positive and the direction points in the opposite direction to the closest point on the universe.
[in] | shape | universe shape |
[in] | point | any point |
[out] | distance | signed closest distance from the point to the universe |
[out] | direction | signed direction from the point to the closest point on the universe |
subroutine mod_shape_basic::shape_universe_get_samples_inside | ( | class(t_shape_universe), intent(inout) | shape, |
integer, intent(in) | i, | ||
integer, intent(in) | j, | ||
integer, intent(in) | k, | ||
integer, intent(in) | n, | ||
integer, intent(in) | n_samples, | ||
integer, dimension(:,:,:), intent(inout) | samples ) |
Sample a cell of coordinates (i
,j
,k
) with (2*n_samples+1)^d samples, where d denotes the dimension of the cell. Return a integer array samples
containing the value n
where the sample is inside the shape.
n_samples
is called the sampling level and can take its value in range [0,∞].
Example of sampling for various sampling level:
!! n_samples = 0 n_samples = 1 n_samples = 2 !! ┏━━━━━━━┓ ×━━━×━━━× ×━×━×━×━× !! ┃ ┃ ┃ ┃ × × × × × !! ┃ × ┃ × × × × × × × × ... !! ┃ ┃ ┃ ┃ × × × × × !! ┗━━━━━━━┛ ×━━━×━━━× ×━×━×━×━× !!
[in,out] | shape | universe shape |
[in] | i,j,k | coordinates of the cell |
[in] | n | value to put where the sample is inside the universe |
[in] | n_samples | sampling level (see description) |
[in,out] | samples | array of the (2*n_samples+1)^d samples |
logical pure function mod_shape_basic::shape_universe_is_inside | ( | class(t_shape_universe), intent(in) | shape, |
double precision, dimension(3), intent(in) | point ) |
[in] | shape | universe shape |
[in] | point | any point |