Canoe
Comprehensive Atmosphere N' Ocean Engine
particle_outputs.cpp
Go to the documentation of this file.
1 
4 // athena
5 #include <athena/outputs/outputs.hpp>
6 
7 // n-body
8 #include "particles.hpp"
9 
10 bool ParticleBase::ShouldMeshOutput(std::string variable_name) const {
11  return variable_name.compare("particle") == 0;
12 }
13 
14 void ParticleBase::LoadMeshOutputData(OutputType *out, int *num_vars) const {
15  OutputData *pod = new OutputData;
16  pod->type = "SCALARS";
17  pod->name = "p-weight";
18  pod->data.InitWithShallowSlice(const_cast<AthenaArray<Real> &>(weight), 4, 0,
19  1);
20  out->AppendOutputDataNode(pod);
21  *num_vars += 1;
22 
23  pod = new OutputData;
24  pod->type = "SCALARS";
25  pod->name = "p-charge";
26  pod->data.InitWithShallowSlice(const_cast<AthenaArray<Real> &>(charge), 4, 0,
27  1);
28  out->AppendOutputDataNode(pod);
29  *num_vars += 1;
30 }
AthenaArray< Real > charge
Definition: particles.hpp:42
AthenaArray< Real > weight
mesh data container
Definition: particles.hpp:42
bool ShouldMeshOutput(std::string variable_name) const override
void LoadMeshOutputData(OutputType *pod, int *num_vars) const override