Octopus
cube_function_oct_m Module Reference

Data Types

type  cube_function_t
 
interface  dcube_to_mesh
 
interface  dmesh_to_cube
 
interface  zcube_to_mesh
 
interface  zmesh_to_cube
 

Functions/Subroutines

pure logical function cube_map_is_trivial (cube)
 True when the cube_map describes a trivial mesh->cube identity: the mesh is X-fastest with one full-X-row segment per (iy, iz) pair, and the cube has the same dimensions as the mesh. The mapping then degenerates to a flat memcopy. Holds for 3D periodic systems with MeshOrder = order_cube and no domain decomposition. More...
 
subroutine, public dcube_function_alloc_rs (cube, cf, in_device, force_alloc)
 Allocates locally the real space grid, if PFFT library is not used. Otherwise, it assigns the PFFT real space grid to the cube real space grid, via pointer. More...
 
subroutine, public dcube_function_free_rs (cube, cf)
 Deallocates the real space grid. More...
 
subroutine, public dcube_function_allgather (cube, cf, cf_local, order, gatherfs)
 
subroutine dcube_map_ring_exchange (mpi_grp, send_mf, n_send_mf, recv_mf, n_recv_mf, send_map, n_send_map, recv_map, n_recv_map, send_proc, recv_proc)
 One ring step of the domain-parallel mesh-to-cube exchange. More...
 
subroutine dmesh_to_cube_1 (mesh, mf, cube, cf)
 Convert a single function from the mesh to the cube. More...
 
subroutine dmesh_to_cube_2 (mesh, mf, cube, cf, mf_buffer)
 Convert a set of functions from the mesh to the cube. More...
 
subroutine dcube_to_mesh_1 (cube, cf, mesh, mf)
 Convert a single function from the cube to the mesh. More...
 
subroutine dcube_to_mesh_2 (cube, cf, mesh, mf, mf_buffer)
 Convert a set of functions from the cube to the mesh. More...
 
subroutine, public dmesh_to_cube_parallel (mesh, mf, cube, cf, map)
 The next two subroutines convert a function between the normal mesh and the cube in parallel. More...
 
subroutine, public dcube_to_mesh_parallel (cube, cf, mesh, mf, map)
 
real(real64) function, public dcube_function_surface_average (cube, cf)
 This function calculates the surface average of any function. More...
 
subroutine, public dsubmesh_to_cube (sm, mf, cube, cf)
 The next two subroutines convert a function between a submesh and the cube. More...
 
subroutine, public dcube_to_submesh (cube, cf, sm, mf)
 
subroutine, public zcube_function_alloc_rs (cube, cf, in_device, force_alloc)
 Allocates locally the real space grid, if PFFT library is not used. Otherwise, it assigns the PFFT real space grid to the cube real space grid, via pointer. More...
 
subroutine, public zcube_function_free_rs (cube, cf)
 Deallocates the real space grid. More...
 
subroutine, public zcube_function_allgather (cube, cf, cf_local, order, gatherfs)
 
subroutine zcube_map_ring_exchange (mpi_grp, send_mf, n_send_mf, recv_mf, n_recv_mf, send_map, n_send_map, recv_map, n_recv_map, send_proc, recv_proc)
 One ring step of the domain-parallel mesh-to-cube exchange. More...
 
subroutine zmesh_to_cube_1 (mesh, mf, cube, cf)
 Convert a single function from the mesh to the cube. More...
 
subroutine zmesh_to_cube_2 (mesh, mf, cube, cf, mf_buffer)
 Convert a set of functions from the mesh to the cube. More...
 
subroutine zcube_to_mesh_1 (cube, cf, mesh, mf)
 Convert a single function from the cube to the mesh. More...
 
subroutine zcube_to_mesh_2 (cube, cf, mesh, mf, mf_buffer)
 Convert a set of functions from the cube to the mesh. More...
 
subroutine, public zmesh_to_cube_parallel (mesh, mf, cube, cf, map)
 The next two subroutines convert a function between the normal mesh and the cube in parallel. More...
 
subroutine, public zcube_to_mesh_parallel (cube, cf, mesh, mf, map)
 
complex(real64) function, public zcube_function_surface_average (cube, cf)
 This function calculates the surface average of any function. More...
 
