# PhasicFlow: src/Interaction/sphereInteraction/boundaries/boundarySphereInteraction/boundarySphereInteraction.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.

boundarySphereInteraction.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 __boundarySphereInteraction_hpp__
#define __boundarySphereInteraction_hpp__
#include "virtualConstructor.hpp"
#include "generalBoundary.hpp"
#include "sortedContactList.hpp"
#include "sphereParticles.hpp"
namespace pFlow
{
template<typename contactForceModel,typename geometryMotionModel>
class boundarySphereInteraction
:
public generalBoundary
{
public:
using BoundarySphereInteractionType
= boundarySphereInteraction<contactForceModel, geometryMotionModel>;
using GeometryMotionModel = geometryMotionModel;
using ContactForceModel = contactForceModel;
using MotionModel = typename geometryMotionModel::MotionModel;
using ModelStorage = typename ContactForceModel::contactForceStorage;
using IdType = uint32;
using IndexType = uint32;
using ContactListType =
sortedContactList<ModelStorage, DefaultExecutionSpace, IdType>;
private:
const GeometryMotionModel& geometryMotion_;
const sphereParticles& sphParticles_;
uniquePtr<ContactListType> ppPairs_ = nullptr;
uniquePtr<ContactListType> pwPairs_ = nullptr;
protected:
void allocatePPPairs();
void allocatePWPairs();
public:
TypeInfoTemplate12("boundarySphereInteraction", ContactForceModel, MotionModel);
boundarySphereInteraction(
const boundaryBase& boundary,
const sphereParticles& sphPrtcls,
const GeometryMotionModel& geomMotion);
create_vCtor
(
BoundarySphereInteractionType,
boundaryBase,
(
const boundaryBase& boundary,
const sphereParticles& sphPrtcls,
const GeometryMotionModel& geomMotion
),
(boundary, sphPrtcls, geomMotion)
);
add_vCtor
(
BoundarySphereInteractionType,
BoundarySphereInteractionType,
boundaryBase
);
~boundarySphereInteraction()override=default;
const auto& sphParticles()const
{
return sphParticles_;
}
const auto& geometryMotion()const
{
return geometryMotion_;
}
ContactListType& ppPairs()
{
return ppPairs_();
}
const ContactListType& ppPairs()const
{
return ppPairs_();
}
ContactListType& pwPairs()
{
return pwPairs_();
}
const ContactListType& pwPairs()const
{
return pwPairs_();
}
bool ppPairsAllocated()const
{
if( ppPairs_)return true;
return false;
}
bool pwPairsAllocated()const
{
if( pwPairs_)return true;
return false;
}
virtual
bool sphereSphereInteraction(
real dt,
const ContactForceModel& cfModel,
uint32 step)
{
// for default boundary, no thing to be done
return false;
}
bool hearChanges
(
real t,
real dt,
uint32 iter,
const message& msg,
const anyList& varList
) override
{
pOutput<<"Function (hearChanges in boundarySphereInteractions)is not implmented Message "<<
msg <<endl<<" name "<< this->boundaryName() <<" type "<< this->type()<<endl;;
//notImplementedFunction;
return true;
}
static
uniquePtr<BoundarySphereInteractionType> create(
const boundaryBase& boundary,
const sphereParticles& sphPrtcls,
const GeometryMotionModel& geomMotion
);
};
}
#include "boundarySphereInteraction.cpp"
#endif //__boundarySphereInteraction_hpp__
pFlow::pOutput
processorOstream pOutput
pFlow::boundarySphereInteraction::TypeInfoTemplate12
TypeInfoTemplate12("boundarySphereInteraction", ContactForceModel, MotionModel)
pFlow::boundarySphereInteraction::create
static uniquePtr< BoundarySphereInteractionType > create(const boundaryBase &boundary, const sphereParticles &sphPrtcls, const GeometryMotionModel &geomMotion)
Definition: boundarySphereInteraction.cpp:50
pFlow::message
Definition: message.hpp:33
pFlow::boundarySphereInteraction::pwPairs
const ContactListType & pwPairs() const
Definition: boundarySphereInteraction.hpp:128
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::boundarySphereInteraction::pwPairsAllocated
bool pwPairsAllocated() const
Definition: boundarySphereInteraction.hpp:139
pFlow::boundarySphereInteraction::ContactForceModel
contactForceModel ContactForceModel
Definition: boundarySphereInteraction.hpp:43
pFlow::boundarySphereInteraction::add_vCtor
add_vCtor(BoundarySphereInteractionType, BoundarySphereInteractionType, boundaryBase)
pFlow::boundarySphereInteraction::IdType
uint32 IdType
Definition: boundarySphereInteraction.hpp:49
pFlow::boundarySphereInteraction::allocatePWPairs
void allocatePWPairs()
Definition: boundarySphereInteraction.cpp:30
boundarySphereInteraction.cpp
pFlow::boundarySphereInteraction::IndexType
uint32 IndexType
Definition: boundarySphereInteraction.hpp:51
pFlow::boundarySphereInteraction
Definition: boundarySphereInteraction.hpp:32
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
sortedContactList.hpp
pFlow::boundarySphereInteraction::~boundarySphereInteraction
~boundarySphereInteraction() override=default
pFlow::boundarySphereInteraction::allocatePPPairs
void allocatePPPairs()
Definition: boundarySphereInteraction.cpp:23
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow
Definition: demGeometry.hpp:27
pFlow::sphereParticles
Class for managing spherical particles.
Definition: sphereParticles.hpp:42
pFlow::generalBoundary::type
const word & type() const
Definition: generalBoundary.hpp:132
pFlow::boundarySphereInteraction::boundarySphereInteraction
boundarySphereInteraction(const boundaryBase &boundary, const sphereParticles &sphPrtcls, const GeometryMotionModel &geomMotion)
Definition: boundarySphereInteraction.cpp:38
pFlow::anyList
Definition: anyList.hpp:35
pFlow::boundarySphereInteraction::sphParticles_
const sphereParticles & sphParticles_
const reference to sphere particles
Definition: boundarySphereInteraction.hpp:61
pFlow::boundarySphereInteraction::pwPairs_
uniquePtr< ContactListType > pwPairs_
Definition: boundarySphereInteraction.hpp:65
pFlow::boundarySphereInteraction::sphereSphereInteraction
virtual bool sphereSphereInteraction(real dt, const ContactForceModel &cfModel, uint32 step)
Definition: boundarySphereInteraction.hpp:146
pFlow::boundarySphereInteraction::GeometryMotionModel
geometryMotionModel GeometryMotionModel
Definition: boundarySphereInteraction.hpp:41
pFlow::boundarySphereInteraction::sphParticles
const auto & sphParticles() const
Definition: boundarySphereInteraction.hpp:103
pFlow::boundarySphereInteraction::ppPairs
ContactListType & ppPairs()
Definition: boundarySphereInteraction.hpp:113
virtualConstructor.hpp
pFlow::boundaryBase
Definition: boundaryBase.hpp:42
pFlow::boundarySphereInteraction::create_vCtor
create_vCtor(BoundarySphereInteractionType, boundaryBase,(const boundaryBase &boundary, const sphereParticles &sphPrtcls, const GeometryMotionModel &geomMotion),(boundary, sphPrtcls, geomMotion))
pFlow::boundarySphereInteraction::ppPairs
const ContactListType & ppPairs() const
Definition: boundarySphereInteraction.hpp:118
pFlow::boundarySphereInteraction::pwPairs
ContactListType & pwPairs()
Definition: boundarySphereInteraction.hpp:123
pFlow::sortedContactList
Definition: sortedContactList.hpp:30
pFlow::uniquePtr< ContactListType >
generalBoundary.hpp
pFlow::generalBoundary::boundary
const auto & boundary() const
Definition: generalBoundary.hpp:108
sphereParticles.hpp
pFlow::boundarySphereInteraction::geometryMotion
const auto & geometryMotion() const
Definition: boundarySphereInteraction.hpp:108
pFlow::boundarySphereInteraction::MotionModel
typename geometryMotionModel::MotionModel MotionModel
Definition: boundarySphereInteraction.hpp:45
pFlow::boundarySphereInteraction::hearChanges
bool hearChanges(real t, real dt, uint32 iter, const message &msg, const anyList &varList) override
Definition: boundarySphereInteraction.hpp:158
pFlow::boundarySphereInteraction::ppPairsAllocated
bool ppPairsAllocated() const
Definition: boundarySphereInteraction.hpp:133
pFlow::boundarySphereInteraction::ModelStorage
typename ContactForceModel::contactForceStorage ModelStorage
Definition: boundarySphereInteraction.hpp:47
pFlow::boundarySphereInteraction::geometryMotion_
const GeometryMotionModel & geometryMotion_
Definition: boundarySphereInteraction.hpp:58
pFlow::boundarySphereInteraction::ppPairs_
uniquePtr< ContactListType > ppPairs_
Definition: boundarySphereInteraction.hpp:63
pFlow::generalBoundary
Definition: generalBoundary.hpp:38
pFlow::generalBoundary::boundaryName
const word & boundaryName() const
Definition: generalBoundary.hpp:126