GRIDMAN
grid managment library
Functions/Subroutines
grid1.f File Reference

Basic methods of the data-type GRIDMAN_GRID, see gridman.f. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gridman_grid_allocate (GRID, TYPE, NEDGES, NPOINTS, NCELLS, IERR, NEDGEINDEX, NCELLINDEX)
 Allocate GRIDMAN_GRID object. More...
 
subroutine gridman_grid_deallocate (GRID, IERR)
 Deallocate grid object. More...
 
subroutine gridman_grid_check (GRID, RES, IERR)
 Check consistency of the grid data. More...
 
subroutine gridman_grid_unitwrite (GRID, IOUT, IERR)
 Save grid object in a file defined by the unit index. More...
 
subroutine gridman_grid_filewrite (GRID, FNAME, IERR)
 Save grid object in a file defined by the file name. More...
 
subroutine gridman_grid_unitread (GRID, IIN, IERR)
 Read grid object from file defined by unit number. More...
 
subroutine gridman_grid_fileread (GRID, FNAME, IERR)
 Read grid object from file defined by file name. More...
 
subroutine gridman_grid_copy (GRID2, GRID1, IERR)
 Create a copy of the grid object. More...
 
subroutine gridman_grid_compare (GRID1, GRID2, RES, IERR)
 Compare two grid objects. More...
 
subroutine gridman_grid_take (GRID2, GRID1, IERR)
 Take data from one grid object to another. More...
 
subroutine gridman_grid_count (GRID, NCOUNT, IERR)
 Return the number of cells plus the number of edges not belonging to any cell. More...
 
subroutine gridman_grid_metadata_text (GRID, TEXT, NT, IERR)
 Print metadata into text array. More...
 
subroutine gridman_grid_metadata_unit (GRID, IUNIT, IERR)
 Print metadata into unit - shell for GRIDMAN_GRID_METADATA_TEXT. More...
 

Detailed Description

Basic methods of the data-type GRIDMAN_GRID, see gridman.f.

Definition in file grid1.f.

Function/Subroutine Documentation

subroutine gridman_grid_allocate ( type(gridman_grid)  GRID,
integer, intent(in)  TYPE,
integer(gridman_sp), intent(in)  NEDGES,
integer(gridman_sp), intent(in)  NPOINTS,
integer(gridman_sp), intent(in)  NCELLS,
integer, intent(out)  IERR,
integer, intent(in), optional  NEDGEINDEX,
integer, intent(in), optional  NCELLINDEX 
)

Allocate GRIDMAN_GRID object.

WARNING: if GRID exists it will be overwritten!

Parameters
gridResulting grid object
[in]typeGrid type
[in]ncellsNumber of cells
[in]nedgesNumber of edges
[in]npointsNumber of points
[out]ierrError code
[in]nedgeindexNumber of groups of indices for edges

If NEDGEINDEX<=0 then egde indices are not allocated

Parameters
[in]ncellindexNumber of groups of indices for cells

If NEDGEINDEX<=0 then cell indices are not allocated

Definition at line 30 of file grid1.f.

References gridman::gridman_dbg, gridman_grid_deallocate(), gridman::gridman_sp, and gridman::gridman_unit.

Referenced by gridman_addsurf2grid_2d(), gridman_addsurf2grid_3d(), gridman_carre2grid(), gridman_grid2d_cut(), gridman_grid2d_merge(), gridman_grid2d_triang(), gridman_grid_cells(), gridman_grid_combine(), gridman_grid_copy(), gridman_grid_eliminate_cells(), gridman_grid_eliminate_edges(), gridman_grid_points(), gridman_grid_unitread(), gridman_template2grid(), and gridman_tria2grid().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_grid_deallocate ( type(gridman_grid)  GRID,
integer, intent(out)  IERR 
)

Deallocate grid object.

Parameters
gridGrid object to be deallocated
[out]ierrError code

Definition at line 184 of file grid1.f.

References gridman::gridman_dbg, gridman_index_deallocate(), and gridman::gridman_unit.

