create_linspace Subroutine

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.

Calls

proc~~create_linspace~~CallsGraph proc~create_linspace create_linspace gc gc proc~create_linspace->gc
Help

Source Code


Source Code

   subroutine create_linspace(self, emin, emax)
   !< Create a Cartesian block with linearly spaced nodes.
   !<
   !< @note If the extents (emin, emax) of the block are not passed, the values already saved into the block are used.
   !<
   !< @TODO re-add elemental attribute.
   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.
   type(vector)                              :: delta   !< Diagonal of block bounding-box.
   real(R8P)                                 :: delta_x !< X component of diagonal of block bounding-box.
   real(R8P)                                 :: delta_y !< Y component of diagonal of block bounding-box.
   real(R8P)                                 :: delta_z !< Z component of diagonal of block bounding-box.
   integer(I4P)                              :: i       !< Counter.
   integer(I4P)                              :: j       !< Counter.
   integer(I4P)                              :: k       !< Counter.

   self%error%status = ERROR_BLOCK_CREATE_LINSPACE_FAILED

   self%signature%is_cartesian = .true.
   if (present(emin)) self%signature%emin = emin
   if (present(emax)) self%signature%emax = emax
   associate(gc=>self%signature%gc, ni=>self%signature%ni, nj=>self%signature%nj, nk=>self%signature%nk)
      if (self%signature%emin/=self%signature%emax) then
         delta = (self%signature%emax - self%signature%emin) / (ni * ex + nj * ey + nk * ez)
         delta_x = delta.dot.ex
         delta_y = delta.dot.ey
         delta_z = delta.dot.ez
         do k=0 - gc(5), nk + gc(6)
            do j=0 - gc(3), nj + gc(4)
               do i=0 - gc(1), ni + gc(2)
                  self%node(i, j, k)%vertex = self%signature%emin + (i * delta_x) * ex + (j * delta_y) * ey + (k * delta_z) * ez
               enddo
            enddo
         enddo
         call self%compute_metrics
         self%error%status = NO_ERROR
      endif
   endassociate
   endsubroutine create_linspace


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