ASPECT
Public Member Functions | Private Attributes | List of all members
aspect::Particle::Property::ParticlePropertyInformation Class Reference

Public Member Functions

 ParticlePropertyInformation ()
 
 ParticlePropertyInformation (const std::vector< std::vector< std::pair< std::string, unsigned int >>> &property_information)
 
bool fieldname_exists (const std::string &name) const
 
unsigned int get_field_index_by_name (const std::string &name) const
 
std::string get_field_name_by_index (const unsigned int field_index) const
 
unsigned int get_position_by_field_name (const std::string &name) const
 
unsigned int get_components_by_field_name (const std::string &name) const
 
unsigned int get_position_by_field_index (const unsigned int field_index) const
 
unsigned int get_components_by_field_index (const unsigned int field_index) const
 
unsigned int get_position_by_plugin_index (const unsigned int plugin_index) 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 n_plugins () const
 
unsigned int n_fields () const
 
unsigned int n_components () const
 

Private Attributes

std::vector< std::string > field_names
 
std::vector< unsigned int > components_per_field
 
std::vector< unsigned int > position_per_field
 
std::vector< unsigned int > fields_per_plugin
 
std::vector< unsigned int > components_per_plugin
 
std::vector< unsigned int > position_per_plugin
 
unsigned int number_of_components
 
unsigned int number_of_fields
 
unsigned int number_of_plugins
 

Detailed Description

This class is used to store all the necessary information to translate between the data structure of the particle properties (a flat vector of doubles) and the semantic meaning of these properties. It contains information about the three layers of particle property information:

By 'property plugins' we mean each separate class that is derived from aspect::Particle::Property::Interface<dim>, and that is selected in the input file. This means in any model there are as many property plugins as entries in the 'List of particle properties' input parameter.

Each plugin can create one or more 'property fields'. Property fields are interpreted as distinctly named particle properties. Most plugins contain only one field, but some group distinctly named properties into groups, such as the 'InitialComposition' plugin, which creates one property field per compositional field and names the property fields according to the compositional field names. When writing particle data to output files each 'property field' will be written into a separate output field.

Last each field can contain several 'property components' if it represents a vector or tensor property. These components can not be named individually, but it is still important to be able to know how many components belong to a particular field.

Information that is often required by other algorithms is for example the number of components (= number of doubles in the property vector) of a particle field or plugin, and its position within the particle property vector. All of this information might be required within loops over all fields, or for a specific field either identified by its index, or by its name.

Definition at line 109 of file interface.h.

Constructor & Destructor Documentation

§ ParticlePropertyInformation() [1/2]

aspect::Particle::Property::ParticlePropertyInformation::ParticlePropertyInformation ( )

Empty default constructor.

§ ParticlePropertyInformation() [2/2]

aspect::Particle::Property::ParticlePropertyInformation::ParticlePropertyInformation ( const std::vector< std::vector< std::pair< std::string, unsigned int >>> &  property_information)

Constructor. Initialize the various arrays of this structure with the given property information collected from the individual plugins.

property_information A vector that contains one vector per property plugin. Each of these vectors contains one or more pairs that represent a property field name and the number of components for this field. The input argument can be constructed by concatenating the output of the Particle::Property::Interface<dim>::get_property_information() functions of all property plugins.

Member Function Documentation

§ fieldname_exists()

bool aspect::Particle::Property::ParticlePropertyInformation::fieldname_exists ( const std::string &  name) const

Checks if the particle property specified by name exists in this model.

§ get_field_index_by_name()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::get_field_index_by_name ( const std::string &  name) const

Get the field index of the particle property specified by name.

§ get_field_name_by_index()

std::string aspect::Particle::Property::ParticlePropertyInformation::get_field_name_by_index ( const unsigned int  field_index) const

Get the field index of the particle property specified by name.

§ get_position_by_field_name()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::get_position_by_field_name ( const std::string &  name) const

Get the data position of the first component of the particle property specified by name in the property vector of a particle.

§ get_components_by_field_name()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::get_components_by_field_name ( const std::string &  name) const

Get the number of components of the particle property specified by name.

§ get_position_by_field_index()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::get_position_by_field_index ( const unsigned int  field_index) const

Get the data position of the first component of the particle property specified by field_index in the property vector of a particle.

§ get_components_by_field_index()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::get_components_by_field_index ( const unsigned int  field_index) const

Get the number of components of the particle property specified by field_index.

§ get_position_by_plugin_index()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::get_position_by_plugin_index ( const unsigned int  plugin_index) const

Get the data position of the first component of the particle property specified by plugin_index in the property vector of a particle.

§ get_components_by_plugin_index()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::get_components_by_plugin_index ( const unsigned int  plugin_index) const

Get the number of components of the particle property specified by plugin_index.

§ get_fields_by_plugin_index()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::get_fields_by_plugin_index ( const unsigned int  plugin_index) const

Get the number of fields of the particle property specified by plugin_index.

§ n_plugins()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::n_plugins ( ) const

Return the number of active particle property plugins.

§ n_fields()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::n_fields ( ) const

Return the number of active particle property fields.

§ n_components()

unsigned int aspect::Particle::Property::ParticlePropertyInformation::n_components ( ) const

Return the number of active particle property components.

Member Data Documentation

§ field_names

std::vector<std::string> aspect::Particle::Property::ParticlePropertyInformation::field_names
private

A vector of all property field names.

Definition at line 224 of file interface.h.

§ components_per_field

std::vector<unsigned int> aspect::Particle::Property::ParticlePropertyInformation::components_per_field
private

A vector containing the number of components per property field.

Definition at line 229 of file interface.h.

§ position_per_field

std::vector<unsigned int> aspect::Particle::Property::ParticlePropertyInformation::position_per_field
private

A vector containing the position index of the first data component of each field in the property vector of every particle.

Definition at line 235 of file interface.h.

§ fields_per_plugin

std::vector<unsigned int> aspect::Particle::Property::ParticlePropertyInformation::fields_per_plugin
private

A vector containing the number of property fields per property plugin.

Definition at line 241 of file interface.h.

§ components_per_plugin

std::vector<unsigned int> aspect::Particle::Property::ParticlePropertyInformation::components_per_plugin
private

A vector containing the number of components per property plugin.

Definition at line 246 of file interface.h.

§ position_per_plugin

std::vector<unsigned int> aspect::Particle::Property::ParticlePropertyInformation::position_per_plugin
private

A vector containing the position index of the first data component of each plugin in the property vector of every particle.

Definition at line 252 of file interface.h.

§ number_of_components

unsigned int aspect::Particle::Property::ParticlePropertyInformation::number_of_components
private

The number of doubles needed to represent a particle's additional properties.

Definition at line 258 of file interface.h.

§ number_of_fields

unsigned int aspect::Particle::Property::ParticlePropertyInformation::number_of_fields
private

The number of distinctly named particle property fields.

Definition at line 263 of file interface.h.

§ number_of_plugins

unsigned int aspect::Particle::Property::ParticlePropertyInformation::number_of_plugins
private

The number of active particle property plugins.

Definition at line 268 of file interface.h.


The documentation for this class was generated from the following file: