ASPECT
Public Member Functions | Protected Attributes | List of all members
aspect::Particle::Property::Interface< dim > Class Template Referenceabstract
Inheritance diagram for aspect::Particle::Property::Interface< dim >:
Inheritance graph
[legend]

Public Member Functions

virtual void initialize_one_particle_property (const Point< dim > &position, std::vector< double > &particle_properties) const
 
virtual void update_particle_properties (const ParticleUpdateInputs< dim > &inputs, typename ParticleHandler< dim >::particle_iterator_range &particles) const
 
virtual DEAL_II_DEPRECATED 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 UpdateTimeFlags need_update () const
 
virtual UpdateFlags get_update_flags (const unsigned int component) const
 
virtual DEAL_II_DEPRECATED 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 set_data_position (const unsigned int data_position)
 
virtual unsigned int get_data_position () const
 
- Public Member Functions inherited from aspect::Particle::ParticleInterfaceBase
 ParticleInterfaceBase ()
 
void set_particle_manager_index (unsigned int particle_manager_index)
 Set which particle manager the plugin belongs to. More...
 
unsigned int get_particle_manager_index () const
 Gets which particle manager the plugin belong to. More...
 
- Public Member Functions inherited from aspect::Plugins::InterfaceBase
virtual ~InterfaceBase ()=default
 
virtual void initialize ()
 
virtual void update ()
 
virtual void parse_parameters (ParameterHandler &prm)
 

Protected Attributes

unsigned int data_position
 

Additional Inherited Members

- Static Public Member Functions inherited from aspect::Plugins::InterfaceBase
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 338 of file interface.h.

Member Function Documentation

§ 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

§ update_particle_properties()

template<int dim>
virtual void aspect::Particle::Property::Interface< dim >::update_particle_properties ( const ParticleUpdateInputs< dim > &  inputs,
typename ParticleHandler< dim >::particle_iterator_range &  particles 
) const
virtual

Update function. This function is called every time an update is requested by need_update() for every cell for every property. It is expected to update the properties of all particles in the given range particles, which are all in one cell. 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]inputsA struct of type ParticleUpdateInputs that contains all necessary inputs to compute the particle updates. See the documentation of this struct in include/aspect/particle/property/interface.h for a list of all available inputs.
[in,out]particlesThe particles that are to be updated within this function.

Reimplemented in aspect::Particle::Property::ElasticTensorDecomposition< dim >, aspect::Particle::Property::CrystalPreferredOrientation< dim >, aspect::Particle::Property::CpoBinghamAverage< dim >, aspect::Particle::Property::CpoElasticTensor< dim >, aspect::Particle::Property::PTPath< dim >, aspect::Particle::Property::GrainSize< dim >, aspect::Particle::Property::ViscoPlasticStrainInvariant< dim >, aspect::Particle::Property::IntegratedStrain< dim >, aspect::Particle::Property::MeltParticle< dim >, aspect::Particle::Property::Composition< dim >, aspect::Particle::Property::ElasticStress< dim >, aspect::Particle::Property::IntegratedStrainInvariant< dim >, aspect::Particle::Property::StrainRate< dim >, aspect::Particle::Property::Velocity< dim >, aspect::Particle::Property::Position< dim >, and aspect::Particle::Property::ReferencePosition< dim >.

§ update_particle_property()

template<int dim>
virtual DEAL_II_DEPRECATED 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_positionAn 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]solutionThe values of the solution variables at the current particle position.
[in]gradientsThe gradients of the solution variables at the current particle position.
[in,out]particleThe 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().
Deprecated:
This version of the function is deprecated. Use update_particle_properties() instead, which allows to update all particles of a cell in one function call.

§ 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.

