initialize Subroutine

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.

Assign block signature, allocate dynamic memory and set block features.

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).

Calls

proc~~initialize~~CallsGraph proc~initialize initialize gc_ gc_ proc~initialize->gc_
Help

Source Code


Source Code

   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.
   !<
   !< Assign block signature, allocate dynamic memory and set block features.
   class(block_object),          intent(inout)        :: self         !< Block.
   type(block_signature_object), intent(in), optional :: signature    !< Signature, namely id, level, dimensions, etc...
   integer(I8P),                 intent(in), optional :: id           !< Unique (Morton) identification code.
   integer(I4P),                 intent(in), optional :: level        !< Grid refinement level.
   integer(I4P),                 intent(in), optional :: gc(1:)       !< Number of ghost cells along each frame.
   integer(I4P),                 intent(in), optional :: ni           !< Number of cells in I direction.
   integer(I4P),                 intent(in), optional :: nj           !< Number of cells in J direction.
   integer(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).

   self%error%status = ERROR_BLOCK_CREATE_FAILED

   if ((.not.(present(signature))).and.&
       (.not.(present(id).and.present(level).and.present(gc).and.present(ni).and.present(nj).and.present(nk)))) then
      error stop 'error: either signature or (id, level, gc, ni, nj, nk) tuple must be passed to a block initialized'
   endif

   call self%destroy

   call self%signature%initialize(signature=signature,                             &
                                  id=id, level=level, gc=gc, ni=ni, nj=nj, nk=nk,  &
                                  emin=emin, emax=emax, is_cartesian=is_cartesian, &
                                  is_null_x=is_null_x, is_null_y=is_null_y, is_null_z=is_null_z)

   associate(gc_=>self%signature%gc, ni_=>self%signature%ni, nj_=>self%signature%nj, nk_=>self%signature%nk)
      allocate(self%cell(  1 - gc_(1) : ni_ + gc_(2), 1 - gc_(3) : nj_ + gc_(4), 1 - gc_(5) : nk_ + gc_(6)))
      allocate(self%face_i(0 - gc_(1) : ni_ + gc_(2), 1 - gc_(3) : nj_ + gc_(4), 1 - gc_(5) : nk_ + gc_(6)))
      allocate(self%face_j(1 - gc_(1) : ni_ + gc_(2), 0 - gc_(3) : nj_ + gc_(4), 1 - gc_(5) : nk_ + gc_(6)))
      allocate(self%face_k(1 - gc_(1) : ni_ + gc_(2), 1 - gc_(3) : nj_ + gc_(4), 0 - gc_(5) : nk_ + gc_(6)))
      allocate(self%node(  0 - gc_(1) : ni_ + gc_(2), 0 - gc_(3) : nj_ + gc_(4), 0 - gc_(5) : nk_ + gc_(6)))
   endassociate

   self%error%status = NO_ERROR
   endsubroutine initialize


adim_assign_adim allocate_blocks block_assign_block block_d_assign_block_d cell_assign_cell cells_number cells_number check cli_parse cli_parse cli_parse close compute_extents compute_faces_metrics compute_metrics compute_metrics compute_reference_values compute_space_operator compute_volumes correct_metrics cp create_linspace description description description description description description description description description destroy destroy destroy destroy destroy destroy destroy destroy destroy destroy destroy destroy destroy destroy destroy err_assign_err face_assign_face file_assign_file free_assign_free grid_d_assign_grid_d initialize initialize initialize initialize initialize initialize initialize initialize initialize initialize initialize initialize initialize initialize initialize initialize_unix initialize_windows integrate interpolate_at_nodes iolength iolength iopos_block_nodes is_the_end load_file_grid load_file_name_from_file load_file_parameters load_from_file load_from_file load_from_file load_from_file load_from_file load_from_file load_from_file load_grid_dimensions_from_file load_input_files load_nodes_from_file load_nodes_from_file mkdir node_assign_node node_to_center nodes_number nodes_number nullify_normals open os_assign_os parse_command_line_interface progress rm save_file_grid save_file_grid save_file_grid_tec save_file_grid_vtk save_file_name_into_file save_file_parameters save_grid_dimensions_into_file save_into_file save_into_file save_into_file save_into_file save_into_file save_into_file save_into_file save_nodes_into_file save_nodes_into_file set_command_line_interface set_stop solver_assign_solver time_assign_time update