block_object Derived Type

type, public :: block_object

type~~block_object~~InheritsGraph type~block_object block_object type~block_signature_object block_signature_object type~block_signature_object->type~block_object signature type~cell_object cell_object type~cell_object->type~block_object cell type~face_object face_object type~face_object->type~block_object face_i, face_j, face_k type~node_object node_object type~node_object->type~block_object node type~error_object error_object type~error_object->type~block_object error vector vector vector->type~block_signature_object emax, emin vector->type~cell_object center vector->type~face_object normal vector->type~node_object vertex
Help


Block object class.

Inherited By

type~~block_object~~InheritedByGraph type~block_object block_object type~simulation_object simulation_object type~block_object->type~simulation_object blocks
Help

Source Code


Components

TypeVisibility AttributesNameInitial
type(cell_object), public, allocatable:: cell(:,:,:)

Cell.

type(error_object), public :: error

Errors handler.

type(face_object), public, allocatable:: face_i(:,:,:)

Faces along I direction.

type(face_object), public, allocatable:: face_j(:,:,:)

Faces along I direction.

type(face_object), public, allocatable:: face_k(:,:,:)

Faces along I direction.

type(node_object), public, allocatable:: node(:,:,:)

Cell.

type(block_signature_object), public :: signature

Signature, namely id, level, dimensions, etc…


Type-Bound Procedures

generic, public :: assignment(=) => block_assign_block

Overload =.

  • private pure subroutine block_assign_block(lhs, rhs)

    Operator =.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: lhs

    Left hand side.

    type(block_object), intent(in) :: rhs

    Right hand side.

procedure, private, pass(lhs) :: block_assign_block

Operator =.

  • private pure subroutine block_assign_block(lhs, rhs)

    Operator =.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: lhs

    Left hand side.

    type(block_object), intent(in) :: rhs

    Right hand side.

procedure, public, pass(self) :: cells_number

Return the number of cells.

  • private elemental function cells_number(self, with_ghosts) result(cells_number_)

    Return the number of cells.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(in) :: self

    Block.

    logical, intent(in), optional :: with_ghosts

    Take into account ghost cells.

    Return Value integer(kind=I4P)

    Number of cells.

procedure, private, pass(self) :: compute_extents

Compute block extents.

  • private elemental subroutine compute_extents(self)

    Compute block extents.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

procedure, private, pass(self) :: compute_faces_metrics

Compute block faces metrics.

  • private elemental subroutine compute_faces_metrics(self)

    Compute block faces metrics.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

procedure, private, pass(self) :: compute_metrics

Compute block metrics.

  • private subroutine compute_metrics(self)

    Compute block metrics.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

procedure, public, pass(self) :: compute_space_operator

Compute space operator.

procedure, private, pass(self) :: compute_volumes

Compute block volumes.

  • private elemental subroutine compute_volumes(self)

    Compute block volumes.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

procedure, private, pass(self) :: correct_metrics

Correct block metrics.

  • private subroutine correct_metrics(self)

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Correct the metrics.

procedure, public, pass(self) :: create_linspace

Create a Cartesian block with linearly spaced nodes.

  • private subroutine create_linspace(self, emin, emax)

    Create a Cartesian block with linearly spaced nodes.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

    type(vector), intent(in), optional :: emin

    Coordinates of minimum abscissa of the block.

    type(vector), intent(in), optional :: emax

    Coordinates of maximum abscissa of the block.

procedure, public, pass(self) :: destroy

Destroy block.

  • private elemental subroutine destroy(self)

    Destroy block.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

procedure, public, pass(self) :: initialize

Initialize block.

  • private subroutine initialize(self, signature, id, level, gc, ni, nj, nk, emin, emax, is_cartesian, is_null_x, is_null_y, is_null_z)

    Initialize block.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

    type(block_signature_object), intent(in), optional :: signature

    Signature, namely id, level, dimensions, etc…

    integer(kind=I8P), intent(in), optional :: id

    Unique (Morton) identification code.

    integer(kind=I4P), intent(in), optional :: level

    Grid refinement level.

    integer(kind=I4P), intent(in), optional :: gc(1:)

    Number of ghost cells along each frame.

    integer(kind=I4P), intent(in), optional :: ni

    Number of cells in I direction.

    integer(kind=I4P), intent(in), optional :: nj

    Number of cells in J direction.

    integer(kind=I4P), intent(in), optional :: nk

    Number of cells in K direction.

    type(vector), intent(in), optional :: emin

    Coordinates of minimum abscissa of the block.

    type(vector), intent(in), optional :: emax

    Coordinates of maximum abscissa of the block.

    logical, intent(in), optional :: is_cartesian

    Flag for checking if the block is Cartesian.

    logical, intent(in), optional :: is_null_x

    Nullify X direction (2D yz, 1D y or z domain).

    logical, intent(in), optional :: is_null_y

    Nullify Y direction (2D xy, 1D x or y domain).

    logical, intent(in), optional :: is_null_z

    Nullify Z direction (2D xy, 1D x or y domain).

procedure, public, pass(self) :: interpolate_at_nodes

Interpolate cell-centered variable at nodes.

  • private pure subroutine interpolate_at_nodes(self, var_cell, var_node)

    Interpolate cell-centered variable at nodes.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(in) :: self

    Block.

    real(kind=R8P), intent(in) :: var_cell(1-self%signature%gc(1):,1-self%signature%gc(3):,1-self%signature%gc(5):)

    Cell-centered variable.

    real(kind=R8P), intent(out) :: var_node(0-self%signature%gc(1):,0-self%signature%gc(3):,0-self%signature%gc(5):)

    Node-centered variable.