subroutine, public zsubmesh_to_cube (sm, mf, cube, cf)
 The next two subroutines convert a function between a submesh and the cube. More...
 
subroutine, public zcube_to_submesh (cube, cf, sm, mf)
 

Function/Subroutine Documentation

◆ cube_map_is_trivial()

pure logical function cube_function_oct_m::cube_map_is_trivial ( type(cube_t), intent(in)  cube)
private

True when the cube_map describes a trivial mesh->cube identity: the mesh is X-fastest with one full-X-row segment per (iy, iz) pair, and the cube has the same dimensions as the mesh. The mapping then degenerates to a flat memcopy. Holds for 3D periodic systems with MeshOrder = order_cube and no domain decomposition.

Definition at line 200 of file cube_function.F90.

◆ dcube_function_alloc_rs()

subroutine, public cube_function_oct_m::dcube_function_alloc_rs ( type(cube_t), intent(in), target  cube,
type(cube_function_t), intent(inout)  cf,
logical, intent(in), optional  in_device,
logical, intent(in), optional  force_alloc 
)

Allocates locally the real space grid, if PFFT library is not used. Otherwise, it assigns the PFFT real space grid to the cube real space grid, via pointer.

Definition at line 289 of file cube_function.F90.

◆ dcube_function_free_rs()

subroutine, public cube_function_oct_m::dcube_function_free_rs ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(inout)  cf 
)

Deallocates the real space grid.

Definition at line 345 of file cube_function.F90.

◆ dcube_function_allgather()

subroutine, public cube_function_oct_m::dcube_function_allgather ( type(cube_t), intent(in)  cube,
real(real64), dimension(:,:,:), intent(out)  cf,
real(real64), dimension(:,:,:), intent(in), contiguous  cf_local,
integer, dimension(3), intent(in), optional  order,
logical, intent(in), optional  gatherfs 
)

Definition at line 385 of file cube_function.F90.

◆ dcube_map_ring_exchange()

subroutine cube_function_oct_m::dcube_map_ring_exchange ( type(mpi_grp_t), intent(in)  mpi_grp,
real(real64), dimension(:, :), intent(in), contiguous  send_mf,
integer, intent(in)  n_send_mf,
real(real64), dimension(:, :), intent(inout), contiguous  recv_mf,
integer, intent(in)  n_recv_mf,
integer, dimension(:, :), intent(in), contiguous  send_map,
integer, intent(in)  n_send_map,
integer, dimension(:, :), intent(inout), contiguous  recv_map,
integer, intent(in)  n_recv_map,
integer, intent(in)  send_proc,
integer, intent(in)  recv_proc 
)
private

One ring step of the domain-parallel mesh-to-cube exchange.

Definition at line 409 of file cube_function.F90.

◆ dmesh_to_cube_1()

subroutine cube_function_oct_m::dmesh_to_cube_1 ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in), target, contiguous  mf,
type(cube_t), intent(in), target  cube,
type(cube_function_t), intent(inout)  cf 
)
private

Convert a single function from the mesh to the cube.

Parameters
[in]mfA function defined on the mesh,

Definition at line 442 of file cube_function.F90.

◆ dmesh_to_cube_2()

subroutine cube_function_oct_m::dmesh_to_cube_2 ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:, :), intent(in), optional, target, contiguous  mf,
type(cube_t), intent(in), target  cube,
type(cube_function_t), intent(inout)  cf,
type(accel_mem_t), intent(in), optional, target  mf_buffer 
)
private

Convert a set of functions from the mesh to the cube.

Parameters
[in]mfA batch of functions defined on the mesh,
[in]mf_bufferDevice-resident source buffer for the GPU path. This is mutually exclusive with mf.

Definition at line 463 of file cube_function.F90.

◆ dcube_to_mesh_1()

subroutine cube_function_oct_m::dcube_to_mesh_1 ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(in)  cf,
class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(out), target, contiguous  mf 
)
private

Convert a single function from the cube to the mesh.

Parameters
[in]cfcube function
[out]mfA function defined on the mesh,

Definition at line 736 of file cube_function.F90.

◆ dcube_to_mesh_2()

