Octopus
mesh_init_oct_m Module Reference

This module contains subroutines, related to the initialization of the mesh. More...

Detailed Description

This module contains subroutines, related to the initialization of the mesh.

Functions/Subroutines

subroutine, public mesh_init_stage_1 (mesh, namespace, space, box, coord_system, spacing, enlarge)
 First stage mesh initialization. More...
 
subroutine, public mesh_init_stage_2 (mesh, namespace, space, box, stencil, regenerate)
 This subroutine creates the global array of spatial indices and the inverse mapping. More...
 
subroutine, public mesh_init_stage_3 (mesh, namespace, space, stencil, mc, parent, regenerate)
 When running parallel in domains, stencil and np_stencil are needed to compute the ghost points. mpi_grp is the communicator group that will be used for this mesh. More...
 
subroutine rebalance_array (data_input, data_output, output_sizes)
 re-distribute the points to improve load balancing More...
 
subroutine reorder_points (namespace, space, idx, grid_to_spatial, grid_to_spatial_reordered)
 reorder the points in the grid according to the variables MeshOrder and MeshLocalOrder More...
 
subroutine get_sizes_offsets (local_size, sizes, offsets, mpi_grp)
 return the sizes and offsets of a distributed array for all tasks of a mpi group. More...
 

Variables

integer, parameter inner_point = 1
 
integer, parameter enlargement_point = 2
 
integer, parameter boundary = -1
 

Function/Subroutine Documentation

◆ mesh_init_stage_1()

subroutine, public mesh_init_oct_m::mesh_init_stage_1 ( class(mesh_t), intent(inout)  mesh,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
class(box_t), intent(in), target  box,
class(coordinate_system_t), intent(in), target  coord_system,
real(real64), dimension(1:space%dim), intent(in)  spacing,
integer, dimension(1:space%dim), intent(in)  enlarge 
)

First stage mesh initialization.

The function determines a parallelepiped that surrounds the box. Moreover, it adjusts the spacing to make it commensurate with the box size for periodic dimensions.

Definition at line 169 of file mesh_init.F90.

◆ mesh_init_stage_2()

subroutine, public mesh_init_oct_m::mesh_init_stage_2 ( class(mesh_t), intent(inout)  mesh,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
class(box_t), intent(in)  box,
type(stencil_t), intent(in)  stencil,
logical, intent(in), optional  regenerate 
)

This subroutine creates the global array of spatial indices and the inverse mapping.

Spatial indices form a regular mesh in spacedim dimensions with integer valued coordinates.

Definition at line 289 of file mesh_init.F90.

◆ mesh_init_stage_3()

subroutine, public mesh_init_oct_m::mesh_init_stage_3 ( class(mesh_t), intent(inout)  mesh,
type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
type(stencil_t), intent(in)  stencil,
type(multicomm_t), intent(in)  mc,
type(mesh_t), intent(in), optional  parent,
logical, intent(in), optional  regenerate 
)

When running parallel in domains, stencil and np_stencil are needed to compute the ghost points. mpi_grp is the communicator group that will be used for this mesh.

Definition at line 537 of file mesh_init.F90.

◆ rebalance_array()

subroutine mesh_init_oct_m::rebalance_array ( integer(int64), dimension(:), intent(in), contiguous  data_input,
integer(int64), dimension(:), intent(out), allocatable  data_output,
integer, dimension(:), intent(out), optional, allocatable  output_sizes 
)
private

re-distribute the points to improve load balancing

TODO: Add some more information!

Definition at line 810 of file mesh_init.F90.

◆ reorder_points()

subroutine mesh_init_oct_m::reorder_points ( type(namespace_t), intent(in)  namespace,
class(space_t), intent(in)  space,
type(index_t), intent(in)  idx,
integer(int64), dimension(:), intent(in)  grid_to_spatial,
integer(int64), dimension(:), intent(out), allocatable  grid_to_spatial_reordered 
)
private

reorder the points in the grid according to the variables MeshOrder and MeshLocalOrder

see description below.

Definition at line 906 of file mesh_init.F90.

◆ get_sizes_offsets()

subroutine mesh_init_oct_m::get_sizes_offsets ( integer, intent(in)  local_size,
integer, dimension(:), intent(out), allocatable  sizes,
integer(int64), dimension(:), intent(out), allocatable  offsets,
type(mpi_grp_t), intent(in), optional  mpi_grp 
)
private

return the sizes and offsets of a distributed array for all tasks of a mpi group.

Parameters
[in]local_sizelocal size of the slice
[out]sizesarray of all sizes
[out]offsetsarray of offsets
[in]mpi_grpthe MPI group over which the data is distributed

Definition at line 1178 of file mesh_init.F90.

Variable Documentation

◆ inner_point

integer, parameter mesh_init_oct_m::inner_point = 1
private

Definition at line 156 of file mesh_init.F90.

◆ enlargement_point

integer, parameter mesh_init_oct_m::enlargement_point = 2
private

Definition at line 157 of file mesh_init.F90.

◆ boundary

integer, parameter mesh_init_oct_m::boundary = -1
private

Definition at line 158 of file mesh_init.F90.