# PhasicFlow: sphereParticles Class Reference
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

sphereParticles Class Reference

Class for managing spherical particles. More...

Inheritance diagram for sphereParticles:
[legend]
Collaboration diagram for sphereParticles:
[legend]

## Public Types

using | ShapeType = sphereShape

## Public Member Functions

| sphereParticles (systemControl &control, const property &prop)
| construct from systemControl and property More...
| ~sphereParticles () override=default
bool | initializeParticles ()
| Insert new particles in position with specified shapes. More...
const auto & | spheres () const
| const reference to shapes object More...
const auto & | I () const
| const reference to inertia pointField More...
auto & | I ()
| reference to inertia pointField More...
const auto & | rVelocity () const
auto & | rVelocity ()
bool | hearChanges (real t, real dt, uint32 iter, const message &msg, const anyList &varList) override
const uint32PointField_D & | propertyId () const override
const realPointField_D & | diameter () const override
const realPointField_D & | mass () const override
bool | beforeIteration () override
| before iteration step More...
bool | iterate () override
| iterate particles More...
bool | insertParticles (const realx3Vector &position, const wordVector &shapesNames, const anyList &setVarList) override
realx3PointField_D & | rAcceleration () override
const realx3PointField_D & | rAcceleration () const override
const realPointField_D & | boundingSphere () const override
word | shapeTypeName () const override
const shape & | getShapes () const override
void | boundingSphereMinMax (real &minDiam, real &maxDiam) const override
Public Member Functions inherited from particles
| TypeInfo ("particles")
| particles (systemControl &control)
const auto & | dynPointStruct () const
const pointStructure & | pStruct () const
const auto & | simDomain () const
const auto & | thisDomain () const
const auto & | extendedDomain () const
auto | size () const
auto | capacity () const
auto | numActive () const
bool | isAllActive () const
const auto & | pointPosition () const
const auto & | velocity () const
const auto & | accelertion () const
auto & | accelertion ()
auto & | contactForce ()
const auto & | contactForce () const
auto & | contactTorque ()
const auto & | contactTorque () const
uint | maxId () const
bool | afterIteration () override
| This is called in time loop, after iterate. More...
Public Member Functions inherited from observer
| observer (message msg)
| observer (const subscriber *subscrbr, message msg)
virtual | ~observer ()
void | subscribe (const subscriber *subscrbr, message msg)
observer & | addEvent (message::EVENT event)
bool | subscribed () const
void | addToSubscriber (const subscriber *subscrbr, message msg)
bool | addToSubscriber (const subscriber &subscriber)
Public Member Functions inherited from demComponent
| TypeInfo ("demComponent")
| Type info. More...
| demComponent (const word &name, systemControl &control)
| construct from components More...
| demComponent (const demComponent &)=delete
| No copy constructor. More...
| demComponent (demComponent &&)=delete
| No move constructor. More...
demComponent & | operator= (const demComponent &)=delete
| No copy assignment. More...
demComponent & | operator= (demComponent &&)=delete
| No move assignment. More...
virtual | ~demComponent ()=default
| destructor More...
const auto & | control () const
| Const ref to systemControl. More...
auto & | control ()
| Ref to systemControl. More...
real | dt () const
| Time step of integration. More...
real | currentTime () const
| Current simulation time. More...
uint32 | currentIter () const
| return current iteration number More...
timeInfo | TimeInfo () const
| return time info of the simulaiton More...
const auto & | time () const
auto & | time ()
const auto & | timers () const
| Const ref to timers. More...
auto & | timers ()
| Ref to timers. More...
virtual bool | beforeTimeLoop ()
| This is called before the start of time loop. More...
virtual bool | afterTimeLoop ()
| This is called after the time loop. More...

## Protected Member Functions

