tk::Tracker class

Tracker advances Lagrangian particles in state space.

Constructors, destructors, conversion operators

Tracker(bool feedback = false, std::size_t npar = 0, const std::vector<std::size_t>& inpoel = {}) explicit

Public functions

void genpar(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, std::size_t nchare, int chid)
Generate particles to each of our mesh cells.
template<class HostProxy, class ParticleWriterProxy, class ChareArray>
void writeParticles(HostProxy& hostproxy, const ParticleWriterProxy& pw, ChareArray*const array)
template<class ParticleWriterProxy>
void doWriteParticles(const ParticleWriterProxy& pw, uint64_t it, std::size_t nchare)
template<class ChareArray>
void advanceParticle(ChareArray*const array, std::size_t i, std::size_t e, tk::real dt, const std::array<tk::real, 4>& Np)
template<class HostProxy, class ChareArrayProxy, class ChareArray>
void track(HostProxy& hostproxy, const ChareArrayProxy& arrayProxy, const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, const std::unordered_map<int, std::vector<std::size_t>>& msum, int chid, ChareArray*const array, tk::real dt)
template<class ChareArrayProxy>
void findpar(const ChareArrayProxy& arrayProxy, const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, int fromch, const std::vector<std::size_t>& miss, const std::vector<std::vector<tk::real>>& ps)
template<class HostProxy, class ChareArrayProxy, class ChareArray>
void foundpar(HostProxy& hostproxy, ChareArrayProxy& arrayProxy, const std::unordered_map<int, std::vector<std::size_t>>& msum, ChareArray*const array, int chid, const std::vector<std::size_t>& found)
template<class ChareArrayProxy>
void collectpar(const ChareArrayProxy& arrayProxy, const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, int fromch, const std::vector<std::size_t>& miss, const std::vector<std::vector<tk::real>>& ps)
template<class HostProxy, class ChareArray>
void collectedpar(HostProxy& hostproxy, ChareArray*const array, const std::vector<std::size_t>& found, std::size_t nchare)

Charm++ pack/unpack serializer member functions

tk::Particles m_particles
Particle properties.
std::vector<std::size_t> m_elp
Element ID in which a particle has last been found for all particles.
std::set<std::size_t> m_parmiss
Indicies of particles not found here (missing)
std::set<std::size_t> m_parelse
Indicies of particles not found here but found by fellows.
std::size_t m_nchpar
Number of chares we received particles from.
std::pair<std::vector<std::size_t>, std::vector<std::size_t>> m_esupel
Elements surrounding points of elements of mesh chunk we operate on.
bool m_feedback
Bool that determines whether to send sub-task feedback to host.
void pup(PUP::er& p)
Pack/Unpack serialize member function.
void operator|(PUP::er& p, Tracker& i)
Pack/Unpack serialize operator|.

Function documentation

tk::Tracker::Tracker(bool feedback = false, std::size_t npar = 0, const std::vector<std::size_t>& inpoel = {}) explicit

Parameters
feedback in Whether to send sub-task feedback to host
npar in Number of particles per mesh element
inpoel in Mesh element connectivity

Constructor

void tk::Tracker::genpar(const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, std::size_t nchare, int chid)

Generate particles to each of our mesh cells.

Parameters
coord in Mesh node coordinates
inpoel in Mesh element connectivity
nchare in Total number of holder array chares
chid in Host chare ID (thisIndex)

template<class HostProxy, class ParticleWriterProxy, class ChareArray>
void tk::Tracker::writeParticles(HostProxy& hostproxy, const ParticleWriterProxy& pw, ChareArray*const array)

Parameters
hostproxy in Charm++ host proxy to which address reductions
pw in Charm++ particle writer proxy
array in Charm++ array object pointer of the holder class

Output number of particles we will write to file in this step

template<class ParticleWriterProxy>
void tk::Tracker::doWriteParticles(const ParticleWriterProxy& pw, uint64_t it, std::size_t nchare)

Parameters
pw in Charm++ particle writer proxy
it in Iteration count
nchare in Number of chares that contribute

Output particles fields to file