subroutine cube_function_oct_m::dcube_to_mesh_2 ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(in)  cf,
class(mesh_t), intent(in)  mesh,
real(real64), dimension(:, :), intent(out), optional, target, contiguous  mf,
type(accel_mem_t), intent(inout), optional, target  mf_buffer 
)
private

Convert a set of functions from the cube to the mesh.

Parameters
[in]cfcube function
[out]mfA batch of functions defined on the mesh,
[in,out]mf_bufferDevice-resident destination buffer for the GPU path. This is mutually exclusive with mf.

Definition at line 757 of file cube_function.F90.

◆ dmesh_to_cube_parallel()

subroutine, public cube_function_oct_m::dmesh_to_cube_parallel ( class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(in), target  mf,
type(cube_t), intent(in)  cube,
type(cube_function_t), intent(inout)  cf,
type(mesh_cube_parallel_map_t), intent(in)  map 
)

The next two subroutines convert a function between the normal mesh and the cube in parallel.

Parameters
[in]mfmf(meshnp)

Definition at line 884 of file cube_function.F90.

◆ dcube_to_mesh_parallel()

subroutine, public cube_function_oct_m::dcube_to_mesh_parallel ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(in)  cf,
class(mesh_t), intent(in)  mesh,
real(real64), dimension(:), intent(out)  mf,
type(mesh_cube_parallel_map_t), intent(in)  map 
)
Parameters
[out]mfmf(meshnp)

Definition at line 977 of file cube_function.F90.

◆ dcube_function_surface_average()

real(real64) function, public cube_function_oct_m::dcube_function_surface_average ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(in)  cf 
)

This function calculates the surface average of any function.

Warning
Some more careful testing should be done on this.

Definition at line 1054 of file cube_function.F90.

◆ dsubmesh_to_cube()

subroutine, public cube_function_oct_m::dsubmesh_to_cube ( type(submesh_t), intent(in)  sm,
real(real64), dimension(:), intent(in), target  mf,
type(cube_t), intent(in)  cube,
type(cube_function_t), intent(inout)  cf 
)

The next two subroutines convert a function between a submesh and the cube.

Parameters
[in]mffunction defined on the submesh.

Definition at line 1107 of file cube_function.F90.

◆ dcube_to_submesh()

subroutine, public cube_function_oct_m::dcube_to_submesh ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(in)  cf,
type(submesh_t), intent(in)  sm,
real(real64), dimension(:), intent(out), target  mf 
)
Parameters
[out]mffunction defined on the submesh.

Definition at line 1150 of file cube_function.F90.

◆ zcube_function_alloc_rs()

subroutine, public cube_function_oct_m::zcube_function_alloc_rs ( type(cube_t), intent(in), target  cube,
type(cube_function_t), intent(inout)  cf,
logical, intent(in), optional  in_device,
logical, intent(in), optional  force_alloc 
)

Allocates locally the real space grid, if PFFT library is not used. Otherwise, it assigns the PFFT real space grid to the cube real space grid, via pointer.

Definition at line 1264 of file cube_function.F90.

◆ zcube_function_free_rs()

subroutine, public cube_function_oct_m::zcube_function_free_rs ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(inout)  cf 
)

Deallocates the real space grid.

Definition at line 1320 of file cube_function.F90.

◆ zcube_function_allgather()

subroutine, public cube_function_oct_m::zcube_function_allgather ( type(cube_t), intent(in)  cube,
complex(real64), dimension(:,:,:), intent(out)  cf,
complex(real64), dimension(:,:,:), intent(in), contiguous  cf_local,
integer, dimension(3), intent(in), optional  order,
logical, intent(in), optional  gatherfs 
)

Definition at line 1360 of file cube_function.F90.

◆ zcube_map_ring_exchange()

subroutine cube_function_oct_m::zcube_map_ring_exchange ( type(mpi_grp_t), intent(in)  mpi_grp,
complex(real64), dimension(:, :), intent(in), contiguous  send_mf,
integer, intent(in)  n_send_mf,
complex(real64), dimension(:, :), intent(inout), contiguous  recv_mf,
integer, intent(in)  n_recv_mf,
integer, dimension(:, :), intent(in), contiguous  send_map,
integer, intent(in)  n_send_map,
integer, dimension(:, :), intent(inout), contiguous  recv_map,
integer, intent(in)  n_recv_map,
integer, intent(in)  send_proc,
integer, intent(in)  recv_proc 
)
private

