Module for data exchange between neighbouring subdomains in a domain decomposition. For distribution of TensorProdFun accross subdomains, see the distribute() TBP in m_tensorprod_basis.f90.
More...
|
| subroutine, public | data_exchange (domain, neighbours, data_blocks, move_to) |
| | Subroutine to exchange blocks of data between neighbouring subdomains.
|
| |
| subroutine, public | guard_layer_offset (offset, tp_space, x, y, z, node_based) |
| | Determine the neighbour offset for a particle at position (x, y, z).
|
| |
|
|
integer, parameter, public | remove_block = -huge(1) |
| |
Module for data exchange between neighbouring subdomains in a domain decomposition. For distribution of TensorProdFun accross subdomains, see the distribute() TBP in m_tensorprod_basis.f90.
◆ data_exchange()
| subroutine, public m_domain_data_exchange::data_exchange |
( |
class(domaindecomp), intent(in) | domain, |
|
|
type(tensorprodneighbour), dimension(-max_comm_neighbours_x:max_comm_neighbours_x, -max_comm_neighbours_y:max_comm_neighbours_y, -max_comm_neighbours_z:max_comm_neighbours_z), intent(in) | neighbours, |
|
|
real(wp), dimension(:, :), intent(inout), allocatable | data_blocks, |
|
|
integer, dimension(:, :), intent(in) | move_to ) |
Subroutine to exchange blocks of data between neighbouring subdomains.
- Parameters
-
| [in] | domain | The local DomainDecomp of the current rank |
| [in] | neighbours | The array of neighbouring TensorProdNeighbour objects |
| [in,out] | data_blocks | The blocks of data to be sent/received. A 2D array where the second index is the block index |
| [in] | move_to | An array indicating the direction to move each block of data. A 2D array where the first index is the direction (1=x, 2=y, 3=z) and the second index is the block index |
- Note
- For example, suppose we want to move one block of reals to the positive x-direction neighbour, and one block to the negative y-direction neighbour. Then we would set move_to(:, 1) = [1, 0, 0] and move_to(:, 2) = [0, -1, 0], and data_blocks(:, 1) and data_blocks(:, 2) would contain the data to be sent in each case. [0, 0, 0] keeps the data on the current rank. At the end of the subroutine, data_blocks(:, :) contains the received data from the neighbours, as well as the data that was kept on the current rank.
◆ guard_layer_offset()
| subroutine, public m_domain_data_exchange::guard_layer_offset |
( |
integer, dimension(3), intent(out) | offset, |
|
|
type(tensorprodspace), intent(in) | tp_space, |
|
|
real(wp), intent(in) | x, |
|
|
real(wp), intent(in) | y, |
|
|
real(wp), intent(in) | z, |
|
|
logical, intent(in), optional | node_based ) |
Determine the neighbour offset for a particle at position (x, y, z).
Given a position in physical space, this subroutine determines which neighbour (if any) the particle should be sent to, expressed as a 3D offset (ri, rj, rk) in the neighbour array. If the particle is within our own responsible intervals, offset = [0, 0, 0]. The search is split into three independent 1D searches.
- Parameters
-
| [out] | offset | The 3D neighbour offset (ri, rj, rk) |
| [in] | tp_space | The TensorProdSpace |
| [in] | x | The x-coordinate of the particle |
| [in] | y | The y-coordinate of the particle |
| [in] | z | The z-coordinate of the particle |
| [in] | node_based | Whether the guard layer is node-based (true) or rank-based (false) (default: .false.) |