21 #ifndef _aspect_particle_property_interface_h 22 #define _aspect_particle_property_interface_h 30 #include <deal.II/particles/particle.h> 31 #include <deal.II/particles/particle_handler.h> 32 #include <deal.II/particles/property_pool.h> 33 #include <deal.II/fe/fe_update_flags.h> 43 using namespace ::Particles;
338 initialize_one_particle_property (
const Point<dim> &position,
339 std::vector<double> &particle_properties)
const;
369 update_particle_property (
const unsigned int data_position,
370 const Vector<double> &solution,
371 const std::vector<Tensor<1,dim>> &gradients,
372 typename ParticleHandler<dim>::particle_iterator &particle)
const;
405 update_one_particle_property (
const unsigned int data_position,
406 const Point<dim> &position,
407 const Vector<double> &solution,
408 const std::vector<Tensor<1,dim>> &gradients,
409 const ArrayView<double> &particle_properties)
const;
425 need_update ()
const;
437 get_needed_update_flags ()
const;
455 late_initialization_mode ()
const;
471 std::vector<std::pair<std::string, unsigned int>>
472 get_property_information()
const = 0;
500 parse_parameters (ParameterHandler &prm);
522 initialize_one_particle_property (
const Point<dim> &position,
523 std::vector<double> &particle_properties)
const override;
532 std::vector<std::pair<std::string, unsigned int>>
533 get_property_information()
const override;
540 parse_parameters (ParameterHandler &prm)
override;
584 initialize_one_particle (
typename ParticleHandler<dim>::particle_iterator &particle)
const;
593 initialize_late_particle (
const Point<dim> &particle_location,
594 const ParticleHandler<dim> &particle_handler,
596 const typename parallel::distributed::Triangulation<dim>::active_cell_iterator &cell =
typename parallel::distributed::Triangulation<dim>::active_cell_iterator())
const;
603 update_one_particle (
typename ParticleHandler<dim>::particle_iterator &particle,
604 const Vector<double> &solution,
605 const std::vector<Tensor<1,dim>> &gradients)
const;
619 need_update ()
const;
628 get_needed_update_flags ()
const;
635 plugin_name_exists(
const std::string &name)
const;
647 check_plugin_order(
const std::string &first,
const std::string &second)
const;
652 unsigned int get_plugin_index_by_name(
const std::string &name)
const;
660 template <
typename ParticlePropertyType>
663 has_matching_property ()
const;
673 template <
typename ParticlePropertyType>
675 const ParticlePropertyType &
676 get_matching_property ()
const;
686 get_n_property_components ()
const;
697 get_particle_size ()
const;
706 get_data_info()
const;
717 get_property_component_by_name(
const std::string &name)
const;
739 register_particle_property (
const std::string &name,
740 const std::string &description,
741 void (*declare_parameters_function) (ParameterHandler &),
756 parse_parameters (ParameterHandler &prm);
796 template <
typename ParticlePropertyType>
801 for (
const auto &p : property_list)
802 if (Plugins::plugin_type_matches<ParticlePropertyType>(*p))
810 template <
typename ParticlePropertyType>
812 const ParticlePropertyType &
815 AssertThrow(has_matching_property<ParticlePropertyType> (),
816 ExcMessage(
"You asked Particle::Property::Manager::has_matching_property() for a " 817 "particle property of type <" + boost::core::demangle(
typeid(ParticlePropertyType).name()) +
"> " 818 "that could not be found in the current model. Activate this " 819 "particle property in the input file."));
821 typename std::vector<std::unique_ptr<Interface<dim>>>::const_iterator property;
822 for (
const auto &p : property_list)
823 if (Plugins::plugin_type_matches<ParticlePropertyType>(*p))
824 return Plugins::get_plugin_as_type<ParticlePropertyType>(*p);
827 return Plugins::get_plugin_as_type<ParticlePropertyType>(*(*property));
837 #define ASPECT_REGISTER_PARTICLE_PROPERTY(classname,name,description) \ 838 template class classname<2>; \ 839 template class classname<3>; \ 840 namespace ASPECT_REGISTER_PARTICLE_PROPERTY_ ## classname \ 842 aspect::internal::Plugins::RegisterHelper<aspect::Particle::Property::Interface<2>,classname<2>> \ 843 dummy_ ## classname ## _2d (&aspect::Particle::Property::Manager<2>::register_particle_property, \ 844 name, description); \ 845 aspect::internal::Plugins::RegisterHelper<aspect::Particle::Property::Interface<3>,classname<3>> \ 846 dummy_ ## classname ## _3d (&aspect::Particle::Property::Manager<3>::register_particle_property, \ 847 name, description); \ unsigned int n_components() const
std::vector< unsigned int > position_per_field
std::string get_field_name_by_index(const unsigned int field_index) const
StructuredDataLookup< dim > DEAL_II_DEPRECATED
ParticlePropertyInformation property_information
unsigned int get_components_by_field_index(const unsigned int field_index) const
std::vector< unsigned int > components_per_plugin
void write_plugin_graph(std::ostream &output_stream)
unsigned int get_components_by_field_name(const std::string &name) const
bool has_matching_property() const
unsigned int get_position_by_field_name(const std::string &name) const
bool fieldname_exists(const std::string &name) const
InitializationModeForLateParticles
std::vector< std::string > field_names
std::vector< unsigned int > components_per_field
unsigned int n_integrator_properties
unsigned int get_field_index_by_name(const std::string &name) const
unsigned int number_of_components
std::list< std::unique_ptr< Interface< dim > > > property_list
unsigned int number_of_plugins
unsigned int get_position_by_plugin_index(const unsigned int plugin_index) const
std::vector< unsigned int > fields_per_plugin
unsigned int n_fields() const
unsigned int get_components_by_plugin_index(const unsigned int plugin_index) const
unsigned int get_fields_by_plugin_index(const unsigned int plugin_index) const
unsigned int number_of_fields
std::vector< unsigned int > position_per_plugin
const ParticlePropertyType & get_matching_property() const
void declare_parameters(ParameterHandler &prm)
unsigned int n_plugins() const
ParticlePropertyInformation()
std::vector< std::string > plugin_names
unsigned int get_position_by_field_index(const unsigned int field_index) const