One ring step of the domain-parallel mesh-to-cube exchange.

Definition at line 1384 of file cube_function.F90.

◆ zmesh_to_cube_1()

subroutine cube_function_oct_m::zmesh_to_cube_1 ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(in), target, contiguous  mf,
type(cube_t), intent(in), target  cube,
type(cube_function_t), intent(inout)  cf 
)
private

Convert a single function from the mesh to the cube.

Parameters
[in]mfA function defined on the mesh,

Definition at line 1417 of file cube_function.F90.

◆ zmesh_to_cube_2()

subroutine cube_function_oct_m::zmesh_to_cube_2 ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:, :), intent(in), optional, target, contiguous  mf,
type(cube_t), intent(in), target  cube,
type(cube_function_t), intent(inout)  cf,
type(accel_mem_t), intent(in), optional, target  mf_buffer 
)
private

Convert a set of functions from the mesh to the cube.

Parameters
[in]mfA batch of functions defined on the mesh,
[in]mf_bufferDevice-resident source buffer for the GPU path. This is mutually exclusive with mf.

Definition at line 1438 of file cube_function.F90.

◆ zcube_to_mesh_1()

subroutine cube_function_oct_m::zcube_to_mesh_1 ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(in)  cf,
class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(out), target, contiguous  mf 
)
private

Convert a single function from the cube to the mesh.

Parameters
[in]cfcube function
[out]mfA function defined on the mesh,

Definition at line 1711 of file cube_function.F90.

◆ zcube_to_mesh_2()

subroutine cube_function_oct_m::zcube_to_mesh_2 ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(in)  cf,
class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:, :), intent(out), optional, target, contiguous  mf,
type(accel_mem_t), intent(inout), optional, target  mf_buffer 
)
private

Convert a set of functions from the cube to the mesh.

Parameters
[in]cfcube function
[out]mfA batch of functions defined on the mesh,
[in,out]mf_bufferDevice-resident destination buffer for the GPU path. This is mutually exclusive with mf.

Definition at line 1732 of file cube_function.F90.

◆ zmesh_to_cube_parallel()

subroutine, public cube_function_oct_m::zmesh_to_cube_parallel ( class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(in), target  mf,
type(cube_t), intent(in)  cube,
type(cube_function_t), intent(inout)  cf,
type(mesh_cube_parallel_map_t), intent(in)  map 
)

The next two subroutines convert a function between the normal mesh and the cube in parallel.

Parameters
[in]mfmf(meshnp)

Definition at line 1859 of file cube_function.F90.

◆ zcube_to_mesh_parallel()

subroutine, public cube_function_oct_m::zcube_to_mesh_parallel ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(in)  cf,
class(mesh_t), intent(in)  mesh,
complex(real64), dimension(:), intent(out)  mf,
type(mesh_cube_parallel_map_t), intent(in)  map 
)
Parameters
[out]mfmf(meshnp)

Definition at line 1952 of file cube_function.F90.

◆ zcube_function_surface_average()

complex(real64) function, public cube_function_oct_m::zcube_function_surface_average ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(in)  cf 
)

This function calculates the surface average of any function.

Warning
Some more careful testing should be done on this.

Definition at line 2029 of file cube_function.F90.

◆ zsubmesh_to_cube()

subroutine, public cube_function_oct_m::zsubmesh_to_cube ( type(submesh_t), intent(in)  sm,
complex(real64), dimension(:), intent(in), target  mf,
type(cube_t), intent(in)  cube,
type(cube_function_t), intent(inout)  cf 
)

The next two subroutines convert a function between a submesh and the cube.

Parameters
[in]mffunction defined on the submesh.

Definition at line 2082 of file cube_function.F90.

◆ zcube_to_submesh()

subroutine, public cube_function_oct_m::zcube_to_submesh ( type(cube_t), intent(in)  cube,
type(cube_function_t), intent(in)  cf,
type(submesh_t), intent(in)  sm,
complex(real64), dimension(:), intent(out), target  mf 
)
Parameters
[out]mffunction defined on the submesh.

Definition at line 2125 of file cube_function.F90.