www.cemf.ir
grainParticles Class Reference
+ Inheritance diagram for grainParticles:
+ Collaboration diagram for grainParticles:

Public Types

using ShapeType = grainShape
 

Public Member Functions

 grainParticles (systemControl &control, const property &prop)
 construct from systemControl and property More...
 
 ~grainParticles () override=default
 
bool initializeParticles ()
 Insert new particles in position with specified shapes. More...
 
const auto & grains () 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_DpropertyId () const override
 
const realPointField_Ddiameter () const override
 
const realPointField_DgrainDiameter () const
 
const realPointField_DcoarseGrainFactor () const
 
const realPointField_Dmass () 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_DrAcceleration () override
 
const realx3PointField_DrAcceleration () const override
 
const realPointField_DboundingSphere () const override
 
word shapeTypeName () const override
 
const shapegetShapes () 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 pointStructurepStruct () 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...
 
- Public Member Functions inherited from observer
 observer (message msg)
 
 observer (const subscriber *subscrbr, message msg)
 
virtual ~observer ()
 
void subscribe (const subscriber *subscrbr, message msg)
 
observeraddEvent (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...
 
demComponentoperator= (const demComponent &)=delete
 No copy assignment. More...
 
demComponentoperator= (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

TimeraccelerationTimer ()
 
TimerintCorrectTimer ()
 
integrationrVelIntegration ()
 
- 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 &coarseGrainFactors, realVector &m, realVector &Is, uint32Vector &shIndex)
 

Private Attributes

ShapeType grains_
 reference to shapes More...
 
uint32PointField_D propertyId_
 property id on device More...
 
realPointField_D grainDiameter_
 diameter / boundig sphere size of particles on device More...
 
realPointField_D coarseGrainFactor_
 
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...
 
boundaryGrainParticlesList boundaryGrainParticles_
 boundaries More...
 
uniquePtr< integrationrVelIntegration_ = 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

Definition at line 42 of file grainParticles.hpp.

Member Typedef Documentation

◆ ShapeType

Definition at line 46 of file grainParticles.hpp.

Constructor & Destructor Documentation

◆ grainParticles()

◆ ~grainParticles()

~grainParticles ( )
overridedefault

Member Function Documentation

◆ getParticlesInfoFromShape()

bool getParticlesInfoFromShape ( const wordVector shapeNames,
uint32Vector propIds,
realVector diams,
realVector coarseGrainFactors,
realVector m,
realVector Is,
uint32Vector shIndex 
)
private

Definition at line 88 of file grainParticles.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 106 of file grainParticles.hpp.

References grainParticles::accelerationTimer_.

◆ intCorrectTimer()

Timer& intCorrectTimer ( )
inlineprotected

Definition at line 111 of file grainParticles.hpp.

References grainParticles::intCorrectTimer_.

◆ rVelIntegration()

integration& rVelIntegration ( )
inlineprotected

Definition at line 116 of file grainParticles.hpp.

References grainParticles::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
positionposition of new particles
shapeshape of new particles
setFieldinitial value of the selected fields for new particles

Definition at line 26 of file grainParticles.cpp.

References grainShape::boundingDiameter(), grainShape::coarseGrainFactor(), grainParticles::coarseGrainFactor(), grainParticles::coarseGrainFactor_, internalField< T, MemorySpace >::deviceView(), VectorSingle< T, MemorySpace >::deviceView(), particles::dynPointStruct(), pFlow::endl(), fatalErrorInFunction, grainParticles::grainDiameter_, grainParticles::grains_, grainParticles::I(), grainParticles::I_, baseShapeNames::indexValid(), grainShape::Inertia(), LAMBDA_HD, grainShape::mass(), grainParticles::mass(), grainParticles::mass_, pFlow::minMax(), grainParticles::propertyId_, particles::shapeIndex(), and shape::shapePropertyIds().

Referenced by grainParticles::grainParticles().

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

◆ grains()

const auto& grains ( ) const
inline

const reference to shapes object

Definition at line 147 of file grainParticles.hpp.

References grainParticles::grains_.

◆ I() [1/2]

const auto& I ( ) const
inline

const reference to inertia pointField

Definition at line 153 of file grainParticles.hpp.

References grainParticles::I_.

Referenced by grainParticles::initializeParticles().

+ Here is the caller graph for this function:

◆ I() [2/2]

auto& I ( )
inline

reference to inertia pointField

Definition at line 159 of file grainParticles.hpp.

References grainParticles::I_.

◆ rVelocity() [1/2]

const auto& rVelocity ( ) const
inline

Definition at line 164 of file grainParticles.hpp.

References grainParticles::rVelocity_.

◆ rVelocity() [2/2]

auto& rVelocity ( )
inline

Definition at line 169 of file grainParticles.hpp.

References grainParticles::rVelocity_.

◆ hearChanges()

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

Implements observer.

Definition at line 174 of file grainParticles.hpp.

References notImplementedFunction.

◆ propertyId()

const uint32PointField_D& propertyId ( ) const
inlineoverridevirtual

Implements particles.

Definition at line 186 of file grainParticles.hpp.

References grainParticles::propertyId_.

◆ diameter()

const realPointField_D& diameter ( ) const
inlineoverridevirtual

Implements particles.

Definition at line 191 of file grainParticles.hpp.

References grainParticles::grainDiameter_.

Referenced by grainParticles::boundingSphere().

+ Here is the caller graph for this function:

◆ grainDiameter()

const realPointField_D& grainDiameter ( ) const
inline

Definition at line 196 of file grainParticles.hpp.

References grainParticles::grainDiameter_.

◆ coarseGrainFactor()

const realPointField_D& coarseGrainFactor ( ) const
inline

Definition at line 201 of file grainParticles.hpp.

References grainParticles::coarseGrainFactor_.

Referenced by grainParticles::initializeParticles().

+ Here is the caller graph for this function:

◆ mass()

const realPointField_D& mass ( ) const
inlineoverridevirtual

Implements particles.

Definition at line 207 of file grainParticles.hpp.

References grainParticles::mass_.

Referenced by grainParticles::initializeParticles().

+ Here is the caller graph for this function:

◆ beforeIteration()

bool beforeIteration ( )
overridevirtual

before iteration step

Implements demComponent.

Definition at line 278 of file grainParticles.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

Implements demComponent.

Definition at line 301 of file grainParticles.cpp.

References pFlow::grainParticlesKernels::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 345 of file grainParticles.cpp.

References anyList::emplaceBack().

+ Here is the call graph for this function:

◆ rAcceleration() [1/2]

realx3PointField_D& rAcceleration ( )
inlineoverridevirtual

Implements particles.

Definition at line 224 of file grainParticles.hpp.

References grainParticles::rAcceleration_.

◆ rAcceleration() [2/2]

const realx3PointField_D& rAcceleration ( ) const
inlineoverridevirtual

Implements particles.

Definition at line 229 of file grainParticles.hpp.

References grainParticles::rAcceleration_.

◆ boundingSphere()

const realPointField_D& boundingSphere ( ) const
inlineoverridevirtual

Implements particles.

Definition at line 234 of file grainParticles.hpp.

References grainParticles::diameter().

+ Here is the call graph for this function:

◆ shapeTypeName()

pFlow::word shapeTypeName ( ) const
overridevirtual

Implements particles.

Definition at line 404 of file grainParticles.cpp.

◆ getShapes()

const pFlow::shape & getShapes ( ) const
overridevirtual

Implements particles.

Definition at line 409 of file grainParticles.cpp.

◆ boundingSphereMinMax()

void boundingSphereMinMax ( real minDiam,
real maxDiam 
) const
overridevirtual

Implements particles.

Definition at line 415 of file grainParticles.cpp.

Member Data Documentation

◆ grains_

ShapeType grains_
private

reference to shapes

Definition at line 51 of file grainParticles.hpp.

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

◆ propertyId_

uint32PointField_D propertyId_
private

property id on device

Definition at line 54 of file grainParticles.hpp.

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

◆ grainDiameter_

realPointField_D grainDiameter_
private

diameter / boundig sphere size of particles on device

Definition at line 57 of file grainParticles.hpp.

Referenced by grainParticles::diameter(), grainParticles::grainDiameter(), and grainParticles::initializeParticles().

◆ coarseGrainFactor_

realPointField_D coarseGrainFactor_
private

◆ mass_

realPointField_D mass_
private

mass of particles field

Definition at line 63 of file grainParticles.hpp.

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

◆ I_

realPointField_D I_
private

pointField of inertial of particles

Definition at line 66 of file grainParticles.hpp.

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

◆ rVelocity_

realx3PointField_D rVelocity_
private

pointField of rotational Velocity of particles on device

Definition at line 69 of file grainParticles.hpp.

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

◆ rAcceleration_

realx3PointField_D rAcceleration_
private

pointField of rotational acceleration of particles on device

Definition at line 72 of file grainParticles.hpp.

Referenced by grainParticles::rAcceleration().

◆ boundaryGrainParticles_

boundaryGrainParticlesList boundaryGrainParticles_
private

boundaries

Definition at line 75 of file grainParticles.hpp.

◆ rVelIntegration_

uniquePtr<integration> rVelIntegration_ = nullptr
private

rotational velocity integrator

Definition at line 78 of file grainParticles.hpp.

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

◆ accelerationTimer_

Timer accelerationTimer_
private

timer for acceleration computations

Definition at line 81 of file grainParticles.hpp.

Referenced by grainParticles::accelerationTimer().

◆ intPredictTimer_

Timer intPredictTimer_
private

timer for integration computations (prediction step)

Definition at line 84 of file grainParticles.hpp.

◆ intCorrectTimer_

Timer intCorrectTimer_
private

timer for integration computations (correction step)

Definition at line 87 of file grainParticles.hpp.

Referenced by grainParticles::intCorrectTimer().

◆ fieldUpdateTimer_

Timer fieldUpdateTimer_
private

Definition at line 89 of file grainParticles.hpp.


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