www.cemf.ir
NBS.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 
22 #ifndef __NBS_hpp__
23 #define __NBS_hpp__
24 
26 #include "NBSLevel0.hpp"
27 #include "cellsWallLevel0.hpp"
28 #include "Vector.hpp"
29 
30 namespace pFlow
31 {
32 
33 
34 class NBS
35 :
36  public particleWallContactSearchs<NBS>
37 {
38 public:
39 
41 
42 private:
43 
45 
47 
49 
51 
53 
54 protected:
55 
57 
58  bool impl_broadSearch
59  (
60  csPairContainerType& ppPairs,
61  csPairContainerType& pwPairs,
62  const deviceViewType1D<realx3>& pointPos,
63  const pFlagTypeDevice& flags,
64  const deviceViewType1D<real>& diameter
65  )
66  {
67  bool searchBoxChanged;
69  ppPairs,
70  pointPos,
71  flags,
72  diameter,
73  searchBoxChanged))
74  {
76  "Error in broadSearch for NBS (particle-particle)"<<endl;
77  return false;
78  }
79 
81  pwPairs,
84  pointPos,
85  diameter,
86  sizeRatio_))
87  {
89  "Error in broadSearch for NBS (particle-wall)"<<endl;
90  return false;
91  }
92 
93  return true;
94  }
95 
96 public:
97 
98  TypeInfoNV("NBS");
99 
100  NBS(
101  const dictionary& dict,
102  const box& domainBox,
103  real minBSSize,
104  real maxBSSize,
105  const deviceViewType1D<realx3> &position,
106  const pFlagTypeDevice &flags,
107  const deviceViewType1D<real> &diam,
108  uint32 nWallPoints,
109  uint32 nWallElements,
110  const ViewType1D<realx3,memory_space>& wallPoints,
111  const ViewType1D<uint32x3,memory_space>& wallVertices,
112  const ViewType1D<realx3,memory_space>& wallNormals );
113 
114 
116  NBS(const NBS&) = default;
117 
119  NBS(NBS&&) = default;
120 
122  NBS& operator = (const NBS&) = default;
123 
125  NBS& operator = (NBS&&) = default;
126 
128  ~NBS()=default;
129 
130 
132 
134  {
135  return 1;
136  }
137 
139  {
140  return sizeRatio_;
141  }
142 
144  {
145  return cellExtent_;
146  }
147 
148  auto getCellIterator([[maybe_unused]] uint32 lvl)const
149  {
150  return NBSLevel0_.getCellIterator();
151  }
152 
154  {
155  return Vector<cells>("Cells", 1, NBSLevel0_.getDomainCells());
156  }
157 
158 };
159 
160 }
161 
162 #endif
pFlow::NBS::impl_broadSearch
bool impl_broadSearch(csPairContainerType &ppPairs, csPairContainerType &pwPairs, const deviceViewType1D< realx3 > &pointPos, const pFlagTypeDevice &flags, const deviceViewType1D< real > &diameter)
Definition: NBS.hpp:59
pFlow::NBS::cellExtent_
real cellExtent_
Definition: NBS.hpp:46
pFlow::NBS::sizeRatio_
real sizeRatio_
Definition: NBS.hpp:44
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::NBSLevel0
Definition: NBSLevel0.hpp:32
pFlow::NBS::sizeRatio
real sizeRatio() const
Definition: NBS.hpp:138
pFlow::particleWallContactSearchs
Definition: particleWallContactSearchs.hpp:31
pFlow::NBSLevel0::broadSearch
bool broadSearch(csPairContainerType &pairs, const deviceViewType1D< realx3 > &pointPos, const pFlagTypeDevice &flags, const deviceViewType1D< real > &diameter, bool &searchBoxChanged)
Definition: NBSLevel0.cpp:94
pFlow::NBS::~NBS
INLINE_FUNCTION_HD ~NBS()=default
pFlow::NBS::adjustableBox_
Logical adjustableBox_
Definition: NBS.hpp:48
NBSLevel0.hpp
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::NBS::TypeInfoNV
TypeInfoNV("NBS")
cellsWallLevel0.hpp
pFlow::NBS::CellIterator
typename NBSLevel0::CellIterator CellIterator
Definition: NBS.hpp:40
pFlow::NBS::operator=
INLINE_FUNCTION_HD NBS & operator=(const NBS &)=default
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::deviceViewType1D
Kokkos::View< T * > deviceViewType1D
1D array (vector) with default device (memory space and execution space)
Definition: KokkosTypes.hpp:121
pFlow::unsortedPairs
Definition: unsortedPairs.hpp:32
pFlow
Definition: demGeometry.hpp:27
pFlow::mapperNBS::getSearchCells
const auto & getSearchCells() const
Definition: mapperNBS.hpp:160
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::NBS::getCellIterator
auto getCellIterator([[maybe_unused]] uint32 lvl) const
Definition: NBS.hpp:148
particleWallContactSearchs.hpp
pFlow::NBS::NBSLevel0_
NBSLevel0 NBSLevel0_
Definition: NBS.hpp:50
pFlow::mapperNBS::getDomainCells
const auto & getDomainCells() const
Definition: mapperNBS.hpp:155
pFlow::NBS::NBS
NBS(const dictionary &dict, const box &domainBox, real minBSSize, real maxBSSize, const deviceViewType1D< realx3 > &position, const pFlagTypeDevice &flags, const deviceViewType1D< real > &diam, uint32 nWallPoints, uint32 nWallElements, const ViewType1D< realx3, memory_space > &wallPoints, const ViewType1D< uint32x3, memory_space > &wallVertices, const ViewType1D< realx3, memory_space > &wallNormals)
Definition: NBS.cpp:24
pFlow::NBS
Definition: NBS.hpp:34
pFlow::ViewType1D
Kokkos::View< T *, properties... > ViewType1D
1D veiw as a vector
Definition: KokkosTypes.hpp:93
pFlow::NBS::cellsWallLevel0_
cellsWallLevel0 cellsWallLevel0_
Definition: NBS.hpp:52
pFlow::Logical
Holds a bool value and converts strings to bool.
Definition: Logical.hpp:39
pFlow::NBS::getDomainCellsLevels
Vector< cells > getDomainCellsLevels() const
Definition: NBS.hpp:153
pFlow::NBS::cellExtent
real cellExtent() const
Definition: NBS.hpp:143
pFlow::box
Definition: box.hpp:32
pFlow::mapperNBS::getCellIterator
auto getCellIterator() const
Definition: mapperNBS.hpp:150
pFlow::cellsWallLevel0
Definition: cellsWallLevel0.hpp:34
pFlow::NBS::numLevels
uint32 numLevels() const
Definition: NBS.hpp:133
pFlow::NBSLevel0::CellIterator
typename MapperType::CellIterator CellIterator
Definition: NBSLevel0.hpp:40
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:55
pFlow::Vector
Definition: Vector.hpp:48
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67
Vector.hpp
pFlow::pointFlag< DefaultExecutionSpace >
pFlow::cellsWallLevel0::broadSearch
bool broadSearch(csPairContainerType &pairs, const cells &searchBox, const mapperNBS::CellIterator &particleMap, const deviceViewType1D< realx3 > &pPoints, const deviceViewType1D< real > &pDiams, real sizeRatio)
Definition: cellsWallLevel0.cpp:66