Class TempLat::GhostBuster
template <size_t NDim>
ClassList > TempLat > GhostBuster
A class which adds and removes (busts!) ghost cells to your layout. Pass the original layout and the target layout to the constructor. Then pass any pointer which satisfies for origin layout to the function call operator. And the rest will be history. More...
#include <ghostbuster.h>
Public Attributes
| Type | Name |
|---|---|
| device::Idx | mDirection mDirection is positive, if we contract (i.e. remove ghosts) and negative if we expand (i.e. add ghosts) the memory. |
| LayoutStruct< NDim > | mFrom |
| LayoutStruct< NDim > | mTo |
Public Functions
| Type | Name |
|---|---|
| GhostBuster (const LayoutStruct< NDim > & from, const LayoutStruct< NDim > & to, bool verbose=false) |
|
| void | bustTheGhosts (MemoryBlock< T, NDim > & block) |
| void | operator() (M< T, NDim, Args... > & obj) overload for passing objects which have a data() and a size() method, like std::vector<T> |
Detailed Description
Since the ghost cells are ghost cells, they will be overwritten arbitrarily. The non-ghost cells are guaranteed to port their value from the old to the new layout.
Memory allocation of the pointer is NOT affected. This is a memmove-like routine.
Unit test: ctest -R test-ghostbuster
Public Attributes Documentation
variable mDirection
mDirection is positive, if we contract (i.e. remove ghosts) and negative if we expand (i.e. add ghosts) the memory.
variable mFrom
variable mTo
Public Functions Documentation
function GhostBuster
inline TempLat::GhostBuster::GhostBuster (
const LayoutStruct < NDim > & from,
const LayoutStruct < NDim > & to,
bool verbose=false
)
function bustTheGhosts
template<typename T>
inline void TempLat::GhostBuster::bustTheGhosts (
MemoryBlock < T, NDim > & block
)
function operator()
overload for passing objects which have a data() and a size() method, like std::vector<T>
template<template< typename S, size_t _NDim, typename... MArgs > class M, typename T, typename... Args>
inline void TempLat::GhostBuster::operator() (
M< T, NDim, Args... > & obj
)
The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/lattice/ghostcells/ghostbuster.h