DEMParticleAccessor< dim, number > Class Template Reference

Developer Documentation: MeltPoolDG::DEMParticleAccessor< dim, number > Class Template Reference
Developer Documentation
MeltPoolDG::DEMParticleAccessor< dim, number > Class Template Reference

#include <particle_accessor.hpp>

Public Member Functions

 DEMParticleAccessor (dealii::Particles::ParticleAccessor< dim > &particle)
 
 DEMParticleAccessor (dealii::Point< dim, number > &location, dealii::ArrayView< number > properties, dealii::types::particle_index particle_id)
 
 DEMParticleAccessor (dealii::Particles::PropertyPool< dim > &property_pool, const typename dealii::Particles::PropertyPool< dim >::Handle handle) noexcept
 Construct accessor from a PropertyPool handle.
 
 DEMParticleAccessor (const DEMParticleAccessor &other) noexcept=default
 
 DEMParticleAccessor (DEMParticleAccessor &&other) noexcept=default
 
DEMParticleAccessoroperator= (DEMParticleAccessor &&other) noexcept=default
 
DEMParticleAccessoroperator= (const DEMParticleAccessor &other) noexcept=default
 
dealii::Point< dim, number > & get_location ()
 
const dealii::Point< dim, number > & get_location () const
 
dealii::Tensor< 1, dim, number > linear_velocity () const
 
number & linear_velocity (const unsigned int dimension)
 
const number & linear_velocity (const unsigned int dimension) const
 
number & linear_acceleration (const unsigned int dimension)
 
dealii::Tensor< 1, axial_dim< dim >, number > get_angular_velocity () const
 
number & angular_acceleration (const unsigned int dimension)
 
number & angular_velocity (const unsigned int dimension)
 
const number & angular_velocity (const unsigned int dimension) const
 
dealii::Tensor< 1, axial_dim< dim >, number > angular_velocity () const
 
number & force (const unsigned int dimension)
 
const number & force (const unsigned int dimension) const
 
dealii::Tensor< 1, dim, number > force () const
 
void set_force (const dealii::Tensor< 1, dim, number > &force)
 
void add_force (const dealii::Tensor< 1, dim, number > &force)
 
void set_torque (const dealii::Tensor< 1, axial_dim< dim >, number > &torque)
 
void add_torque (const dealii::Tensor< 1, axial_dim< dim >, number > &torque)
 
number & torque (const unsigned int dimension)
 
const number & torque (const unsigned int dimension) const
 
dealii::Tensor< 1, axial_dim< dim >, number > torque () const
 
dealii::types::particle_index id () const
 
dealii::types::particle_index local_id () const
 
number & radius ()
 
const number & radius () const
 
number & mass ()
 
const number & mass () const
 
number & density ()
 
const number & density () const
 
number & get_property (const typename SphericalParticle< dim, number >::Properties property)
 
const number & get_property (const typename SphericalParticle< dim, number >::Properties property) const
 
dealii::Triangulation< dim >::active_cell_iterator get_surrounding_cell () const
 

Private Attributes

std::reference_wrapper< dealii::Point< dim, number > > location
 Reference to the particle location.
 
dealii::ArrayView< number > properties
 View to the particle properties (velocity, force etc.).
 
dealii::Triangulation< dim >::active_cell_iterator surrounding_cell
 
dealii::types::particle_index particle_id
 The global unique identifier of the particle.
 
dealii::types::particle_index local_particle_id = dealii::numbers::invalid_unsigned_int
 

Detailed Description

template<int dim, typename number>
class MeltPoolDG::DEMParticleAccessor< dim, number >

This class acts as a lightweight wrapper around deal.II's ParticleAccessor or PropertyPool handles. It allows read/write access to particle properties (velocity, angular velocity, forces, etc.) and to the particle's spatial location.

Constructor & Destructor Documentation

◆ DEMParticleAccessor() [1/5]

template<int dim, typename number >
MeltPoolDG::DEMParticleAccessor< dim, number >::DEMParticleAccessor ( dealii::Particles::ParticleAccessor< dim > &  particle)

Construct accessor from a deal.II ParticleAccessor.

Parameters
particleReference to a deal.II particle accessor.

◆ DEMParticleAccessor() [2/5]

template<int dim, typename number >
MeltPoolDG::DEMParticleAccessor< dim, number >::DEMParticleAccessor ( dealii::Point< dim, number > &  location,
dealii::ArrayView< number >  properties,
dealii::types::particle_index  particle_id 
)

Construct accessor from a location and properties view.

Parameters
locationReference to the particle location.
propertiesView to the particle properties.
particle_idThe unique identifier for the particle.

◆ DEMParticleAccessor() [3/5]

template<int dim, typename number >
MeltPoolDG::DEMParticleAccessor< dim, number >::DEMParticleAccessor ( dealii::Particles::PropertyPool< dim > &  property_pool,
const typename dealii::Particles::PropertyPool< dim >::Handle  handle 
)
noexcept

Construct accessor from a PropertyPool handle.

Parameters
property_poolReference to the deal.II property pool.
handleHandle/index of the particle within the property pool.

◆ DEMParticleAccessor() [4/5]

template<int dim, typename number >
MeltPoolDG::DEMParticleAccessor< dim, number >::DEMParticleAccessor ( const DEMParticleAccessor< dim, number > &  other)
defaultnoexcept

Copy constructor.

◆ DEMParticleAccessor() [5/5]

template<int dim, typename number >
MeltPoolDG::DEMParticleAccessor< dim, number >::DEMParticleAccessor ( DEMParticleAccessor< dim, number > &&  other)
defaultnoexcept

Move constructor.

Member Function Documentation

◆ add_force()

template<int dim, typename number >
void MeltPoolDG::DEMParticleAccessor< dim, number >::add_force ( const dealii::Tensor< 1, dim, number > &  force)

Accumulates the specified force vector to the particle by adding its components into the particle's property array.

Parameters
forceThe force vector to be added.

◆ add_torque()

template<int dim, typename number >
void MeltPoolDG::DEMParticleAccessor< dim, number >::add_torque ( const dealii::Tensor< 1, axial_dim< dim >, number > &  torque)

Accumulates the specified torque vector to the particle by adding its components into the internal torque vector.

Parameters
torqueThe torque vector to be added.

◆ angular_acceleration()

template<int dim, typename number >
number & MeltPoolDG::DEMParticleAccessor< dim, number >::angular_acceleration ( const unsigned int  dimension)

Returns the angular acceleration of the given particle in the specified dimension.

Parameters
dimensionThe dimension for which to return the acceleration.
Returns
The angular acceleration in the specified dimension.

◆ angular_velocity() [1/3]

template<int dim, typename number >
dealii::Tensor< 1, axial_dim< dim >, number > MeltPoolDG::DEMParticleAccessor< dim, number >::angular_velocity ( ) const

Returns the angular velocity tensor of the given particle.

Returns
A tensor representing the angular velocity of the particle.

◆ angular_velocity() [2/3]

template<int dim, typename number >
number & MeltPoolDG::DEMParticleAccessor< dim, number >::angular_velocity ( const unsigned int  dimension)

Returns the angular velocity of the given particle in the specified dimension.

Parameters
dimensionThe dimension for which to return the angular velocity.
Returns
The angular velocity in the specified dimension.

◆ angular_velocity() [3/3]

template<int dim, typename number >
const number & MeltPoolDG::DEMParticleAccessor< dim, number >::angular_velocity ( const unsigned int  dimension) const

Same as above but for const access.

◆ density() [1/2]

template<int dim, typename number >
number & MeltPoolDG::DEMParticleAccessor< dim, number >::density ( )

Returns the density of the particle.

Returns
The density of the particle.

◆ density() [2/2]

template<int dim, typename number >
const number & MeltPoolDG::DEMParticleAccessor< dim, number >::density ( ) const

Same as above but for const access.

◆ force() [1/3]

template<int dim, typename number >
dealii::Tensor< 1, dim, number > MeltPoolDG::DEMParticleAccessor< dim, number >::force ( ) const

