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

boundaryGrainInteraction.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 __boundaryGrainInteraction_hpp__
#define __boundaryGrainInteraction_hpp__
#include "virtualConstructor.hpp"
#include "generalBoundary.hpp"
#include "sortedContactList.hpp"
#include "grainParticles.hpp"
namespace pFlow
{
template<typename contactForceModel,typename geometryMotionModel>
class boundaryGrainInteraction
:
public generalBoundary
{
public:
using BoundaryGrainInteractionType
= boundaryGrainInteraction<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 grainParticles& grnParticles_;
uniquePtr<ContactListType> ppPairs_ = nullptr;
uniquePtr<ContactListType> pwPairs_ = nullptr;
protected:
void allocatePPPairs();
void allocatePWPairs();
public:
TypeInfoTemplate12("boundaryGrainInteraction", ContactForceModel, MotionModel);
boundaryGrainInteraction(
const boundaryBase& boundary,
const grainParticles& grnPrtcls,
const GeometryMotionModel& geomMotion);
create_vCtor
(
BoundaryGrainInteractionType,
boundaryBase,
(
const boundaryBase& boundary,
const grainParticles& grnPrtcls,
const GeometryMotionModel& geomMotion
),
(boundary, grnPrtcls, geomMotion)
);
add_vCtor
(
BoundaryGrainInteractionType,
BoundaryGrainInteractionType,
boundaryBase
);
~boundaryGrainInteraction()override=default;
const auto& grnParticles()const
{
return grnParticles_;
}
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 grainGrainInteraction(
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<BoundaryGrainInteractionType> create(
const boundaryBase& boundary,
const grainParticles& sphPrtcls,
const GeometryMotionModel& geomMotion
);
};
}
#include "boundaryGrainInteraction.cpp"
#endif //__boundaryGrainInteraction_hpp__
pFlow::pOutput
processorOstream pOutput
pFlow::message
Definition: message.hpp:33
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::boundaryGrainInteraction
Definition: boundaryGrainInteraction.hpp:32
pFlow::boundaryGrainInteraction::ppPairs_
uniquePtr< ContactListType > ppPairs_
Definition: boundaryGrainInteraction.hpp:63
pFlow::grainParticles
Definition: grainParticles.hpp:42
pFlow::boundaryGrainInteraction::grnParticles
const auto & grnParticles() const
Definition: boundaryGrainInteraction.hpp:103
pFlow::boundaryGrainInteraction::ContactForceModel
contactForceModel ContactForceModel
Definition: boundaryGrainInteraction.hpp:43
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::boundaryGrainInteraction::~boundaryGrainInteraction
~boundaryGrainInteraction() override=default
sortedContactList.hpp
pFlow::boundaryGrainInteraction::ppPairsAllocated
bool ppPairsAllocated() const
Definition: boundaryGrainInteraction.hpp:133
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::boundaryGrainInteraction::create
static uniquePtr< BoundaryGrainInteractionType > create(const boundaryBase &boundary, const grainParticles &sphPrtcls, const GeometryMotionModel &geomMotion)
Definition: boundaryGrainInteraction.cpp:50
pFlow::boundaryGrainInteraction::allocatePWPairs
void allocatePWPairs()
Definition: boundaryGrainInteraction.cpp:30
pFlow::boundaryGrainInteraction::geometryMotion_
const GeometryMotionModel & geometryMotion_
Definition: boundaryGrainInteraction.hpp:58
pFlow::boundaryGrainInteraction::IndexType
uint32 IndexType
Definition: boundaryGrainInteraction.hpp:51
pFlow
Definition: demGeometry.hpp:27
grainParticles.hpp
pFlow::boundaryGrainInteraction::geometryMotion
const auto & geometryMotion() const
Definition: boundaryGrainInteraction.hpp:108
pFlow::boundaryGrainInteraction::ppPairs
ContactListType & ppPairs()
Definition: boundaryGrainInteraction.hpp:113
pFlow::generalBoundary::type
const word & type() const
Definition: generalBoundary.hpp:132
pFlow::boundaryGrainInteraction::grnParticles_
const grainParticles & grnParticles_
const reference to sphere particles
Definition: boundaryGrainInteraction.hpp:61
pFlow::boundaryGrainInteraction::add_vCtor
add_vCtor(BoundaryGrainInteractionType, BoundaryGrainInteractionType, boundaryBase)
pFlow::boundaryGrainInteraction::pwPairs
ContactListType & pwPairs()
Definition: boundaryGrainInteraction.hpp:123
pFlow::anyList
Definition: anyList.hpp:35
pFlow::boundaryGrainInteraction::pwPairsAllocated
bool pwPairsAllocated() const
Definition: boundaryGrainInteraction.hpp:139
pFlow::boundaryGrainInteraction::pwPairs
const ContactListType & pwPairs() const
Definition: boundaryGrainInteraction.hpp:128
pFlow::boundaryGrainInteraction::pwPairs_
uniquePtr< ContactListType > pwPairs_
Definition: boundaryGrainInteraction.hpp:65
pFlow::boundaryGrainInteraction::ppPairs
const ContactListType & ppPairs() const
Definition: boundaryGrainInteraction.hpp:118
virtualConstructor.hpp
pFlow::boundaryBase
Definition: boundaryBase.hpp:42
pFlow::boundaryGrainInteraction::MotionModel
typename geometryMotionModel::MotionModel MotionModel
Definition: boundaryGrainInteraction.hpp:45
pFlow::boundaryGrainInteraction::TypeInfoTemplate12
TypeInfoTemplate12("boundaryGrainInteraction", ContactForceModel, MotionModel)
pFlow::boundaryGrainInteraction::grainGrainInteraction
virtual bool grainGrainInteraction(real dt, const ContactForceModel &cfModel, uint32 step)
Definition: boundaryGrainInteraction.hpp:146
pFlow::boundaryGrainInteraction::hearChanges
bool hearChanges(real t, real dt, uint32 iter, const message &msg, const anyList &varList) override
Definition: boundaryGrainInteraction.hpp:158
pFlow::boundaryGrainInteraction::IdType
uint32 IdType
Definition: boundaryGrainInteraction.hpp:49
pFlow::sortedContactList
Definition: sortedContactList.hpp:30
pFlow::uniquePtr< ContactListType >
generalBoundary.hpp
pFlow::generalBoundary::boundary
const auto & boundary() const
Definition: generalBoundary.hpp:108
pFlow::boundaryGrainInteraction::boundaryGrainInteraction
boundaryGrainInteraction(const boundaryBase &boundary, const grainParticles &grnPrtcls, const GeometryMotionModel &geomMotion)
Definition: boundaryGrainInteraction.cpp:38
pFlow::boundaryGrainInteraction::GeometryMotionModel
geometryMotionModel GeometryMotionModel
Definition: boundaryGrainInteraction.hpp:41
boundaryGrainInteraction.cpp
pFlow::boundaryGrainInteraction::allocatePPPairs
void allocatePPPairs()
Definition: boundaryGrainInteraction.cpp:23
pFlow::boundaryGrainInteraction::ModelStorage
typename ContactForceModel::contactForceStorage ModelStorage
Definition: boundaryGrainInteraction.hpp:47
pFlow::boundaryGrainInteraction::create_vCtor
create_vCtor(BoundaryGrainInteractionType, boundaryBase,(const boundaryBase &boundary, const grainParticles &grnPrtcls, const GeometryMotionModel &geomMotion),(boundary, grnPrtcls, geomMotion))
pFlow::generalBoundary
Definition: generalBoundary.hpp:38
pFlow::generalBoundary::boundaryName
const word & boundaryName() const
Definition: generalBoundary.hpp:126