BSpline Finite Element Exterior Calculus
Loading...
Searching...
No Matches
m_domain_data_exchange Module Reference

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...

Functions/Subroutines

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).
 

Variables

integer, parameter, public remove_block = -huge(1)
 

Detailed Description

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.

Function/Subroutine Documentation

◆ 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]domainThe local DomainDecomp of the current rank
[in]neighboursThe array of neighbouring TensorProdNeighbour objects
[in,out]data_blocksThe blocks of data to be sent/received. A 2D array where the second index is the block index
[in]move_toAn 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]offsetThe 3D neighbour offset (ri, rj, rk)
[in]tp_spaceThe TensorProdSpace
[in]xThe x-coordinate of the particle
[in]yThe y-coordinate of the particle
[in]zThe z-coordinate of the particle
[in]node_basedWhether the guard layer is node-based (true) or rank-based (false) (default: .false.)