Returns the force vector of the given particle.

Returns
A tensor representing the force of the particle.

◆ force() [2/3]

template<int dim, typename number >
number & MeltPoolDG::DEMParticleAccessor< dim, number >::force ( const unsigned int  dimension)

Returns the force acting on the given particle in the specified dimension.

Parameters
dimensionThe dimension for which to return the force.
Returns
The force in the specified dimension.

◆ force() [3/3]

template<int dim, typename number >
const number & MeltPoolDG::DEMParticleAccessor< dim, number >::force ( const unsigned int  dimension) const

Same as above but for const access.

◆ get_angular_velocity()

template<int dim, typename number >
dealii::Tensor< 1, axial_dim< dim >, number > MeltPoolDG::DEMParticleAccessor< dim, number >::get_angular_velocity ( ) const

Returns the angular velocity of the given particle.

Returns
A tensor representing the angular velocity of the particle.

◆ get_location() [1/2]

template<int dim, typename number >
dealii::Point< dim, number > & MeltPoolDG::DEMParticleAccessor< dim, number >::get_location ( )

Returns a reference to the location of the particle.

Returns
Reference to the particle location.

◆ get_location() [2/2]

template<int dim, typename number >
const dealii::Point< dim, number > & MeltPoolDG::DEMParticleAccessor< dim, number >::get_location ( ) const

Same as above but for const access.

◆ get_property() [1/2]

template<int dim, typename number >
number & MeltPoolDG::DEMParticleAccessor< dim, number >::get_property ( const typename SphericalParticle< dim, number >::Properties  property)

This function returns the value of a single-valued property stored in the given particle.

Parameters
propertyThe property to retrieve.
Returns
The value of the specified property.
Note
This function should be used only for scalar properties. For vector-valued properties such as translational or angular velocity, use the functions get_velocity() and get_angular_velocity().

◆ get_property() [2/2]

template<int dim, typename number >
const number & MeltPoolDG::DEMParticleAccessor< dim, number >::get_property ( const typename SphericalParticle< dim, number >::Properties  property) const

Same as above but for const access.

◆ get_surrounding_cell()

template<int dim, typename number >
dealii::Triangulation< dim >::active_cell_iterator MeltPoolDG::DEMParticleAccessor< dim, number >::get_surrounding_cell ( ) const

Return the surrounding active cell of the particle center location. This function can only be called for locally owned particles as the surrounding active cell might not be locally available for ghost particles.

◆ id()

template<int dim, typename number >
dealii::types::particle_index MeltPoolDG::DEMParticleAccessor< dim, number >::id ( ) const

Returns the unique identifier of the particle.

Returns
The particle ID.

◆ linear_acceleration()

template<int dim, typename number >
number & MeltPoolDG::DEMParticleAccessor< dim, number >::linear_acceleration ( const unsigned int  dimension)

Returns the linear acceleration of the given particle in the specified dimension.

Parameters
dimensionThe dimension for which to return the acceleration.
Returns
The linear acceleration in the specified dimension.

◆ linear_velocity() [1/3]

template<int dim, typename number >
dealii::Tensor< 1, dim, number > MeltPoolDG::DEMParticleAccessor< dim, number >::linear_velocity ( ) const

Returns the linear velocity of the given particle, i.e., the translational velocity at the particle center of mass.

Returns
A tensor representing the linear velocity of the particle.

◆ linear_velocity() [2/3]

template<int dim, typename number >
number & MeltPoolDG::DEMParticleAccessor< dim, number >::linear_velocity ( const unsigned int  dimension)

Returns the linear velocity of the given particle in the specified dimension.

Parameters
dimensionThe dimension for which to return the velocity.
Returns
The linear velocity in the specified dimension.

◆ linear_velocity() [3/3]

template<int dim, typename number >
const number & MeltPoolDG::DEMParticleAccessor< dim, number >::linear_velocity ( const unsigned int  dimension) const

Same as above but for const access.

◆ local_id()

template<int dim, typename number >
dealii::types::particle_index MeltPoolDG::DEMParticleAccessor< dim, number >::local_id ( ) const

