diff --git a/src/Particles/SphereParticles/sphereParticles/sphereParticles.cpp b/src/Particles/SphereParticles/sphereParticles/sphereParticles.cpp index cfa0ea80..f1d71012 100644 --- a/src/Particles/SphereParticles/sphereParticles/sphereParticles.cpp +++ b/src/Particles/SphereParticles/sphereParticles/sphereParticles.cpp @@ -380,10 +380,13 @@ bool pFlow::sphereParticles::insertParticles return false; } - auto exclusionListAllPtr = getFieldObjectList(); + + auto exclusionListAllPtr = getFieldObjectList(); + auto newInsertedPtr = pStruct().insertPoints( position, setField, time(), exclusionListAllPtr()); + if(!newInsertedPtr) { fatalErrorInFunction<< diff --git a/src/phasicFlow/containers/VectorHD/VectorSingle.hpp b/src/phasicFlow/containers/VectorHD/VectorSingle.hpp index e0d14127..8dafeeb7 100644 --- a/src/phasicFlow/containers/VectorHD/VectorSingle.hpp +++ b/src/phasicFlow/containers/VectorHD/VectorSingle.hpp @@ -544,18 +544,21 @@ public: resize(maxInd+1); } - if constexpr (isHostAccessible_) - { - fillSelected(deviceVectorAll(), indices.hostView(), indices.size(), val); - return true; - }else - { - fillSelected(deviceVectorAll(), indices.deviceView(), indices.size(), val); - return true; - } + using policy = Kokkos::RangePolicy< + execution_space, + Kokkos::IndexType >; + auto dVec = deviceVectorAll(); + auto dIndex = indices.deviceView(); + + Kokkos::parallel_for( + "insertSetElement", + policy(0,indices.size()), LAMBDA_HD(int32 i){ + dVec(dIndex(i))= val; + }); + Kokkos::fence(); - return false; + return true; } INLINE_FUNCTION_H @@ -597,13 +600,11 @@ public: bool insertSetElement(const int32IndexContainer& indices, const Vector& vals) { - //Info<<"start of insertSetElement vecotsingle"<empty() || maxInd > size()-1 ) { resize(maxInd+1); diff --git a/src/phasicFlow/setFieldList/setFieldEntryTemplates.cpp b/src/phasicFlow/setFieldList/setFieldEntryTemplates.cpp index 32e63e96..db9e4f28 100644 --- a/src/phasicFlow/setFieldList/setFieldEntryTemplates.cpp +++ b/src/phasicFlow/setFieldList/setFieldEntryTemplates.cpp @@ -158,6 +158,7 @@ void* pFlow::setFieldEntry::setPointFieldSelected if( pointField::TYPENAME() == fieldTypeName ) { + auto& field = owner.lookupObject>(fName); if(field.insertSetElement(selected, value)) return &field; diff --git a/src/phasicFlow/structuredData/pointStructure/pointStructure.cpp b/src/phasicFlow/structuredData/pointStructure/pointStructure.cpp index f3f38e5b..8dd2494e 100644 --- a/src/phasicFlow/structuredData/pointStructure/pointStructure.cpp +++ b/src/phasicFlow/structuredData/pointStructure/pointStructure.cpp @@ -373,17 +373,19 @@ pFlow::uniquePtr pFlow::pointStructure::insertPoints tobeInsertedIndex_ = newPointsPtr(); // set the position of new points - + if(!pointPosition_.insertSetElement( newPointsPtr(), pos) )return nullptr; + if(!pointFlag_.insertSetElement( newPointsPtr(), static_cast(PointFlag::ACTIVE)) )return nullptr; + setNumMaxPoints(); auto minInd = newPointsPtr().min(); auto maxInd = newPointsPtr().max(); @@ -393,6 +395,7 @@ pFlow::uniquePtr pFlow::pointStructure::insertPoints for(auto sfEntry:setField) { + if(void* fieldPtr = sfEntry.setPointFieldSelectedAll( owner,