FieldAOS.h

template<typename Field, typename Buffer>
void Cubism::IO::Field2AOS(const Field &f, const typename Field::IndexRangeType &r, Buffer *buf, const size_t dface = 0)

Write field data into AoS buffer.

Copy the data from a structure of arrays (SoA) field into an array of structures (AoS) buffer for I/O operation. This is a low-level function which can be used in high-level I/O interfaces. The index range r may describe a sub-region of the index range spanned by the field f. The size of the output buffer buf is determined by the index range r and Field::NComponents.

Template Parameters
  • Field: Field type

  • Buffer: Data type of AoS buffer

Parameters
  • f: Input field

  • r: Index space for the copy (describes the memory region of buf)

  • buf: Output buffer

  • dface: Face direction (relevant for Cubism::EntityType::Face)

template<typename Field, typename Buffer>
void Cubism::IO::AOS2Field(const Buffer *buf, const typename Field::IndexRangeType &r, Field &f, const size_t dface = 0)

Read AoS buffer into field data.

Copy the data from an array of structures (AoS) buffer into a structure of arrays field. This is a low-level function which can be used in high-level I/O interfaces. The index range r may describe a sub-region of the index range spanned by the field f. The size of the input buffer buf is determined by the index range r and Field::NComponents.

Template Parameters
  • Field: Field type

  • Buffer: Data type of AoS buffer

Parameters
  • buf: Input buffer

  • r: Index space for the read (describes the memory region of buf)

  • f: Output field

  • dface: Face direction (relevant for Cubism::EntityType::Face)