module kinds_modTypes:
public type sectionVariables:
integer, private, parameter :: SECTION_RECT_MAX = 4Subroutines and functions:
public subroutine section_reset (sect, maxrect) public subroutine section_add (sect, rect) public logical function section_intersect (sect, rect, opt_offset) public subroutine section_volume (sect, volume)
The section is made up of a very limited number of clusters each consisting of a 3D rectangle (cuboid).
Rectangles can be added to a section, the algorithm tries to reduce the total volume of all clusters.
Author: Matthias Lieber
public type section integer (kind=i_k), dimension (3,2,SECTION_RECT_MAX) :: rect integer (kind=i_k) :: nrect = 0 integer (kind=i_k), dimension (3) :: maxext end type sectionComponents:
rect | a limited number of 3D cuboids |
nrect | number of used cuboids |
public subroutine section_reset (sect, maxrect) type (section), intent(inout) :: sect integer (kind=i_k), intent(in), dimension (3,2) :: maxrect end subroutine section_resetParameters:
sect | the section |
maxrect | max allowed size |
Parameter maxrect will be used in section_add to estimate if it is useful to add a new cuboid or not.
public subroutine section_add (sect, rect) type (section), intent(inout) :: sect integer (kind=i_k), intent(in), dimension (3,2) :: rect end subroutine section_addParameters:
sect | the section |
rect | 3D cuboid to add |
If necessary it will create a new cuboid in sect to keep overall volume as small as possible.
public logical function section_intersect (sect, rect, opt_offset) type (section), intent(inout) :: sect integer (kind=i_k), intent(in), dimension (3,2) :: rect integer (kind=i_k), optional, intent(in), dimension (3) :: opt_offset end function section_intersectParameters:
sect | the section |
rect | 3D cuboid to intersect |
opt_offset | optional offset for upper bound of sect |
Optionally, an offset used for the upper bound of sect can be given.
public subroutine section_volume (sect, volume) type (section), intent(inout) :: sect integer (kind=i_k), intent(out) :: volume end subroutine section_volumeParameters:
sect | the section |
volume | volume |