# PhasicFlow: src/Particles/particles/particles.hpp Source File

particles.hpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#ifndef __particles_hpp__
#define __particles_hpp__
#include "dynamicPointStructure.hpp"
#include "particleIdHandler.hpp"
#include "demParticles.hpp"
namespace pFlow
{
class setFieldList;
class particles
:
public eventObserver,
public demParticles
{
protected:
// owner repository
Time& time_;
const word integrationMethod_;
// dynamic point structure for particles
dynamicPointStructure dynPointStruct_;
// - name of shapes - this is managed by particles
wordPointField& shapeName_;
// id of particles on host
int32PointField_HD& id_;
// property id on device
int8PointField_D& propertyId_;
// diameter / boundig sphere size of particles on device
realPointField_D& diameter_;
// mass on device
realPointField_D& mass_;
// - acceleration on device
realx3PointField_D& accelertion_;
realx3PointField_D& contactForce_;
realx3PointField_D& contactTorque_;
// - object handling particle id
particleIdHandler idHandler_;
virtual uniquePtr<List<eventObserver*>> getFieldObjectList()const;
void zeroForce()
{
contactForce_.fill(zero3);
}
void zeroTorque()
{
contactTorque_.fill(zero3);
}
public:
// type info
TypeInfo("particles");
particles(systemControl& control, const word& integrationMethod);
inline const auto& time()const {
return time_;
}
inline auto& time() {
return time_;
}
inline auto integrationMethod()const
{
return integrationMethod_;
}
inline const auto& dynPointStruct()const
{
return dynPointStruct_;
}
inline auto& dynPointStruct()
{
return dynPointStruct_;
}
inline const auto& pStruct()const{
return dynPointStruct_.pStruct();
}
inline auto& pStruct(){
return dynPointStruct_.pStruct();
}
inline auto size()const{
return pStruct().size();
}
inline auto capacity() const{
return pStruct().capacity();
}
inline auto activePointsMaskD()const{
return pStruct().activePointsMaskD();
}
inline auto numActive()const
{
return pStruct().numActive();
}
inline bool allActive()const{
return pStruct().allActive();
}
inline auto activeRange()const{
return pStruct().activeRange();
}
inline auto activePointsMaskH()const{
return pStruct().activePointsMaskH();
}
inline const auto& pointPosition()const{
return pStruct().pointPosition();
}
inline const auto& position()const
{
return pStruct().pointPosition();
}
inline const auto& pointVelocity()const{
return dynPointStruct().velocity();
}
inline const auto& velocity()const{
return dynPointStruct().velocity();
}
inline const auto& id()const{
return id_;
}
inline auto& id(){
return id_;
}
inline const auto& diameter()const{
return diameter_;
}
inline auto& diameter(){
return diameter_;
}
inline const auto& mass()const{
return mass_;
}
inline auto& mass() {
return mass_;
}
inline const auto& accelertion()const{
return accelertion_;
}
inline auto& accelertion(){
return accelertion_;
}
inline
realx3PointField_D& contactForce()
{
return contactForce_;
}
inline
const realx3PointField_D& contactForce() const
{
return contactForce_;
}
inline
realx3PointField_D& contactTorque()
{
return contactTorque_;
}
inline
const realx3PointField_D& contactTorque() const
{
return contactTorque_;
}
inline const auto& propertyId()const{
return propertyId_;
}
inline auto& propertyId(){
return propertyId_;
}
inline const auto& shapeName()const{
return shapeName_;
}
inline auto& shapName(){
return shapeName_;
}
bool beforeIteration() override
{
auto domain = this->control().domain();
auto numMarked = dynPointStruct_.markDeleteOutOfBox(domain);
/*if(numMarked)
{
output<<"\nNumber of deleted points/particles that are out of domain box: "<<numMarked<<endl;
}*/
this->zeroForce();
this->zeroTorque();
return true;
}
virtual
bool insertParticles
(
const realx3Vector& position,
const wordVector& shapes,
const setFieldList& setField
) = 0;
virtual
realx3PointField_D& rAcceleration() = 0;
virtual
const realx3PointField_D& rAcceleration() const = 0;
virtual
const realVector_D& boundingSphere()const = 0;
virtual
word shapeTypeName()const = 0;
virtual
void boundingSphereMinMax(real & minDiam, real& maxDiam)const = 0;
}; // particles
} // pFlow
#endif //__particles_hpp__
pFlow::particles::mass
const auto & mass() const
Definition: particles.hpp:188
pFlow::particles::shapeName_
wordPointField & shapeName_
Definition: particles.hpp:49
pFlow::particles::beforeIteration
bool beforeIteration() override
Definition: particles.hpp:244
pFlow::particles::pointVelocity
const auto & pointVelocity() const
Definition: particles.hpp:164
pFlow::particles::propertyId
auto & propertyId()
Definition: particles.hpp:232
pFlow::particles::velocity
const auto & velocity() const
Definition: particles.hpp:168
pFlow::particles::zeroTorque
void zeroTorque()
Definition: particles.hpp:83
pFlow::particles::accelertion
const auto & accelertion() const
Definition: particles.hpp:196
pFlow::particles::contactTorque
const realx3PointField_D & contactTorque() const
Definition: particles.hpp:223
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::particles::pointPosition
const auto & pointPosition() const
Definition: particles.hpp:155
pFlow::demComponent::control
const auto & control() const
Definition: demComponent.hpp:57
pFlow::particles::position
const auto & position() const
Definition: particles.hpp:159
pFlow::particles::dynPointStruct
const auto & dynPointStruct() const
Definition: particles.hpp:108
pFlow::particles::mass
auto & mass()
Definition: particles.hpp:192
pFlow::particles::rAcceleration
virtual realx3PointField_D & rAcceleration()=0
pFlow::particles::shapeTypeName
virtual word shapeTypeName() const =0
pFlow::dynamicPointStructure::markDeleteOutOfBox
auto markDeleteOutOfBox(const box &domain)
Definition: dynamicPointStructure.hpp:113
pFlow::particles::contactTorque_
realx3PointField_D & contactTorque_
Definition: particles.hpp:70
pFlow::particleIdHandler
Definition: particleIdHandler.hpp:30
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::particles::time
auto & time()
Definition: particles.hpp:99
pFlow::zero3
const realx3 zero3(0.0)
Definition: types.hpp:97
pFlow::particles::capacity
auto capacity() const
Definition: particles.hpp:130
pFlow::eventObserver
Definition: eventObserver.hpp:33
pFlow::particles::integrationMethod
auto integrationMethod() const
Definition: particles.hpp:103
pFlow::dynamicPointStructure
Definition: dynamicPointStructure.hpp:33
pFlow::particles::propertyId
const auto & propertyId() const
Definition: particles.hpp:228
pFlow::particles::integrationMethod_
const word integrationMethod_
Definition: particles.hpp:43
pFlow
Definition: demComponent.hpp:28
pFlow::particles::diameter
auto & diameter()
Definition: particles.hpp:184
pFlow::particles::time
const auto & time() const
Definition: particles.hpp:95
pFlow::particles::dynPointStruct_
dynamicPointStructure dynPointStruct_
Definition: particles.hpp:46
pFlow::particles::id_
int32PointField_HD & id_
Definition: particles.hpp:52
pFlow::particles::contactForce
realx3PointField_D & contactForce()
Definition: particles.hpp:205
pFlow::pointField
Definition: pointField.hpp:35
pFlow::particles::zeroForce
void zeroForce()
Definition: particles.hpp:78
pFlow::particles::time_
Time & time_
Definition: particles.hpp:41
pFlow::particles
Definition: particles.hpp:33
pFlow::particles::accelertion_
realx3PointField_D & accelertion_
Definition: particles.hpp:64
pFlow::demParticles
Definition: demParticles.hpp:31
pFlow::particles::boundingSphere
virtual const realVector_D & boundingSphere() const =0
pFlow::particles::id
auto & id()
Definition: particles.hpp:176
pFlow::particles::pStruct
const auto & pStruct() const
Definition: particles.hpp:118
demParticles.hpp
pFlow::setFieldList
Definition: setFieldList.hpp:32
pFlow::particles::pStruct
auto & pStruct()
Definition: particles.hpp:122
pFlow::particles::getFieldObjectList
virtual uniquePtr< List< eventObserver * > > getFieldObjectList() const
Definition: particles.cpp:154
pFlow::particles::size
auto size() const
Definition: particles.hpp:126
pFlow::dynamicPointStructure::pStruct
pointStructure & pStruct()
Definition: dynamicPointStructure.hpp:88
pFlow::particles::contactTorque
realx3PointField_D & contactTorque()
Definition: particles.hpp:217
pFlow::particles::propertyId_
int8PointField_D & propertyId_
Definition: particles.hpp:55
pFlow::particles::insertParticles
virtual bool insertParticles(const realx3Vector &position, const wordVector &shapes, const setFieldList &setField)=0
pFlow::particles::numActive
auto numActive() const
Definition: particles.hpp:138
pFlow::VectorSingle
Definition: VectorSingle.hpp:45
pFlow::particles::activePointsMaskH
auto activePointsMaskH() const
Definition: particles.hpp:151
pFlow::particles::mass_
realPointField_D & mass_
Definition: particles.hpp:61
dynamicPointStructure.hpp
pFlow::particles::diameter
const auto & diameter() const
Definition: particles.hpp:180
pFlow::particles::accelertion
auto & accelertion()
Definition: particles.hpp:200
pFlow::particles::boundingSphereMinMax
virtual void boundingSphereMinMax(real &minDiam, real &maxDiam) const =0
pFlow::uniquePtr
Definition: uniquePtr.hpp:44
pFlow::particles::dynPointStruct
auto & dynPointStruct()
Definition: particles.hpp:113
pFlow::particles::TypeInfo
TypeInfo("particles")
pFlow::particles::shapeName
const auto & shapeName() const
Definition: particles.hpp:236
pFlow::particles::idHandler_
particleIdHandler idHandler_
Definition: particles.hpp:74
pFlow::particles::shapName
auto & shapName()
Definition: particles.hpp:240
pFlow::particles::allActive
bool allActive() const
Definition: particles.hpp:143
pFlow::particles::id
const auto & id() const
Definition: particles.hpp:172
particleIdHandler.hpp
pFlow::Vector< realx3 >
pFlow::particles::contactForce
const realx3PointField_D & contactForce() const
Definition: particles.hpp:211
pFlow::particles::activePointsMaskD
auto activePointsMaskD() const
Definition: particles.hpp:134
pFlow::particles::contactForce_
realx3PointField_D & contactForce_
Definition: particles.hpp:67
pFlow::particles::particles
particles(systemControl &control, const word &integrationMethod)
Definition: particles.cpp:26
pFlow::particles::diameter_
realPointField_D & diameter_
Definition: particles.hpp:58
pFlow::particles::activeRange
auto activeRange() const
Definition: particles.hpp:147
pFlow::Time
Definition: Time.hpp:39