GRIDMAN
grid managment library
|
Basic subroutines, calculation of geometrical properties. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | gridman_grid2d_check (GRID, RES, IERR) |
Check correctness of the 2D grid object. More... | |
subroutine | gridman_grid2d_chains (GRID, CHAINS, IERR) |
Find closed chain of points which form each cell. More... | |
subroutine | gridman_grid2d_lengths (GRID, LEDGES, IERR) |
Calculate lengths of the cell edges. More... | |
subroutine | gridman_grid2d_crossect (GRID, SCELLS, IERR) |
Calculate cross section area of the cells. More... | |
subroutine | gridman_grid2d_center (GRID, XCN, IERR) |
Calculate coordinates of the cell centers. More... | |
subroutine | gridman_grid2d_norm (GRID, VN, IERR) |
Calculate unit normal vectors to grid edges. More... | |
subroutine | gridman_grid2d_isconvex (GRID, ISCONVEX, IERR) |
Find if cells are convex polygons or not. More... | |
subroutine | gridman_grid2d_cylareas (GRID, SEDGES, IERR, ANGLE) |
Calculate cylindrical areas of the cell edges. More... | |
subroutine | gridman_grid2d_cylvolumes (GRID, VCELLS, IERR, ANGLE) |
Calculate cylindrical cell volumes. More... | |
Basic subroutines, calculation of geometrical properties.
Definition in file grid2d.f.
subroutine gridman_grid2d_check | ( | type(gridman_grid) | GRID, |
integer, intent(out) | RES, | ||
integer, intent(out) | IERR | ||
) |
Check correctness of the 2D grid object.
grid | Grid object to be checked | |
[out] | res | Code of the result |
[out] | ierr | Error code |
Definition at line 37 of file grid2d.f.
References gridman::gridman_dp, gridman_grid_cells(), gridman_grid_check(), gridman_grid_points(), gridman_indlist_deallocate(), gridman_intersect2d(), gridman::gridman_sp, and gridman::gridman_unit.
Referenced by gridman_2dgrid2vtk(), gridman_2dgrid2vtk_index(), gridman_addsurf2grid_2d(), gridman_carre2grid(), gridman_grid2d_center(), gridman_grid2d_crossect(), gridman_grid2d_cut(), gridman_grid2d_cylareas(), gridman_grid2d_cylvolumes(), gridman_grid2d_isconvex(), gridman_grid2d_lengths(), gridman_grid2d_merge(), gridman_grid2d_norm(), gridman_grid2d_triang(), gridman_grid2template(), gridman_grid2tria(), gridman_template2grid(), and gridman_tria2grid().
subroutine gridman_grid2d_chains | ( | type(gridman_grid) | GRID, |
type(gridman_indlist) | CHAINS, | ||
integer, intent(out) | IERR | ||
) |
Find closed chain of points which form each cell.
In each element of the list first and last index points to the same point. IERR=450 is returned of no closed chain is found. WARNING: if the object CHAINS already exist it will be overwritten!
grid | Grid object for which the list of chains is generated | |
chains | Resulting list of chains | |
[out] | ierr | Error code |
Definition at line 266 of file grid2d.f.
References gridman_grid_cells(), gridman_grid_points(), gridman_indlist_allocate(), gridman_indlist_deallocate(), gridman::gridman_sp, and gridman::gridman_unit.
Referenced by gridman_2dgrid2vtk(), gridman_grid2d_center(), gridman_grid2d_crossect(), gridman_grid2d_cylvolumes(), gridman_grid2d_isconvex(), gridman_grid2d_norm(), gridman_grid2d_polygon_trajectory(), gridman_grid2d_triang(), and gridman_grid2tria().
subroutine gridman_grid2d_lengths | ( | type(gridman_grid) | GRID, |
real(gridman_dp), dimension(grid%nedges) | LEDGES, | ||
integer, intent(out) | IERR | ||
) |
Calculate lengths of the cell edges.
grid | Grid object for which the areas are calculated | |
ledges | Resulting array of lengths (has to be allocated) | |
[out] | ierr | Error code |
Definition at line 425 of file grid2d.f.
References gridman::gridman_dp, gridman_grid2d_check(), gridman::gridman_sp, and gridman::gridman_unit.
subroutine gridman_grid2d_crossect | ( | type(gridman_grid) | GRID, |
real(gridman_dp), dimension(grid%ncells) | SCELLS, | ||
integer, intent(out) | IERR | ||
) |
Calculate cross section area of the cells.
grid | Grid for which the areas are calculated | |
scells | Resulting arrray with cell areas (has to be allocated) | |
[out] | ierr | Error code |
Definition at line 483 of file grid2d.f.
References gridman::gridman_dp, gridman_grid2d_chains(), gridman_grid2d_check(), gridman_indlist_deallocate(), gridman::gridman_sp, and gridman::gridman_unit.
subroutine gridman_grid2d_center | ( | type(gridman_grid) | GRID, |
real(gridman_dp), dimension(2,grid%ncells) | XCN, | ||
integer, intent(out) | IERR | ||
) |
Calculate coordinates of the cell centers.
Coordinates of the center of mass of planar polygons
grid | Grid object for which the coordinates are calculated | |
xcn | Resulting X (1st index=1) and Y (1st index=2) coordinates of the centers. The array must be allocated | |
[out] | ierr | Error code |
Definition at line 559 of file grid2d.f.
References gridman::gridman_dp, gridman_grid2d_chains(), gridman_grid2d_check(), gridman_indlist_deallocate(), gridman::gridman_sp, and gridman::gridman_unit.
subroutine gridman_grid2d_norm | ( | type(gridman_grid) | GRID, |
real(gridman_dp), dimension(2,grid%nedges) | VN, | ||
integer, intent(out) | IERR | ||
) |
Calculate unit normal vectors to grid edges.
grid | Grid for which the normals are calculated | |
vn | Resulting array with X (1st index=1) and Y (1st index=2) coordinates of the normals (array has to be allocated) | |
[out] | ierr | Error code |
Convention about the direction of normal vectors
The normal vectors, thus, always point outwards from the grid
Definition at line 692 of file grid2d.f.
References gridman::gridman_dp, gridman_grid2d_chains(), gridman_grid2d_check(), gridman_indlist_deallocate(), gridman::gridman_sp, and gridman::gridman_unit.
subroutine gridman_grid2d_isconvex | ( | type(gridman_grid) | GRID, |
logical, dimension(grid%ncells) | ISCONVEX, | ||
integer, intent(out) | IERR | ||
) |
Find if cells are convex polygons or not.
grid | Grid which will be processed | |
isconvex | Resulting array where .TRUE. stand for convex polygons and .FALS. otherwise (has to be allocated) | |
[out] | ierr | Erorr code |
The algorithm assumes closed polygons without self intersections. Such polygon is convex if all angles between two neighbour edges < 180 degrees
Definition at line 830 of file grid2d.f.
References gridman::gridman_dp, gridman_grid2d_chains(), gridman_grid2d_check(), gridman_indlist_deallocate(), gridman::gridman_sp, and gridman::gridman_unit.
subroutine gridman_grid2d_cylareas | ( | type(gridman_grid) | GRID, |
real(gridman_dp), dimension(grid%nedges) | SEDGES, | ||
integer, intent(out) | IERR, | ||
real(gridman_dp), optional | ANGLE | ||
) |
Calculate cylindrical areas of the cell edges.
Calculate areas of the cell edges asumming that the grid defines cylindrical coordinates, with X(1) being the radius -
grid | Grid object for which the areas are calculated | |
sedges | Resulting array of surface areas (has to be allocated) | |
[out] | ierr | Error code |
angle | Azimuthal angle occupied by the edges, in radian, default 2*pi |
Definition at line 944 of file grid2d.f.
References gridman::gridman_dp, gridman_grid2d_check(), gridman::gridman_sp, and gridman::gridman_unit.
subroutine gridman_grid2d_cylvolumes | ( | type(gridman_grid) | GRID, |
real(gridman_dp), dimension(grid%ncells) | VCELLS, | ||
integer, intent(out) | IERR, | ||
real(gridman_dp), optional | ANGLE | ||
) |
Calculate cylindrical cell volumes.
Calculate volumes of the cells asumming that the grid defines cylindrical coordinates, with X(1) being the radius -
grid | Grid object for which the volumes are calculated | |
vcells | Resulting array of cell volumes (has to be allocated) | |
[out] | ierr | Error code |
angle | Azimuthal angle occupied by the cells, in radian, default 2*pi |
Definition at line 1018 of file grid2d.f.
References gridman::gridman_dp, gridman_grid2d_chains(), gridman_grid2d_check(), gridman_indlist_deallocate(), gridman::gridman_sp, and gridman::gridman_unit.