Timer & | accelerationTimer ()
Timer & | intCorrectTimer ()
integration & | rVelIntegration ()
Protected Member Functions inherited from particles
void | zeroForce ()
void | zeroTorque ()
auto & | dynPointStruct ()
auto & | pointPosition ()
auto & | idHandler ()
auto & | shapeIndex ()

## Private Member Functions

bool | getParticlesInfoFromShape (const wordVector &shapeNames, uint32Vector &propIds, realVector &diams, realVector &m, realVector &Is, uint32Vector &shIndex)

## Private Attributes

ShapeType | spheres_
| reference to shapes More...
uint32PointField_D | propertyId_
| property id on device More...
realPointField_D | diameter_
| diameter / boundig sphere size of particles on device More...
realPointField_D | mass_
| mass of particles field More...
realPointField_D | I_
| pointField of inertial of particles More...
realx3PointField_D | rVelocity_
| pointField of rotational Velocity of particles on device More...
realx3PointField_D | rAcceleration_
| pointField of rotational acceleration of particles on device More...
boundarySphereParticlesList | boundarySphereParticles_
| boundaries More...
uniquePtr< integration > | rVelIntegration_ = nullptr
| rotational velocity integrator More...
Timer | accelerationTimer_
| timer for acceleration computations More...
Timer | intPredictTimer_
| timer for integration computations (prediction step) More...
Timer | intCorrectTimer_
| timer for integration computations (correction step) More...
Timer | fieldUpdateTimer_

## Additional Inherited Members

Static Public Member Functions inherited from observer
static constexpr auto | numEvents ()

## Detailed Description

Class for managing spherical particles.

This is a top-level class that contains the essential components for defining spherical prticles in a DEM simulation.

Definition at line 42 of file sphereParticles.hpp.

## Member Typedef Documentation

## ShapeType

using ShapeType = sphereShape

Definition at line 46 of file sphereParticles.hpp.

## Constructor & Destructor Documentation

## sphereParticles()

sphereParticles | ( | systemControl & | control,
|  | const property & | prop
| ) |  |

construct from systemControl and property

Definition at line 308 of file sphereParticles.cpp.

References demComponent::control(), integration::create(), particles::dynPointStruct(), END_REPORT, END_WARNING, fatalErrorInFunction, fatalExit, internalField< T, MemorySpace >::field(), Green_Text, sphereParticles::initializeParticles(), REPORT, sphereParticles::rVelIntegration_, sphereParticles::rVelocity_, and WARNING.

Here is the call graph for this function:

## ~sphereParticles()

~sphereParticles | ( |  | ) |

overridedefault

## Member Function Documentation

## getParticlesInfoFromShape()

bool getParticlesInfoFromShape | ( | const wordVector & | shapeNames,
|  | uint32Vector & | propIds,
|  | realVector & | diams,
|  | realVector & | m,
|  | realVector & | Is,
|  | uint32Vector & | shIndex
| ) |  |

private

Definition at line 259 of file sphereParticles.cpp.

References pFlow::endl(), fatalErrorInFunction, m, Vector< T, Allocator >::reserve(), and Vector< T, Allocator >::size().

Here is the call graph for this function:

## accelerationTimer()

Timer& accelerationTimer | ( |  | ) |

inlineprotected

Definition at line 109 of file sphereParticles.hpp.

References sphereParticles::accelerationTimer_.

## intCorrectTimer()

Timer& intCorrectTimer | ( |  | ) |

inlineprotected

Definition at line 114 of file sphereParticles.hpp.

References sphereParticles::intCorrectTimer_.

## rVelIntegration()

integration& rVelIntegration | ( |  | ) |

inlineprotected

Definition at line 119 of file sphereParticles.hpp.

References sphereParticles::rVelIntegration_.

## initializeParticles()

bool initializeParticles | ( |  | ) |

Insert new particles in position with specified shapes.

This function is involked by inserted object to insert new set of particles into the simulation.

Parameters

  position | position of new particles
  shape | shape of new particles
  setField | initial value of the selected fields for new particles

