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

sphereInteraction.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 __sphereInteraction_hpp__
#define __sphereInteraction_hpp__
#include "interaction.hpp"
#include "sphereParticles.hpp"
#include "boundarySphereInteractionList.hpp"
#include "sphereInteractionKernels.hpp"
#include "boundariesMask.hpp"
#include "MPITimer.hpp"
//#include "unsortedContactList.hpp"
namespace pFlow
{
template<
typename contactForceModel,
typename geometryMotionModel,
template <class, class, class> class contactListType>
class sphereInteraction
:
public interaction
{
public:
using GeometryMotionModel = geometryMotionModel;
using ContactForceModel = contactForceModel;
using MotionModel = typename geometryMotionModel::MotionModel;
using ModelStorage = typename ContactForceModel::contactForceStorage;
using BoundaryListType = boundarySphereInteractionList<ContactForceModel,GeometryMotionModel>;
using IdType = uint32;
using IndexType = uint32;
using ContactListType =
contactListType<ModelStorage, DefaultExecutionSpace, IdType>;
//using BoundaryContactListType = unsortedContactList<ModelStorage, DefaultExecutionSpace, IdType>;
private:
const GeometryMotionModel& geometryMotion_;
const sphereParticles& sphParticles_;
BoundaryListType boundaryInteraction_;
boundariesMask<6> activeBoundaries_;
uniquePtr<contactSearch> contactSearch_ = nullptr;
uniquePtr<ContactForceModel> forceModel_ = nullptr;
uniquePtr<ContactListType> ppContactList_ = nullptr;
uniquePtr<ContactListType> pwContactList_ = nullptr;
Timer ppInteractionTimer_;
Timer pwInteractionTimer_;
Timer boundaryInteractionTimer_;
Timer contactListMangementTimer_;
Timer contactListMangementBoundaryTimer_;
bool createSphereInteraction();
bool sphereSphereInteraction();
bool sphereWallInteraction();
using rpPPInteraction =
Kokkos::RangePolicy<Kokkos::IndexType<uint32>, Kokkos::Schedule<Kokkos::Dynamic>>;
using rpPWInteraction = rpPPInteraction;
public:
TypeInfoTemplate13("sphereInteraction", ContactForceModel, MotionModel, ContactListType);
sphereInteraction(
systemControl& control,
const particles& prtcl,
const geometry& geom);
add_vCtor
(
interaction,
sphereInteraction,
systemControl
);
bool beforeIteration() override;
bool iterate() override;
bool afterIteration() override;
bool hearChanges(
real t,
real dt,
uint32 iter,
const message& msg,
const anyList& varList)override;
};
}
#include "sphereInteraction.cpp"
#endif //__sphereInteraction_hpp__
pFlow::sphereInteraction::sphereWallInteraction
bool sphereWallInteraction()
Definition: sphereInteraction.cpp:85
pFlow::sphereInteraction::boundaryInteractionTimer_
Timer boundaryInteractionTimer_
timer for boundary interaction time
Definition: sphereInteraction.hpp:102
pFlow::sphereInteraction::beforeIteration
bool beforeIteration() override
This is called in time loop, before iterate. (overriden from demComponent)
Definition: sphereInteraction.cpp:156
pFlow::sphereInteraction::geometryMotion_
const GeometryMotionModel & geometryMotion_
const reference to geometry
Definition: sphereInteraction.hpp:71
pFlow::message
Definition: message.hpp:33
pFlow::real
float real
Definition: builtinTypes.hpp:45
pFlow::sphereInteraction::MotionModel
typename geometryMotionModel::MotionModel MotionModel
Definition: sphereInteraction.hpp:51
pFlow::sphereInteraction::afterIteration
bool afterIteration() override
This is called in time loop, after iterate. (overriden from demComponent)
Definition: sphereInteraction.cpp:337
pFlow::demComponent::control
const auto & control() const
Const ref to systemControl.
Definition: demComponent.hpp:88
pFlow::sphereInteraction::ContactListType
contactListType< ModelStorage, DefaultExecutionSpace, IdType > ContactListType
Definition: sphereInteraction.hpp:62
pFlow::sphereInteraction::IdType
uint32 IdType
Definition: sphereInteraction.hpp:57
pFlow::sphereInteraction::createSphereInteraction
bool createSphereInteraction()
Definition: sphereInteraction.cpp:22
pFlow::sphereInteraction::TypeInfoTemplate13
TypeInfoTemplate13("sphereInteraction", ContactForceModel, MotionModel, ContactListType)
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::sphereInteraction::GeometryMotionModel
geometryMotionModel GeometryMotionModel
Definition: sphereInteraction.hpp:47
pFlow::sphereInteraction::boundaryInteraction_
BoundaryListType boundaryInteraction_
particle-particle and particle-wall interactions at boundaries
Definition: sphereInteraction.hpp:77
pFlow::systemControl
Definition: systemControl.hpp:41
interaction.hpp
pFlow::sphereInteraction::rpPWInteraction
rpPPInteraction rpPWInteraction
range policy for p-w interaction execution
Definition: sphereInteraction.hpp:122
pFlow::sphereInteraction::sphereInteraction
sphereInteraction(systemControl &control, const particles &prtcl, const geometry &geom)
Constructor from components.
Definition: sphereInteraction.cpp:127
pFlow::sphereInteraction::ppInteractionTimer_
Timer ppInteractionTimer_
timer for particle-particle interaction computations
Definition: sphereInteraction.hpp:96
pFlow::sphereInteraction::activeBoundaries_
boundariesMask< 6 > activeBoundaries_
a mask for active boundaries (boundaries with intreaction)
Definition: sphereInteraction.hpp:80
pFlow::sphereInteraction::pwContactList_
uniquePtr< ContactListType > pwContactList_
contact list for particle-wall interactions (keeps the history)
Definition: sphereInteraction.hpp:92
pFlow
Definition: demGeometry.hpp:27
pFlow::sphereInteraction::ContactForceModel
contactForceModel ContactForceModel
Definition: sphereInteraction.hpp:49
pFlow::sphereParticles
Class for managing spherical particles.
Definition: sphereParticles.hpp:42
pFlow::sphereInteraction::ppContactList_
uniquePtr< ContactListType > ppContactList_
contact list for particle-particle interactoins (keeps the history)
Definition: sphereInteraction.hpp:89
pFlow::sphereInteraction::IndexType
uint32 IndexType
Definition: sphereInteraction.hpp:59
pFlow::sphereInteraction::contactSearch_
uniquePtr< contactSearch > contactSearch_
contact search object for pp and pw interactions
Definition: sphereInteraction.hpp:83
pFlow::anyList
Definition: anyList.hpp:35
pFlow::particles
Definition: particles.hpp:33
pFlow::sphereInteraction::add_vCtor
add_vCtor(interaction, sphereInteraction, systemControl)
Add virtual constructor.
pFlow::sphereInteraction::sphParticles_
const sphereParticles & sphParticles_
const reference to particles
Definition: sphereInteraction.hpp:74
sphereInteractionKernels.hpp
sphereInteraction.cpp
pFlow::Timer
Definition: Timer.hpp:33
pFlow::sphereInteraction
Definition: sphereInteraction.hpp:41
pFlow::sphereInteraction::ModelStorage
typename ContactForceModel::contactForceStorage ModelStorage
Definition: sphereInteraction.hpp:53
MPITimer.hpp
pFlow::boundariesMask< 6 >
boundarySphereInteractionList.hpp
pFlow::sphereInteraction::rpPPInteraction
Kokkos::RangePolicy< Kokkos::IndexType< uint32 >, Kokkos::Schedule< Kokkos::Dynamic > > rpPPInteraction
range policy for p-p interaction execution
Definition: sphereInteraction.hpp:119
pFlow::sphereInteraction::contactListMangementTimer_
Timer contactListMangementTimer_
timer for managing contact lists (only inernal points)
Definition: sphereInteraction.hpp:105
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::sphereInteraction::pwInteractionTimer_
Timer pwInteractionTimer_
timer for particle-wall interaction computations
Definition: sphereInteraction.hpp:99
boundariesMask.hpp
pFlow::sphereInteraction::iterate
bool iterate() override
This is called in time loop.
Definition: sphereInteraction.cpp:162
sphereParticles.hpp
pFlow::sphereInteraction::hearChanges
bool hearChanges(real t, real dt, uint32 iter, const message &msg, const anyList &varList) override
Check for changes in the point structures. (overriden from observer)
Definition: sphereInteraction.cpp:344
pFlow::sphereInteraction::forceModel_
uniquePtr< ContactForceModel > forceModel_
contact force model
Definition: sphereInteraction.hpp:86
pFlow::demComponent::dt
real dt() const
Time step of integration.
Definition: demComponent.cpp:33
pFlow::boundarySphereInteractionList< ContactForceModel, GeometryMotionModel >
pFlow::sphereInteraction::contactListMangementBoundaryTimer_
Timer contactListMangementBoundaryTimer_
Definition: sphereInteraction.hpp:107
pFlow::interaction
Definition: interaction.hpp:38
pFlow::sphereInteraction::sphereSphereInteraction
bool sphereSphereInteraction()
Definition: sphereInteraction.cpp:53