Files
phasicFlow/src/Particles/particles/particles.cpp

113 lines
2.7 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
2022-09-05 01:56:29 +04:30
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
2022-09-05 01:56:29 +04:30
Licence:
This file is part of phasicFlow code. It is a free software for simulating
2022-09-05 01:56:29 +04:30
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
2022-09-05 01:56:29 +04:30
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
#include "particles.hpp"
2022-09-05 01:56:29 +04:30
pFlow::particles::particles(systemControl& control)
: observer(defaultMessage_),
demComponent("particles", control),
dynPointStruct_(control),
/*id_(
objectFile(
"id",
"",
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
),
dynPointStruct_,
static_cast<uint32>(-1),
static_cast<uint32>(-1)
),*/
shapeIndex_(
objectFile(
"shapeIndex",
"",
objectFile::READ_ALWAYS,
objectFile::WRITE_ALWAYS
),
dynPointStruct_,
0
),
accelertion_(
objectFile(
"accelertion",
"",
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
),
dynPointStruct_,
zero3
),
contactForce_(
objectFile(
"contactForce",
"",
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
),
dynPointStruct_,
zero3
),
contactTorque_(
objectFile(
"contactTorque",
"",
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
),
dynPointStruct_,
zero3
),
idHandler_(particleIdHandler::create(dynPointStruct_))
2022-09-05 01:56:29 +04:30
{
this->addToSubscriber(dynPointStruct_);
idHandler_().initialIdCheck();
2022-09-05 01:56:29 +04:30
}
bool
pFlow::particles::beforeIteration()
{
zeroForce();
zeroTorque();
return dynPointStruct_.beforeIteration();
}
bool
pFlow::particles::iterate()
2022-09-05 01:56:29 +04:30
{
return dynPointStruct_.iterate();
}
bool
pFlow::particles::afterIteration()
{
return dynPointStruct_.afterIteration();
}
void
pFlow::particles::boundingSphereMinMax(real& minDiam, real& maxDiam) const
{
auto& shp = getShapes();
minDiam = shp.minBoundingSphere();
maxDiam = shp.maxBoundingSphere();
}