procedure, public, pass(self) :: load_nodes_from_file

Load nodes from file.

  • private subroutine load_nodes_from_file(self, file_unit, pos)

    Load nodes from file.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

    integer(kind=I4P), intent(in) :: file_unit

    File unit.

    integer(kind=I4P), intent(in) :: pos

    Position to start the loading.

procedure, private, pass(self) :: node_to_center

Compute cell centers coordinates from cell nodes.

  • private pure function node_to_center(self) result(center)

    Compute cell centers coordinates from cell nodes.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(in) :: self

    Block.

    Return Value type(vector), allocatable, (:,:,:)

    Cell centers coordinates.

procedure, public, pass(self) :: nodes_number

Return the number of nodes.

  • private elemental function nodes_number(self, with_ghosts) result(nodes_number_)

    Return the number of nodes.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(in) :: self

    Block.

    logical, intent(in), optional :: with_ghosts

    Take into account ghost cells.

    Return Value integer(kind=I4P)

    Number of cells.

procedure, private, pass(self) :: nullify_normals

Nullify normals for 2D or 1D domains.

  • private elemental subroutine nullify_normals(self)

    Nullify normals for 2D or 1D domains.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

procedure, public, pass(self) :: save_file_grid

Save gird file.

  • private subroutine save_file_grid(self, file_name, ascii, metrics, tecplot, vtk)

    Save grid file file.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

    character(len=*), intent(in) :: file_name

    File name.

    logical, intent(in), optional :: ascii

    Ascii/binary output.

    logical, intent(in), optional :: metrics

    Save also metrics data.

    logical, intent(in), optional :: tecplot

    Tecplot output format sentinel.

    logical, intent(in), optional :: vtk

    VTK output format sentinel.

procedure, private, pass(self) :: save_file_grid_tec

Save grid file in Tecplot format.

  • private subroutine save_file_grid_tec(self, file_name, ascii, metrics)

    Save grid file in Tecplot format.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

    character(len=*), intent(in) :: file_name

    Output file name.

    logical, intent(in), optional :: ascii

    Ascii/binary output.

    logical, intent(in), optional :: metrics

    Save also metrics data.

procedure, private, pass(self) :: save_file_grid_vtk

Save grid file in VTK format.

  • private subroutine save_file_grid_vtk(self, file_name, ascii, metrics)

    Save mesh data into VTK file.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

    character(len=*), intent(in) :: file_name

    Output file name.

    logical, intent(in), optional :: ascii

    Ascii/binary output.

    logical, intent(in), optional :: metrics

    Save also metrics data.

procedure, public, pass(self) :: save_nodes_into_file

Save nodes into file.

  • private subroutine save_nodes_into_file(self, file_unit, pos)

    Save nodes into file.

    Arguments

    Type IntentOptional AttributesName
    class(block_object), intent(inout) :: self

    Block.

    integer(kind=I4P), intent(in) :: file_unit

    File unit.

    integer(kind=I4P), intent(in) :: pos

    Position to start the loading.

Source Code

type :: block_object
   !< Block object class.
   type(error_object)             :: error                !< Errors handler.
   type(block_signature_object)   :: signature            !< Signature, namely id, level, dimensions, etc...
   type(cell_object), allocatable :: cell(:,:,:)          !< Cell.
   type(face_object), allocatable :: face_i(:,:,:)        !< Faces along I direction.
   type(face_object), allocatable :: face_j(:,:,:)        !< Faces along I direction.
   type(face_object), allocatable :: face_k(:,:,:)        !< Faces along I direction.
   type(node_object), allocatable :: node(:,:,:)          !< Cell.
   contains
      ! public methods
      procedure, pass(self) :: cells_number           !< Return the number of cells.
      procedure, pass(self) :: compute_space_operator !< Compute space operator.
      procedure, pass(self) :: create_linspace        !< Create a Cartesian block with linearly spaced nodes.
      procedure, pass(self) :: destroy                !< Destroy block.
      procedure, pass(self) :: interpolate_at_nodes   !< Interpolate cell-centered variable at nodes.
      procedure, pass(self) :: initialize             !< Initialize block.
      procedure, pass(self) :: load_nodes_from_file   !< Load nodes from file.
      procedure, pass(self) :: nodes_number           !< Return the number of nodes.
      procedure, pass(self) :: save_file_grid         !< Save gird file.
      procedure, pass(self) :: save_nodes_into_file   !< Save nodes into file.
      ! operators
      generic :: assignment(=) => block_assign_block !< Overload `=`.
      ! private methods
      procedure, pass(lhs),  private :: block_assign_block    !< Operator `=`.
      procedure, pass(self), private :: compute_extents       !< Compute block extents.
      procedure, pass(self), private :: compute_faces_metrics !< Compute block faces metrics.
      procedure, pass(self), private :: compute_metrics       !< Compute block metrics.
      procedure, pass(self), private :: compute_volumes       !< Compute block volumes.
      procedure, pass(self), private :: correct_metrics       !< Correct block metrics.
      procedure, pass(self), private :: node_to_center        !< Compute cell centers coordinates from cell nodes.
      procedure, pass(self), private :: nullify_normals       !< Nullify normals for 2D or 1D domains.
      procedure, pass(self), private :: save_file_grid_tec    !< Save grid file in Tecplot format.
      procedure, pass(self), private :: save_file_grid_vtk    !< Save grid file in VTK format.
endtype block_object