# PhasicFlow: src/Interaction/contactSearch/contactSearch/contactSearch.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.

contactSearch.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 __contactSearch_hpp__
#define __contactSearch_hpp__
#include "contactSearchGlobals.hpp"
#include "dictionary.hpp"
#include "virtualConstructor.hpp"
#include "timeInfo.hpp"
#include "Timer.hpp"
namespace pFlow
{
// - forward
class box;
class particles;
class geometry;
class pointStructure;
class contactSearch
{
private:
const box& extendedDomainBox_;
uint32 updateInterval_= 1;
uint32 lastUpdated_ = 0;
bool performedSearch_ = false;
bool performedSearchBoundary_ = false;
const particles& particles_;
const geometry& geometry_;
Timer bTimer_;
Timer ppTimer_;
dictionary dict_;
virtual
bool BroadSearch(
const timeInfo& ti,
csPairContainerType& ppPairs,
csPairContainerType& pwPairs,
bool force
)=0;
virtual
bool BoundaryBroadSearch(
uint32 bndryIndex,
const timeInfo& ti,
csPairContainerType& ppPairs,
csPairContainerType& pwPairs,
bool force = false
)=0;
public:
TypeInfo("contactSearch");
contactSearch(
const dictionary& dict,
const box& extDomain,
const particles& prtcl,
const geometry& geom,
Timers& timers);
virtual ~contactSearch()=default;
create_vCtor
(
contactSearch,
dictionary,
(
const dictionary& dict,
const box& domain,
const particles& prtcl,
const geometry& geom,
Timers& timers
),
(dict, domain, prtcl, geom, timers)
);
inline
bool performedSearch()const
{
return performedSearch_;
}
inline
bool performedSearchBoundary()const
{
return performedSearchBoundary_;
}
inline
bool performSearch(uint32 iter, bool force = false)const
{
if((iter-lastUpdated_) % updateInterval_ == 0 || iter == 0 || force )
{
return true;
}
return false;
}
bool enterBroadSearch(const timeInfo& ti, bool force = false)const
{
return performSearch(ti.iter(), force);
}
virtual
bool enterBroadSearchBoundary(const timeInfo& ti, bool force=false)const = 0;
inline
uint32 updateInterval()const
{
return updateInterval_;
}
inline
const dictionary& dict()const
{
return dict_;
}
inline
const box& extendedDomainBox()const
{
return extendedDomainBox_;
}
inline
const particles& Particles()const
{
return particles_;
}
const pointStructure& pStruct()const;
inline
const geometry& Geometry()const
{
return geometry_;
}
inline
Timer& ppTimer()
{
return ppTimer_;
}
inline
Timer& bTimer()
{
return bTimer_;
}
bool broadSearch(
const timeInfo& ti,
csPairContainerType& ppPairs,
csPairContainerType& pwPairs,
bool force = false);
bool boundaryBroadSearch(
uint32 bndryIndex,
const timeInfo& ti,
csPairContainerType& ppPairs,
csPairContainerType& pwPairs,
bool force = false);
virtual
real sizeRatio()const = 0;
virtual
real cellExtent()const = 0;
static
uniquePtr<contactSearch> create(
const dictionary& dict,
const box& extDomain,
const particles& prtcl,
const geometry& geom,
Timers& timers);
};
}
#endif //__ContactSearch_hpp__
pFlow::contactSearch::cellExtent
virtual real cellExtent() const =0
pFlow::contactSearch::Geometry
const geometry & Geometry() const
Definition: contactSearch.hpp:174
pFlow::contactSearch::contactSearch
contactSearch(const dictionary &dict, const box &extDomain, const particles &prtcl, const geometry &geom, Timers &timers)
Definition: contactSearch.cpp:26
pFlow::contactSearch::bTimer
Timer & bTimer()
Definition: contactSearch.hpp:186
pFlow::contactSearch::enterBroadSearchBoundary
virtual bool enterBroadSearchBoundary(const timeInfo &ti, bool force=false) const =0
pFlow::real
float real
Definition: builtinTypes.hpp:45
timeInfo.hpp
pFlow::contactSearch::updateInterval
uint32 updateInterval() const
Definition: contactSearch.hpp:148
pFlow::contactSearch::BroadSearch
virtual bool BroadSearch(const timeInfo &ti, csPairContainerType &ppPairs, csPairContainerType &pwPairs, bool force)=0
pFlow::contactSearch::enterBroadSearch
bool enterBroadSearch(const timeInfo &ti, bool force=false) const
Definition: contactSearch.hpp:139
pFlow::contactSearch::ppTimer_
Timer ppTimer_
Definition: contactSearch.hpp:68
pFlow::contactSearch::sizeRatio
virtual real sizeRatio() const =0
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::contactSearch::broadSearch
bool broadSearch(const timeInfo &ti, csPairContainerType &ppPairs, csPairContainerType &pwPairs, bool force=false)
Definition: contactSearch.cpp:49
pFlow::contactSearch::create
static uniquePtr< contactSearch > create(const dictionary &dict, const box &extDomain, const particles &prtcl, const geometry &geom, Timers &timers)
Definition: contactSearch.cpp:118
pFlow::contactSearch::boundaryBroadSearch
bool boundaryBroadSearch(uint32 bndryIndex, const timeInfo &ti, csPairContainerType &ppPairs, csPairContainerType &pwPairs, bool force=false)
Definition: contactSearch.cpp:82
pFlow::contactSearch::bTimer_
Timer bTimer_
Definition: contactSearch.hpp:66
pFlow::contactSearch::particles_
const particles & particles_
const ref to particles
Definition: contactSearch.hpp:61
pFlow::contactSearch::dict
const dictionary & dict() const
Definition: contactSearch.hpp:154
pFlow::contactSearch::pStruct
const pointStructure & pStruct() const
Definition: contactSearch.cpp:43
pFlow::Timers
Definition: Timers.hpp:32
pFlow::timeInfo
Definition: timeInfo.hpp:28
pFlow::unsortedPairs
Definition: unsortedPairs.hpp:32
pFlow
Definition: demGeometry.hpp:27
pFlow::contactSearch::geometry_
const geometry & geometry_
const ref to geometry
Definition: contactSearch.hpp:64
pFlow::pointStructure
Definition: pointStructure.hpp:34
pFlow::particles
Definition: particles.hpp:33
contactSearchGlobals.hpp
pFlow::Timer
Definition: Timer.hpp:33
dictionary.hpp
pFlow::contactSearch::updateInterval_
uint32 updateInterval_
update interval in terms of iteration numebr
Definition: contactSearch.hpp:49
pFlow::contactSearch::extendedDomainBox_
const box & extendedDomainBox_
Definition: contactSearch.hpp:46
virtualConstructor.hpp
pFlow::contactSearch::lastUpdated_
uint32 lastUpdated_
last iteration number which contact search has been performed
Definition: contactSearch.hpp:52
pFlow::contactSearch::performSearch
bool performSearch(uint32 iter, bool force=false) const
Definition: contactSearch.hpp:130
pFlow::contactSearch::create_vCtor
create_vCtor(contactSearch, dictionary,(const dictionary &dict, const box &domain, const particles &prtcl, const geometry &geom, Timers &timers),(dict, domain, prtcl, geom, timers))
pFlow::contactSearch::performedSearchBoundary_
bool performedSearchBoundary_
performed search in boundaries
Definition: contactSearch.hpp:58
pFlow::contactSearch::ppTimer
Timer & ppTimer()
Definition: contactSearch.hpp:180
pFlow::contactSearch
Definition: contactSearch.hpp:42
pFlow::contactSearch::TypeInfo
TypeInfo("contactSearch")
pFlow::contactSearch::extendedDomainBox
const box & extendedDomainBox() const
Definition: contactSearch.hpp:160
pFlow::contactSearch::Particles
const particles & Particles() const
Definition: contactSearch.hpp:166
pFlow::contactSearch::performedSearch_
bool performedSearch_
performed search?
Definition: contactSearch.hpp:55
pFlow::box
Definition: box.hpp:32
pFlow::timeInfo::iter
const uint32 & iter() const
Definition: timeInfo.hpp:55
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::geometry
Base class for geometry for managing tri-surfaces, geometry motion, and surface physical properties.
Definition: geometry.hpp:44
pFlow::contactSearch::performedSearchBoundary
bool performedSearchBoundary() const
Definition: contactSearch.hpp:124
Timer.hpp
pFlow::contactSearch::BoundaryBroadSearch
virtual bool BoundaryBroadSearch(uint32 bndryIndex, const timeInfo &ti, csPairContainerType &ppPairs, csPairContainerType &pwPairs, bool force=false)=0
pFlow::contactSearch::~contactSearch
virtual ~contactSearch()=default
pFlow::domain
Definition: domain.hpp:31
pFlow::contactSearch::performedSearch
bool performedSearch() const
Definition: contactSearch.hpp:118
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
pFlow::contactSearch::dict_
dictionary dict_
Definition: contactSearch.hpp:70