Referenced by check_polygon(), gridman_addsurf2grid_2d(), gridman_addsurf2grid_3d(), gridman_carre2grid(), gridman_carre_read30_grid(), gridman_carre_readsonnet_grid(), gridman_grid_allocate(), gridman_grid_combine(), gridman_grid_copy(), gridman_grid_eliminate_edges(), gridman_grid_unitread(), gridman_template2grid(), and gridman_tria2grid().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_grid_check ( type(gridman_grid)  GRID,
integer, intent(out)  RES,
integer, intent(out)  IERR 
)

Check consistency of the grid data.

  • RES=0: the grid is correct
  • RES=1: grid is not allocated
  • RES=2: dimensions are incorrect
  • RES=3: wrong array size
  • RES=4: cell index is out of bounds
  • RES=5: duplicate cell index for an edge
  • RES=6: NCELLS and CELLS do not match
  • RES=7: index of point is out of bounds
  • RES=8: incorrect unit scaling factor
  • RES=9: incorrect edge indices
  • RES=10: incorrect cell indices
Parameters
gridGrid object to be checked
[out]resCode of the result
[out]ierrError code

Definition at line 289 of file grid1.f.

References gridman_index_check(), gridman::gridman_sp, and gridman::gridman_unit.

Referenced by gridman_3dgrid2vtk_index(), gridman_addsurf2grid_3d(), gridman_grid2d_check(), gridman_grid2d_triang(), gridman_grid_cells(), gridman_grid_combine(), gridman_grid_compare(), gridman_grid_copy(), gridman_grid_count(), gridman_grid_eliminate_cells(), gridman_grid_eliminate_edges(), gridman_grid_points(), gridman_grid_take(), gridman_grid_unitread(), and gridman_grid_unitwrite().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_grid_unitwrite ( type(gridman_grid)  GRID,
integer, intent(in)  IOUT,
integer, intent(out)  IERR 
)

Save grid object in a file defined by the unit index.

GRIDMAN_GRID_UNITWRITE and GRIDMAN_GRID_FILEWRITE are combined in the interface GRIDMAN_GRID_WRITE

Parameters
gridGrid object to be saved
[in]ioutIndex of the output unit
[out]ierrError code

At the moment only ASCII format is supported

Todo:
HDF5 format has shell be added in the future

Definition at line 541 of file grid1.f.

References gridman_grid_check(), gridman_index_write(), gridman::gridman_sp, and gridman::gridman_unit.

Referenced by gridman_grid_filewrite().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_grid_filewrite ( type(gridman_grid)  GRID,
character(*)  FNAME,
integer, intent(out)  IERR 
)

Save grid object in a file defined by the file name.

This subroutine is a shell for GRIDMAN_GRID_UNITWRITE

GRIDMAN_GRID_UNITWRITE and GRIDMAN_GRID_FILEWRITE are combined in the interface GRIDMAN_GRID_WRITE

Parameters
gridGrid object to be saved
fnameName of the output file
[out]ierrError code

Definition at line 705 of file grid1.f.

References gridman::gridman_dbg, gridman_grid_unitwrite(), and gridman::gridman_unit.

Here is the call graph for this function:

subroutine gridman_grid_unitread ( type(gridman_grid)  GRID,
integer, intent(in)  IIN,
integer, intent(out)  IERR 
)

Read grid object from file defined by unit number.

WARNING: Object which already exists will be overwritten!

GRIDMAN_GRID_UNITREAD and GRIDMAN_GRID_FILEREAD are Combined in the interafce GRIDMAN_GRID_READ

Parameters
gridResulting grid object
[in]iinIndex of the input unit
[out]ierrError code

At the moment only ASCII format is supported

Todo:
HDF5 format has shell be added in the future

Definition at line 767 of file grid1.f.

References gridman_grid_allocate(), gridman_grid_check(), gridman_grid_deallocate(), gridman_index_read(), gridman::gridman_sp, and gridman::gridman_unit.

Referenced by gridman_grid_fileread().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_grid_fileread ( type(gridman_grid)  GRID,
character(*), intent(in)  FNAME,
integer, intent(out)  IERR 
)

Read grid object from file defined by file name.

This subroutine is a shell for GRIDMAN_GRID_UNITREAD

WARNING: Object which already exists will be overwritten!