Definition at line 201 of file sphereParticles.cpp.

References sphereShape::boundingDiameter(), internalField< T, MemorySpace >::deviceView(), VectorSingle< T, MemorySpace >::deviceView(), sphereParticles::diameter_, particles::dynPointStruct(), pFlow::endl(), fatalErrorInFunction, sphereParticles::I(), sphereParticles::I_, baseShapeNames::indexValid(), sphereShape::Inertia(), LAMBDA_HD, sphereShape::mass(), sphereParticles::mass(), sphereParticles::mass_, pFlow::minMax(), sphereParticles::propertyId_, particles::shapeIndex(), shape::shapePropertyIds(), and sphereParticles::spheres_.

Referenced by sphereParticles::sphereParticles().

Here is the call graph for this function:
Here is the caller graph for this function:

## spheres()

const auto& spheres | ( |  | ) | const

inline

const reference to shapes object

Definition at line 150 of file sphereParticles.hpp.

References sphereParticles::spheres_.

## I() [1/2]

const auto& I | ( |  | ) | const

inline

const reference to inertia pointField

Definition at line 156 of file sphereParticles.hpp.

References sphereParticles::I_.

Referenced by sphereParticles::initializeParticles().

Here is the caller graph for this function:

## I() [2/2]

auto& I | ( |  | ) |

inline

reference to inertia pointField

Definition at line 162 of file sphereParticles.hpp.

References sphereParticles::I_.

## rVelocity() [1/2]

const auto& rVelocity | ( |  | ) | const

inline

Definition at line 167 of file sphereParticles.hpp.

References sphereParticles::rVelocity_.

## rVelocity() [2/2]

auto& rVelocity | ( |  | ) |

inline

Definition at line 172 of file sphereParticles.hpp.

References sphereParticles::rVelocity_.

## hearChanges()

bool hearChanges | ( | real | t,
|  | real | dt,
|  | uint32 | iter,
|  | const message & | msg,
|  | const anyList & | varList
| ) |  |

inlineoverridevirtual

Implements observer.

Definition at line 177 of file sphereParticles.hpp.

References notImplementedFunction.

## propertyId()

const uint32PointField_D& propertyId | ( |  | ) | const

inlineoverridevirtual

Implements particles.

Definition at line 189 of file sphereParticles.hpp.

References sphereParticles::propertyId_.

## diameter()

const realPointField_D& diameter | ( |  | ) | const

inlineoverridevirtual

Implements particles.

Definition at line 194 of file sphereParticles.hpp.

References sphereParticles::diameter_.

Referenced by sphereParticles::boundingSphere().

Here is the caller graph for this function:

## mass()

const realPointField_D& mass | ( |  | ) | const

inlineoverridevirtual

Implements particles.

Definition at line 199 of file sphereParticles.hpp.

References sphereParticles::mass_.

Referenced by sphereParticles::initializeParticles().

Here is the caller graph for this function:

## beforeIteration()

bool beforeIteration | ( |  | ) |

overridevirtual

before iteration step

Reimplemented from particles.

Definition at line 515 of file sphereParticles.cpp.

References particles::beforeIteration().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## iterate()

bool iterate | ( |  | ) |

overridevirtual

iterate particles

Reimplemented from particles.

Definition at line 537 of file sphereParticles.cpp.

References pFlow::sphereParticlesKernels::acceleration(), and particles::iterate().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

## insertParticles()

bool insertParticles | ( | const realx3Vector & | position,
|  | const wordVector & | shapesNames,
|  | const anyList & | setVarList
| ) |  |

overridevirtual

Implements particles.

Definition at line 581 of file sphereParticles.cpp.

References anyList::emplaceBack().

Here is the call graph for this function:

## rAcceleration() [1/2]

realx3PointField_D& rAcceleration | ( |  | ) |

inlineoverridevirtual

Implements particles.

Definition at line 216 of file sphereParticles.hpp.

References sphereParticles::rAcceleration_.

