Polygonal shape (2D only)  
More...
|  | 
| subroutine | mod_shape_polygon::initialize_shape_polygon (shape) | 
|  | Initialize the polygon shape. 
 | 
|  | 
| subroutine | mod_shape_polygon::copy_shape_polygon (shape, copy) | 
|  | Copy the polygon. 
 | 
|  | 
| logical pure function | mod_shape_polygon::shape_polygon_is_inside (shape, point) | 
|  | Check if a point lies inside the polygon. 
 | 
|  | 
| subroutine | mod_shape_polygon::shape_polygon_get_samples_inside (shape, i, j, k, n, n_samples, samples) | 
|  | Check if a given number of point lies in a polygon. 
 | 
|  | 
| pure subroutine | mod_shape_polygon::shape_polygon_get_distance (shape, point, distance, direction) | 
|  | Compute the signed distance and the signed direction from a point to the polygon. 
 | 
|  | 
Polygonal shape (2D only) 
◆ copy_shape_polygon()
  
  | 
        
          | subroutine mod_shape_polygon::copy_shape_polygon | ( | class(t_shape_polygon), intent(in) | shape, |  
          |  |  | class(t_shape), allocatable | copy ) |  | private | 
 
Copy the polygon. 
- Parameters
- 
  
    | [in] | shape | polygon shape |  | [out] | copy | copied polygon shape |  
 
 
 
◆ initialize_shape_polygon()
      
        
          | subroutine mod_shape_polygon::initialize_shape_polygon | ( | class(t_shape_polygon), intent(inout) | shape | ) |  | 
      
 
Initialize the polygon shape. 
- Parameters
- 
  
    | [in,out] | shape | polygon shape |  
 
 
 
◆ shape_polygon_get_distance()
  
  | 
        
          | pure subroutine mod_shape_polygon::shape_polygon_get_distance | ( | class(t_shape_polygon), intent(in) | shape, |  
          |  |  | double precision, dimension(3), intent(in) | point, |  
          |  |  | double precision, intent(out) | distance, |  
          |  |  | double precision, dimension(3), intent(out) | direction ) |  | private | 
 
Compute the signed distance and the signed direction from a point to the polygon. 
If the point lies inside the polygon, the distance is negative and the direction points to the closest point on the polygon. If the point lies outiside the polygon, the distance is positive and the direction points in the opposite direction to the closest point on the polygon.
- Parameters
- 
  
    | [in] | shape | polygon shape |  | [in] | point | any point |  | [out] | distance | signed closest distance from the point to the polygon |  | [out] | direction | signed direction from the point to the closest point on the polygon |  
 
 
 
◆ shape_polygon_get_samples_inside()
  
  | 
        
          | subroutine mod_shape_polygon::shape_polygon_get_samples_inside | ( | class(t_shape_polygon), 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 ) |  | private | 
 
Check if a given number of point lies in a polygon. 
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
  !!      ┏━━━━━━━┓       ×━━━×━━━×       ×━×━×━×━×
  !!      ┃       ┃       ┃       ┃       × × × × ×
  !!      ┃   ×   ┃       ×   ×   ×       × × × × ×    ...
  !!      ┃       ┃       ┃       ┃       × × × × ×
  !!      ┗━━━━━━━┛       ×━━━×━━━×       ×━×━×━×━×
  !! 
- Parameters
- 
  
    | [in,out] | shape | polygon shape |  | [in] | i,j,k | coordinates of the cell |  | [in] | n | value to put where the sample is inside the polygon |  | [in] | n_samples | sampling level (see description) |  | [in,out] | samples | array of the (2*n_sammples+1)^d samples |  
 
 
 
◆ shape_polygon_is_inside()
  
  | 
        
          | logical pure function mod_shape_polygon::shape_polygon_is_inside | ( | class(t_shape_polygon), intent(in) | shape, |  
          |  |  | double precision, dimension(3), intent(in) | point ) |  | private | 
 
Check if a point lies inside the polygon. 
- Parameters
- 
  
    | [in] | shape | polygon shape |  | [in] | point | any point |