8 #include <application/application.hpp>
9 #include <application/exceptions.hpp>
12 #include <athena/mesh/mesh.hpp>
23 :
NamedGroup(name), linked_flag_(false), pmy_block_(pmb) {
24 Application::Logger app(
"n-body");
25 app->Log(
"Initialize ParticleBase");
27 int nc1 = pmb->ncells1, nc2 = pmb->ncells2, nc3 = pmb->ncells3;
29 weight.NewAthenaArray(nc3, nc2, nc1);
30 charge.NewAthenaArray(nc3, nc2, nc1);
35 Application::Logger app(
"n-body");
36 app->Log(
"Destroy ParticleBase");
42 std::string str = pin->GetOrAddString(
"particles",
"particles",
"");
43 auto particle_names = Vectorize<std::string>(str.c_str());
45 for (
auto const &name : particle_names) {
47 all_particles.push_back(std::make_shared<ParticleBase>(pmb, name));
48 }
else if (name ==
"scp") {
49 all_particles.push_back(std::make_shared<ParticleBase>(pmb, name));
51 throw NotImplementedError(
"Particle '" + name +
"' unrecognized.");
61 for (
auto &pt : pts) {
62 if (pt->GetName() == name)
return pt;
AthenaArray< ParticleData * > pd_in_cell_
AthenaArray< Real > charge
AthenaArray< Real > weight
mesh data container
ParticleBase(MeshBlock *pmb, std::string name)
static AllParticles Create(MeshBlock *pmb, ParameterInput *pin)
ParticlePtr find_particle(AllParticles const &pts, std::string name)
std::shared_ptr< ParticleBase > ParticlePtr
std::vector< ParticlePtr > AllParticles