# PhasicFlow: particles 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.

particles Class Referenceabstract
Inheritance diagram for particles:
[legend]
Collaboration diagram for particles:
[legend]

## Public Member Functions

| 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 | beforeIteration () override
| This is called in time loop, before iterate. More...
bool | iterate () override
| This is called in time loop. More...
bool | afterIteration () override
| This is called in time loop, after iterate. More...
virtual bool | insertParticles (const realx3Vector &position, const wordVector &shapesNames, const anyList &setVarList)=0
virtual const uint32PointField_D & | propertyId () const =0
virtual const realPointField_D & | diameter () const =0
virtual const realPointField_D & | mass () const =0
virtual realx3PointField_D & | rAcceleration ()=0
virtual const realx3PointField_D & | rAcceleration () const =0
virtual const realPointField_D & | boundingSphere () const =0
virtual word | shapeTypeName () const =0
virtual const shape & | getShapes () const =0
virtual void | boundingSphereMinMax (real &minDiam, real &maxDiam) const =0
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)
virtual bool | hearChanges (real t, real dt, uint32 iter, const message &msg, const anyList &varList)=0
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

void | zeroForce ()
void | zeroTorque ()
auto & | dynPointStruct ()
auto & | pointPosition ()
auto & | idHandler ()
auto & | shapeIndex ()

## Private Attributes

dynamicPointStructure | dynPointStruct_
| dynamic point structure for particles center mass More...
uint32PointField_D | shapeIndex_
| shape index of each particle More...
realx3PointField_D | accelertion_
| acceleration on device More...
realx3PointField_D | contactForce_
| contact force field More...
realx3PointField_D | contactTorque_
| contact torque field More...
uniquePtr< particleIdHandler > | idHandler_ = nullptr
| handling new ids for new particles More...
Timer | baseFieldBoundaryUpdateTimer_

## Static Private Attributes

static const message | defaultMessage_ { message::DEFAULT }
| messages for this objects More...

## Additional Inherited Members

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

## Detailed Description

Definition at line 33 of file particles.hpp.

## Constructor & Destructor Documentation

## particles()

particles | ( | systemControl & | control | ) |

explicit

Definition at line 22 of file particles.cpp.

References observer::addToSubscriber(), and particles::dynPointStruct_.

Here is the call graph for this function:

## Member Function Documentation

## zeroForce()

void zeroForce | ( |  | ) |

inlineprotected

Definition at line 64 of file particles.hpp.

References particles::contactForce_, pointField< T, MemorySpace >::fill(), and pFlow::zero3.

Here is the call graph for this function:

## zeroTorque()

void zeroTorque | ( |  | ) |

inlineprotected

Definition at line 69 of file particles.hpp.

References particles::contactTorque_, pointField< T, MemorySpace >::fill(), and pFlow::zero3.

Here is the call graph for this function:

## dynPointStruct() [1/2]

auto& dynPointStruct | ( |  | ) |

inlineprotected

Definition at line 74 of file particles.hpp.

References particles::dynPointStruct_.

Referenced by ContactSearch< searchMethod >::BroadSearch(), ContactSearch< searchMethod >::ContactSearch(), grainParticles::grainParticles(), grainParticles::initializeParticles(), sphereParticles::initializeParticles(), and sphereParticles::sphereParticles().

Here is the caller graph for this function:

## pointPosition() [1/2]

auto& pointPosition | ( |  | ) |

inlineprotected

Definition at line 79 of file particles.hpp.

References particles::dynPointStruct_, and internalPoints::pointPosition().

Referenced by ContactSearch< searchMethod >::BroadSearch(), and ContactSearch< searchMethod >::ContactSearch().

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

## idHandler()

auto& idHandler | ( |  | ) |

inlineprotected

Definition at line 84 of file particles.hpp.

References particles::idHandler_.

## shapeIndex()

auto& shapeIndex | ( |  | ) |

inlineprotected

Definition at line 89 of file particles.hpp.

References particles::shapeIndex_.

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

Here is the caller graph for this function:

## TypeInfo()

TypeInfo | ( | "particles" |  | ) |

## dynPointStruct() [2/2]

const auto& dynPointStruct | ( |  | ) | const

inline

Definition at line 101 of file particles.hpp.

References particles::dynPointStruct_.

## pStruct()

const pointStructure& pStruct | ( |  | ) | const

inline

Definition at line 106 of file particles.hpp.

References particles::dynPointStruct_.

## simDomain()

const auto& simDomain | ( |  | ) | const

inline

Definition at line 111 of file particles.hpp.

References particles::dynPointStruct_, and pointStructure::simDomain().

Here is the call graph for this function:

## thisDomain()

const auto& thisDomain | ( |  | ) | const

inline

Definition at line 116 of file particles.hpp.

References particles::dynPointStruct_, and pointStructure::thisDomain().

Here is the call graph for this function:

## extendedDomain()

const auto& extendedDomain | ( |  | ) | const

inline

Definition at line 121 of file particles.hpp.

References particles::dynPointStruct_, and pointStructure::extendedDomain().

Here is the call graph for this function:

## size()

auto size | ( |  | ) | const

inline

Definition at line 126 of file particles.hpp.

References particles::dynPointStruct_, and internalPoints::size().

Here is the call graph for this function:

## capacity()

auto capacity | ( |  | ) | const

inline

Definition at line 131 of file particles.hpp.

References internalPoints::capacity(), and particles::dynPointStruct_.

Here is the call graph for this function:

## numActive()

auto numActive | ( |  | ) | const

inline

Definition at line 136 of file particles.hpp.

References particles::dynPointStruct_, and internalPoints::numActive().

Here is the call graph for this function:

## isAllActive()

bool isAllActive | ( |  | ) | const

inline

Definition at line 141 of file particles.hpp.

References particles::dynPointStruct_, and internalPoints::isAllActive().

Here is the call graph for this function:

## pointPosition() [2/2]

const auto& pointPosition | ( |  | ) | const

inline

Definition at line 146 of file particles.hpp.

References particles::dynPointStruct_, and internalPoints::pointPosition().

Here is the call graph for this function:

## velocity()

const auto& velocity | ( |  | ) | const

inline

Definition at line 151 of file particles.hpp.

References particles::dynPointStruct_, and dynamicPointStructure::velocity().

Here is the call graph for this function:

## accelertion() [1/2]

const auto& accelertion | ( |  | ) | const

inline

Definition at line 156 of file particles.hpp.

References particles::accelertion_.

## accelertion() [2/2]

auto& accelertion | ( |  | ) |

inline

Definition at line 161 of file particles.hpp.

References particles::accelertion_.

## contactForce() [1/2]

auto& contactForce | ( |  | ) |

inline

Definition at line 166 of file particles.hpp.

References particles::contactForce_.

## contactForce() [2/2]

const auto& contactForce | ( |  | ) | const

inline

Definition at line 171 of file particles.hpp.

References particles::contactForce_.

## contactTorque() [1/2]

auto& contactTorque | ( |  | ) |

inline

Definition at line 176 of file particles.hpp.

References particles::contactTorque_.

## contactTorque() [2/2]

const auto& contactTorque | ( |  | ) | const

inline

Definition at line 181 of file particles.hpp.

References particles::contactTorque_.

## maxId()

uint maxId | ( |  | ) | const

inline

Definition at line 187 of file particles.hpp.

References particles::idHandler_.

## beforeIteration()

bool beforeIteration | ( |  | ) |

overridevirtual

This is called in time loop, before iterate.

Implements demComponent.

Reimplemented in sphereParticles.

Definition at line 86 of file particles.cpp.

Referenced by sphereParticles::beforeIteration(), and grainParticles::beforeIteration().

Here is the caller graph for this function:

## iterate()

bool iterate | ( |  | ) |

overridevirtual

This is called in time loop.

Perform the main calculations when the component should evolve along time.

Implements demComponent.

Reimplemented in sphereParticles.

Definition at line 104 of file particles.cpp.

Referenced by sphereParticles::iterate(), and grainParticles::iterate().

Here is the caller graph for this function:

## afterIteration()

bool afterIteration | ( |  | ) |

overridevirtual

This is called in time loop, after iterate.

Implements demComponent.

Definition at line 110 of file particles.cpp.

Referenced by main().

Here is the caller graph for this function:

## insertParticles()

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

pure virtual

Implemented in grainParticles, and sphereParticles.

## propertyId()

virtual const uint32PointField_D& propertyId | ( |  | ) | const

pure virtual

Implemented in sphereParticles, and grainParticles.

## diameter()

virtual const realPointField_D& diameter | ( |  | ) | const

pure virtual

Implemented in sphereParticles, and grainParticles.

## mass()

virtual const realPointField_D& mass | ( |  | ) | const

pure virtual

Implemented in grainParticles, and sphereParticles.

## rAcceleration() [1/2]

virtual realx3PointField_D& rAcceleration | ( |  | ) |

pure virtual

Implemented in grainParticles, and sphereParticles.

## rAcceleration() [2/2]

virtual const realx3PointField_D& rAcceleration | ( |  | ) | const

pure virtual

Implemented in grainParticles, and sphereParticles.

## boundingSphere()

virtual const realPointField_D& boundingSphere | ( |  | ) | const

pure virtual

Implemented in grainParticles, and sphereParticles.

Referenced by ContactSearch< searchMethod >::BroadSearch(), and ContactSearch< searchMethod >::ContactSearch().

Here is the caller graph for this function:

## shapeTypeName()

virtual word shapeTypeName | ( |  | ) | const

pure virtual

Implemented in grainParticles, and sphereParticles.

Referenced by interaction::create().

Here is the caller graph for this function:

## getShapes()

virtual const shape& getShapes | ( |  | ) | const

pure virtual

Implemented in grainParticles, and sphereParticles.

Referenced by insertionRegion::readInsertionRegion().

Here is the caller graph for this function:

## boundingSphereMinMax()

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

pure virtual

Implemented in grainParticles, and sphereParticles.

Definition at line 116 of file particles.cpp.

Referenced by ContactSearch< searchMethod >::ContactSearch().

Here is the caller graph for this function:

## Member Data Documentation

## dynPointStruct_

dynamicPointStructure dynPointStruct_

private

dynamic point structure for particles center mass

Definition at line 40 of file particles.hpp.

Referenced by particles::capacity(), particles::dynPointStruct(), particles::extendedDomain(), particles::isAllActive(), particles::numActive(), particles::particles(), particles::pointPosition(), particles::pStruct(), particles::simDomain(), particles::size(), particles::thisDomain(), and particles::velocity().

## shapeIndex_

uint32PointField_D shapeIndex_

private

shape index of each particle

Definition at line 43 of file particles.hpp.

Referenced by particles::shapeIndex().

## accelertion_

realx3PointField_D accelertion_

private

acceleration on device

Definition at line 46 of file particles.hpp.

Referenced by particles::accelertion().

## contactForce_

realx3PointField_D contactForce_

private

contact force field

Definition at line 49 of file particles.hpp.

Referenced by particles::contactForce(), and particles::zeroForce().

## contactTorque_

realx3PointField_D contactTorque_

private

contact torque field

Definition at line 52 of file particles.hpp.

Referenced by particles::contactTorque(), and particles::zeroTorque().

## idHandler_

uniquePtr<particleIdHandler> idHandler_ = nullptr

private

handling new ids for new particles

Definition at line 55 of file particles.hpp.

Referenced by particles::idHandler(), and particles::maxId().

## baseFieldBoundaryUpdateTimer_

Timer baseFieldBoundaryUpdateTimer_

private

Definition at line 57 of file particles.hpp.

## defaultMessage_

const message defaultMessage_ { message::DEFAULT }

inlinestaticprivate

messages for this objects

Definition at line 60 of file particles.hpp.

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

- src/Particles/particles/particles.hpp
- src/Particles/particles/particles.cpp