ASPECT
aspect::Particle::Property::Interface< dim > Class Template Referenceabstract
Inheritance diagram for aspect::Particle::Property::Interface< dim >:
[legend]

## Public Member Functions

virtual ~Interface ()

virtual void initialize ()

virtual void initialize_one_particle_property (const Point< dim > &position, std::vector< double > &particle_properties) const

virtual void update_particle_property (const unsigned int data_position, const Vector< double > &solution, const std::vector< Tensor< 1, dim > > &gradients, typename ParticleHandler< dim >::particle_iterator &particle) const

virtual DEAL_II_DEPRECATED void update_one_particle_property (const unsigned int data_position, const Point< dim > &position, const Vector< double > &solution, const std::vector< Tensor< 1, dim > > &gradients, const ArrayView< double > &particle_properties) const

virtual UpdateTimeFlags need_update () const

virtual UpdateFlags get_needed_update_flags () const

virtual InitializationModeForLateParticles late_initialization_mode () const

virtual std::vector< std::pair< std::string, unsigned int > > get_property_information () const =0

virtual void parse_parameters (ParameterHandler &prm)

## Static Public Member Functions

static void declare_parameters (ParameterHandler &prm)

## Detailed Description

### template<int dim> class aspect::Particle::Property::Interface< dim >

Interface provides an example of how to extend the Particle class to include related particle data. This allows users to attach scalars/vectors/tensors/etc to particles and ensure they are transmitted correctly over MPI and written to output files.

Definition at line 308 of file interface.h.

## § ~Interface()

template<int dim>
 virtual aspect::Particle::Property::Interface< dim >::~Interface ( )
virtual

Destructor. Made virtual so that derived classes can be created and destroyed through pointers to the base class.

## § initialize()

template<int dim>
 virtual void aspect::Particle::Property::Interface< dim >::initialize ( )
virtual

Initialization function. This function is called once at the beginning of the program after parse_parameters is run.

## § initialize_one_particle_property()

template<int dim>
 virtual void aspect::Particle::Property::Interface< dim >::initialize_one_particle_property ( const Point< dim > & position, std::vector< double > & particle_properties ) const
virtual

Initialization function. This function is called once at the creation of every particle for every property to initialize its value.

Parameters
 [in] position The current particle position. [in,out] particle_properties The properties of the particle that is initialized within the call of this function. The purpose of this function should be to extend this vector by a number of properties.

## § update_particle_property()

template<int dim>
 virtual void aspect::Particle::Property::Interface< dim >::update_particle_property ( const unsigned int data_position, const Vector< double > & solution, const std::vector< Tensor< 1, dim > > & gradients, typename ParticleHandler< dim >::particle_iterator & particle ) const
virtual

Update function. This function is called every time an update is request by need_update() for every particle for every property. It is obvious that this function is called a lot, so its code should be efficient. The interface provides a default implementation that does nothing, therefore derived plugins that do not require an update do not need to implement this function.

Parameters
 [in] data_position An unsigned integer that denotes which component of the particle property vector is associated with the current property. For properties that own several components it denotes the first component of this property, all other components fill consecutive entries in the particle_properties vector. [in] solution The values of the solution variables at the current particle position. [in] gradients The gradients of the solution variables at the current particle position. [in,out] particle The particle that is updated within the call of this function. The particle location can be accessed using particle->get_location() and its properties using particle->get_properties().

## § update_one_particle_property()

template<int dim>
 virtual DEAL_II_DEPRECATED void aspect::Particle::Property::Interface< dim >::update_one_particle_property ( const unsigned int data_position, const Point< dim > & position, const Vector< double > & solution, const std::vector< Tensor< 1, dim > > & gradients, const ArrayView< double > & particle_properties ) const
virtual

Update function. This function is called every time an update is request by need_update() for every particle for every property. It is obvious that this function is called a lot, so its code should be efficient. The interface provides a default implementation that does nothing, therefore derived plugins that do not require an update do not need to implement this function.

Parameters
 [in] data_position An unsigned integer that denotes which component of the particle property vector is associated with the current property. For properties that own several components it denotes the first component of this property, all other components fill consecutive entries in the particle_properties vector. [in] position The current particle position. [in] solution The values of the solution variables at the current particle position. [in] gradients The gradients of the solution variables at the current particle position. [in,out] particle_properties The properties of the particle that is updated within the call of this function.
Deprecated:

## § need_update()

template<int dim>
 virtual UpdateTimeFlags aspect::Particle::Property::Interface< dim >::need_update ( ) const
virtual

Returns an enum, which determines at what times particle properties are updated. The default implementation returns update_never, which signals that particle properties should never be updated. See the documentation of UpdateTimeFlags for a list of possible values and examples for their use. Every plugin that implements this function should return the value appropriate for its purpose, unless it does not need any update, which is the default. This option saves considerable computation time in cases, when no plugin needs to update particle properties over time.

## § get_needed_update_flags()

template<int dim>
 virtual UpdateFlags aspect::Particle::Property::Interface< dim >::get_needed_update_flags ( ) const
virtual

Return which data has to be provided to update all properties. Note that particle properties can only ask for update_default (no data), update_values (solution values), and update_gradients (solution gradients). All other update flags will have no effect.

Returns
The necessary update flags for this particle property.

## § late_initialization_mode()

template<int dim>
 virtual InitializationModeForLateParticles aspect::Particle::Property::Interface< dim >::late_initialization_mode ( ) const
virtual

Returns an enum, which determines how this particle property is initialized for particles that are created later than the initial particle generation, e.g. to balance the particle load or prevent empty cells. The default implementation returns interpolate, which will use the particle interpolator to set the new particle properties to a value that is interpolated from the other particles in the cell. See the documentation of InitializationModeForLateParticles for a list of possible values and examples for their use. Every plugin that implements this function should return the value appropriate for its purpose, unless it wants to use the default value.

Reimplemented in aspect::Particle::Property::InitialComposition< dim >.

## § get_property_information()

template<int dim>
 virtual std::vector > aspect::Particle::Property::Interface< dim >::get_property_information ( ) const
pure virtual

Set up the information about the names and number of components this property requires. Derived classes need to implement this function.

The purpose of this function is to return a vector of pairs of a property name and the number of components associated with this name (e.g. 1 for scalar properties, n for n-dimensional vectors).

Returns
A vector that contains pairs of the property names and the number of components this property plugin defines.

## § declare_parameters()

template<int dim>
 static void aspect::Particle::Property::Interface< dim >::declare_parameters ( ParameterHandler & prm )
static

Declare the parameters this class takes through input files. Derived classes should overload this function if they actually do take parameters; this class declares a fall-back function that does nothing, so that property classes that do not take any parameters do not have to do anything at all.

This function is static (and needs to be static in derived classes) so that it can be called without creating actual objects (because declaring parameters happens before we read the input file and thus at a time when we don't even know yet which property objects we need).

## § parse_parameters()

template<int dim>
 virtual void aspect::Particle::Property::Interface< dim >::parse_parameters ( ParameterHandler & prm )
virtual

Read the parameters this class declares from the parameter file. The default implementation in this class does nothing, so that derived classes that do not need any parameters do not need to implement it.

The documentation for this class was generated from the following file:
• /home/bob/source/include/aspect/particle/property/interface.h