Bug fix for observed in particles, getNth and naming for contact lists
This commit is contained in:
parent
b65be8881c
commit
892f5395bc
|
@ -80,13 +80,17 @@ public:
|
|||
|
||||
TypeInfoNV("sortedContactList");
|
||||
|
||||
|
||||
explicit sortedContactList(uint32 initialSize =1)
|
||||
sortedContactList(uint32 initialSize =1)
|
||||
:
|
||||
SortedPairs(initialSize),
|
||||
values_("values", SortedPairs::capacity()),
|
||||
sortedPairs0_("sortedPairs0", SortedPairs::capacity()),
|
||||
values0_("values0", SortedPairs::capacity())
|
||||
sortedContactList("sortedContactList", initialSize)
|
||||
{}
|
||||
|
||||
sortedContactList(const word& name, uint32 initialSize =1)
|
||||
:
|
||||
SortedPairs(name, initialSize),
|
||||
values_(groupNames(name, "values"), SortedPairs::capacity()),
|
||||
sortedPairs0_(groupNames(name, "sortedPairs0"), SortedPairs::capacity()),
|
||||
values0_(groupNames(name, "values0"), SortedPairs::capacity())
|
||||
{}
|
||||
|
||||
bool beforeBroadSearch()
|
||||
|
|
|
@ -110,11 +110,11 @@ public:
|
|||
|
||||
|
||||
// constructors
|
||||
explicit sortedPairs(uint32 initialSize =1)
|
||||
explicit sortedPairs(const word& name, uint32 initialSize =1)
|
||||
:
|
||||
UnsortedPairs(initialSize),
|
||||
flags_("flags_",UnsortedPairs::capacity()+1),
|
||||
sortedPairs_("sortedPairs_",UnsortedPairs::capacity())
|
||||
flags_( groupNames(name, "flags_"), UnsortedPairs::capacity()+1),
|
||||
sortedPairs_(groupNames(name, "sortedPairs_"), UnsortedPairs::capacity())
|
||||
{}
|
||||
|
||||
|
||||
|
|
|
@ -82,11 +82,16 @@ public:
|
|||
TypeInfoNV("unsortedContactList");
|
||||
|
||||
explicit unsortedContactList(uint32 capacity=1)
|
||||
:
|
||||
unsortedContactList("unsortedContactList", capacity)
|
||||
{}
|
||||
|
||||
unsortedContactList(const word& name, uint32 capacity=1)
|
||||
:
|
||||
UnsortedPairs(capacity),
|
||||
values_("values", UnsortedPairs::capacity()),
|
||||
values_(groupNames(name, "values"), UnsortedPairs::capacity()),
|
||||
container0_(capacity),
|
||||
values0_("values0",container0_.capacity())
|
||||
values0_(groupNames(name, "values0"),container0_.capacity())
|
||||
{}
|
||||
|
||||
|
||||
|
|
|
@ -194,7 +194,9 @@ public:
|
|||
{
|
||||
uint newCap = container_.capacity()+len;
|
||||
this->clear();
|
||||
//output<<"----------------before "<<capacity()<< " " << size()<<endl;
|
||||
container_.rehash(newCap);
|
||||
//output<<"----------------after "<<capacity()<< " " << size()<<endl;
|
||||
}
|
||||
|
||||
INLINE_FUNCTION_H
|
||||
|
|
|
@ -41,9 +41,9 @@ bool pFlow::grainInteraction<cFM,gMM, cLT>::createGrainInteraction()
|
|||
geometryMotion_,
|
||||
timers());
|
||||
|
||||
ppContactList_ = makeUnique<ContactListType>(nPrtcl+1);
|
||||
ppContactList_ = makeUnique<ContactListType>("Grain-Grain",nPrtcl+1);
|
||||
|
||||
pwContactList_ = makeUnique<ContactListType>(nPrtcl/5+1);
|
||||
pwContactList_ = makeUnique<ContactListType>("Grain-wall",nPrtcl/5+1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -41,9 +41,9 @@ bool pFlow::sphereInteraction<cFM,gMM, cLT>::createSphereInteraction()
|
|||
geometryMotion_,
|
||||
timers());
|
||||
|
||||
ppContactList_ = makeUnique<ContactListType>(nPrtcl+1);
|
||||
ppContactList_ = makeUnique<ContactListType>("sphere-sphere",nPrtcl+1);
|
||||
|
||||
pwContactList_ = makeUnique<ContactListType>(nPrtcl/5+1);
|
||||
pwContactList_ = makeUnique<ContactListType>("sphere-wall",nPrtcl/5+1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -62,6 +62,12 @@ pFlow::particles::particles(systemControl& control, const shape& shapes)
|
|||
//idHandler_().initialIdCheck();
|
||||
}
|
||||
|
||||
pFlow::particles::~particles()
|
||||
{
|
||||
// invalidates / unsobscribe from subscriber before its actual destruction
|
||||
addToSubscriber(nullptr, message::Empty());
|
||||
}
|
||||
|
||||
bool
|
||||
pFlow::particles::beforeIteration()
|
||||
{
|
||||
|
|
|
@ -98,6 +98,8 @@ public:
|
|||
|
||||
explicit particles(systemControl& control, const shape& shapes);
|
||||
|
||||
~particles() override;
|
||||
|
||||
inline const auto& dynPointStruct() const
|
||||
{
|
||||
return dynPointStruct_;
|
||||
|
|
|
@ -269,11 +269,19 @@ template<typename Type, typename... sProperties>
|
|||
INLINE_FUNCTION_H void
|
||||
getNth(Type& dst, const ViewType1D<Type, sProperties...>& src, const uint32 n)
|
||||
{
|
||||
using exeSpace = ViewType1D<Type, sProperties...>::execution_space;
|
||||
if constexpr(isHostAccessible<exeSpace>())
|
||||
{
|
||||
dst = src[n];
|
||||
}
|
||||
else
|
||||
{
|
||||
auto subV = Kokkos::subview(src, Kokkos::make_pair(n, n + 1));
|
||||
hostViewType1D<Type> dstView("getNth", 1);
|
||||
// hostViewTypeScalar
|
||||
Kokkos::deep_copy(dstView, subV);
|
||||
dst = *dstView.data();
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, typename... properties>
|
||||
|
|
Loading…
Reference in New Issue