32#include "ParticleList.hpp"
55template <
class T>
struct DefaultInitAllocator : std::allocator<T> {
58 using std::allocator<T>::allocator;
60 template <
class U>
struct rebind {
61 using other = DefaultInitAllocator<U>;
69 void construct(T *p)
noexcept { ::new (
static_cast<void *
>(p)) T; }
72 template <
class... Args>
void construct(T *p, Args &&...args) {
73 ::new (
static_cast<void *
>(p)) T(std::forward<Args>(args)...);
92 using ByteVec = std::vector<char, detail::DefaultInitAllocator<char>>;
96 char *
data() {
return buf.data(); }
97 const char *
data()
const {
return buf.data(); }
100 std::size_t
size()
const {
return buf.size(); }
107 void resize(std::size_t new_size) { buf.resize(new_size); }
111 const auto &
bonds()
const {
return bondbuf; }
113 auto make_span() {
return std::span(buf.data(), buf.size()); }
147void pack_cells(CommBuf &buf, std::span<ParticleList *const> cells,
149 unsigned data_parts);
162void unpack_cells(CommBuf &buf, std::span<ParticleList *const> cells,
174void add_forces(CommBuf &buf, std::span<ParticleList *const> cells,
175 unsigned data_parts);
177#ifdef ESPRESSO_BOND_CONSTRAINT
181void add_rattle(CommBuf &buf, std::span<ParticleList *const> cells);
184#ifdef ESPRESSO_DIPOLE_FIELD_TRACKING
188void add_dip_fld(CommBuf &buf, std::span<ParticleList *const> cells);
206 unsigned data_parts);
Vector implementation and trait types for boost qvm interoperability.
Class that stores marshalled data for ghost communications.
char * data()
Returns a pointer to the non-bond storage.
std::size_t size() const
Returns the number of elements in the non-bond storage.
const auto & bonds() const
auto & bonds()
Returns a reference to the bond storage.
const char * data() const
void resize(std::size_t new_size)
Resizes the underlying storage s.t.
void unpack_cells(CommBuf &buf, std::span< ParticleList *const > cells, BoxGeometry const &box_geo, unsigned data_parts)
Unpack particle data from a communication buffer into cells.
void pack_cells(CommBuf &buf, std::span< ParticleList *const > cells, Utils::Vector3d const &shift, BoxGeometry const &box_geo, unsigned data_parts)
Pack particle data from cells into a communication buffer.
void local_cell_copy(ParticleList &src, ParticleList &dst, Utils::Vector3d const &shift, BoxGeometry const &box_geo, unsigned data_parts)
Copy particle data from src to dst applying a ghost shift.
std::size_t calc_transmit_size(BoxGeometry const &box_geo, unsigned data_parts)
Calculate the per-particle transmit size for the given data parts.
void add_forces(CommBuf &buf, std::span< ParticleList *const > cells, unsigned data_parts)
Add forces (and optionally torques) from a communication buffer to particles in cells.
void add_dip_fld(CommBuf &buf, std::span< ParticleList *const > cells)
Add dipole fields from a communication buffer to particles.
void add_rattle(CommBuf &buf, std::span< ParticleList *const > cells)
Add rattle corrections from a communication buffer to particles.