template<class ChareArray>
void tk::Tracker::advanceParticle(ChareArray*const array, std::size_t i, std::size_t e, tk::real dt, const std::array<tk::real, 4>& Np)

Parameters
array in Charm++ array object pointer of the holder class
in Particle index
in Mesh element index where the particle currently resides
dt in Time step size
Np in Four finite-element shapefunctions evaluated (as a result of the particle search) at the particle location in element e

Advance particle based on velocity from mesh cell

template<class HostProxy, class ChareArrayProxy, class ChareArray>
void tk::Tracker::track(HostProxy& hostproxy, const ChareArrayProxy& arrayProxy, const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, const std::unordered_map<int, std::vector<std::size_t>>& msum, int chid, ChareArray*const array, tk::real dt)

Parameters
hostproxy in Charm++ host proxy to which address reductions
arrayProxy in Charm++ array proxy to which address point-to-point communications (this is the proxy that holds us)
coord in Mesh node coordinates
inpoel in Mesh element connectivity
msum in Mesh chunks surrounding mesh chunks; we only use the keys of this container to address fellow Charm++ chare array elements via the arrayProxy
chid in Charm++ array index (thisIndex of the holder class)
array in Charm++ array object pointer of the holder class
dt in Time step size

Advance our particles and initiate search for their new mesh cells

template<class ChareArrayProxy>
void tk::Tracker::findpar(const ChareArrayProxy& arrayProxy, const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, int fromch, const std::vector<std::size_t>& miss, const std::vector<std::vector<tk::real>>& ps)

Parameters
arrayProxy in Charm++ array proxy to which address point-to-point communications (this is the proxy that holds us)
coord in Mesh node coordinates
inpoel in Mesh element connectivity
fromch in Chare ID the request originates from
miss in Indices of particles to find
ps in Particle data associated to those particle indices to find

Find particles missing by the requestor and make those found ours

template<class HostProxy, class ChareArrayProxy, class ChareArray>
void tk::Tracker::foundpar(HostProxy& hostproxy, ChareArrayProxy& arrayProxy, const std::unordered_map<int, std::vector<std::size_t>>& msum, ChareArray*const array, int chid, const std::vector<std::size_t>& found)

Parameters
hostproxy in Charm++ host proxy to which address reductions
arrayProxy in Charm++ array proxy to whose all elements te address our desparate broadcast (this is the proxy that holds us)
msum in Mesh chunks surrounding mesh chunks; we only use the keys of this container to address fellow Charm++ chare array elements via the arrayProxy
array in Charm++ array object pointer of the holder class
chid in Charm++ array index (thisIndex of the holder class)
found in Indices of particles found

Receive particle indices found elsewhere (by fellow neighbors)

template<class ChareArrayProxy>
void tk::Tracker::collectpar(const ChareArrayProxy& arrayProxy, const std::array<std::vector<tk::real>, 3>& coord, const std::vector<std::size_t>& inpoel, int fromch, const std::vector<std::size_t>& miss, const std::vector<std::vector<tk::real>>& ps)

Parameters
arrayProxy in Charm++ array proxy to which address point-to-point communications (this is the proxy that holds us)
coord in Mesh node coordinates
inpoel in Mesh element connectivity
fromch in Chare ID the request originates from
miss in Indices of particles to find
ps in Particle data associated to those particle indices to find

Find particles missing by the requestor and make those found ours

template<class HostProxy, class ChareArray>
void tk::Tracker::collectedpar(HostProxy& hostproxy, ChareArray*const array, const std::vector<std::size_t>& found, std::size_t nchare)

Parameters
hostproxy in Charm++ host proxy to which address reductions
array in Charm++ array object pointer of the holder class
found in Indices of particles found
nchare in Total number of holder array chares

Collect particle indices found elsewhere (by far fellows)

void tk::Tracker::pup(PUP::er& p)

Pack/Unpack serialize member function.

Parameters
in/out Charm++'s PUP::er serializer object reference

void tk::Tracker::operator|(PUP::er& p, Tracker& i)

Pack/Unpack serialize operator|.

Parameters
in/out Charm++'s PUP::er serializer object reference
in/out Tracker object reference