/*------------------------------- 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. -----------------------------------------------------------------------------*/ #ifndef __NBS_hpp__ #define __NBS_hpp__ #include "particleWallContactSearchs.hpp" #include "NBSLevel0.hpp" #include "cellsWallLevel0.hpp" #include "Vector.hpp" namespace pFlow { class NBS : public particleWallContactSearchs { public: using CellIterator = typename NBSLevel0::CellIterator; private: real sizeRatio_ = 1.0; real cellExtent_ = 0.5; Logical adjustableBox_; NBSLevel0 NBSLevel0_; cellsWallLevel0 cellsWallLevel0_; protected: friend particleWallContactSearchs; bool impl_broadSearch ( csPairContainerType& ppPairs, csPairContainerType& pwPairs, const deviceViewType1D& pointPos, const pFlagTypeDevice& flags, const deviceViewType1D& diameter ) { bool searchBoxChanged; if( !NBSLevel0_.broadSearch( ppPairs, pointPos, flags, diameter, searchBoxChanged)) { fatalErrorInFunction<< "Error in broadSearch for NBS (particle-particle)"< &position, const pFlagTypeDevice &flags, const deviceViewType1D &diam, uint32 nWallPoints, uint32 nWallElements, const ViewType1D& wallPoints, const ViewType1D& wallVertices, const ViewType1D& wallNormals ); INLINE_FUNCTION_HD NBS(const NBS&) = default; INLINE_FUNCTION_HD NBS(NBS&&) = default; INLINE_FUNCTION_HD NBS& operator = (const NBS&) = default; INLINE_FUNCTION_HD NBS& operator = (NBS&&) = default; INLINE_FUNCTION_HD ~NBS()=default; //// - Methods uint32 numLevels()const { return 1; } real sizeRatio()const { return sizeRatio_; } real cellExtent()const { return cellExtent_; } auto getCellIterator([[maybe_unused]] uint32 lvl)const { return NBSLevel0_.getCellIterator(); } Vector getDomainCellsLevels()const { return Vector("Cells", 1, NBSLevel0_.getDomainCells()); } }; } #endif