# PhasicFlow: src/Interaction/grainInteraction/boundaries/boundaryGrainInteraction/boundaryGrainInteraction.cpp 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.cpp
Go to the documentation of this file.
#include "boundarySphereInteraction.hpp"
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
template <typename cFM, typename gMM>
void pFlow::boundaryGrainInteraction<cFM, gMM>::allocatePPPairs()
{
ppPairs_.reset(nullptr);
ppPairs_ = makeUnique<ContactListType>(1);
}
template <typename cFM, typename gMM>
void pFlow::boundaryGrainInteraction<cFM, gMM>::allocatePWPairs()
{
pwPairs_.reset(nullptr);
pwPairs_ = makeUnique<ContactListType>(1);
}
template <typename cFM, typename gMM>
pFlow::boundaryGrainInteraction<cFM, gMM>::boundaryGrainInteraction(
const boundaryBase &boundary,
const grainParticles &grnPrtcls,
const GeometryMotionModel &geomMotion)
: generalBoundary(boundary, grnPrtcls.pStruct(), "", ""),
geometryMotion_(geomMotion),
grnParticles_(grnPrtcls)
{
}
template <typename cFM, typename gMM>
pFlow::uniquePtr<pFlow::boundaryGrainInteraction<cFM, gMM>>
pFlow::boundaryGrainInteraction<cFM, gMM>::create(
const boundaryBase &boundary,
const grainParticles &grnPrtcls,
const GeometryMotionModel &geomMotion)
{
word cfTypeName = ContactForceModel::TYPENAME();
word gmTypeName = MotionModel::TYPENAME();
word bType = boundary.type();
word boundaryTypeName = angleBracketsNames3(
"boundaryGrainInteraction",
bType,
cfTypeName,
gmTypeName);
word altBTypeName = angleBracketsNames2(
"boundaryGrainInteraction",
cfTypeName,
gmTypeName);
if (boundaryBasevCtorSelector_.search(boundaryTypeName))
{
pOutput.space(4) << "Creating boundry type " << Green_Text(boundaryTypeName) <<
" for boundary " << boundary.name() << " . . ." << END_REPORT;
return boundaryBasevCtorSelector_[boundaryTypeName](
boundary,
grnPrtcls,
geomMotion);
}
else if(boundaryBasevCtorSelector_[altBTypeName])
{
// if boundary condition is not implemented, the default is used
pOutput.space(4) << "Creating boundry type " << Green_Text(altBTypeName) <<
" for boundary " << boundary.name() << " . . ." << END_REPORT;
return boundaryBasevCtorSelector_[altBTypeName](
boundary,
grnPrtcls,
geomMotion);
}
else
{
printKeys
(
fatalError << "Ctor Selector "<< boundaryTypeName<<
" and "<< altBTypeName << " do not exist. \n"
<<"Avaiable ones are: \n\n"
,
boundaryBasevCtorSelector_
);
fatalExit;
}
return nullptr;
}
pFlow::angleBracketsNames3
word angleBracketsNames3(const word &base, const word &w1, const word &w2, const word &w3)
Output base<w1,sw2,w3>
Definition: bTypesFunctions.cpp:168
Green_Text
#define Green_Text(text)
Definition: iOstream.hpp:42
pFlow::pOutput
processorOstream pOutput
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
boundarySphereInteraction.hpp
pFlow::grainParticles
Definition: grainParticles.hpp:42
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::printKeys
iOstream & printKeys(iOstream &os, const wordHashMap< T > &m)
pFlow::boundaryBase::name
const word & name() const
Definition: boundaryBase.hpp:258
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::boundaryBase::type
const word & type() const
Definition: boundaryBase.hpp:252
pFlow::angleBracketsNames2
word angleBracketsNames2(const word &base, const word &w1, const word &w2)
Output base<w1,w2>
Definition: bTypesFunctions.cpp:162
pFlow::boundaryBase
Definition: boundaryBase.hpp:42
END_REPORT
#define END_REPORT
Definition: streams.hpp:40
fatalError
#define fatalError
Report a fatal error and exit the applicaiton.
Definition: error.hpp:70
pStruct
auto & pStruct
Definition: setPointStructure.hpp:24
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
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
pFlow::boundaryGrainInteraction::allocatePPPairs
void allocatePPPairs()
Definition: boundaryGrainInteraction.cpp:23
pFlow::iOstream::space
virtual iOstream & space(int32 n=1)
Write space to stream.
Definition: iOstream.cpp:119
pFlow::generalBoundary
Definition: generalBoundary.hpp:38