Reimplemented in aspect::Particle::Property::ElasticTensorDecomposition< dim >, aspect::Particle::Property::CrystalPreferredOrientation< dim >, aspect::Particle::Property::CpoBinghamAverage< dim >, aspect::Particle::Property::CpoElasticTensor< dim >, aspect::Particle::Property::GrainSize< dim >, aspect::Particle::Property::PTPath< dim >, aspect::Particle::Property::ViscoPlasticStrainInvariant< dim >, aspect::Particle::Property::IntegratedStrain< dim >, aspect::Particle::Property::MeltParticle< dim >, aspect::Particle::Property::Composition< dim >, aspect::Particle::Property::IntegratedStrainInvariant< dim >, aspect::Particle::Property::ElasticStress< dim >, aspect::Particle::Property::StrainRate< dim >, aspect::Particle::Property::Velocity< dim >, aspect::Particle::Property::Position< dim >, and aspect::Particle::Property::ReferencePosition< dim >.

§ get_update_flags()

template<int dim>
virtual UpdateFlags aspect::Particle::Property::Interface< dim >::get_update_flags ( const unsigned int  component) const
virtual

Return which data of the solution component component has to be provided to update the current particle property.

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.

As an example consider a particle property that depends on the solution values and gradients of the velocity field. In this case the function should return update_values | update_gradients if the component is one of the velocity components, and update_default otherwise.

Parameters
componentThe component of the solution which is to be evaluated.
Returns
The necessary update flags for the solution component component that is required for this particle property.

Reimplemented in aspect::Particle::Property::CrystalPreferredOrientation< dim >, aspect::Particle::Property::CpoBinghamAverage< dim >, aspect::Particle::Property::CpoElasticTensor< dim >, aspect::Particle::Property::GrainSize< dim >, aspect::Particle::Property::PTPath< dim >, aspect::Particle::Property::ViscoPlasticStrainInvariant< dim >, aspect::Particle::Property::IntegratedStrain< dim >, aspect::Particle::Property::MeltParticle< dim >, aspect::Particle::Property::Composition< dim >, aspect::Particle::Property::IntegratedStrainInvariant< dim >, aspect::Particle::Property::ElasticStress< dim >, aspect::Particle::Property::StrainRate< dim >, and aspect::Particle::Property::Velocity< dim >.

§ get_needed_update_flags()

template<int dim>
virtual DEAL_II_DEPRECATED 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.
Deprecated:
This function is deprecated. Use the above version of get_update_flags() instead.

§ 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::CrystalPreferredOrientation< dim >, aspect::Particle::Property::GrainSize< dim >, and aspect::Particle::Property::InitialComposition< dim >.

§ get_property_information()

template<int dim>
virtual std::vector<std::pair<std::string, unsigned int> > 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.

Implemented in aspect::Particle::Property::IntegratorProperties< dim >, aspect::Particle::Property::ElasticTensorDecomposition< dim >, aspect::Particle::Property::CrystalPreferredOrientation< dim >, aspect::Particle::Property::CpoBinghamAverage< dim >, aspect::Particle::Property::CpoElasticTensor< dim >, aspect::Particle::Property::PTPath< dim >, aspect::Particle::Property::GrainSize< dim >, aspect::Particle::Property::IntegratedStrain< dim >, aspect::Particle::Property::MeltParticle< dim >, aspect::Particle::Property::Composition< dim >, aspect::Particle::Property::IntegratedStrainInvariant< dim >, aspect::Particle::Property::StrainRate< dim >, aspect::Particle::Property::ViscoPlasticStrainInvariant< dim >, aspect::Particle::Property::Velocity< dim >, aspect::Particle::Property::ElasticStress< dim >, aspect::Particle::Property::Position< dim >, aspect::Particle::Property::ReferencePosition< dim >, aspect::Particle::Property::InitialComposition< dim >, aspect::Particle::Property::Function< dim >, and aspect::Particle::Property::InitialPosition< dim >.

§ set_data_position()

template<int dim>
virtual void aspect::Particle::Property::Interface< dim >::set_data_position ( const unsigned int  data_position)
virtual

Set the position of this property in the particle property vector.

§ get_data_position()

template<int dim>
virtual unsigned int aspect::Particle::Property::Interface< dim >::get_data_position ( ) const
virtual

Get the position of this property in the particle property vector.

Member Data Documentation

§ data_position

template<int dim>
unsigned int aspect::Particle::Property::Interface< dim >::data_position
protected

Store the position of the particle property in the particle property vector. If the property has multiple components, the first component is stored and all other components are stored consecutively after the first one.

Definition at line 532 of file interface.h.


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