www.cemf.ir
cellsWallLevel0.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 #ifndef __cellsWallLevel0_hpp__
22 #define __cellsWallLevel0_hpp__
23 
24 #include "contactSearchGlobals.hpp"
26 #include "mapperNBS.hpp"
27 #include "iBox.hpp"
28 
29 
30 
31 namespace pFlow
32 {
33 
35 {
36 public:
37 
39 
40  using memory_space = typename execution_space::memory_space;
41 
43 
45 
46 private:
47 
48  // - box extent
50 
51  // - number of triangle elements
53 
54  // - number of points
56 
57  // - ref to vectices (borrowed)
59 
60  // - ref to points in the trisurface (borrowed)
62 
63  // - ref to normal vectors of triangles (borrowed)
65 
66  // cell range of element/triangle bounding box
68 
69 
70  using tpPWContactSearch = Kokkos::TeamPolicy<
72  Kokkos::Schedule<Kokkos::Dynamic>,
73  Kokkos::IndexType<uint32>>;
74 
77  {
79  }
80 
81 public:
82 
83  TypeInfoNV("cellsWallLevel0");
84 
87 
90  real cellExtent,
91  uint32 numPoints,
93  const ViewType1D<realx3,memory_space>& points,
94  const ViewType1D<uint32x3,memory_space>& vertices,
95  const ViewType1D<realx3, memory_space>& normals);
96 
97 
98 
99  // - host call
100  // reset triangle elements if they have changed
101  bool resetElements(
103  uint32 numPoints,
104  const ViewType1D<realx3, memory_space>& points,
105  const ViewType1D<uint32x3, memory_space>& vertices,
106  const ViewType1D<realx3, memory_space>& normals);
107 
108 
111  {
112  return elementBox_[i];
113  }
114 
117  {
118  return numElements_;
119  }
120 
121  bool broadSearch(
122  csPairContainerType& pairs,
123  const cells& searchBox,
124  const mapperNBS::CellIterator& particleMap,
125  const deviceViewType1D<realx3>& pPoints,
126  const deviceViewType1D<real>& pDiams,
127  real sizeRatio);
128 
129 
130  bool build(const cells& searchBox);
131 
133  csPairContainerType& pairs,
134  const mapperNBS::CellIterator& particleMap,
135  const deviceViewType1D<realx3>& pPoints,
136  const deviceViewType1D<real>& pDiams,
137  real sizeRatio);
138 
140  csPairContainerType& pairs,
141  const mapperNBS::CellIterator& particleMap,
142  const deviceViewType1D<realx3>& pPoints,
143  const deviceViewType1D<real>& pDiams,
144  real sizeRatio);
145 
146 
147 
148 }; // cellsWallLevel0
149 
150 } // pFlow
151 
152 
153 #endif // __cellsWallLevel0_hpp__
pFlow::cellsWallLevel0::cellsWallLevel0
INLINE_FUNCTION_HD cellsWallLevel0()
Definition: cellsWallLevel0.hpp:86
mapperNBS.hpp
pFlow::cellsWallLevel0::cellExtent_
real cellExtent_
Definition: cellsWallLevel0.hpp:49
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::cellsWallLevel0::elementBox_
ViewType1D< iBoxType, memory_space > elementBox_
Definition: cellsWallLevel0.hpp:67
pFlow::cellsWallLevel0::numElements_
uint32 numElements_
Definition: cellsWallLevel0.hpp:52
contactSearchFunctions.hpp
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::reallocNoInit
INLINE_FUNCTION_H void reallocNoInit(ViewType1D< Type, Properties... > &view, uint32 len)
Definition: KokkosUtilities.hpp:64
pFlow::mapperNBS::CellIterator
Definition: mapperNBS.hpp:45
pFlow::cellsWallLevel0::points_
ViewType1D< realx3, memory_space > points_
Definition: cellsWallLevel0.hpp:61
pFlow::cellsWallLevel0::numElements
INLINE_FUNCTION_HD uint32 numElements() const
Definition: cellsWallLevel0.hpp:116
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::cellsWallLevel0::tpPWContactSearch
Kokkos::TeamPolicy< execution_space, Kokkos::Schedule< Kokkos::Dynamic >, Kokkos::IndexType< uint32 > > tpPWContactSearch
Definition: cellsWallLevel0.hpp:73
pFlow
Definition: demGeometry.hpp:27
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:62
iBox.hpp
pFlow::csExecutionSpace
DefaultExecutionSpace csExecutionSpace
Definition: contactSearchGlobals.hpp:30
pFlow::cellsWallLevel0::TypeInfoNV
TypeInfoNV("cellsWallLevel0")
pFlow::cellsWallLevel0::TagFindCellRange2
Definition: cellsWallLevel0.hpp:44
pFlow::int32
int int32
Definition: builtinTypes.hpp:50
pFlow::cellsWallLevel0::memory_space
typename execution_space::memory_space memory_space
Definition: cellsWallLevel0.hpp:40
pFlow::cellsWallLevel0::normals_
ViewType1D< realx3, memory_space > normals_
Definition: cellsWallLevel0.hpp:64
contactSearchGlobals.hpp
pFlow::cellsWallLevel0::numPoints_
uint32 numPoints_
Definition: cellsWallLevel0.hpp:55
pFlow::ViewType1D
Kokkos::View< T *, properties... > ViewType1D
1D veiw as a vector
Definition: KokkosTypes.hpp:93
pFlow::cellsWallLevel0::elementBox
INLINE_FUNCTION_HD iBoxType elementBox(uint32 i) const
Definition: cellsWallLevel0.hpp:110
pFlow::cellsWallLevel0::findPairsElementRangeCount
int32 findPairsElementRangeCount(csPairContainerType &pairs, const mapperNBS::CellIterator &particleMap, const deviceViewType1D< realx3 > &pPoints, const deviceViewType1D< real > &pDiams, real sizeRatio)
Definition: cellsWallLevel0.cpp:151
pFlow::cellsWallLevel0::build
bool build(const cells &searchBox)
Definition: cellsWallLevel0.cpp:85
pFlow::cellsWallLevel0
Definition: cellsWallLevel0.hpp:34
pFlow::iBox
Definition: iBox.hpp:33
pFlow::cells
Definition: cells.hpp:31
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:55
pFlow::cellsWallLevel0::execution_space
csExecutionSpace execution_space
Definition: cellsWallLevel0.hpp:38
pFlow::cellsWallLevel0::resetElements
bool resetElements(uint32 numElements, uint32 numPoints, const ViewType1D< realx3, memory_space > &points, const ViewType1D< uint32x3, memory_space > &vertices, const ViewType1D< realx3, memory_space > &normals)
Definition: cellsWallLevel0.cpp:45
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
pFlow::cellsWallLevel0::allocateArrays
FUNCTION_H void allocateArrays()
Definition: cellsWallLevel0.hpp:76
pFlow::cellsWallLevel0::vertices_
ViewType1D< uint32x3, memory_space > vertices_
Definition: cellsWallLevel0.hpp:58
pFlow::cellsWallLevel0::particleWallFindPairs
bool particleWallFindPairs(csPairContainerType &pairs, const mapperNBS::CellIterator &particleMap, const deviceViewType1D< realx3 > &pPoints, const deviceViewType1D< real > &pDiams, real sizeRatio)
Definition: cellsWallLevel0.cpp:115