From a900ff32bb49f6d00d7667c7a18c085c55001772 Mon Sep 17 00:00:00 2001 From: Hamidreza Norouzi Date: Sun, 24 Mar 2024 14:25:03 -0700 Subject: [PATCH] phase1 of periodict boundary condition (serial) upto now, particles are transfered from one boundary to another (mirro). this has been tested using iterateSphereParticles utility. --- .../boundaryField/boundaryField.hpp | 3 +- .../boundaryField/exitBoundaryField.cpp | 4 +- .../boundaryField/periodicBoundaryField.cpp | 7 +- .../boundaryField/periodicBoundaryField.hpp | 13 +- src/phasicFlow/eventManagement/message.hpp | 29 ++- .../boundaries/boundaryBase/boundaryBase.cpp | 83 +++++--- .../boundaries/boundaryBase/boundaryBase.hpp | 54 +++-- .../boundaries/boundaryExit/boundaryExit.cpp | 10 +- .../boundaries/boundaryExit/boundaryExit.hpp | 8 +- .../boundaries/boundaryList.cpp | 6 +- .../boundaries/boundaryNone/boundaryNone.cpp | 10 +- .../boundaries/boundaryNone/boundaryNone.hpp | 8 +- .../boundaryPeriodic/boundaryPeriodic.cpp | 15 +- .../boundaryPeriodic/boundaryPeriodic.hpp | 8 +- .../pointStructure/internalPoints.cpp | 189 +++++------------- .../pointStructure/internalPoints.hpp | 173 +++------------- .../pointStructure/pointStructure.cpp | 17 +- 17 files changed, 257 insertions(+), 380 deletions(-) diff --git a/src/phasicFlow/containers/pointField/boundaryField/boundaryField.hpp b/src/phasicFlow/containers/pointField/boundaryField/boundaryField.hpp index a0ad8a0e..d9473a05 100644 --- a/src/phasicFlow/containers/pointField/boundaryField/boundaryField.hpp +++ b/src/phasicFlow/containers/pointField/boundaryField/boundaryField.hpp @@ -52,8 +52,7 @@ protected: static inline const message defaultMessage_ = ( - message::BNDR_RESET+ - message::BNDR_REARRANGE + message::BNDR_RESET ); public: diff --git a/src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField.cpp b/src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField.cpp index 42f534a5..2556a8d8 100644 --- a/src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField.cpp +++ b/src/phasicFlow/containers/pointField/boundaryField/exitBoundaryField.cpp @@ -26,4 +26,6 @@ template ) : BoundaryFieldType(boundary, internal) -{} \ No newline at end of file +{ + this->addEvent(message::BNDR_DELETE); +} \ No newline at end of file diff --git a/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.cpp b/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.cpp index 16f7f965..c6b449f9 100644 --- a/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.cpp +++ b/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.cpp @@ -25,5 +25,8 @@ template InternalFieldType& internal ) : - BoundaryFieldType(boundary, internal) -{} \ No newline at end of file + BoundaryFieldType(boundary, internal) +{ + this->addEvent(message::BNDR_APPEND) + .addEvent(message::BNDR_TRANSFER); +} \ No newline at end of file diff --git a/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.hpp b/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.hpp index 9890d55d..9d93f2b2 100644 --- a/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.hpp +++ b/src/phasicFlow/containers/pointField/boundaryField/periodicBoundaryField.hpp @@ -70,8 +70,17 @@ public: const anyList& varList ) override { - notImplementedFunction; - return false; + BoundaryFieldType::hearChanges(t,dt,iter, msg,varList); + + if(msg.equivalentTo(message::BNDR_APPEND)) + { + // do nothing; + } + if(msg.equivalentTo(message::BNDR_TRANSFER)) + { + //do nothing + } + return true; } }; diff --git a/src/phasicFlow/eventManagement/message.hpp b/src/phasicFlow/eventManagement/message.hpp index 5b055d90..7d811fc5 100644 --- a/src/phasicFlow/eventManagement/message.hpp +++ b/src/phasicFlow/eventManagement/message.hpp @@ -42,16 +42,18 @@ public: ITEM_INSERT = 4, // internal points item inserted RANGE_CHANGED = 5, // internal points range changed ITEM_REARRANGE = 6, // internal points item rearrange - BNDR_REARRANGE = 7, // boundary indices rearrange - BNDR_TRANSFER = 8, // boundary indices transfered - BNDR_RESET = 9, // boundary indices reset entirely - BNDR_DELETE = 10 // boundary indices deleted + ITEM_FLAGCHANGED= 7, // internal points item flag changed, this occurs when transfer occurs + BNDR_REARRANGE = 8, // boundary indices rearrange + BNDR_TRANSFER = 9, // boundary indices transfered + BNDR_RESET = 10, // boundary indices reset entirely + BNDR_DELETE = 11, // boundary indices deleted + BNDR_APPEND = 12 }; private: - static constexpr size_t numberOfEvents_ = 11; + static constexpr size_t numberOfEvents_ = 13; std::bitset events_{0x0000}; @@ -65,10 +67,12 @@ private: "insertedIndices", "range", "rearrangedIndices", + "transferredIndices", "rearrangedIndices", "transferredIndices", "", - "deletedIndices" + "deletedIndices", + "appendedIndices" }; public: @@ -141,6 +145,19 @@ public: { return remove(evnt); } + + inline + message& operator+(const message& msg) + { + for(size_t i=0uL; i< events_.size(); i++) + { + if(msg.equivalentTo(i)) + { + events_.set(i); + } + } + return *this; + } static auto constexpr numEvents() diff --git a/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.cpp b/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.cpp index 503095a3..4353115d 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.cpp @@ -19,6 +19,7 @@ Licence: -----------------------------------------------------------------------------*/ #include "boundaryBase.hpp" +#include "boundaryList.hpp" #include "dictionary.hpp" #include "internalPoints.hpp" #include "anyList.hpp" @@ -34,17 +35,35 @@ void pFlow::boundaryBase::setNewIndices indexList_.assign(newIndices, false); } -void pFlow::boundaryBase::appendNewIndices +bool pFlow::boundaryBase::appendNewIndices ( const uint32Vector_D& newIndices ) { + indexList_.append(newIndices); - // TODO: notify observers about this change + message msg; - // the index list should be sorted - //sort(indexList_.deviceViewAll(), 0, newSize); + msg.add(message::BNDR_APPEND); + anyList varList; + varList.emplaceBack( + message::eventName(message::BNDR_APPEND), + newIndices); + + if(!notify( + internal_.time().currentIter(), + internal_.time().currentTime(), + internal_.time().dt(), + msg, + varList)) + { + fatalErrorInFunction; + return false; + } + + return true; + } bool pFlow::boundaryBase::removeIndices @@ -128,37 +147,32 @@ bool pFlow::boundaryBase::transferPoints keepIndices ); - // third, remove the indices from this list - setNewIndices(keepIndices); - // first, change the flags in the internalPoints - if( !internal_.changePointsFlag( - transferIndices.deviceView(), + if( !internal_.changePointsFlagPosition( + transferIndices, + transferVector, + thisBoundaryIndex(), transferBoundaryIndex) ) { + fatalErrorInFunction; return false; } - // second, change the position of points - if(!internal_.changePointsPoisition( - transferIndices.deviceView(), - transferVector)) - { - return false; - } + // second, remove the indices from this list + setNewIndices(keepIndices); - // fourth, add the indices to the mirror boundary - internal_.boundary(transferBoundaryIndex). - appendNewIndices(transferIndices); + // third, add the indices to the mirror boundary + return mirrorBoundary().appendNewIndices(transferIndices); - return true; } pFlow::boundaryBase::boundaryBase ( const dictionary &dict, - const plane &bplane, - internalPoints &internal + const plane &bplane, + internalPoints &internal, + boundaryList &bndrs, + uint32 thisIndex ) : subscriber(dict.name()), @@ -166,20 +180,23 @@ pFlow::boundaryBase::boundaryBase indexList_(groupNames(dict.name(), "indexList")), neighborLength_(dict.getVal("neighborLength")), internal_(internal), + boundaries_(bndrs), + thisBoundaryIndex_(thisIndex), mirrorProcessoNo_(dict.getVal("mirrorProcessorNo")), name_(dict.name()), type_(dict.getVal("type")) { } +pFlow::boundaryBase &pFlow::boundaryBase::mirrorBoundary() +{ + return boundaries_[mirrorBoundaryIndex()]; +} + void pFlow::boundaryBase::setSize(uint32 newSize) { indexList_.resize(newSize); - /*if( indexList_.capacity() <= newSize+1 ) - { - indexList_.reserve(newSize+1); - }*/ - //INFORMATION<<"new size of boundary "<< name_<<" "<< indexList_.size()< pFlow::boundaryBase::create( +pFlow::uniquePtr pFlow::boundaryBase::create +( const dictionary &dict, - const plane &bplane, - internalPoints &internal) + const plane &bplane, + internalPoints &internal, + boundaryList &bndrs, + uint32 thisIndex +) { word type = dict.getVal("type"); word bType = angleBracketsNames("boundary", type); if( dictionaryvCtorSelector_.search(bType) ) { - return dictionaryvCtorSelector_[bType] (dict, bplane, internal); + return dictionaryvCtorSelector_[bType] (dict, bplane, internal, bndrs, thisIndex); } else { diff --git a/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp b/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp index d55875c6..c177d428 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryBase/boundaryBase.hpp @@ -36,6 +36,7 @@ namespace pFlow class internalPoints; class dictionary; +class boundaryList; class boundaryBase : @@ -53,16 +54,18 @@ private: /// list of particles indices on device uint32Vector_D indexList_; - uint32Vector_H indexListH_; - - bool indexSync_ = false; - /// The length defined for creating neighbor list real neighborLength_; /// a reference to internalPoints& internal_; + /// a reference to the list of boundaries + /// (never use this in the constructor). + boundaryList& boundaries_; + + uint32 thisBoundaryIndex_; + uint32 mirrorProcessoNo_; word name_; @@ -73,7 +76,7 @@ protected: void setNewIndices(const uint32Vector_D& newIndices); - void appendNewIndices(const uint32Vector_D& newIndices); + bool appendNewIndices(const uint32Vector_D& newIndices); bool removeIndices( uint32 numRemove, @@ -85,16 +88,17 @@ protected: uint32 transferBoundaryIndex, realx3 transferVector); - public: TypeInfo("boundaryBase"); boundaryBase( - const dictionary& dict, - const plane& bplane, - internalPoints& internal); + const dictionary &dict, + const plane &bplane, + internalPoints &internal, + boundaryList &bndrs, + uint32 thisIndex); boundaryBase(const boundaryBase&) = delete; @@ -112,11 +116,13 @@ public: boundaryBase, dictionary, ( - const dictionary& dict, - const plane& bplane, - internalPoints& internal + const dictionary &dict, + const plane &bplane, + internalPoints &internal, + boundaryList &bndrs, + uint32 thisIndex ), - (dict, bplane, internal) + (dict, bplane, internal, bndrs, thisIndex) ); virtual @@ -172,6 +178,20 @@ public: return internal_; } + boundaryBase& mirrorBoundary(); + + inline + uint32 thisBoundaryIndex()const + { + return thisBoundaryIndex_; + } + + inline + uint32 mirrorBoundaryIndex()const + { + return thisBoundaryIndex_%2==0? thisBoundaryIndex_+1:thisBoundaryIndex_-1; + } + /// @brief set the size of indexList /// Always make sure that size+1 <= capacity void setSize(uint32 newSize); @@ -200,9 +220,11 @@ public: static uniquePtr create ( - const dictionary& dict, - const plane& bplane, - internalPoints& internal + const dictionary &dict, + const plane &bplane, + internalPoints &internal, + boundaryList &bndrs, + uint32 thisIndex ); diff --git a/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.cpp b/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.cpp index 7b91714c..3b753877 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.cpp @@ -25,12 +25,14 @@ Licence: pFlow::boundaryExit::boundaryExit ( - const dictionary& dict, - const plane& bplane, - internalPoints& internal + const dictionary &dict, + const plane &bplane, + internalPoints &internal, + boundaryList &bndrs, + uint32 thisIndex ) : - boundaryBase(dict, bplane, internal) + boundaryBase(dict, bplane, internal, bndrs, thisIndex) { exitMarginLength_ = max( dict.getValOrSet("exitMarginLength",(real)0.0), (real)0.0); diff --git a/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.hpp b/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.hpp index 77b6cfce..f8aa61c5 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryExit/boundaryExit.hpp @@ -47,9 +47,11 @@ public: TypeInfo("boundary"); boundaryExit( - const dictionary& dict, - const plane& bplane, - internalPoints& internal); + const dictionary &dict, + const plane &bplane, + internalPoints &internal, + boundaryList &bndrs, + uint32 thisIndex); virtual ~boundaryExit() = default; diff --git a/src/phasicFlow/structuredData/boundaries/boundaryList.cpp b/src/phasicFlow/structuredData/boundaries/boundaryList.cpp index 62a695cf..237e4bd7 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryList.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryList.cpp @@ -110,7 +110,9 @@ bool pFlow::boundaryList::setLists() ( pStruct_.simDomain().boundaryDict(i), pStruct_.simDomain().boundaryPlane(i), - pStruct_ + pStruct_, + *this, + i ) ); } @@ -144,7 +146,9 @@ bool pFlow::boundaryList::beforeIteration "Error in beforeIteration in boundary "<name()<"); boundaryNone( - const dictionary& dict, - const plane& bplane, - internalPoints& internal); + const dictionary &dict, + const plane &bplane, + internalPoints &internal, + boundaryList &bndrs, + uint32 thisIndex); ~boundaryNone() override= default; diff --git a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp index 795b83c7..ff02d83c 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.cpp @@ -25,12 +25,14 @@ Licence: pFlow::boundaryPeriodic::boundaryPeriodic ( - const dictionary& dict, - const plane& bplane, - internalPoints& internal + const dictionary &dict, + const plane &bplane, + internalPoints &internal, + boundaryList &bndrs, + uint32 thisIndex ) : - boundaryBase(dict, bplane, internal), + boundaryBase(dict, bplane, internal, bndrs, thisIndex), mirrorBoundaryIndex_(dict.getVal("mirrorBoundaryIndex")) { extendedPlane_ = boundaryBase::boundaryPlane().parallelPlane(-boundaryBase::neighborLength()); @@ -94,17 +96,16 @@ bool pFlow::boundaryPeriodic::beforeIteration( // to obtain the transfer vector const auto& thisP = boundaryPlane(); - const auto& mirrorP = internal().boundary(mirrorBoundaryIndex_).boundaryPlane(); + const auto& mirrorP = mirrorBoundary().boundaryPlane(); realx3 transferVec = thisP.normal()*(thisP.d() + mirrorP.d()); return transferPoints ( numTransfered, transferFlags, - mirrorBoundaryIndex_, + mirrorBoundaryIndex(), transferVec ); - } bool pFlow::boundaryPeriodic::iterate diff --git a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp index bfb8be78..3698926a 100644 --- a/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp +++ b/src/phasicFlow/structuredData/boundaries/boundaryPeriodic/boundaryPeriodic.hpp @@ -42,9 +42,11 @@ public: TypeInfo("boundary"); boundaryPeriodic( - const dictionary& dict, - const plane& bplane, - internalPoints& internal); + const dictionary &dict, + const plane &bplane, + internalPoints &internal, + boundaryList &bndrs, + uint32 thisIndex); ~boundaryPeriodic() override= default; diff --git a/src/phasicFlow/structuredData/pointStructure/internalPoints.cpp b/src/phasicFlow/structuredData/pointStructure/internalPoints.cpp index 7e213b54..26c477c1 100644 --- a/src/phasicFlow/structuredData/pointStructure/internalPoints.cpp +++ b/src/phasicFlow/structuredData/pointStructure/internalPoints.cpp @@ -48,7 +48,7 @@ bool pFlow::internalPoints::deletePoints(const uint32Vector_D& delPoints) "Error in deleting points from internal points"< changePoints, - uint32 boundaryIndex + const uint32Vector_D& changePoints, + realx3 transferVector, + uint32 fromBoundaryIndex, + uint32 toBoundaryIndex ) { - if(boundaryIndex>5) + if(toBoundaryIndex>5) { fatalErrorInFunction<< - "Invalid boundary index "<< boundaryIndex< changePoints, - realx3 transferVector -) -{ + // change the flag + pFlagsD_.changeFlags(changePoints.deviceView(), toBoundaryIndex); + unSyncFlag(); + + // change the position pFlow::internalPointsKernels::changePosition ( pointPosition_.deviceViewAll(), - changePoints, + changePoints.deviceView(), transferVector ); - WARNING<<"Notify about the change in the position of points"<& dist ) { - pFlagSync_ = false; + unSyncFlag(); return pFlagsD_.markPointRegions ( dm, @@ -292,7 +315,7 @@ bool pFlow::internalPoints::read pointPosition_.assignFromHost(fRead); pFlagsD_ = pFlagTypeDevice(pointPosition_.capacity(), 0, pointPosition_.size()); - pFlagSync_ = false; + unSyncFlag(); syncPFlag(); return true; @@ -328,8 +351,7 @@ bool pFlow::internalPoints::read pointPosition_.assignFromHost(fRead); - pFlagsD_ = pFlagTypeDevice(pointPosition_.capacity(), 0, pointPosition_.size()); - pFlagSync_ = false; + createDeviceFlag(pointPosition_.capacity(), 0, pointPosition_.size()); syncPFlag(); return true; @@ -347,118 +369,3 @@ bool pFlow::internalPoints::write auto aPoints = activePointsHost(); return aPoints.write(os,iop); } - - -/*FUNCTION_H -bool pFlow::internalPoints::evaluateinternalPoints() -{ - if(pointFlag_.size() != pointPosition_.size()) - { - fatalErrorInFunction<< - "number of elements in pointFlag and pointPosition is not equal \n"; - return false; - } - - setNumMaxPoints(); - - int32 minActive, maxActive; - numActivePoints_ = pFlow::internalPointsKernels::scanPointFlag( - 0, - numPoints_, - static_cast(internalPoints::ACTIVE), - pointFlag_.deviceViewAll(), - minActive, - maxActive - ); - - activeRange_ = {minActive, maxActive}; - - return true; -} - -FUNCTION_H -void pFlow::internalPoints::setNumMaxPoints() -{ - maxPoints_ = pointFlag_.capacity(); - numPoints_ = pointFlag_.size(); -} - -FUNCTION_H -pFlow::realx3Field_D& pFlow::internalPoints::pointPosition() -{ - return pointPosition_; -} - -FUNCTION_H -pFlow::int8Field_HD& pFlow::internalPoints::pointFlag() -{ - return pointFlag_; -} - -pFlow::uniquePtr - pFlow::internalPoints::getNewPointsIndices(int32 numNewPoints)const -{ - - - if( capacity() - activeRange_.second >= numNewPoints ) - { - // fill the sequence starting from activeRange_.second-1 - return makeUnique( - activeRange_.second, - activeRange_.second+numNewPoints); - - } - - // second, check if there is space at the beginning - if( activeRange_.first >= numNewPoints) - { - return makeUnique( - 0, - numNewPoints); - } - - // otherwise scan the points from first to the end to find empty spaces - int32Vector newPoints( - numNewPoints, - RESERVE()); - - newPoints.clear(); - int32 numAdded = 0; - ForAll(i, pointFlag_) - { - if(!isActive(i)) - { - newPoints.push_back(static_cast(i)); - numAdded++; - } - - if(numAdded == numNewPoints) - { - return makeUnique( - newPoints.data(), - numNewPoints); - } - } - - // check if there is space at the end for the remaining of points - if( numAdded = numNewPoints - numAdded ) - { - int32 ind = size(); - for(int32 i=numAdded; i( - newPoints.data(), - numNewPoints); - } - else - { - fatalErrorInFunction<<"not enough capacity for inserting particles into the point structure\n"; - return nullptr; - } - - return nullptr; -}*/ \ No newline at end of file diff --git a/src/phasicFlow/structuredData/pointStructure/internalPoints.hpp b/src/phasicFlow/structuredData/pointStructure/internalPoints.hpp index 462c4224..71b79877 100644 --- a/src/phasicFlow/structuredData/pointStructure/internalPoints.hpp +++ b/src/phasicFlow/structuredData/pointStructure/internalPoints.hpp @@ -53,7 +53,11 @@ public: using execution_space = typename PointsType::execution_space; -protected: +private: + + //// - friend et al. + + friend boundaryBase; //// - data members @@ -69,22 +73,32 @@ protected: /// if both host and device flags sync mutable bool pFlagSync_ = false; - //// - protected members - - void syncPFlag()const; - - friend boundaryBase; - + //// - protected members bool deletePoints(const uint32Vector_D& delPoints); - bool changePointsFlag( - deviceViewType1D changePoints, - uint32 boundaryIndex); + bool changePointsFlagPosition( + const uint32Vector_D& changePoints, + realx3 transferVector, + uint32 fromBoundaryIndex, + uint32 toBoundaryIndex); - bool changePointsPoisition( - deviceViewType1D changePoints, - realx3 transferVector); +protected: + + void syncPFlag()const; + + inline + void unSyncFlag() + { + pFlagSync_ = false; + } + + inline + void createDeviceFlag(uint32 cap, uint32 start, uint32 end) + { + unSyncFlag(); + pFlagsD_ = pFlagTypeDevice(cap, start, end); + } public: @@ -101,7 +115,7 @@ public: /// Construct from point positions, assume all points are active - internalPoints(const realx3Vector& posVec); + explicit internalPoints(const realx3Vector& posVec); /// No Copy construct internalPoints(const internalPoints&) = delete; @@ -262,134 +276,3 @@ iOstream& operator<<(iOstream& os, const internalPoints& ip) #endif //__internalPoints_hpp__ - -/*class activePointsDevice - { - protected: - ViewType1D flag_; - - bool allActive_; - - range activeRange_; - - public: - - INLINE_FUNCTION_H - activePointsDevice(bool allActive, range active, const ViewType1D& flag) - : - flag_(flag), - allActive_(allActive), - activeRange_(active) - {} - - INLINE_FUNCTION_HD - activePointsDevice(const activePointsDevice&) = default; - - INLINE_FUNCTION_HD - activePointsDevice& operator=(const activePointsDevice&) = default; - - INLINE_FUNCTION_HD - bool operator()(int32 i)const { - if(i flag_; - - bool allActive_; - - range activeRange_; - - public: - - INLINE_FUNCTION_H - activePointsHost(bool allActive, range active, const ViewType1D& flag) - : - flag_(flag), - allActive_(allActive), - activeRange_(active){} - - INLINE_FUNCTION_H - activePointsHost(const activePointsHost&) = default; - - INLINE_FUNCTION_H - activePointsHost& operator=(const activePointsHost&) = default; - - INLINE_FUNCTION_H - bool operator()(int32 i)const { - if(i insertPoints( - const realx3Vector& pos, - const setFieldList& setField, - repository& owner, - const List& exclusionList={nullptr} - );*/ diff --git a/src/phasicFlow/structuredData/pointStructure/pointStructure.cpp b/src/phasicFlow/structuredData/pointStructure/pointStructure.cpp index 40744c07..30b81c10 100644 --- a/src/phasicFlow/structuredData/pointStructure/pointStructure.cpp +++ b/src/phasicFlow/structuredData/pointStructure/pointStructure.cpp @@ -27,8 +27,8 @@ bool pFlow::pointStructure::setupPointStructure(const realx3Vector& points) { PointsTypeHost hPoints ( - pointPosition_.name(), - pointPosition_.fieldKey() + pointPosition().name(), + pointPosition().fieldKey() ); hPoints.assign(points); @@ -49,8 +49,8 @@ bool pFlow::pointStructure::setupPointStructure(const PointsTypeHost &points) PointsTypeHost internal ( - pointPosition_.name(), - pointPosition_.fieldKey(), + pointPosition().name(), + pointPosition().fieldKey(), thisN, thisN, RESERVE() @@ -80,10 +80,9 @@ bool pFlow::pointStructure::setupPointStructure(const PointsTypeHost &points) bool pFlow::pointStructure::initializePoints(const PointsTypeHost &points) { - pointPosition_.assignFromHost(points); + pointPosition().assignFromHost(points); - pFlagsD_ = pFlagTypeDevice(pointPosition_.capacity(), 0, pointPosition_.size()); - pFlagSync_ = false; + createDeviceFlag(pointPosition().capacity(), 0, pointPosition().size()); syncPFlag(); return true; @@ -205,8 +204,8 @@ bool pFlow::pointStructure::read( PointsTypeHost fRead ( - this->pointPosition_.name(), - this->pointPosition_.fieldKey() + this->pointPosition().name(), + this->pointPosition().fieldKey() ); if( !fRead.read(is, iop))