Octopus
index_oct_m Module Reference

This module implements the index, used for the mesh points. More...

Detailed Description

This module implements the index, used for the mesh points.

Octopus uses an intermediate mesh with integer-valued coordinates, which then is scaled to the actual mesh. This module provides functions which perform the mapping between this integer-valued mesh and the point index. Besides a simple cubic indexing, also indexing using a spacefilling Hilbert curve is implemented.

Data Types

interface  hilbert_index_to_point
 
interface  hilbert_index_to_point_int
 
interface  hilbert_point_to_index
 
interface  hilbert_point_to_index_int
 
type  index_t
 

Functions/Subroutines

subroutine, public index_init (idx, dim)
 This subroutine allocates memory and initializes some components. More...
 
subroutine, public index_end (idx)
 This subroutine deallocates all memory. More...
 
integer(int64) function, public index_from_coords (idx, ix)
 This function takes care of the boundary conditions for a given vector of integer coordinates it returns the true global index of the point. More...
 
subroutine, public index_from_coords_vec (idx, npoints, ix, index)
 
subroutine, public index_to_coords (idx, ip, ix)
 Given a global point index, this function returns the set of integer coordinates of the point. More...
 
subroutine, public index_dump (idx, np, dir, mpi_grp, namespace, ierr)
 
subroutine, public index_load (idx, np, dir, mpi_grp, namespace, ierr)
 Load the index arrays from a file. More...
 
subroutine, public index_spatial_to_point (idx, dim, ispatial, point)
 
subroutine, public index_point_to_spatial (idx, dim, ispatial, point)
 
pure subroutine index_cubic_to_point (idx, dim, icubic, point)
 
pure subroutine index_point_to_cubic (idx, dim, icubic, point)
 
subroutine index_hilbert_to_point (idx, dim, ihilbert, point)
 
subroutine index_point_to_hilbert (idx, dim, ihilbert, point)
 
integer(int64) function, public get_blocked_index (dim, point, bsize, number_of_blocks, increase_with_dimensions)
 

Variables

integer, parameter, public idx_cubic = 1
 
integer, parameter, public idx_hilbert = 2
 

Function/Subroutine Documentation

◆ index_init()

subroutine, public index_oct_m::index_init ( type(index_t), intent(inout)  idx,
integer, intent(in)  dim 
)

This subroutine allocates memory and initializes some components.

Definition at line 196 of file index.F90.

◆ index_end()

subroutine, public index_oct_m::index_end ( type(index_t), intent(inout)  idx)

This subroutine deallocates all memory.

Definition at line 215 of file index.F90.

◆ index_from_coords()

integer(int64) function, public index_oct_m::index_from_coords ( type(index_t), intent(in)  idx,
integer, dimension(1:idx%dim), intent(in)  ix 
)

This function takes care of the boundary conditions for a given vector of integer coordinates it returns the true global index of the point.

Definition at line 234 of file index.F90.

◆ index_from_coords_vec()

subroutine, public index_oct_m::index_from_coords_vec ( type(index_t), intent(in)  idx,
integer, intent(in)  npoints,
integer, dimension(1:idx%dim, 1:npoints), intent(in)  ix,
integer(int64), dimension(1:npoints), intent(out)  index 
)

Definition at line 251 of file index.F90.

◆ index_to_coords()

subroutine, public index_oct_m::index_to_coords ( type(index_t), intent(in)  idx,
integer(int64), intent(in)  ip,
integer, dimension(:), intent(out), contiguous  ix 
)

Given a global point index, this function returns the set of integer coordinates of the point.

Definition at line 275 of file index.F90.

◆ index_dump()

subroutine, public index_oct_m::index_dump ( type(index_t), intent(in)  idx,
integer(int64), intent(in)  np,
character(len=*), intent(in)  dir,
type(mpi_grp_t), intent(in)  mpi_grp,
type(namespace_t), intent(in)  namespace,
integer, intent(out)  ierr 
)

Definition at line 287 of file index.F90.

◆ index_load()

subroutine, public index_oct_m::index_load ( type(index_t), intent(inout)  idx,
integer(int64), intent(in)  np,
character(len=*), intent(in)  dir,
type(mpi_grp_t), intent(in)  mpi_grp,
type(namespace_t), intent(in)  namespace,
integer, intent(out)  ierr 
)

Load the index arrays from a file.

Definition at line 321 of file index.F90.

◆ index_spatial_to_point()

subroutine, public index_oct_m::index_spatial_to_point ( type(index_t), intent(in)  idx,
integer, intent(in)  dim,
integer(int64), intent(in)  ispatial,
integer, dimension(1:dim), intent(out)  point 
)

Definition at line 376 of file index.F90.

◆ index_point_to_spatial()

subroutine, public index_oct_m::index_point_to_spatial ( type(index_t), intent(in)  idx,
integer, intent(in)  dim,
integer(int64), intent(out)  ispatial,
integer, dimension(1:dim), intent(in)  point 
)

Definition at line 394 of file index.F90.

◆ index_cubic_to_point()

pure subroutine index_oct_m::index_cubic_to_point ( type(index_t), intent(in)  idx,
integer, intent(in)  dim,
integer(int64), intent(in)  icubic,
integer, dimension(1:dim), intent(out)  point 
)
private

Definition at line 412 of file index.F90.

◆ index_point_to_cubic()

pure subroutine index_oct_m::index_point_to_cubic ( type(index_t), intent(in)  idx,
integer, intent(in)  dim,
integer(int64), intent(out)  icubic,
integer, dimension(1:dim), intent(in)  point 
)
private

Definition at line 430 of file index.F90.

◆ index_hilbert_to_point()

subroutine index_oct_m::index_hilbert_to_point ( type(index_t), intent(in)  idx,
integer, intent(in)  dim,
integer(int64), intent(in)  ihilbert,
integer, dimension(:), intent(out), contiguous  point 
)
private

Definition at line 449 of file index.F90.

◆ index_point_to_hilbert()

subroutine index_oct_m::index_point_to_hilbert ( type(index_t), intent(in)  idx,
integer, intent(in)  dim,
integer(int64), intent(out)  ihilbert,
integer, dimension(1:dim), intent(in)  point 
)
private

Definition at line 460 of file index.F90.

◆ get_blocked_index()

integer(int64) function, public index_oct_m::get_blocked_index ( integer, intent(in)  dim,
integer, dimension(1:dim), intent(in)  point,
integer, dimension(1:dim), intent(in)  bsize,
integer, dimension(1:dim), intent(in)  number_of_blocks,
logical, intent(in), optional  increase_with_dimensions 
)

Definition at line 475 of file index.F90.

Variable Documentation

◆ idx_cubic

integer, parameter, public index_oct_m::idx_cubic = 1

Definition at line 146 of file index.F90.

◆ idx_hilbert

integer, parameter, public index_oct_m::idx_hilbert = 2

Definition at line 146 of file index.F90.