Canoe
Comprehensive Atmosphere N' Ocean Engine
particle_data.hpp
Go to the documentation of this file.
1 #ifndef SRC_NBODY_PARTICLE_DATA_HPP_
2 #define SRC_NBODY_PARTICLE_DATA_HPP_
3 
4 // C/C++ headers
5 #include <array>
6 #include <iosfwd>
7 #include <vector>
8 
9 // Athena++ headers
10 #include <athena/athena.hpp>
11 
12 // canoe
13 #include <configure.hpp>
14 
15 #ifdef MPI_PARALLEL
16 #include <mpi.h>
17 #endif // MPI_PARALLEL
18 
19 class MeshBlock;
20 
21 struct ParticleData {
24 
26  int pid, tid;
27 
29  std::array<int, NINT_PARTICLE_DATA> ii;
30 
32  Real time, weight, charge;
33 
35  Real x1, x2, x3;
36 
38  Real v1, v2, v3;
39 
41  Real a1, a2, a3;
42 
44  std::array<Real, NREAL_PARTICLE_DATA> rr;
45 };
46 
47 std::ostream& operator<<(std::ostream& os, ParticleData const& mp);
48 
49 // helper functions
50 namespace ParticlesHelper {
51 
52 bool check_in_meshblock(ParticleData const& pd, MeshBlock const* pmb);
55 
56 } // namespace ParticlesHelper
57 
58 #endif // SRC_NBODY_PARTICLE_DATA_HPP_
void commit_mpi_particle_data()
void free_mpi_particle_data()
bool check_in_meshblock(ParticleData const &pd, MeshBlock const *pmb)
std::ostream & operator<<(std::ostream &os, ParticleData const &mp)
std::array< Real, NREAL_PARTICLE_DATA > rr
extra real data
Real v1
velocities
int pid
particle id, type id
Real x1
positions
Real time
time instantiated, weight and charge
Real a1
accelerations
std::array< int, NINT_PARTICLE_DATA > ii
extra integer data
ParticleData * next
particle can form a linked list