/*------------------------------- 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 __sphereFluidParticlesKernels_hpp__ #define __sphereFluidParticlesKernels_hpp__ namespace pFlow::sphereFluidParticlesKernels { using rpAcceleration = Kokkos::RangePolicy< DefaultExecutionSpace, Kokkos::Schedule, Kokkos::IndexType >; template void acceleration( realx3 g, deviceViewType1D mass, deviceViewType1D force, deviceViewType1D fluidForce, deviceViewType1D I, deviceViewType1D torque, deviceViewType1D fluidTorque, IncludeFunctionType incld, deviceViewType1D lAcc, deviceViewType1D rAcc ) { auto activeRange = incld.activeRange(); if(incld.allActive()) { Kokkos::parallel_for( "pFlow::sphereParticlesKernels::acceleration", rpAcceleration(activeRange.first, activeRange.second), LAMBDA_HD(int32 i){ lAcc[i] = (force[i]+fluidForce[i])/mass[i] + g; rAcc[i] = (torque[i]+fluidTorque[i])/I[i]; }); } else { Kokkos::parallel_for( "pFlow::sphereParticlesKernels::acceleration", rpAcceleration(activeRange.first, activeRange.second), LAMBDA_HD(int32 i){ if(incld(i)) { lAcc[i] = (force[i]+fluidForce[i])/mass[i] + g; rAcc[i] = (torque[i]+fluidTorque[i])/I[i]; } }); } Kokkos::fence(); } } #endif