Go to the documentation of this file.
43 restitution_ = dict.
getValOrSet(
"restitution", restitution_);
44 velocityName_ = dict.
getValOrSet(
"velocityName",velocityName_);
45 diameterName_ = dict.
getValOrSet(
"diameterName", diameterName_);
52 bool iterBeforeUpdate ,
73 if(
empty())
return true;
77 inContactFlags.
fill(0u);
80 auto points = thisPoints();
82 auto p = boundaryPlane().infPlane();
84 auto diams = diam.
BoundaryField(thisBoundaryIndex()).thisField();
88 Kokkos::parallel_reduce
90 "pFlow::boundaryReflective::afterIteration",
94 if(p.inPositiveDistance(points(i), 0.5*diams(i)))
104 if(numInContact == 0 )
112 exclusiveScan(inContactFlagsD, 0u, s+1, inContactFlagsD, 0u);
116 "pFlow::boundaryReflective::afterIteration",
120 if(inContactFlagsD(i)!= inContactFlagsD(i+1))
121 inContactListD(inContactFlagsD(i)) = points.index(i);
129 const auto restitution = restitution_;
131 Kokkos::parallel_for(
132 "pFlow::boundaryReflective::velocityChange",
136 auto& vel = velocityD(inContactListD(i));
137 real vn =
dot(p.normal(), vel);
141 realx3 vt = vel - vn*p.normal();
142 vel = restitution*(vt - vn*p.normal());
INLINE_FUNCTION_H void fill(const T &val)
Fill the range [0,size) with val.
T getValOrSet(const word &keyword, const T &setVal) const
get the value of data entry or if not found, set the value to setVal
const auto & deviceViewAll() const
const auto & BoundaryField(uint32 i) const
virtual bool beforeIteration(uint32 step, const timeInfo &ti, bool updateIter, bool iterBeforeUpdate, bool &callAgain)
INLINE_FUNCTION_HD T dot(const quadruple< T > &oprnd1, const quadruple< T > &oprnd2)
bool afterIteration(const timeInfo &ti) final
INLINE_FUNCTION_H auto & deviceViewAll()
Device view range [0,capcity)
bool iterate(const timeInfo &ti) final
Kokkos::RangePolicy< Kokkos::DefaultExecutionSpace, Kokkos::Schedule< Kokkos::Static >, Kokkos::IndexType< pFlow::uint32 > > deviceRPolicyStatic
bool beforeIteration(uint32 step, const timeInfo &ti, bool updateIter, bool iterBeforeUpdate, bool &callAgain) final
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
boundaryReflective(const dictionary &dict, const plane &bplane, internalPoints &internal, boundaryList &bndrs, uint32 thisIndex)
void exclusiveScan(const ViewType1D< Type, properties... > &view, uint32 start, uint32 end, ViewType1D< Type, dProperties... > &dView, uint32 dStart)