From 80647e510323952bacc847f580bbcaee50ca5807 Mon Sep 17 00:00:00 2001 From: hamidrezanorouzi Date: Thu, 16 Mar 2023 21:22:24 +0330 Subject: [PATCH] bug fix for cudaRun in indexContainer --- DEMSystems/sphereDEMSystem/sphereDEMSystem.cpp | 2 ++ DEMSystems/sphereDEMSystem/sphereFluidParticles.cpp | 5 +++-- .../sphereParticles/sphereParticles.cpp | 12 ++++++++---- .../containers/indexContainer/indexContainer.hpp | 5 +++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/DEMSystems/sphereDEMSystem/sphereDEMSystem.cpp b/DEMSystems/sphereDEMSystem/sphereDEMSystem.cpp index a4e17394..37f7529f 100644 --- a/DEMSystems/sphereDEMSystem/sphereDEMSystem.cpp +++ b/DEMSystems/sphereDEMSystem/sphereDEMSystem.cpp @@ -75,9 +75,11 @@ pFlow::sphereDEMSystem::sphereDEMSystem( REPORT(0)<< "\nCreating surface geometry for sphereDEMSystem . . . "<(Control(), Property()); + insertion_ = makeUnique( Control().caseSetup().path()+insertionFile__, particles_(), diff --git a/DEMSystems/sphereDEMSystem/sphereFluidParticles.cpp b/DEMSystems/sphereDEMSystem/sphereFluidParticles.cpp index 839bfdc3..9b3a44b0 100644 --- a/DEMSystems/sphereDEMSystem/sphereFluidParticles.cpp +++ b/DEMSystems/sphereDEMSystem/sphereFluidParticles.cpp @@ -56,8 +56,9 @@ pFlow::sphereFluidParticles::sphereFluidParticles( bool pFlow::sphereFluidParticles::beforeIteration() { - return sphereParticles::beforeIteration(); - + sphereParticles::beforeIteration(); + zeroFluidForce_H(); + zeroFluidTorque_H(); return true; } diff --git a/src/Particles/SphereParticles/sphereParticles/sphereParticles.cpp b/src/Particles/SphereParticles/sphereParticles/sphereParticles.cpp index 6191a22e..f4908782 100644 --- a/src/Particles/SphereParticles/sphereParticles/sphereParticles.cpp +++ b/src/Particles/SphereParticles/sphereParticles/sphereParticles.cpp @@ -72,8 +72,11 @@ bool pFlow::sphereParticles::diameterMassInertiaPropId bool pFlow::sphereParticles::initializeParticles() { - - int32IndexContainer indices(0, shapeName_.size()); + + int32IndexContainer indices( + 0, + static_cast(shapeName_.size())); + return insertSphereParticles(shapeName_, indices); } @@ -148,7 +151,7 @@ bool pFlow::sphereParticles::insertSphereParticles( } auto len = names.size(); - + realVector diamVec(len, RESERVE()); realVector massVec(len, RESERVE()); realVector IVec(len, RESERVE()); @@ -160,6 +163,7 @@ bool pFlow::sphereParticles::insertSphereParticles( ForAll(i, names ) { + if (diameterMassInertiaPropId(names[i], d, m, I, pId)) { diamVec.push_back(d); @@ -297,7 +301,6 @@ pFlow::sphereParticles::sphereParticles( fatalExit; } - if(rVelIntegration_->needSetInitialVals()) { @@ -320,6 +323,7 @@ pFlow::sphereParticles::sphereParticles( } + if(!initializeParticles()) { fatalExit; diff --git a/src/phasicFlow/containers/indexContainer/indexContainer.hpp b/src/phasicFlow/containers/indexContainer/indexContainer.hpp index ddb3ccb8..14e88726 100644 --- a/src/phasicFlow/containers/indexContainer/indexContainer.hpp +++ b/src/phasicFlow/containers/indexContainer/indexContainer.hpp @@ -26,6 +26,7 @@ Licence: #include "KokkosUtilities.hpp" #include "ViewAlgorithms.hpp" + namespace pFlow { @@ -79,8 +80,8 @@ public: size_(end-begin), views_("indexContainer", size_) { - pFlow::fillSequence(views_.d_view, 0, size_, min_); - copy(views_.h_view, views_.d_view); + pFlow::fillSequence(views_.h_view, 0, size_, min_); + copy(views_.d_view, views_.h_view); }