CreateMessage Struct Reference

SPADES API: spades::particles::CreateMessage Struct Reference
SPADES API
spades::particles::CreateMessage Struct Reference

Functor for populating message data. More...

#include <MessageOps.H>

Public Member Functions

template<class PArrs >
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void operator() (const amrex::Long n, PArrs &parrs, const amrex::Real timestamp, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &pos, const amrex::IntVect &iv, const int sender_lp, const int sender_entity, const int receiver_lp, const int receiver_entity) const
 Create a message.
 

Detailed Description

Functor for populating message data.

Member Function Documentation

◆ operator()()

template<class PArrs >
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void spades::particles::CreateMessage::operator() ( const amrex::Long n,
PArrs & parrs,
const amrex::Real timestamp,
const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > & pos,
const amrex::IntVect & iv,
const int sender_lp,
const int sender_entity,
const int receiver_lp,
const int receiver_entity ) const
inline

Create a message.

Parameters
n[in] message index
parrs[in, out] message arrays
timestamp[in] time stamp
pos[in] position
iv[in] index
sender_lp[in] sender LP id
sender_entity[in] entity id
receiver_lp[in] receiver LP id
receiver_entity[in] entity id
38 {
39 AMREX_ASSERT(
40 parrs.m_idata[CommonIntData::type_id][n] ==
42
44 parrs.m_rdata[CommonRealData::timestamp][n] = timestamp;
45
46 auto& p = parrs.m_aos[n];
47 AMREX_D_TERM(p.pos(0) = pos[0];, p.pos(1) = pos[1];, p.pos(2) = pos[2];)
48 AMREX_D_TERM(parrs.m_idata[CommonIntData::i][n] = iv[0];
49 , parrs.m_idata[CommonIntData::j][n] = iv[1];
50 , parrs.m_idata[CommonIntData::k][n] = iv[2];)
51 parrs.m_idata[MessageIntData::sender_lp][n] = sender_lp;
52 parrs.m_idata[MessageIntData::sender_entity][n] = sender_entity;
53 parrs.m_idata[MessageIntData::receiver_lp][n] = receiver_lp;
54 parrs.m_idata[MessageIntData::receiver_entity][n] = receiver_entity;
55 }
@ type_id
Definition ParticleData.H:18
@ timestamp
Definition ParticleData.H:12
@ receiver_lp
Definition MessageData.H:23
@ sender_entity
Definition MessageData.H:24
@ sender_lp
Definition MessageData.H:22
@ receiver_entity
Definition MessageData.H:25
static constexpr int UNDEFINED
Undefined message.
Definition MessageData.H:44
static constexpr int MESSAGE
Message.
Definition MessageData.H:36

The documentation for this struct was generated from the following file: