29#include <blockforest/Initialization.h>
30#include <blockforest/StructuredBlockForest.h>
31#include <domain_decomposition/BlockDataID.h>
32#include <domain_decomposition/IBlock.h>
33#include <field/AddToStorage.h>
34#include <field/vtk/FlagFieldCellFilter.h>
35#include <field/vtk/VTKWriter.h>
36#include <stencil/D3Q19.h>
37#include <stencil/D3Q27.h>
38#include <waLBerlaDefinitions.h>
39#if defined(__CUDACC__) and defined(WALBERLA_BUILD_WITH_CUDA)
40#include <gpu/AddGPUFieldToStorage.h>
51#if defined(__CUDACC__) and defined(WALBERLA_BUILD_WITH_CUDA)
71#include <initializer_list>
86template <
typename FloatType, lbmpy::Arch Architecture>
88#if not defined(WALBERLA_BUILD_WITH_CUDA)
90 "waLBerla was compiled without CUDA support");
95 using Kernels = detail::KernelTrait<FloatType, Architecture>;
97 typename Kernels::DynamicUBB>;
99 std::variant<
typename Kernels::StreamCollisionModelThermalized,
100 typename Kernels::StreamCollisionModelLeesEdwards>;
119#if defined(__CUDACC__) and defined(WALBERLA_BUILD_WITH_CUDA)
120 using GPUField = gpu::GPUField<FloatType>;
143 Architecture>::template RegularCommScheme<stencil::D3Q27>;
146 Architecture>::template BoundaryCommScheme<stencil::D3Q27>;
153 Architecture>::template RegularCommScheme<Stencil>;
154 template <
class Field>
207 std::shared_ptr<typename Kernels::UpdateVelFromPDF>
212 std::shared_ptr<InterpolateAndShiftAtBoundary<_PdfField, FloatType>>
214 std::shared_ptr<InterpolateAndShiftAtBoundary<_VectorField, FloatType>>
216 std::shared_ptr<InterpolateAndShiftAtBoundary<_VectorField, FloatType>>
221 return numeric_cast<FloatType>(t);
225 return static_cast<std::size_t
>(Stencil::Size);
229 return std::is_same_v<FloatType, double>;
232 [[nodiscard]]
bool is_gpu() const noexcept
override {
244 auto const &blocks =
m_lattice->get_blocks();
245 auto const n_ghost_layers =
m_lattice->get_ghost_layers();
246 if (n_ghost_layers == 0u)
247 throw std::runtime_error(
"At least one ghost layer must be used");
258 auto pdf_setter =
typename Kernels::InitialPDFsSetter(
260 for (
auto &
block : *blocks) {
266 blocks,
"flag field", n_ghost_layers);
278 m_reset_force = std::make_shared<ResetForce<PdfField, VectorField>>(
283 std::make_shared<typename Kernels::UpdateVelFromPDF>(
292 integrate_pull_scheme();
298 for (
auto const &vtk_handle :
m_vtk_auto | std::views::values) {
299 if (vtk_handle->enabled) {
300 vtk::writeFiles(vtk_handle->ptr)();
301 vtk_handle->execution_count++;
313 void integrate_pull_scheme() {
317 integrate_reset_force(blocks);
319 integrate_stream_collide(blocks);
325 if (has_lees_edwards_bc()) {
326 apply_lees_edwards_pdf_interpolation(blocks);
327 apply_lees_edwards_last_applied_force_interpolation(blocks);
331 integrate_boundaries(blocks);
334 integrate_update_velocities_from_pdf(blocks);
336 if (has_lees_edwards_bc()) {
337 apply_lees_edwards_vel_interpolation_and_shift(blocks);
341 void integrate_stream_collide(std::shared_ptr<BlockStorage>
const &blocks) {
343 for (
auto &
block : *blocks) {
344 auto const block_variant = std::variant<IBlock *>(&
block);
345 std::visit(m_run_stream_collide_sweep, cm_variant, block_variant);
348 std::get_if<typename Kernels::StreamCollisionModelThermalized>(
350 cm->setTime_step(cm->getTime_step() + 1u);
354 void integrate_reset_force(std::shared_ptr<BlockStorage>
const &blocks) {
355 for (
auto &
block : *blocks)
356 (*m_reset_force)(&
block);
359 void integrate_boundaries(std::shared_ptr<BlockStorage>
const &blocks) {
360 for (
auto &
block : *blocks)
361 (*m_boundary)(&
block);
375 void integrate_boundaries_in_ghost_layer(
376 std::shared_ptr<BlockStorage>
const &blocks) {
377 std::vector<std::vector<FloatType>> local_pdfs;
378 for (
auto &
block : *blocks) {
380 local_pdfs.emplace_back(
383 integrate_boundaries(blocks);
384 auto local_pdfs_it = local_pdfs.cbegin();
385 for (
auto &
block : *blocks) {
388 pdf_field->xyzSize());
393 void integrate_update_velocities_from_pdf(
394 std::shared_ptr<BlockStorage>
const &blocks) {
395 for (
auto &
block : *blocks)
396 (*m_update_velocities_from_pdf)(&
block);
407 class StreamCollideSweepVisitor {
411 void operator()(
typename Kernels::StreamCollisionModelThermalized &cm,
413 cm.configure(m_storage, b);
417 void operator()(
typename Kernels::StreamCollisionModelLeesEdwards &cm,
419 cm.setV_s(
static_cast<decltype(cm.getV_s())
>(
420 m_lees_edwards_callbacks->get_shear_velocity()));
424 StreamCollideSweepVisitor() =
default;
425 StreamCollideSweepVisitor(std::shared_ptr<StructuredBlockStorage> storage) {
426 m_storage = std::move(storage);
428 StreamCollideSweepVisitor(std::shared_ptr<StructuredBlockStorage> storage,
429 std::shared_ptr<LeesEdwardsPack> callbacks) {
430 m_storage = std::move(storage);
431 m_lees_edwards_callbacks = std::move(callbacks);
435 std::shared_ptr<StructuredBlockStorage> m_storage{};
436 std::shared_ptr<LeesEdwardsPack> m_lees_edwards_callbacks{};
438 StreamCollideSweepVisitor m_run_stream_collide_sweep{};
441 FloatType shear_mode_relaxation_rate()
const;
447 FloatType odd_mode_relaxation_rate(
448 FloatType shear_relaxation,
449 FloatType magic_number = FloatType{3} / FloatType{16})
const;
454 std::unique_ptr<LeesEdwardsPack> &&lees_edwards_pack)
override;
456 unsigned int shear_plane_normal)
const override;
480 if (has_lees_edwards_bc()) {
482 apply_lees_edwards_pdf_interpolation(blocks);
492 if (has_lees_edwards_bc()) {
494 apply_lees_edwards_vel_interpolation_and_shift(blocks);
504 if (has_lees_edwards_bc()) {
506 apply_lees_edwards_last_applied_force_interpolation(blocks);
532 integrate_boundaries_in_ghost_layer(blocks);
534 integrate_update_velocities_from_pdf(blocks);
543 if (has_lees_edwards_bc()) {
554 auto has_lees_edwards_bc()
const {
555 return std::holds_alternative<
556 typename Kernels::StreamCollisionModelLeesEdwards>(*m_collision_model);
559 void apply_lees_edwards_pdf_interpolation(
560 std::shared_ptr<BlockStorage>
const &blocks) {
561 for (
auto &
block : *blocks)
562 (*m_lees_edwards_pdf_interpol_sweep)(&
block);
565 void apply_lees_edwards_vel_interpolation_and_shift(
566 std::shared_ptr<BlockStorage>
const &blocks) {
567 for (
auto &
block : *blocks)
568 (*m_lees_edwards_vel_interpol_sweep)(&
block);
571 void apply_lees_edwards_last_applied_force_interpolation(
572 std::shared_ptr<BlockStorage>
const &blocks) {
573 for (
auto &
block : *blocks)
574 (*m_lees_edwards_last_applied_force_interpol_sweep)(&
block);
580 apply_lees_edwards_pdf_interpolation(blocks);
581 apply_lees_edwards_vel_interpolation_and_shift(blocks);
582 apply_lees_edwards_last_applied_force_interpolation(blocks);
589 std::optional<Utils::Vector3d>
591 bool consider_ghosts =
false)
const override;
599 std::vector<double>
const &
velocity)
override;
602 std::optional<double>
604 bool consider_ghosts =
false)
const override;
611 std::vector<double>
const &
density)
override;
614 std::optional<std::vector<double>>
616 bool consider_ghosts =
false)
const override;
618 std::vector<double>
const &population)
override;
624 std::vector<double>
const &population)
override;
627 std::optional<Utils::Vector3d>
629 std::optional<Utils::Vector3d>
631 bool consider_ghosts =
false)
const override;
639 std::vector<double>
const &force)
override;
642 std::optional<Utils::VectorXd<9>>
652 auto make_force_interpolation_kernel()
const;
654 auto make_velocity_interpolation_kernel()
const;
656 auto make_density_interpolation_kernel()
const;
664 std::vector<Utils::Vector3d>
const &forces)
override;
665 std::optional<Utils::Vector3d>
667 bool consider_points_in_halo =
false)
const override;
668 std::vector<Utils::Vector3d>
670 std::optional<double>
672 bool consider_points_in_halo =
false)
const override;
680 auto const [lc, uc] =
m_lattice->get_local_grid_range(
true);
691 std::vector<double>
const &data_flat)
override;
692 std::optional<Utils::Vector3d>
694 bool consider_ghosts =
false)
const override;
702 std::vector<std::optional<Utils::Vector3d>>
const &
velocity)
override;
703 std::optional<Utils::Vector3d>
708 bool consider_ghosts =
false)
const override;
713 std::vector<int>
const &raster_flat)
const override;
726 Matrix3<FloatType> tensor(FloatType{0});
734 return to_vector9d(tensor) * (1. /
static_cast<double>(number_of_nodes));
739 Vector3<FloatType> mom(FloatType{0});
771 [[nodiscard]]
double get_kT() const noexcept
override {
772 return static_cast<double>(
m_kT);
775 [[nodiscard]]
unsigned int get_seed() const noexcept
override {
781 std::get_if<typename Kernels::StreamCollisionModelThermalized>(
783 if (!cm or
m_kT == 0.) {
786 return {
static_cast<uint64_t
>(cm->getTime_step())};
791 std::get_if<typename Kernels::StreamCollisionModelThermalized>(
793 if (!cm or
m_kT == 0.) {
794 throw std::runtime_error(
"This LB instance is unthermalized");
797 static_cast<uint32_t
>(std::numeric_limits<uint_t>::max()));
798 cm->setTime_step(
static_cast<uint32_t
>(counter));
824 for (
auto const i : {1u, 2u, 3u, 5u, 6u, 7u}) {
825 tensor[i] *= revert_factor;
831 for (
auto const i : {1u, 2u, 3u, 5u, 6u, 7u}) {
832 tensor[i] *= revert_factor;
844 template <
typename T>
846 if constexpr (std::is_arithmetic_v<T>) {
847 static_assert(std::is_floating_point_v<T>);
848 data *=
static_cast<T
>(factor);
850 auto const coef =
static_cast<typename T::value_type
>(factor);
851 std::transform(std::begin(data), std::end(data), std::begin(data),
852 [coef](
auto value) {
return value * coef; });
865 auto transformed_data = data;
867 return transformed_data;
871 auto transformed_data = data;
873 return transformed_data;
882 vtk_obj.addCellExclusionFilter(fluid_filter);
887 int flag_observables)
override;
904 auto const &blocks =
m_lattice->get_blocks();
905 auto const n_ghost_layers =
m_lattice->get_ghost_layers();
906#if defined(__CUDACC__) and defined(WALBERLA_BUILD_WITH_CUDA)
908 auto field_id = gpu::addGPUFieldToStorage<GPUField>(
909 blocks, tag, Field::F_SIZE, field::fzyx, n_ghost_layers);
910 if constexpr (std::is_same_v<Field, _VectorField>) {
911 for (
auto &
block : *blocks) {
912 auto field =
block.template getData<GPUField>(field_id);
915 }
else if constexpr (std::is_same_v<Field, _PdfField>) {
916 for (
auto &
block : *blocks) {
917 auto field =
block.template getData<GPUField>(field_id);
919 field, std::array<FloatType, Stencil::Size>{});
926#ifdef ESPRESSO_BUILD_WITH_AVX_KERNELS
927 constexpr auto alignment = field::SIMDAlignment();
928 using value_type = Field::value_type;
929 using Allocator = field::AllocateAligned<value_type, alignment>;
930 auto const allocator = std::make_shared<Allocator>();
931 auto const empty_set = Set<SUID>::emptySet();
932 return field::addToStorage<Field>(
933 blocks, tag, field::internal::defaultSize, FloatType{0}, field::fzyx,
934 n_ghost_layers,
false, {}, empty_set, empty_set, allocator);
936 return field::addToStorage<Field>(blocks, tag, FloatType{0}, field::fzyx,
948 auto const &blocks =
m_lattice->get_blocks();
969 std::make_shared<BoundaryFullCommunicator>(blocks);
973 auto boundary_packinfo = std::make_shared<
987 auto const setup = [
this]<
typename PackInfoPdf,
typename PackInfoVec>() {
988 auto const &blocks =
m_lattice->get_blocks();
990 std::make_shared<PDFStreamingCommunicator>(blocks);
1002 setup.template operator()<PackInfoPdf, PackInfoVec>();
Out-of-class boundary access definitions for walberla::LBWalberlaImpl.
Out-of-class collision model setup definitions for walberla::LBWalberlaImpl.
Out-of-class position-based interpolation definitions for walberla::LBWalberlaImpl.
Out-of-class node access definitions for walberla::LBWalberlaImpl.
Out-of-class slice access definitions for walberla::LBWalberlaImpl.
Out-of-class VTK writer registration definition for walberla::LBWalberlaImpl.
LBWalberlaBase provides the public interface of the LB waLBerla bridge.
Vector implementation and trait types for boost qvm interoperability.
Interface of a lattice-based fluid model.
std::map< std::string, std::shared_ptr< VTKHandle > > m_vtk_auto
VTK writers that are executed automatically.
std::unordered_map< std::string, double > units_map
Class that runs and controls the BlockForest in waLBerla.
auto const & get_grid_dimensions() const
walberla::blockforest::StructuredBlockForest Lattice_T
Boundary class optimized for sparse data.
field::FlagField< uint8_t > FlagField
void add_forces_at_pos(std::vector< Utils::Vector3d > const &pos, std::vector< Utils::Vector3d > const &forces) override
Distribute forces to the lattice at given positions.
std::shared_ptr< typename Kernels::UpdateVelFromPDF > m_update_velocities_from_pdf
std::vector< double > get_slice_last_applied_force(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
void zero_centered_transform_impl(T &data, auto const factor) const
Scale data by a conversion factor (in-place).
void reset_boundary_handling(std::shared_ptr< BlockStorage > const &blocks)
FieldTrait< FloatType, Stencil, Architecture >::template RegularCommScheme< Stencil > PDFStreamingCommunicator
Regular communicator.
std::shared_ptr< RegularFullCommunicator > m_pdf_communicator
std::vector< std::optional< Utils::Vector3d > > get_slice_velocity_at_boundary(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
std::optional< Utils::Vector3d > get_node_last_applied_force(Utils::Vector3i const &node, bool consider_ghosts=false) const override
stencil::D3Q19 Stencil
Stencil for collision and streaming operations.
std::optional< Utils::Vector3d > get_node_velocity_at_boundary(Utils::Vector3i const &node, bool consider_ghosts=false) const override
void ghost_communication() override
Perform all pending ghost layer updates.
void pressure_tensor_correction(Matrix3< FloatType > &tensor) const
std::optional< Utils::Vector3d > get_node_velocity(Utils::Vector3i const &node, bool consider_ghosts=false) const override
void reallocate_ubb_field() override
Utils::Vector3d get_boundary_force_from_shape(std::vector< int > const &raster_flat) const override
Total force exerted by the fluid on a subset of boundary nodes.
std::shared_ptr< RegularFullCommunicator > m_full_communicator
BlockDataID m_pdf_tmp_field_id
std::size_t get_force_field_id() const noexcept override
BlockDataID m_pdf_field_id
std::shared_ptr< CollisionModel > m_collision_model
void set_slice_velocity(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &velocity) override
unsigned int get_seed() const noexcept override
void integrate_vtk_writers() override
void pressure_tensor_correction(std::span< FloatType, 9ul > tensor) const
BoundaryModel::FlagField FlagField
bool remove_node_from_boundary(Utils::Vector3i const &node) override
std::optional< Utils::Vector3d > get_node_boundary_force(Utils::Vector3i const &node) const override
std::optional< double > get_density_at_pos(Utils::Vector3d const &pos, bool consider_points_in_halo=false) const override
void zero_centered_to_md_in_place(auto &data) const
BlockDataID m_vel_tmp_field_id
FieldTrait< FloatType, Stencil >::VectorField _VectorField
void set_slice_velocity_at_boundary(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< std::optional< Utils::Vector3d > > const &velocity) override
std::vector< double > get_slice_population(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
void set_rng_state(uint64_t counter) override
std::vector< double > get_slice_velocity(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
Utils::Vector3d get_boundary_force() const override
std::shared_ptr< LatticeWalberla > m_lattice
std::shared_ptr< LeesEdwardsPack > m_lees_edwards_callbacks
LBWalberlaImpl(std::shared_ptr< LatticeWalberla > lattice, double viscosity, double density)
bool set_node_last_applied_force(Utils::Vector3i const &node, Utils::Vector3d const &force) override
std::function< bool(Utils::Vector3d const &)> make_lattice_position_checker(bool consider_points_in_halo) const override
FieldTrait< FloatType, Stencil >::PdfField _PdfField
std::shared_ptr< InterpolateAndShiftAtBoundary< _VectorField, FloatType > > m_lees_edwards_vel_interpol_sweep
std::vector< bool > get_slice_is_boundary(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
bool is_double_precision() const noexcept override
FieldTrait< FloatType, Stencil, Architecture >::template PackInfo< Field > PackInfo
void update_boundary_from_shape(std::vector< int > const &raster_flat, std::vector< double > const &data_flat) override
Set boundary conditions from a rasterized shape.
std::shared_ptr< BoundaryModel > m_boundary
FieldTrait< FloatType, Stencil, Architecture >::PdfField PdfField
std::vector< double > get_slice_pressure_tensor(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
bool set_node_density(Utils::Vector3i const &node, double density) override
void set_collision_model(double kT, unsigned int seed) override
Set up the thermalized collision model.
std::vector< Utils::Vector3d > get_velocities_at_pos(std::vector< Utils::Vector3d > const &pos) override
Interpolate velocities at given positions (batch version).
void ghost_communication_laf() override
std::optional< bool > get_node_is_boundary(Utils::Vector3i const &node, bool consider_ghosts=false) const override
BlockDataID m_velocity_field_id
std::shared_ptr< ResetForce< PdfField, VectorField > > m_reset_force
void setup_streaming_communicator()
Set up the communicator used during integration.
BlockDataID m_flag_field_id
FlagUID const Boundary_flag
Flag for boundary cells.
~LBWalberlaImpl() override=default
std::optional< uint64_t > get_rng_state() const override
std::optional< std::vector< double > > get_node_population(Utils::Vector3i const &node, bool consider_ghosts=false) const override
FloatType m_density
kinematic viscosity
double get_viscosity() const noexcept override
double get_kT() const noexcept override
Utils::Vector3d get_momentum() const override
void set_viscosity(double viscosity) override
void on_boundary_add()
Lazily enable boundary mode on first boundary addition.
std::shared_ptr< BoundaryFullCommunicator > m_boundary_communicator
std::size_t stencil_size() const noexcept override
auto add_to_storage(std::string const tag)
Convenience function to add a field with a custom allocator.
void ghost_communication_full()
Communicate all fields at once using the D3Q27 stencil.
auto zero_centered_to_lb(auto const &data) const
bool set_node_velocity_at_boundary(Utils::Vector3i const &node, Utils::Vector3d const &velocity) override
stencil::D3Q27 StencilFull
Stencil for ghost communication (includes domain corners).
void register_vtk_field_writers(walberla::vtk::VTKOutput &vtk_obj, LatticeModel::units_map const &units, int flag_observables) override
std::optional< double > get_node_density(Utils::Vector3i const &node, bool consider_ghosts=false) const override
std::variant< typename Kernels::StreamCollisionModelThermalized, typename Kernels::StreamCollisionModelLeesEdwards > CollisionModel
void check_lebc(unsigned int shear_direction, unsigned int shear_plane_normal) const override
Verify that MD and LB Lees-Edwards parameters are consistent.
void set_slice_density(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &density) override
void ghost_communication_vel() override
Utils::Vector3d get_external_force() const noexcept override
BlockDataID m_force_to_be_applied_id
FloatType FloatType_c(T t) const
std::shared_ptr< RegularFullCommunicator > m_laf_communicator
void apply_lees_edwards_interpolation()
std::size_t get_velocity_field_id() const noexcept override
Utils::VectorXd< 9 > get_pressure_tensor() const override
ResourceObserver m_mpi_cart_comm_observer
std::shared_ptr< InterpolateAndShiftAtBoundary< _PdfField, FloatType > > m_lees_edwards_pdf_interpol_sweep
FieldTrait< FloatType, Stencil, Architecture >::template BoundaryCommScheme< stencil::D3Q27 > BoundaryFullCommunicator
void set_external_force(Utils::Vector3d const &ext_force) override
void setup_full_communicator()
Set up D3Q27 communicators for full ghost layer updates.
std::optional< Utils::Vector3d > get_velocity_at_pos(Utils::Vector3d const &pos, bool consider_points_in_halo=false) const override
FieldTrait< FloatType, Stencil, Architecture >::VectorField VectorField
void set_slice_last_applied_force(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &force) override
LatticeWalberla::Lattice_T BlockStorage
Lattice model (e.g.
std::shared_ptr< RegularFullCommunicator > m_vel_communicator
std::bitset< GhostComm::SIZE > m_pending_ghost_comm
LatticeWalberla const & get_lattice() const noexcept override
auto zero_centered_to_md(auto const &data) const
void set_slice_population(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &population) override
double get_density() const noexcept override
void ghost_communication_pdf() override
void register_vtk_field_filters(walberla::vtk::VTKOutput &vtk_obj) override
std::optional< Utils::Vector3d > get_node_force_to_be_applied(Utils::Vector3i const &node) const override
std::vector< double > get_densities_at_pos(std::vector< Utils::Vector3d > const &pos) override
void zero_centered_to_lb_in_place(auto &data) const
bool set_node_velocity(Utils::Vector3i const &node, Utils::Vector3d const &v) override
void clear_boundaries() override
FieldTrait< FloatType, Stencil, Architecture >::template RegularCommScheme< stencil::D3Q27 > RegularFullCommunicator
Full communicator.
bool set_node_population(Utils::Vector3i const &node, std::vector< double > const &population) override
BoundaryHandling< FloatType, Vector3< FloatType >, typename Kernels::DynamicUBB > BoundaryModel
bool is_gpu() const noexcept override
FloatType pressure_tensor_correction_factor() const
Correction factor for off-diagonal pressure tensor elements.
std::shared_ptr< PDFStreamingCommunicator > m_pdf_streaming_communicator
detail::KernelTrait< FloatType, Architecture > Kernels
BlockDataID m_last_applied_force_field_id
void integrate() override
std::optional< Utils::VectorXd< 9 > > get_node_pressure_tensor(Utils::Vector3i const &node) const override
std::shared_ptr< InterpolateAndShiftAtBoundary< _VectorField, FloatType > > m_lees_edwards_last_applied_force_interpol_sweep
void update_derived_fields() override
Recompute the fields that the LB step derives from the PDFs.
void ghost_communication_boundary()
bool add_force_at_pos(Utils::Vector3d const &pos, Utils::Vector3d const &force) override
void setup_boundary_handle(std::shared_ptr< LatticeWalberla > lattice, std::shared_ptr< Boundary_T > boundary)
static double * block(double *p, std::size_t index, std::size_t size)
T product(Vector< T, N > const &v)
Vector< double, N > VectorXd
auto reduce(GhostLayerField< double, uint_t{19u}> const *pdf_field, GhostLayerField< double, uint_t{3u}> const *force_field, double const density)
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)
void initialize(GhostLayerField< double, uint_t{19u}> *pdf_field, std::array< double, 19u > const &pop)
auto reduce(GhostLayerField< double, uint_t{19u}> const *pdf_field, double const density)
void initialize(GhostLayerField< double, uint_t{3u}> *vec_field, Vector3< double > const &vec)
\file PackInfoPdfDoublePrecision.cpp \author pystencils
auto to_vector3d(Vector3< T > const &v) noexcept
Cell to_cell(signed_integral_vector auto const &xyz)
ResourceObserver get_mpi_cart_comm_observer()
Get an observer on waLBerla's MPI Cartesian communicator status.
auto to_vector9d(Matrix3< T > const &m) noexcept
static Utils::Vector3d velocity(Particle const &p_ref, Particle const &p_vs)
Velocity of the virtual site.
Observer to monitor the lifetime of a shared resource.
detail::KernelTrait< FT, AT >::PackInfoVec PackInfoStreamingVec
field::GhostLayerField< FT, PdfStencil::Size > PdfField
field::GhostLayerField< FT, uint_t{3u}> VectorField
detail::KernelTrait< FT, AT >::PackInfoPdf PackInfoStreamingPdf
GhostCommFlags
Ghost communication operations.
@ VEL
velocities communication
@ LAF
last applied forces communication
@ UBB
boundaries communication