FreePOOMA
2.4.1
|
pack(field) and unpack(field, rcbp) are used to provide the user with a local 1D view of all the data in a field not including guard layers that belongs to the local processor. More...
Classes | |
struct | PackLocalPatches< InputField > |
struct | UnPackLocalPatches< InputField > |
Functions | |
template<class InputField > | |
RefCountedBlockPtr< typename InputField::Element_t > | pack (const InputField &field) |
template<class InputField , class T > | |
void | unpack (const InputField &field, RefCountedBlockPtr< T > block) |
pack(field) and unpack(field, rcbp) are used to provide the user with a local 1D view of all the data in a field not including guard layers that belongs to the local processor.
The local data is returned from pack() in a RefCountedBlockPtr which can provide raw pointers to the data via the beginPointer member function. Currently pack and unpack copy the data to and from a separate block of memory. If we need to later, we can perform various optimizations under the hood. For example, if there is only one local patch, and the domain is correct (no guards and it doesn't have unused points because of the centering), we could return the RefCountedBlockPtr to the underlying brick data. Given that this function will typically be applied to compressed data, which we would need to uncompress anyway, the copy is probably not going to be expensive.
RefCountedBlockPtr<typename InputField::Element_t> pack | ( | const InputField & | field | ) |
void unpack | ( | const InputField & | field, |
RefCountedBlockPtr< T > | block | ||
) |