group_particles
Loading...
Searching...
No Matches
Functions
group_particles.hpp File Reference

For convenience, the user can just include this single header file. It contains the single routine to be called. More...

Go to the source code of this file.

Functions

template<typename AFields >
void group_particles (Callback< AFields > &callback)
 Runs the code.
 

Detailed Description

For convenience, the user can just include this single header file. It contains the single routine to be called.

Function Documentation

◆ group_particles()

template<typename AFields >
void group_particles ( Callback< AFields > &  callback)

Runs the code.

Template Parameters
AFieldsa type constructed from the AllFields template, defines which fields the code should read from the data files.
Parameters
[in,out]callbackby subclassing from the Callback abstract base class, the user defines which functionality they want the code to fulfill. Furthermore, the passed instance can be used to store data.

See the documentation of the Callback class for all methods that need to be overriden. Here, we give the order in which the non-const member functions are called (so that the user knows when data that they want to store inside the passed instance will be available).

  1. allow the user to read meta-data from the first group and particle files:
  2. perform user-defined action on each group:

    Will be called consecutively for each group that passes Callback::grp_select.

  3. perform user-defined action on each particle in each group:

    Will be called in an undefined order, perhaps in parallel. However, it is guaranteed that no two calls will be simultaneous if they pass the same group. Thus, if the user's Callback::prt_action implementation is local (in the sense that it only acts on data associated with a single group; this will be the case in almost all applications) the user is not required to take any precautations with regard to thread safety.