Returns the rank local particle index of the particle, which can be used for array access.

Returns
The rank local particle index.

◆ mass() [1/2]

template<int dim, typename number >
number & MeltPoolDG::DEMParticleAccessor< dim, number >::mass ( )

Returns the mass of the particle.

Returns
The mass of the particle.

◆ mass() [2/2]

template<int dim, typename number >
const number & MeltPoolDG::DEMParticleAccessor< dim, number >::mass ( ) const

Same as above but for const access.

◆ operator=() [1/2]

template<int dim, typename number >
DEMParticleAccessor & MeltPoolDG::DEMParticleAccessor< dim, number >::operator= ( const DEMParticleAccessor< dim, number > &  other)
defaultnoexcept

Copy assignment operator.

◆ operator=() [2/2]

template<int dim, typename number >
DEMParticleAccessor & MeltPoolDG::DEMParticleAccessor< dim, number >::operator= ( DEMParticleAccessor< dim, number > &&  other)
defaultnoexcept

Move assignment operator.

◆ radius() [1/2]

template<int dim, typename number >
number & MeltPoolDG::DEMParticleAccessor< dim, number >::radius ( )

Returns the radius of the particle.

Returns
The radius of the particle.

◆ radius() [2/2]

template<int dim, typename number >
const number & MeltPoolDG::DEMParticleAccessor< dim, number >::radius ( ) const

Same as above but for const access.

◆ set_force()

template<int dim, typename number >
void MeltPoolDG::DEMParticleAccessor< dim, number >::set_force ( const dealii::Tensor< 1, dim, number > &  force)

Sets the specified force vector to the particle by assigning its components into the particle's property array.

Parameters
forceThe force vector to assign to the particle.

◆ set_torque()

template<int dim, typename number >
void MeltPoolDG::DEMParticleAccessor< dim, number >::set_torque ( const dealii::Tensor< 1, axial_dim< dim >, number > &  torque)

Sets the specified torque vector to the particle by assigning its components into the particle's property array.

Parameters
torqueThe torque vector to assign to the particle.

◆ torque() [1/3]

template<int dim, typename number >
dealii::Tensor< 1, axial_dim< dim >, number > MeltPoolDG::DEMParticleAccessor< dim, number >::torque ( ) const

Returns the torque vector of the given particle.

Returns
A tensor representing the torque of the particle.

◆ torque() [2/3]

template<int dim, typename number >
number & MeltPoolDG::DEMParticleAccessor< dim, number >::torque ( const unsigned int  dimension)

Returns the torque acting on the given particle in the specified dimension.

Parameters
dimensionThe dimension for which to return the torque.
Returns
The torque in the specified dimension.

◆ torque() [3/3]

template<int dim, typename number >
const number & MeltPoolDG::DEMParticleAccessor< dim, number >::torque ( const unsigned int  dimension) const

Same as above but for const access.

Member Data Documentation

◆ local_particle_id

template<int dim, typename number >
dealii::types::particle_index MeltPoolDG::DEMParticleAccessor< dim, number >::local_particle_id = dealii::numbers::invalid_unsigned_int
private

The MPI rank local particle index which can be used e.g. for array access (only available for locally owned particles).

◆ location

template<int dim, typename number >
std::reference_wrapper<dealii::Point<dim, number> > MeltPoolDG::DEMParticleAccessor< dim, number >::location
private

Reference to the particle location.

◆ particle_id

template<int dim, typename number >
dealii::types::particle_index MeltPoolDG::DEMParticleAccessor< dim, number >::particle_id
private

The global unique identifier of the particle.

◆ properties

template<int dim, typename number >
dealii::ArrayView<number> MeltPoolDG::DEMParticleAccessor< dim, number >::properties
private

View to the particle properties (velocity, force etc.).

◆ surrounding_cell

template<int dim, typename number >
dealii::Triangulation<dim>::active_cell_iterator MeltPoolDG::DEMParticleAccessor< dim, number >::surrounding_cell
private

The surrounding active cell of the particle center location. This is only valid for locally owned particles.


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