34#ifndef GPU_DISTRIBUTION_HELPER_H
35#define GPU_DISTRIBUTION_HELPER_H
44#include <cuda_runtime.h>
58 for (
size_t i = 1;
i <= level;
i++) {
137 const bool isEvenTimestep)
182 return weight * (drho + c9o2 * velocity * velocity * (c1o1 + drho) -
cu_sq);
186 const real& omega,
const real& velocity,
const real weight)
190 return (c1o1-q) / (c1o1+q) * (f -
fInverse + (f +
fInverse - c2o1 *
feq * omega) / (c1o1 - omega)) * c1o2
191 + (q * (f +
fInverse) - c6o1 * weight * velocity) / (c1o1 + q);
198 return f - (c6o1 * weight * velocity);
206 return (c1o1-q) / (c1o1+q) * (f -
fInverse + (f +
fInverse - c2o1 *
feq * omega) / (c1o1 - omega)) * c1o2
207 + (q * (f +
fInverse)) / (c1o1 + q);
216 return (c1o1-q) / (c1o1+q) * (f -
fInverse + (f +
fInverse - c2o1 *
feq * omega) / (c1o1 - omega)) * c1o2
217 + (q * (f +
fInverse)) / (c1o1 + q) - weight * drho;
222 const real& velocity,
const real weight)
226 return (c1o1-q) / (c1o1+q) * (f -
fInverse + (f +
fInverse - c2o1 *
feq * omega) / (c1o1 - omega)) * c1o2
227 + (q * (f +
fInverse) - c6o1 * weight * velocity) / (c1o1 + q) - weight * drho;
239 const uint* neighborZ)
292template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::d000>()
const {
return k000(); }
293template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dP00>()
const {
return kP00(); }
294template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dM00>()
const {
return kM00(); }
295template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::d0P0>()
const {
return k0P0(); }
296template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::d0M0>()
const {
return k0M0(); }
297template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::d00P>()
const {
return k00P(); }
298template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::d00M>()
const {
return k00M(); }
299template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dPP0>()
const {
return kPP0(); }
300template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dMM0>()
const {
return kMM0(); }
301template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dPM0>()
const {
return kPM0(); }
302template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dMP0>()
const {
return kMP0(); }
303template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dP0P>()
const {
return kP0P(); }
304template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dM0M>()
const {
return kM0M(); }
305template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dP0M>()
const {
return kP0M(); }
306template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dM0P>()
const {
return kM0P(); }
307template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::d0PP>()
const {
return k0PP(); }
308template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::d0MM>()
const {
return k0MM(); }
309template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::d0PM>()
const {
return k0PM(); }
310template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::d0MP>()
const {
return k0MP(); }
311template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dPPP>()
const {
return kPPP(); }
312template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dMPP>()
const {
return kMPP(); }
313template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dPMP>()
const {
return kPMP(); }
314template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dMMP>()
const {
return kMMP(); }
315template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dPPM>()
const {
return kPPM(); }
316template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dMPM>()
const {
return kMPM(); }
317template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dPMM>()
const {
return kPMM(); }
318template <>
constexpr uint ListIndices::getIndex<vf::lbm::dir::dMMM>()
const {
return kMMM(); }
320template <
size_t direction>
324 const size_t inverseDir = vf::lbm::dir::inverseDir<direction>();
329template <
size_t direction>
333 const size_t inverseDir = vf::lbm::dir::inverseDir<direction>();
338template <
size_t direction>
346template <
size_t direction>
std::shared_ptr< T > SPtr
constexpr real getInterpolatedDistributionForNoSlipBC(const real &q, const real &f, const real &fInverse, const real &feq, const real &omega)
constexpr void getPostCollisionDistribution(real *local, const Distributions27 &global, const ListIndices &indices)
constexpr void writeInSameDirection(const real population, const ListIndices &listIndices, const Distributions27 &populationReferences)
constexpr void setPostCollisionDistribution(Distributions27 &global, const ListIndices &indices, const real *local)
constexpr real getEquilibriumForBC(const real &drho, const real &velocity, const real &cu_sq, const real weight)
constexpr void getPreCollisionDistribution(real *local, const Distributions27 &global, const ListIndices &indices)
constexpr void setPreCollisionDistribution(Distributions27 &global, const ListIndices &indices, const real *local)
constexpr real getInterpolatedDistributionForNoSlipWithPressureBC(const real &q, const real &f, const real &fInverse, const real &feq, const real &omega, const real &drho, const real weight)
real getForceFactor(size_t level)
constexpr void writeInInverseDirection(const real population, const ListIndices &listIndices, const Distributions27 &populationReferences)
constexpr void getPointersToSubgridDistances(SubgridDistances27 &subgridD, real *subgridDistances, const unsigned int numberOfSubgridIndices)
constexpr real getBounceBackDistributionForVeloBC(const real &f, const real &velocity, const real weight)
constexpr void getPointersToDistributions(Distributions27 &dist, real *distributionArray, const unsigned long long numberOfLBnodes, const bool isEvenTimestep)
constexpr real getInterpolatedDistributionForVeloBC(const real &q, const real &f, const real &fInverse, const real &feq, const real &omega, const real &velocity, const real weight)
constexpr bool isValidFluidNode(uint nodeType)
constexpr DistributionReferences27 getDistributionReferences27(real *distributions, const unsigned long long numberOfLBnodes, const bool isEvenTimestep)
constexpr real readFromSameDirection(const ListIndices &listIndices, const Distributions27 &populationReferences)
constexpr real readFromInverseDirection(const ListIndices &listIndices, const Distributions27 &populationReferences)
constexpr real getInterpolatedDistributionForVeloWithPressureBC(const real &q, const real &f, const real &fInverse, const real &feq, const real &omega, const real &drho, const real &velocity, const real weight)
constexpr uint kPM0() const
constexpr uint kMM0() const
constexpr uint kM0M() const
constexpr uint kMPP() const
constexpr uint k0M0() const
constexpr uint kPMP() const
constexpr uint kPPP() const
constexpr uint kPP0() const
constexpr uint kPMM() const
constexpr uint k00P() const
constexpr uint kP0P() const
constexpr uint kM00() const
constexpr uint k0MM() const
constexpr uint k0PP() const
constexpr uint k0MP() const
constexpr uint kM0P() const
constexpr uint k00M() const
constexpr ListIndices()=default
constexpr uint k000() const
constexpr ListIndices(uint index, const uint *neighborX, const uint *neighborY, const uint *neighborZ)
constexpr uint kMPM() const
constexpr uint kP0M() const
constexpr uint k0PM() const
constexpr uint kMMP() const
constexpr uint k0P0() const
constexpr uint kMP0() const
constexpr uint kPPM() const
constexpr uint kP00() const
constexpr uint kMMM() const
constexpr uint getIndex() const