21 #ifndef _aspect_particle_generator_interface_h 22 #define _aspect_particle_generator_interface_h 27 #include <deal.II/particles/particle.h> 28 #include <deal.II/particles/generators.h> 29 #include <deal.II/base/parameter_handler.h> 47 using namespace ::Particles;
48 using ::Particles::Particle;
54 "You requested to generate a particle at a position that " 55 "is not owned by this process, therefore the " 56 "Particle::Generator::Interface::generate_particle() function " 57 "refused to create it. You can circumvent this error message " 58 "by catching the ExcParticlePointNotInDomain exception and " 59 "do whatever you think is appropriate in this case.");
67 class Interface :
public SimulatorAccess<dim>,
public ParticleInterfaceBase
75 save (std::map<std::string, std::string> &status_strings)
const override;
78 load (
const std::map<std::string, std::string> &status_strings)
override;
103 std::pair<Particles::internal::LevelInd,Particle<dim>>
104 generate_particle (
const typename parallel::distributed::Triangulation<dim>::active_cell_iterator &cell,
105 const types::particle_index
id);
117 std::pair<Particles::internal::LevelInd,Particle<dim>>
118 generate_particle (
const typename parallel::distributed::Triangulation<dim>::active_cell_iterator &cell,
119 const types::particle_index
id,
120 const Point<dim> &reference_position);
135 std::pair<Particles::internal::LevelInd,Particle<dim>>
137 const types::particle_index
id)
const;
159 Particles::ParticleIterator<dim>
161 const types::particle_index
id,
162 Particles::ParticleHandler<dim> &particle_handler)
const;
189 const std::string &description,
190 void (*declare_parameters_function) (ParameterHandler &),
204 std::unique_ptr<Interface<dim>>
238 #define ASPECT_REGISTER_PARTICLE_GENERATOR(classname, name, description) \ 239 template class classname<2>; \ 240 template class classname<3>; \ 241 namespace ASPECT_REGISTER_PARTICLE_GENERATOR_ ## classname \ 243 aspect::internal::Plugins::RegisterHelper<aspect::Particle::Generator::Interface<2>,classname<2 >> \ 244 dummy_ ## classname ## _2d (&aspect::Particle::Generator::register_particle_generator<2>, \ 245 name, description); \ 246 aspect::internal::Plugins::RegisterHelper<aspect::Particle::Generator::Interface<3>,classname<3>> \ 247 dummy_ ## classname ## _3d (&aspect::Particle::Generator::register_particle_generator<3>, \ 248 name, description); \ Particles::ParticleIterator< dim > insert_particle_at_position(const Point< dim > &position, const types::particle_index id, Particles::ParticleHandler< dim > &particle_handler) const
virtual void initialize() override
virtual void generate_particles(Particles::ParticleHandler< dim > &particle_handler)=0
std::pair< Particles::internal::LevelInd, Particle< dim > > generate_particle(const typename parallel::distributed::Triangulation< dim >::active_cell_iterator &cell, const types::particle_index id)
DeclExceptionMsg(ExcParticlePointNotInDomain, "You requested to generate a particle at a position that " "is not owned by this process, therefore the " "Particle::Generator::Interface::generate_particle() function " "refused to create it. You can circumvent this error message " "by catching the ExcParticlePointNotInDomain exception and " "do whatever you think is appropriate in this case.")
void register_particle_generator(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< Interface< dim >>(*factory_function)())
void write_plugin_graph(std::ostream &output_stream)
std::unique_ptr< Interface< dim > > create_particle_generator(ParameterHandler &prm)
void load(const std::map< std::string, std::string > &status_strings) override
void save(std::map< std::string, std::string > &status_strings) const override
std::mt19937 random_number_generator
static void declare_parameters(ParameterHandler &prm)