GRIDMAN_GRID_UNITREAD and GRIDMAN_GRID_FILEREAD are Combined in the interafce GRIDMAN_GRID_READ

Parameters
gridResulting grid object
[in]fnameName of the output file
[out]ierrError code

Definition at line 931 of file grid1.f.

References gridman::gridman_dbg, gridman_grid_unitread(), and gridman::gridman_unit.

Here is the call graph for this function:

subroutine gridman_grid_copy ( type(gridman_grid)  GRID2,
type(gridman_grid)  GRID1,
integer, intent(out)  IERR 
)

Create a copy of the grid object.

WARNING: If GRID2 already exists it will be overwritten!

Parameters
grid1Original object
grid2Copy to be created
[out]ierrError code

Definition at line 981 of file grid1.f.

References gridman_grid_allocate(), gridman_grid_check(), gridman_grid_deallocate(), gridman_index_copy(), and gridman::gridman_unit.

Referenced by gridman_carre2grid().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_grid_compare ( type(gridman_grid)  GRID1,
type(gridman_grid)  GRID2,
integer, intent(out)  RES,
integer, intent(out)  IERR 
)

Compare two grid objects.

  • RES=0: two grids are equivalent
  • RES=1: different grid types
  • RES=2: different dimensions
  • RES=3: different topology (CELLs)
  • RES=4: different topology (POINTs)
  • RES=5: different units
  • RES=6: different coordinates
  • RES=7: different description strings
  • RES=8: different edge indices
  • RES=9: different cell indices
Parameters
grid1First object to compare
grid2Second object to compare
[out]resCode of the result
[out]ierrError code

Definition at line 1068 of file grid1.f.

References gridman::gridman_dp, gridman_grid_check(), gridman_index_compare(), gridman::gridman_sp, gridman::gridman_tol, and gridman::gridman_unit.

Here is the call graph for this function:

subroutine gridman_grid_take ( type(gridman_grid)  GRID2,
type(gridman_grid)  GRID1,
integer, intent(out)  IERR 
)

Take data from one grid object to another.

Opposite to GRIDMAN_GRID_COPY, GRID2 is not overwritten and has to exist. Index tables of GRID2 are not modified

WARNING: indices are not taken

Parameters
grid2Grid object to which the copy is taken
grid1Original grid object

Definition at line 1283 of file grid1.f.

References gridman_grid_check(), gridman::gridman_sp, and gridman::gridman_unit.

Referenced by gridman_grid2d_triang().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_grid_count ( type(gridman_grid)  GRID,
integer(gridman_sp), intent(out)  NCOUNT,
integer, intent(out)  IERR 
)

Return the number of cells plus the number of edges not belonging to any cell.

Parameters
gridGrid object where cells and surfaces are counted
[out]ncountReturned number of cells and "free" edges
[out]ierrError code

Definition at line 1360 of file grid1.f.

References gridman_grid_check(), gridman::gridman_sp, and gridman::gridman_unit.

Referenced by gridman_2dgrid2vtk_index(), and gridman_vtk_grid2d_write().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gridman_grid_metadata_text ( type(gridman_grid)  GRID,
character(gridman_length), dimension(:), allocatable  TEXT,
integer, intent(out)  NT,
integer, intent(out)  IERR 
)

Print metadata into text array.

Called from the interface GRIDMAN_GRID_METADATA

Parameters
gridGrid whose metadata has to be printed
textArray of strings with printed metadata, TEXT(NT)
[out]ntLength of array TEXT
[out]ierrError code

Definition at line 1407 of file grid1.f.

References gridman::gridman_length.

Referenced by gridman_grid_metadata_unit().

Here is the caller graph for this function:

subroutine gridman_grid_metadata_unit ( type(gridman_grid)  GRID,
integer, intent(in)  IUNIT,
integer, intent(out)  IERR 
)

Print metadata into unit - shell for GRIDMAN_GRID_METADATA_TEXT.

Called from the interface GRIDMAN_GRID_METADATA

Parameters
gridGrid whose metadata has to be printed
[in]iunitNumber of the output unit
[out]ierrError code

Definition at line 1510 of file grid1.f.

References gridman_grid_metadata_text(), and gridman::gridman_length.

Here is the call graph for this function: