3#include <deal.II/particles/particle_accessor.h>
4#include <deal.II/particles/property_pool.h>
18 template <
int dim,
typename number>
47 dealii::Particles::PropertyPool<dim> &property_pool,
48 const typename dealii::Particles::PropertyPool<dim>::Handle handle)
noexcept;
77 dealii::Point<dim, number> &
83 const dealii::Point<dim, number> &
92 dealii::Tensor<1, dim, number>
124 dealii::Tensor<1, axial_dim<dim>, number>
156 dealii::Tensor<1, axial_dim<dim>, number>
166 force(
const unsigned int dimension);
172 force(
const unsigned int dimension)
const;
179 dealii::Tensor<1, dim, number>
225 torque(
const unsigned int dimension);
231 torque(
const unsigned int dimension)
const;
238 dealii::Tensor<1, axial_dim<dim>, number>
246 dealii::types::particle_index
254 dealii::types::particle_index
323 typename dealii::Triangulation<dim>::active_cell_iterator
328 std::reference_wrapper<dealii::Point<dim, number>>
location;
346 template <
int dim,
typename number>
348 dealii::Particles::ParticleAccessor<dim> &particle)
349 : location(particle.get_location())
350 , properties(particle.get_properties())
351 , surrounding_cell(particle.get_surrounding_cell())
352 , particle_id(particle.get_id())
353 , local_particle_id(particle.get_local_index())
356 template <
int dim,
typename number>
358 dealii::ArrayView<number> properties,
359 dealii::types::particle_index particle_id)
361 , properties(properties)
362 , particle_id(particle_id)
365 template <
int dim,
typename number>
367 dealii::Particles::PropertyPool<dim> &property_pool,
368 const typename dealii::Particles::PropertyPool<dim>::Handle handle) noexcept
369 : location(property_pool.get_location(handle))
370 , properties(property_pool.get_properties(handle))
371 , particle_id(property_pool.get_id(handle))
374 template <
int dim,
typename number>
375 dealii::Point<dim, number> &
381 template <
int dim,
typename number>
382 const dealii::Point<dim, number> &
388 template <
int dim,
typename number>
389 dealii::Tensor<1, dim, number>
392 Assert(!properties.empty(), dealii::ExcInternalError());
393 dealii::Tensor<1, dim, number> velocity;
394 for (
int dimension = 0; dimension < dim; ++dimension)
395 velocity[dimension] =
400 template <
int dim,
typename number>
404 AssertIndexRange(dimension, dim);
408 template <
int dim,
typename number>
412 AssertIndexRange(dimension, dim);
417 template <
int dim,
typename number>
421 AssertIndexRange(dimension, dim);
425 template <
int dim,
typename number>
426 dealii::Tensor<1, axial_dim<dim>, number>
429 Assert(!properties.empty(), dealii::ExcInternalError());
430 dealii::Tensor<1, axial_dim<dim>, number> velocity;
431 for (
int dimension = 0; dimension < axial_dim<dim>; ++dimension)
432 velocity[dimension] =
437 template <
int dim,
typename number>
441 AssertIndexRange(dimension, axial_dim<dim>);
445 template <
int dim,
typename number>
449 AssertIndexRange(dimension, axial_dim<dim>);
453 template <
int dim,
typename number>
457 AssertIndexRange(dimension, axial_dim<dim>);
461 template <
int dim,
typename number>
462 dealii::Tensor<1, axial_dim<dim>, number>
465 Assert(!properties.empty(), dealii::ExcInternalError());
466 dealii::Tensor<1, axial_dim<dim>, number> angular_velocity_vector;
467 for (
int dimension = 0; dimension < axial_dim<dim>; ++dimension)
469 angular_velocity_vector[dimension] = angular_velocity(dimension);
471 return angular_velocity_vector;
474 template <
int dim,
typename number>
478 AssertIndexRange(dimension, dim);
482 template <
int dim,
typename number>
486 AssertIndexRange(dimension, dim);
490 template <
int dim,
typename number>
491 dealii::Tensor<1, dim, number>
494 dealii::Tensor<1, dim, number> force_vector;
495 for (
unsigned int dimension = 0; dimension < dim; ++dimension)
496 force_vector[dimension] = force(dimension);
500 template <
int dim,
typename number>
504 Assert(!properties.empty(), dealii::ExcInternalError());
505 for (
int dimension = 0; dimension < dim; ++dimension)
509 template <
int dim,
typename number>
513 Assert(!properties.empty(), dealii::ExcInternalError());
514 for (
int dimension = 0; dimension < dim; ++dimension)
518 template <
int dim,
typename number>
522 AssertIndexRange(dimension, axial_dim<dim>);
526 template <
int dim,
typename number>
530 AssertIndexRange(dimension, axial_dim<dim>);
534 template <
int dim,
typename number>
535 dealii::Tensor<1, axial_dim<dim>, number>
538 dealii::Tensor<1, axial_dim<dim>, number> torque_vector;
539 for (
unsigned int dimension = 0; dimension < axial_dim<dim>; ++dimension)
540 torque_vector[dimension] = torque(dimension);
541 return torque_vector;
544 template <
int dim,
typename number>
547 const dealii::Tensor<1, axial_dim<dim>, number> &torque)
549 Assert(!properties.empty(), dealii::ExcInternalError());
550 for (
int dimension = 0; dimension < axial_dim<dim>; ++dimension)
555 template <
int dim,
typename number>
558 const dealii::Tensor<1, axial_dim<dim>, number> &torque)
560 Assert(!properties.empty(), dealii::ExcInternalError());
561 for (
int dimension = 0; dimension < axial_dim<dim>; ++dimension)
566 template <
int dim,
typename number>
567 dealii::types::particle_index
573 template <
int dim,
typename number>
574 dealii::types::particle_index
577 Assert(local_particle_id != dealii::numbers::invalid_unsigned_int,
578 dealii::ExcMessage(
"The local particle ID is only valid for locally owned particles."));
579 return local_particle_id;
582 template <
int dim,
typename number>
589 template <
int dim,
typename number>
597 template <
int dim,
typename number>
604 template <
int dim,
typename number>
611 template <
int dim,
typename number>
618 template <
int dim,
typename number>
626 template <
int dim,
typename number>
631 Assert(!properties.empty(), dealii::ExcInternalError());
632 return properties[property];
635 template <
int dim,
typename number>
640 Assert(!properties.empty(), dealii::ExcInternalError());
641 return properties[property];
644 template <
int dim,
typename number>
645 typename dealii::Triangulation<dim>::active_cell_iterator
648 Assert(surrounding_cell.state() == dealii::IteratorState::valid,
649 dealii::ExcMessage(
"The surrounding cell is only valid for locally owned particles."));
650 return surrounding_cell;
Definition particle_accessor.hpp:20
dealii::types::particle_index local_id() const
Definition particle_accessor.hpp:575
number & angular_acceleration(const unsigned int dimension)
Definition particle_accessor.hpp:439
DEMParticleAccessor & operator=(const DEMParticleAccessor &other) noexcept=default
dealii::Tensor< 1, axial_dim< dim >, number > torque() const
Definition particle_accessor.hpp:536
dealii::types::particle_index local_particle_id
Definition particle_accessor.hpp:342
void add_force(const dealii::Tensor< 1, dim, number > &force)
Definition particle_accessor.hpp:511
number & radius()
Definition particle_accessor.hpp:584
DEMParticleAccessor(const DEMParticleAccessor &other) noexcept=default
dealii::Tensor< 1, axial_dim< dim >, number > get_angular_velocity() const
Definition particle_accessor.hpp:427
dealii::Point< dim, number > & get_location()
Definition particle_accessor.hpp:376
dealii::Tensor< 1, axial_dim< dim >, number > angular_velocity() const
Definition particle_accessor.hpp:463
number & mass()
Definition particle_accessor.hpp:599
dealii::ArrayView< number > properties
View to the particle properties (velocity, force etc.).
Definition particle_accessor.hpp:331
dealii::types::particle_index id() const
Definition particle_accessor.hpp:568
void set_torque(const dealii::Tensor< 1, axial_dim< dim >, number > &torque)
Definition particle_accessor.hpp:546
dealii::Tensor< 1, dim, number > force() const
Definition particle_accessor.hpp:492
dealii::Tensor< 1, dim, number > linear_velocity() const
Definition particle_accessor.hpp:390
dealii::types::particle_index particle_id
The global unique identifier of the particle.
Definition particle_accessor.hpp:338
number & density()
Definition particle_accessor.hpp:613
void add_torque(const dealii::Tensor< 1, axial_dim< dim >, number > &torque)
Definition particle_accessor.hpp:557
number & get_property(const typename SphericalParticle< dim, number >::Properties property)
Definition particle_accessor.hpp:628
void set_force(const dealii::Tensor< 1, dim, number > &force)
Definition particle_accessor.hpp:502
DEMParticleAccessor(dealii::Particles::ParticleAccessor< dim > &particle)
Definition particle_accessor.hpp:347
std::reference_wrapper< dealii::Point< dim, number > > location
Reference to the particle location.
Definition particle_accessor.hpp:328
dealii::Triangulation< dim >::active_cell_iterator get_surrounding_cell() const
Definition particle_accessor.hpp:646
dealii::Triangulation< dim >::active_cell_iterator surrounding_cell
Definition particle_accessor.hpp:335
number & linear_acceleration(const unsigned int dimension)
Definition particle_accessor.hpp:419
DEMParticleAccessor & operator=(DEMParticleAccessor &&other) noexcept=default
DEMParticleAccessor(DEMParticleAccessor &&other) noexcept=default
Class representing a finite-sized spherical particle, intended for use with the obstacle field class.
Definition particle.hpp:35
Properties
Enum to define the index of each property in the particle's property vector.
Definition particle.hpp:54
Interface for a general preconditioner.
Definition boundary_condition_functions.hpp:17