# PhasicFlow: src/Interaction/contactSearch/boundaries/periodicBoundaryContactSearch/wallBoundaryContactSearch.hpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

wallBoundaryContactSearch.hpp
Go to the documentation of this file.
/*------------------------------- 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 __wallBoundaryContactSearch_hpp__
#define __wallBoundaryContactSearch_hpp__
#include "contactSearchGlobals.hpp"
#include "contactSearchFunctions.hpp"
#include "scatteredFieldAccess.hpp"
#include "iBox.hpp"
#include "cells.hpp"
namespace pFlow
{
class wallBoundaryContactSearch
{
public:
using execution_space = csExecutionSpace;
using memory_space = typename execution_space::memory_space;
using iBoxType = iBox<int32>;
private:
// - box extent
real cellExtent_ = 0.5;
// - number of triangle elements
uint32 numElements_ = 0;
// - number of points
uint32 numPoints_ = 0;
// - ref to vectices (borrowed)
ViewType1D<uint32x3, memory_space> vertices_;
// - ref to points in the trisurface (borrowed)
ViewType1D<realx3, memory_space> points_;
// - ref to normal vectors of triangles (borrowed)
ViewType1D<realx3, memory_space> normals_;
// cell range of element/triangle bounding box
ViewType1D<iBoxType, memory_space> elementBox_;
ViewType1D<uint8, memory_space> validBox_;
FUNCTION_H
void allocateArrays()
{
reallocNoInit( elementBox_, numElements_);
reallocNoInit( validBox_, numElements_);
}
public:
TypeInfoNV("wallBoundaryContactSearch");
INLINE_FUNCTION_HD
wallBoundaryContactSearch()=default;
FUNCTION_H
wallBoundaryContactSearch(
real cellExtent,
uint32 numPoints,
uint32 numElements,
const ViewType1D<realx3,memory_space>& points,
const ViewType1D<uint32x3,memory_space>& vertices,
const ViewType1D<realx3, memory_space>& normals);
INLINE_FUNCTION_HD
uint32 numElements()const
{
return numElements_;
}
bool build(const cells& searchBox, const realx3& transferVec);
bool broadSearch(
csPairContainerType& pairs,
const cells &searchCells,
const deviceScatteredFieldAccess<realx3>& thisPoints,
const deviceScatteredFieldAccess<real>& thisDiams,
const deviceScatteredFieldAccess<realx3>& mirrorPoints,
const deviceScatteredFieldAccess<real>& mirroDiams,
const realx3& transferVec,
real sizeRatio);
uint32 findPairsElementRangeCount(
csPairContainerType &pairs,
const cells &searchCells,
const deviceScatteredFieldAccess<realx3> &pPoints,
const deviceScatteredFieldAccess<real> &pDiams,
const realx3 &transferVec,
uint baseTriIndex);
}; // wallBoundaryContactSearch
} // pFlow
#endif // __wallBoundaryContactSearch_hpp__
pFlow::wallBoundaryContactSearch
Definition: wallBoundaryContactSearch.hpp:36
pFlow::scatteredFieldAccess
Definition: scatteredFieldAccess.hpp:32
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::wallBoundaryContactSearch::cellExtent_
real cellExtent_
Definition: wallBoundaryContactSearch.hpp:49
pFlow::wallBoundaryContactSearch::execution_space
csExecutionSpace execution_space
Definition: wallBoundaryContactSearch.hpp:40
pFlow::wallBoundaryContactSearch::allocateArrays
FUNCTION_H void allocateArrays()
Definition: wallBoundaryContactSearch.hpp:73
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::wallBoundaryContactSearch::normals_
ViewType1D< realx3, memory_space > normals_
Definition: wallBoundaryContactSearch.hpp:64
pFlow::wallBoundaryContactSearch::vertices_
ViewType1D< uint32x3, memory_space > vertices_
Definition: wallBoundaryContactSearch.hpp:58
pFlow::wallBoundaryContactSearch::TypeInfoNV
TypeInfoNV("wallBoundaryContactSearch")
pFlow::wallBoundaryContactSearch::findPairsElementRangeCount
uint32 findPairsElementRangeCount(csPairContainerType &pairs, const cells &searchCells, const deviceScatteredFieldAccess< realx3 > &pPoints, const deviceScatteredFieldAccess< real > &pDiams, const realx3 &transferVec, uint baseTriIndex)
Definition: wallBoundaryContactSearch.cpp:102
pFlow::unsortedPairs
Definition: unsortedPairs.hpp:32
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::wallBoundaryContactSearch::wallBoundaryContactSearch
INLINE_FUNCTION_HD wallBoundaryContactSearch()=default
pFlow::wallBoundaryContactSearch::build
bool build(const cells &searchBox, const realx3 &transferVec)
Definition: wallBoundaryContactSearch.cpp:24
contactSearchGlobals.hpp
pFlow::wallBoundaryContactSearch::numElements
INLINE_FUNCTION_HD uint32 numElements() const
Definition: wallBoundaryContactSearch.hpp:98
pFlow::wallBoundaryContactSearch::broadSearch
bool broadSearch(csPairContainerType &pairs, const cells &searchCells, const deviceScatteredFieldAccess< realx3 > &thisPoints, const deviceScatteredFieldAccess< real > &thisDiams, const deviceScatteredFieldAccess< realx3 > &mirrorPoints, const deviceScatteredFieldAccess< real > &mirroDiams, const realx3 &transferVec, real sizeRatio)
Definition: wallBoundaryContactSearch.cpp:50
pFlow::ViewType1D
Kokkos::View< T *, properties... > ViewType1D
1D veiw as a vector
Definition: KokkosTypes.hpp:93
pFlow::wallBoundaryContactSearch::elementBox_
ViewType1D< iBoxType, memory_space > elementBox_
Definition: wallBoundaryContactSearch.hpp:67
pFlow::wallBoundaryContactSearch::numElements_
uint32 numElements_
Definition: wallBoundaryContactSearch.hpp:52
pFlow::wallBoundaryContactSearch::memory_space
typename execution_space::memory_space memory_space
Definition: wallBoundaryContactSearch.hpp:42
pFlow::iBox
Definition: iBox.hpp:33
pFlow::cells
Definition: cells.hpp:31
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:55
pFlow::triple< real >
pFlow::wallBoundaryContactSearch::validBox_
ViewType1D< uint8, memory_space > validBox_
Definition: wallBoundaryContactSearch.hpp:69
scatteredFieldAccess.hpp
pFlow::wallBoundaryContactSearch::points_
ViewType1D< realx3, memory_space > points_
Definition: wallBoundaryContactSearch.hpp:61
pFlow::wallBoundaryContactSearch::numPoints_
uint32 numPoints_
Definition: wallBoundaryContactSearch.hpp:55