OFF file grid object definition and implementation.
The file grid is an unformatted, stream file containing the nodes coordinates of the whole grid. It skeleton is the following
# header blocks_number # for each block id, level, gc, ni, nj, nk # core # for each block (for all nodes of block) node%vertex%x, node%vertex%y, node%vertex%z
file_grid_object provides standard API for loading and saving this file.
File grid object class.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(error_object), | public | :: | error | Errors handler. |
|||
character(len=:), | public, | allocatable | :: | file_name | File name. |
||
integer(kind=I4P), | public | :: | file_unit | = | 0 | File unit. |
|
logical, | public | :: | is_connected | = | .false. | Sentinel to check if file is connected. |
|
logical, | public | :: | is_initialized | = | .false. | Sentinel to check if file is initialized. |
generic, public :: assignment(=) => file_assign_file | Overload |
procedure, public, pass(self) :: close | Close file. |
procedure, public, pass(self) :: description | Return a pretty-formatted description of the file. |
procedure, public, pass(self) :: destroy | Destroy file. |
procedure, public, pass(lhs) :: file_assign_file | Operator |
procedure, public, pass(self) :: initialize | Initialize file. |
procedure, public, pass(self) :: load_file_name_from_file | Load file name from file. |
procedure, public, pass(self) :: load_grid_dimensions_from_file | Load the grid dimensions of all blocks from file. |
procedure, public, pass(self) :: load_nodes_from_file | Load nodes coordinates from file. |
procedure, public, pass(self) :: open | Open file. |
procedure, public, pass(self) :: save_file_name_into_file | Save file name into file. |
procedure, public, pass(self) :: save_grid_dimensions_into_file | Save the grid dimensions of all blocks into file. |
procedure, public, pass(self) :: save_nodes_into_file | Save nodes coordinates into file. |
Load the grid dimensions of all blocks from file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_grid_object), | intent(inout) | :: | self | File object. |
||
type(grid_dimensions_object), | intent(inout) | :: | grid_dimensions | Grid dimensions off all blocks into file. |
||
character(len=*), | intent(in), | optional | :: | file_name | File name. |
Load nodes coordinates from file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_grid_object), | intent(inout) | :: | self | File object. |
||
type(grid_dimensions_object), | intent(in) | :: | grid_dimensions | Grid dimensions off all blocks into file. |
||
type(block_object), | intent(inout) | :: | blocks(1:) | Blocks storage. |
||
character(len=*), | intent(in), | optional | :: | file_name | File name. |
Load the grid dimensions of all blocks into file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_grid_object), | intent(inout) | :: | self | File object. |
||
type(grid_dimensions_object), | intent(in) | :: | grid_dimensions | Grid dimensions off all blocks into file. |
Save nodes coordinates into file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file_grid_object), | intent(inout) | :: | self | File object. |
||
type(grid_dimensions_object), | intent(in) | :: | grid_dimensions | Grid dimensions off all blocks into file. |
||
type(block_object), | intent(inout) | :: | blocks(1:) | Blocks storage. |