Loading...
Searching...
No Matches
terra::communication::shell::fv_detail Namespace Reference

Functions

template<typename ScalarType >
void pack_inner_cells (const grid::Grid2DDataScalar< ScalarType > &buffer, const grid::Grid4DDataScalar< ScalarType > &data, const int local_subdomain_id, const grid::BoundaryFace face)
 Packs the innermost real-cell layer adjacent to face into buffer.
 
template<typename ScalarType >
void unpack_to_ghost (const grid::Grid2DDataScalar< ScalarType > &buffer, const grid::Grid4DDataScalar< ScalarType > &data, const int local_subdomain_id, const grid::BoundaryFace face, const grid::BoundaryDirection dir0, const grid::BoundaryDirection dir1)
 Writes buffer into the ghost cell layer at face.
 
template<typename ScalarType , int VecDim>
void pack_inner_cells_vec (const grid::Grid3DDataScalar< ScalarType > &buffer, const grid::Grid4DDataVec< ScalarType, VecDim > &data, const int local_subdomain_id, const grid::BoundaryFace face)
 Packs the innermost real-cell layer adjacent to face into buffer for a vector field.
 
template<typename ScalarType , int VecDim>
void unpack_to_ghost_vec (const grid::Grid3DDataScalar< ScalarType > &buffer, const grid::Grid4DDataVec< ScalarType, VecDim > &data, const int local_subdomain_id, const grid::BoundaryFace face, const grid::BoundaryDirection dir0, const grid::BoundaryDirection dir1)
 Writes buffer into the ghost cell layer at face for a vector field.
 

Function Documentation

◆ pack_inner_cells()

template<typename ScalarType >
void terra::communication::shell::fv_detail::pack_inner_cells ( const grid::Grid2DDataScalar< ScalarType > &  buffer,
const grid::Grid4DDataScalar< ScalarType > &  data,
const int  local_subdomain_id,
const grid::BoundaryFace  face 
)

Packs the innermost real-cell layer adjacent to face into buffer.

For a face whose normal is in direction d:

  • Ghost layer lives at data index 0 (P0 side) or extent-1 (P1 side) in d.
  • The innermost real cells are at index 1 (P0) or extent-2 (P1).

The two varying dimensions are packed in forward order: buffer(i, j) = data(id, ..., i+1, j+1, ...)

The receiver applies BoundaryDirection reversal during unpack if needed.

◆ pack_inner_cells_vec()

template<typename ScalarType , int VecDim>
void terra::communication::shell::fv_detail::pack_inner_cells_vec ( const grid::Grid3DDataScalar< ScalarType > &  buffer,
const grid::Grid4DDataVec< ScalarType, VecDim > &  data,
const int  local_subdomain_id,
const grid::BoundaryFace  face 
)

Packs the innermost real-cell layer adjacent to face into buffer for a vector field.

buffer has shape [ni, nj, VecDim] and packs all VecDim components together so a single MPI message per face suffices.

◆ unpack_to_ghost()

template<typename ScalarType >
void terra::communication::shell::fv_detail::unpack_to_ghost ( const grid::Grid2DDataScalar< ScalarType > &  buffer,
const grid::Grid4DDataScalar< ScalarType > &  data,
const int  local_subdomain_id,
const grid::BoundaryFace  face,
const grid::BoundaryDirection  dir0,
const grid::BoundaryDirection  dir1 
)

Writes buffer into the ghost cell layer at face.

Parameters
dir0Iteration direction for the first varying dimension.
dir1Iteration direction for the second varying dimension.

Direction mapping (from SubdomainNeighborhood::neighborhood_face()): FORWARD: buffer index i → data index i+1 BACKWARD: buffer index i → data index (extent - 2 - i)

◆ unpack_to_ghost_vec()

template<typename ScalarType , int VecDim>
void terra::communication::shell::fv_detail::unpack_to_ghost_vec ( const grid::Grid3DDataScalar< ScalarType > &  buffer,
const grid::Grid4DDataVec< ScalarType, VecDim > &  data,
const int  local_subdomain_id,
const grid::BoundaryFace  face,
const grid::BoundaryDirection  dir0,
const grid::BoundaryDirection  dir1 
)

Writes buffer into the ghost cell layer at face for a vector field.