This is the first merge from main into MPI branch

Merge branch 'main' into local-MPI
This commit is contained in:
Hamidreza
2025-05-03 16:40:46 +03:30
578 changed files with 118959 additions and 28494 deletions

View File

@ -41,16 +41,14 @@ pFlow::particleIdHandler::particleIdHandler(pointStructure& pStruct)
bool
pFlow::particleIdHandler::hearChanges(
real t,
real dt,
uint32 iter,
const timeInfo& ti,
const message& msg,
const anyList& varList
)
{
if(msg.equivalentTo(message::ITEM_INSERT))
if(msg.equivalentTo(message::ITEMS_INSERT))
{
const word eventName = message::eventName(message::ITEM_INSERT);
const word eventName = message::eventName(message::ITEMS_INSERT);
const auto& indices = varList.getObject<uint32IndexContainer>(
eventName);
@ -66,7 +64,7 @@ pFlow::particleIdHandler::hearChanges(
}
else
{
return uint32PointField_D::hearChanges(t,dt,iter, msg,varList);
return uint32PointField_D::hearChanges(ti, msg, varList);
}
}

View File

@ -60,15 +60,11 @@ public:
virtual
uint32 maxId()const = 0;
// heat change for possible insertion of particles
// overrdie from internalField
bool hearChanges
(
real t,
real dt,
uint32 iter,
const timeInfo& ti,
const message& msg,
const anyList& varList
) override;

View File

@ -18,22 +18,12 @@ Licence:
-----------------------------------------------------------------------------*/
#include "particles.hpp"
#include "shape.hpp"
pFlow::particles::particles(systemControl& control)
pFlow::particles::particles(systemControl& control, const shape& shapes)
: 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)
),*/
dynPointStruct_(control, shapes.maxBoundingSphere()),
shapeIndex_(
objectFile(
"shapeIndex",
@ -44,16 +34,6 @@ pFlow::particles::particles(systemControl& control)
dynPointStruct_,
0
),
accelertion_(
objectFile(
"accelertion",
"",
objectFile::READ_IF_PRESENT,
objectFile::WRITE_ALWAYS
),
dynPointStruct_,
zero3
),
contactForce_(
objectFile(
"contactForce",
@ -82,6 +62,12 @@ pFlow::particles::particles(systemControl& control)
//idHandler_().initialIdCheck();
}
pFlow::particles::~particles()
{
// invalidates / unsobscribe from subscriber before its actual destruction
addToSubscriber(nullptr, message::Empty());
}
bool
pFlow::particles::beforeIteration()
{
@ -94,7 +80,6 @@ pFlow::particles::beforeIteration()
zeroTorque();
baseFieldBoundaryUpdateTimer_.start();
shapeIndex_.updateBoundariesSlaveToMasterIfRequested();
accelertion_.updateBoundariesSlaveToMasterIfRequested();
idHandler_().updateBoundariesSlaveToMasterIfRequested();
baseFieldBoundaryUpdateTimer_.end();
return true;

View File

@ -25,11 +25,14 @@ PARTICULAR PURPOSE.
#include "demComponent.hpp"
#include "dynamicPointStructure.hpp"
#include "particleIdHandler.hpp"
#include "shape.hpp"
//#include "shape.hpp"
namespace pFlow
{
class shape;
class particles
: public observer
, public demComponent
@ -42,9 +45,6 @@ private:
/// shape index of each particle
uint32PointField_D shapeIndex_;
/// acceleration on device
realx3PointField_D accelertion_;
/// contact force field
realx3PointField_D contactForce_;
@ -57,7 +57,7 @@ private:
Timer baseFieldBoundaryUpdateTimer_;
/// messages for this objects
static inline const message defaultMessage_{ message::DEFAULT };
static inline const message defaultMessage_= message::Empty();
protected:
@ -96,7 +96,9 @@ public:
// type info
TypeInfo("particles");
explicit particles(systemControl& control);
explicit particles(systemControl& control, const shape& shapes);
~particles() override;
inline const auto& dynPointStruct() const
{
@ -153,14 +155,14 @@ public:
return dynPointStruct_.velocity();
}
inline const auto& accelertion() const
inline const auto& acceleration() const
{
return accelertion_;
return dynPointStruct_.acceleration();
}
inline auto& accelertion()
inline auto& acceleration()
{
return accelertion_;
return dynPointStruct_.acceleration();
}
inline auto& contactForce()
@ -184,7 +186,7 @@ public:
}
inline
uint maxId()const
uint32 maxId()const
{
return idHandler_().maxId();
}

View File

@ -1,5 +1,24 @@
#include "shape.hpp"
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
#include "shape.hpp"
bool pFlow::shape::findPropertyIds()
{
@ -62,6 +81,18 @@ pFlow::shape::shape
}
pFlow::shape::shape
(
const word &shapeType,
const word &fileName,
repository *owner,
const property &prop
)
:
shape(fileName, owner, prop)
{
}
bool pFlow::shape::writeToDict(dictionary &dict)const
{
if(!baseShapeNames::writeToDict(dict))return false;
@ -74,4 +105,37 @@ bool pFlow::shape::writeToDict(dictionary &dict)const
}
return true;
}
}
pFlow::uniquePtr<pFlow::shape> pFlow::shape::create
(
const word &shapeType,
const word &fileName,
repository *owner,
const property &prop
)
{
word type = angleBracketsNames("shape", shapeType);
if( wordvCtorSelector_.search(type) )
{
auto objPtr =
wordvCtorSelector_[type]
(shapeType, fileName, owner, prop);
return objPtr;
}
else
{
printKeys
(
fatalError << "Ctor Selector "<<
type << " dose not exist. \n"
<<"Avaiable ones are: \n\n"
,
wordvCtorSelector_
);
fatalExit;
return nullptr;
}
}

View File

@ -37,7 +37,7 @@ private:
const property& property_;
/// list of property ids of shapes (index)
uint32Vector shapePropertyIds_;
uint32Vector shapePropertyIds_;
/// list of material names
wordVector materialNames_;
@ -60,9 +60,28 @@ public:
const word& fileName,
repository* owner,
const property& prop);
shape(
const word& shapeType,
const word& fileName,
repository* owner,
const property& prop);
~shape() override=default;
create_vCtor
(
shape,
word,
(
const word& shapeType,
const word& fileName,
repository* owner,
const property& prop
),
(shapeType, fileName, owner, prop)
);
inline
const auto& properties()const
{
@ -148,6 +167,9 @@ public:
virtual
realVector boundingDiameter()const = 0;
virtual
realVector volume()const = 0;
virtual
bool mass(uint32 index, real& m)const = 0;
@ -187,6 +209,13 @@ public:
virtual
real Inertial_zz(uint32 index)const = 0;
static
uniquePtr<shape> create(
const word& shapeType,
const word& fileName,
repository* owner,
const property& prop);
};
}