Merge branch 'develop' into MPIdev

This commit is contained in:
Hamidreza Norouzi
2024-05-18 19:14:01 +03:30
111 changed files with 2006 additions and 703 deletions

View File

@ -60,7 +60,7 @@ pFlow::collisionCheck::checkPoint(const realx3& p, const real d) const
{
uint32 n = head_(i, j, k);
while( n != -1)
while( n != static_cast<uint32>(-1))
{
if( ((position_[n]-p).length() - 0.5*(diameters_[n]+d )) <= 0.0 )
{
@ -85,7 +85,7 @@ pFlow::collisionCheck::mapLastAddedParticle()
"size mismatch of next and position"<<endl;
return false;
}
next_.push_back(-1);
next_.push_back(static_cast<uint32>(-1));
const auto& p = position_[n];
if(!searchBox_.isInside(p))

View File

@ -74,9 +74,6 @@ pFlow::insertion::pStruct() const
return particles_.pStruct();
}
bool
pFlow::insertion::readInsertionDict()
{

View File

@ -32,7 +32,9 @@ class pointStructure;
/**
* Base class for particle insertion
*/
class insertion : public fileDictionary
class insertion
:
public fileDictionary
{
private:
@ -118,6 +120,8 @@ public:
/*/// read from iIstream
virtual bool read(iIstream& is) = 0;*/
using fileDictionary::write;
/// write to iOstream
bool write(iOstream& os, const IOPattern& iop)const override ;
};

View File

@ -389,7 +389,9 @@ pFlow::sphereParticles::sphereParticles(
intPredictTimer_(
"Integration-predict", &this->timers() ),
intCorrectTimer_(
"Integration-correct", &this->timers() )
"Integration-correct", &this->timers() ),
fieldUpdateTimer_(
"fieldUpdate", &this->timers() )
{
auto intMethod = control.settingsDict().getVal<word>("integrationMethod");
@ -514,13 +516,14 @@ bool pFlow::sphereParticles::beforeIteration()
rVelIntegration_().predict(dt,rVelocity_, rAcceleration_);
intPredictTimer_.end();
fieldUpdateTimer_.start();
propertyId_.updateBoundariesSlaveToMasterIfRequested();
diameter_.updateBoundariesSlaveToMasterIfRequested();
mass_.updateBoundariesSlaveToMasterIfRequested();
I_.updateBoundariesSlaveToMasterIfRequested();
rVelocity_.updateBoundariesSlaveToMasterIfRequested();
rAcceleration_.updateBoundariesSlaveToMasterIfRequested();
fieldUpdateTimer_.end();
return true;
}

View File

@ -79,10 +79,10 @@ private:
/// timer for integration computations (correction step)
Timer intCorrectTimer_;
Timer fieldUpdateTimer_;
private:
bool initializeParticles();
bool getParticlesInfoFromShape(
const wordVector& shapeNames,
@ -119,11 +119,14 @@ public:
*/
/*bool insertParticles
(
const realx3Vector& position,
const realx3Vector& position,
const wordVector& shapes,
const setFieldList& setField
) override ;*/
// TODO: make this method private later
bool initializeParticles();
/// const reference to shapes object
const auto& spheres() const
{

View File

@ -38,6 +38,7 @@ pFlow::dynamicPointStructure::dynamicPointStructure
*this,
zero3
),
velocityUpdateTimer_("velocity boundary update", &timers()),
integrationMethod_
(
control.settingsDict().getVal<word>("integrationMethod")
@ -81,11 +82,11 @@ pFlow::dynamicPointStructure::dynamicPointStructure
bool pFlow::dynamicPointStructure::beforeIteration()
{
return pointStructure::beforeIteration();
/*real dt = this->dt();
auto& acc = time().lookupObject<realx3PointField_D>("acceleration");
return predict(dt, acc);*/
if(!pointStructure::beforeIteration())return false;
velocityUpdateTimer_.start();
velocity_.updateBoundariesSlaveToMasterIfRequested();
velocityUpdateTimer_.end();
return true;
}
bool pFlow::dynamicPointStructure::iterate()

View File

@ -44,6 +44,8 @@ private:
uniquePtr<integration> integrationVel_ = nullptr;
Timer velocityUpdateTimer_;
/// @brief integration method for velocity and position
word integrationMethod_;

View File

@ -74,7 +74,8 @@ pFlow::particles::particles(systemControl& control)
dynPointStruct_,
zero3
),
idHandler_(particleIdHandler::create(dynPointStruct_))
idHandler_(particleIdHandler::create(dynPointStruct_)),
baseFieldBoundaryUpdateTimer_("baseFieldBoundaryUpdate",&timers())
{
this->addToSubscriber(dynPointStruct_);
@ -84,18 +85,18 @@ pFlow::particles::particles(systemControl& control)
bool
pFlow::particles::beforeIteration()
{
zeroForce();
zeroTorque();
if( !dynPointStruct_.beforeIteration())
{
return false;
}
zeroForce();
zeroTorque();
baseFieldBoundaryUpdateTimer_.start();
shapeIndex_.updateBoundariesSlaveToMasterIfRequested();
accelertion_.updateBoundariesSlaveToMasterIfRequested();
idHandler_().updateBoundariesSlaveToMasterIfRequested();
baseFieldBoundaryUpdateTimer_.end();
return true;
}

View File

@ -54,6 +54,8 @@ private:
/// handling new ids for new particles
uniquePtr<particleIdHandler> idHandler_ = nullptr;
Timer baseFieldBoundaryUpdateTimer_;
/// messages for this objects
static inline const message defaultMessage_{ message::DEFAULT };

View File

@ -15,8 +15,11 @@ pFlow::regularParticleIdHandler::regularParticleIdHandler
pFlow::Pair<pFlow::uint32, pFlow::uint32>
pFlow::regularParticleIdHandler::getIdRange(uint32 nNewParticles)
{
if(nNewParticles==0) return {0,0};
uint32 startId;
if(maxId_==-1)
if(maxId_== static_cast<uint32>(-1))
{
startId = 0;
}
@ -37,7 +40,7 @@ bool pFlow::regularParticleIdHandler::initialIdCheck()
uint32 maxId = max( *this );
/// particles should get ids from 0 to size-1
if(maxId == -1)
if(maxId == static_cast<uint32>(-1))
{
fillSequence(*this,0u);
maxId_ = size()-1;

View File

@ -31,7 +31,7 @@ class regularParticleIdHandler
{
private:
uint32 maxId_ = -1;
uint32 maxId_ = static_cast<uint32>(-1);
bool initialIdCheck()override;
public:

View File

@ -132,7 +132,7 @@ public:
return true;
}
}
idx = -1;
idx = static_cast<uint32>(-1);
return false;
}
@ -144,6 +144,8 @@ public:
// - IO
using fileDictionary::write;
bool write(iOstream& os)const override;
};