35template <
typename FloatType, lbmpy::Arch Architecture>
39 std::vector<double>
out;
42 [&](
auto &
block,
auto const &
bci,
auto const &
ci,
45 out.resize(3u *
ci.numCells());
53 if (m_boundary->node_is_boundary(node)) {
54 auto const &
vec = m_boundary->get_node_value_at_boundary(node);
55 for (
uint_t f = 0
u; f < 3u; ++f) {
59 for (
uint_t f = 0
u; f < 3u; ++f) {
71template <
typename FloatType, lbmpy::Arch Architecture>
74 std::vector<double>
const &
velocity) {
75 m_pending_ghost_comm.set(GhostComm::PDF);
76 m_pending_ghost_comm.set(GhostComm::VEL);
79 [&](
auto &
block,
auto const &
bci,
auto const &
ci,
87 std::vector<FloatType>
values(3u *
bci.numCells());
92 for (
uint_t f = 0
u; f < 3u; ++f) {
104template <
typename FloatType, lbmpy::Arch Architecture>
109 std::vector<double>
out;
112 [&](
auto const &
block,
auto const &
bci,
auto const &
ci,
115 out.resize(3u *
ci.numCells());
123 for (
uint_t f = 0
u; f < 3u; ++f) {
130 zero_centered_to_md_in_place(
out);
134template <
typename FloatType, lbmpy::Arch Architecture>
137 std::vector<double>
const &force) {
138 m_pending_ghost_comm.set(GhostComm::VEL);
139 m_pending_ghost_comm.set(GhostComm::LAF);
142 [&](
auto &
block,
auto const &
bci,
auto const &
ci,
144 assert(force.size() == 3u *
ci.numCells());
150 std::vector<FloatType>
values(3u *
bci.numCells());
155 for (
uint_t f = 0
u; f < 3u; ++f) {
167template <
typename FloatType, lbmpy::Arch Architecture>
172 std::vector<double>
out;
175 [&](
auto const &
block,
auto const &
bci,
auto const &
ci,
178 out.resize(stencil_size() *
ci.numCells());
185 for (
uint_t f = 0
u; f < stencil_size(); ++f) {
196template <
typename FloatType, lbmpy::Arch Architecture>
202 [&](
auto &
block,
auto const &
bci,
auto const &
ci,
210 std::vector<FloatType>
values(stencil_size() *
bci.numCells());
215 for (
uint_t f = 0
u; f < stencil_size(); ++f) {
227template <
typename FloatType, lbmpy::Arch Architecture>
231 std::vector<double>
out;
234 [&](
auto const &
block,
auto const &
bci,
auto const &
ci,
237 out.resize(
ci.numCells());
253template <
typename FloatType, lbmpy::Arch Architecture>
256 std::vector<double>
const &
density) {
257 m_pending_ghost_comm.set(GhostComm::PDF);
260 [&](
auto &
block,
auto const &
bci,
auto const &
ci,
264 std::vector<FloatType>
values(
bci.numCells());
277template <
typename FloatType, lbmpy::Arch Architecture>
282 std::vector<double>
out;
285 [&](
auto const &
block,
auto const &
bci,
auto const &
ci,
288 out.resize(9u *
ci.numCells());
296 pressure_tensor_correction(
298 for (
uint_t f = 0
u; f < 9u; ++f) {
Vector implementation and trait types for boost qvm interoperability.
DEVICE_QUALIFIER constexpr size_type size() const noexcept
std::vector< double > get_slice_last_applied_force(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
void set_slice_velocity(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &velocity) override
std::vector< double > get_slice_population(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
std::vector< double > get_slice_velocity(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
std::vector< double > get_slice_density(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
std::vector< double > get_slice_pressure_tensor(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
void set_slice_density(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &density) override
void set_slice_last_applied_force(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &force) override
void set_slice_population(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &population) override
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
static double * block(double *p, std::size_t index, std::size_t size)
void set(GhostLayerField< double, uint_t{19u}> *pdf_field, double const rho_in, double const density, Cell const &cell)
double get(GhostLayerField< double, uint_t{19u}> const *pdf_field, double const density, Cell const &cell)
void set(GhostLayerField< double, uint_t{19u}> const *pdf_field, GhostLayerField< double, uint_t{3u}> *velocity_field, GhostLayerField< double, uint_t{3u}> *force_field, Vector3< double > const &force, double const density, Cell const &cell)
void set(GhostLayerField< double, uint_t{19u}> *pdf_field, std::array< double, 19u > const &pop, Cell const &cell)
auto get(GhostLayerField< double, uint_t{19u}> const *pdf_field, Cell const &cell)
auto get(GhostLayerField< double, uint_t{19u}> const *pdf_field, double const density, Cell const &cell)
auto get(GhostLayerField< double, uint_t{3u}> const *vec_field, Cell const &cell)
void set(GhostLayerField< double, uint_t{19u}> *pdf_field, GhostLayerField< double, uint_t{3u}> *velocity_field, GhostLayerField< double, uint_t{3u}> const *force_field, Vector3< double > const &u, Cell const &cell)
\file PackInfoPdfDoublePrecision.cpp \author pystencils
void copy_block_buffer(CellInterval const &bci, CellInterval const &ci, Utils::Vector3i const &block_offset, Utils::Vector3i const &lower_corner, auto &&kernel)
Synchronize data between a sliced block and a container.
void for_each_block_in_slice(::LatticeWalberla const &lattice, Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, auto &&visitor)
Iterate over all local blocks that overlap a given 3D slice, invoking a visitor for each such block.
static Utils::Vector3d velocity(Particle const &p_ref, Particle const &p_vs)
Velocity of the virtual site.