## rAcceleration() [2/2]

const realx3PointField_D& rAcceleration | ( |  | ) | const

inlineoverridevirtual

Implements particles.

Definition at line 221 of file sphereParticles.hpp.

References sphereParticles::rAcceleration_.

## boundingSphere()

const realPointField_D& boundingSphere | ( |  | ) | const

inlineoverridevirtual

Implements particles.

Definition at line 226 of file sphereParticles.hpp.

References sphereParticles::diameter().

Here is the call graph for this function:

## shapeTypeName()

pFlow::word shapeTypeName | ( |  | ) | const

overridevirtual

Implements particles.

Definition at line 634 of file sphereParticles.cpp.

## getShapes()

const pFlow::shape & getShapes | ( |  | ) | const

overridevirtual

Implements particles.

Definition at line 639 of file sphereParticles.cpp.

## boundingSphereMinMax()

void boundingSphereMinMax | ( | real & | minDiam,
|  | real & | maxDiam
| ) |  | const

overridevirtual

Implements particles.

Definition at line 645 of file sphereParticles.cpp.

## Member Data Documentation

## spheres_

ShapeType spheres_

private

reference to shapes

Definition at line 51 of file sphereParticles.hpp.

Referenced by sphereParticles::initializeParticles(), and sphereParticles::spheres().

## propertyId_

uint32PointField_D propertyId_

private

property id on device

Definition at line 54 of file sphereParticles.hpp.

Referenced by sphereParticles::initializeParticles(), and sphereParticles::propertyId().

## diameter_

realPointField_D diameter_

private

diameter / boundig sphere size of particles on device

Definition at line 57 of file sphereParticles.hpp.

Referenced by sphereParticles::diameter(), and sphereParticles::initializeParticles().

## mass_

realPointField_D mass_

private

mass of particles field

Definition at line 60 of file sphereParticles.hpp.

Referenced by sphereParticles::initializeParticles(), and sphereParticles::mass().

## I_

realPointField_D I_

private

pointField of inertial of particles

Definition at line 63 of file sphereParticles.hpp.

Referenced by sphereParticles::I(), and sphereParticles::initializeParticles().

## rVelocity_

realx3PointField_D rVelocity_

private

pointField of rotational Velocity of particles on device

Definition at line 66 of file sphereParticles.hpp.

Referenced by sphereParticles::rVelocity(), and sphereParticles::sphereParticles().

## rAcceleration_

realx3PointField_D rAcceleration_

private

pointField of rotational acceleration of particles on device

Definition at line 69 of file sphereParticles.hpp.

Referenced by sphereParticles::rAcceleration().

## boundarySphereParticles_

boundarySphereParticlesList boundarySphereParticles_

private

boundaries

Definition at line 72 of file sphereParticles.hpp.

## rVelIntegration_

uniquePtr<integration> rVelIntegration_ = nullptr

private

rotational velocity integrator

Definition at line 75 of file sphereParticles.hpp.

Referenced by sphereParticles::rVelIntegration(), and sphereParticles::sphereParticles().

## accelerationTimer_

Timer accelerationTimer_

private

timer for acceleration computations

Definition at line 78 of file sphereParticles.hpp.

Referenced by sphereParticles::accelerationTimer().

## intPredictTimer_

Timer intPredictTimer_

private

timer for integration computations (prediction step)

Definition at line 81 of file sphereParticles.hpp.

## intCorrectTimer_

Timer intCorrectTimer_

private

timer for integration computations (correction step)

Definition at line 84 of file sphereParticles.hpp.

Referenced by sphereParticles::intCorrectTimer().

## fieldUpdateTimer_

Timer fieldUpdateTimer_

private

Definition at line 86 of file sphereParticles.hpp.

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

- src/Particles/SphereParticles/sphereParticles/sphereParticles.hpp
- src/Particles/SphereParticles/sphereParticles/sphereParticles.cpp