Files
phasicFlow/src/Particles/particles/particles.hpp

253 lines
4.2 KiB
C++
Raw Normal View History

2022-09-05 01:56:29 +04:30
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
2022-12-10 01:32:54 +03:30
#ifndef __particles_hpp__
#define __particles_hpp__
2022-09-05 01:56:29 +04:30
2022-12-10 01:32:54 +03:30
#include "dynamicPointStructure.hpp"
2024-01-21 13:26:23 -08:00
#include "demComponent.hpp"
2022-09-05 01:56:29 +04:30
namespace pFlow
{
class particles
:
2024-01-21 13:26:23 -08:00
public observer,
public demComponent
2022-09-05 01:56:29 +04:30
{
2024-01-21 13:26:23 -08:00
private:
2022-09-05 01:56:29 +04:30
2024-01-21 13:26:23 -08:00
/// dynamic point structure for particles center mass
2022-09-05 01:56:29 +04:30
dynamicPointStructure dynPointStruct_;
// - name of shapes - this is managed by particles
2024-01-21 13:26:23 -08:00
//wordPointField& shapeName_;
2022-09-05 01:56:29 +04:30
// id of particles on host
2024-01-21 13:26:23 -08:00
int32PointField_D id_;
2022-09-05 01:56:29 +04:30
// property id on device
2024-01-21 13:26:23 -08:00
int8PointField_D propertyId_;
2022-09-05 01:56:29 +04:30
// diameter / boundig sphere size of particles on device
2024-01-21 13:26:23 -08:00
realPointField_D diameter_;
2022-09-05 01:56:29 +04:30
2024-01-21 13:26:23 -08:00
// mass of particles field
realPointField_D mass_;
2022-09-05 01:56:29 +04:30
// - acceleration on device
2024-01-21 13:26:23 -08:00
realx3PointField_D accelertion_;
2022-09-05 01:56:29 +04:30
2024-01-21 13:26:23 -08:00
/// contact force field
realx3PointField_D contactForce_;
2022-09-05 01:56:29 +04:30
2024-01-21 13:26:23 -08:00
/// contact torque field
realx3PointField_D contactTorque_;
2022-09-05 01:56:29 +04:30
2024-01-21 13:26:23 -08:00
2022-09-05 01:56:29 +04:30
void zeroForce()
{
2024-01-21 13:26:23 -08:00
WARNING<<"fill contactTorque"<<END_WARNING;
//contactForce_.fill(zero3);
2022-09-05 01:56:29 +04:30
}
void zeroTorque()
{
2024-01-21 13:26:23 -08:00
WARNING<<"fill contactTorque"<<END_WARNING;
//contactTorque_.fill(zero3);
2022-09-05 01:56:29 +04:30
}
2024-01-21 13:26:23 -08:00
protected:
2022-09-05 01:56:29 +04:30
2024-01-21 13:26:23 -08:00
inline auto& dynPointStruct()
2022-09-05 01:56:29 +04:30
{
2024-01-21 13:26:23 -08:00
return dynPointStruct_;
2022-09-05 01:56:29 +04:30
}
2024-01-21 13:26:23 -08:00
inline auto& pointPosition()
2022-09-05 01:56:29 +04:30
{
2024-01-21 13:26:23 -08:00
return dynPointStruct_.pointPosition();
2022-09-05 01:56:29 +04:30
}
2024-01-21 13:26:23 -08:00
inline
auto& velocity()
2022-09-05 01:56:29 +04:30
{
2024-01-21 13:26:23 -08:00
return dynPointStruct_.velocity();
2022-09-05 01:56:29 +04:30
}
2024-01-21 13:26:23 -08:00
public:
2022-09-05 01:56:29 +04:30
2024-01-21 13:26:23 -08:00
// type info
TypeInfo("particles");
explicit particles(systemControl& control);
inline const auto& dynPointStruct()const
{
return dynPointStruct_;
}
2022-09-05 01:56:29 +04:30
inline auto size()const{
2024-01-21 13:26:23 -08:00
return dynPointStruct_.size();
2022-09-05 01:56:29 +04:30
}
inline auto capacity() const{
2024-01-21 13:26:23 -08:00
return dynPointStruct_.capacity();
2022-09-05 01:56:29 +04:30
}
2024-01-21 13:26:23 -08:00
2022-09-05 01:56:29 +04:30
inline auto numActive()const
{
2024-01-21 13:26:23 -08:00
return dynPointStruct_.numActive();
2022-09-05 01:56:29 +04:30
}
2024-01-21 13:26:23 -08:00
inline bool isAllActive()const
2022-09-05 01:56:29 +04:30
{
2024-01-21 13:26:23 -08:00
return dynPointStruct_.isAllActive();
2022-09-05 01:56:29 +04:30
}
2024-01-21 13:26:23 -08:00
inline
const auto& pointPosition()const
{
return dynPointStruct_.pointPosition();
2022-09-05 01:56:29 +04:30
}
2024-01-21 13:26:23 -08:00
inline
const auto& velocity()const
{
return dynPointStruct_.velocity();
2022-09-05 01:56:29 +04:30
}
2024-01-21 13:26:23 -08:00
inline
const auto& diameter()const
{
2022-09-05 01:56:29 +04:30
return diameter_;
}
2024-01-21 13:26:23 -08:00
inline
auto& diameter()
{
2022-09-05 01:56:29 +04:30
return diameter_;
}
2024-01-21 13:26:23 -08:00
inline
const auto& mass()const
{
2022-09-05 01:56:29 +04:30
return mass_;
}
2024-01-21 13:26:23 -08:00
inline auto& mass()
{
2022-09-05 01:56:29 +04:30
return mass_;
}
2024-01-21 13:26:23 -08:00
inline
const auto& accelertion()const
{
2022-09-05 01:56:29 +04:30
return accelertion_;
}
2024-01-21 13:26:23 -08:00
inline
auto& accelertion()
{
2022-09-05 01:56:29 +04:30
return accelertion_;
}
inline
2024-01-21 13:26:23 -08:00
auto& contactForce()
2022-09-05 01:56:29 +04:30
{
return contactForce_;
}
inline
2024-01-21 13:26:23 -08:00
const auto& contactForce() const
2022-09-05 01:56:29 +04:30
{
return contactForce_;
}
inline
2024-01-21 13:26:23 -08:00
auto& contactTorque()
2022-09-05 01:56:29 +04:30
{
return contactTorque_;
}
inline
2024-01-21 13:26:23 -08:00
const auto& contactTorque() const
2022-09-05 01:56:29 +04:30
{
return contactTorque_;
}
2024-01-21 13:26:23 -08:00
inline
const auto& propertyId()const
{
2022-09-05 01:56:29 +04:30
return propertyId_;
}
2024-01-21 13:26:23 -08:00
inline
auto& propertyId()
{
2022-09-05 01:56:29 +04:30
return propertyId_;
}
2024-01-21 13:26:23 -08:00
/*inline const auto& shapeName()const{
2022-09-05 01:56:29 +04:30
return shapeName_;
2024-01-21 13:26:23 -08:00
}*/
2022-09-05 01:56:29 +04:30
2024-01-21 13:26:23 -08:00
/*inline auto& shapName(){
2022-09-05 01:56:29 +04:30
return shapeName_;
2024-01-21 13:26:23 -08:00
}*/
2022-09-05 01:56:29 +04:30
bool beforeIteration() override;
2022-09-05 01:56:29 +04:30
2024-01-21 13:26:23 -08:00
/*virtual
2022-09-05 01:56:29 +04:30
bool insertParticles
(
const realx3Vector& position,
const wordVector& shapes,
const setFieldList& setField
2024-01-21 13:26:23 -08:00
) = 0;*/
2022-09-05 01:56:29 +04:30
virtual
realx3PointField_D& rAcceleration() = 0;
virtual
const realx3PointField_D& rAcceleration() const = 0;
2024-01-21 13:26:23 -08:00
/*virtual
const realVector_D& boundingSphere()const = 0;*/
2022-09-05 01:56:29 +04:30
virtual
word shapeTypeName()const = 0;
virtual
void boundingSphereMinMax(real & minDiam, real& maxDiam)const = 0;
}; // particles
} // pFlow
2022-12-10 01:32:54 +03:30
#endif //__particles_hpp__