29#include <blockforest/Initialization.h>
30#include <blockforest/StructuredBlockForest.h>
31#include <blockforest/communication/UniformBufferedScheme.h>
32#include <domain_decomposition/BlockDataID.h>
33#include <domain_decomposition/IBlock.h>
34#include <field/AddToStorage.h>
35#include <field/GhostLayerField.h>
36#include <field/communication/PackInfo.h>
37#include <field/vtk/FlagFieldCellFilter.h>
38#include <field/vtk/VTKWriter.h>
39#include <stencil/D3Q19.h>
40#include <stencil/D3Q27.h>
41#if defined(__CUDACC__)
42#include <gpu/AddGPUFieldToStorage.h>
43#include <gpu/HostFieldAllocator.h>
44#include <gpu/communication/MemcpyPackInfo.h>
45#include <gpu/communication/UniformGPUScheme.h>
48#include "../BoundaryHandling.hpp"
49#include "../BoundaryPackInfo.hpp"
50#include "../utils/boundary.hpp"
51#include "../utils/types_conversion.hpp"
55#if defined(__CUDACC__)
75#include <initializer_list>
90template <
typename FloatType, lbmpy::Arch Architecture>
94 typename detail::KernelTrait<FloatType,
97 typename detail::KernelTrait<FloatType,
105 typename detail::BoundaryHandlingTrait<
106 FloatType, Architecture>::DynamicUBB>;
108 std::variant<CollisionModelThermalized, CollisionModelLeesEdwards>;
119 template <
typename FT, lbmpy::Arch AT = lbmpy::Arch::CPU>
struct FieldTrait {
120 using PdfField = field::GhostLayerField<FT, Stencil::Size>;
122 template <
class Field>
123 using PackInfo = field::communication::PackInfo<Field>;
128 template <
class Stencil>
130 blockforest::communication::UniformBufferedScheme<Stencil>;
131 template <
class Stencil>
133 blockforest::communication::UniformBufferedScheme<Stencil>;
136#if defined(__CUDACC__)
140 template <
class Field>
141 using MemcpyPackInfo = gpu::communication::MemcpyPackInfo<Field>;
144 template <
typename Stencil>
145 class UniformGPUScheme
146 :
public gpu::communication::UniformGPUScheme<Stencil> {
148 explicit UniformGPUScheme(
auto const &bf)
149 : gpu::communication::UniformGPUScheme<Stencil>(
155 template <
class Field>
using PackInfo = MemcpyPackInfo<Field>;
160 template <
class Stencil>
162 template <
class Stencil>
164 blockforest::communication::UniformBufferedScheme<Stencil>;
176#if defined(__CUDACC__)
177 using GPUField = gpu::GPUField<FloatType>;
180 using VectorFieldCpu =
197 return numeric_cast<FloatType>(t);
201 return static_cast<std::size_t
>(Stencil::Size);
205 return std::is_same_v<FloatType, double>;
209 class CollideSweepVisitor {
214 cm.configure(m_storage, b);
219 cm.setV_s(
static_cast<decltype(cm.getV_s())
>(
220 m_lees_edwards_callbacks->get_shear_velocity()));
224 CollideSweepVisitor() =
default;
225 CollideSweepVisitor(std::shared_ptr<StructuredBlockStorage> storage) {
226 m_storage = std::move(storage);
228 CollideSweepVisitor(std::shared_ptr<StructuredBlockStorage> storage,
229 std::shared_ptr<LeesEdwardsPack> callbacks) {
230 m_storage = std::move(storage);
231 m_lees_edwards_callbacks = std::move(callbacks);
235 std::shared_ptr<StructuredBlockStorage> m_storage{};
236 std::shared_ptr<LeesEdwardsPack> m_lees_edwards_callbacks{};
238 CollideSweepVisitor m_run_collide_sweep{};
240 FloatType shear_mode_relaxation_rate()
const {
241 return FloatType{2} / (FloatType{6} *
m_viscosity + FloatType{1});
244 FloatType odd_mode_relaxation_rate(
245 FloatType shear_relaxation,
246 FloatType magic_number = FloatType{3} / FloatType{16})
const {
247 return (FloatType{4} - FloatType{2} * shear_relaxation) /
248 (FloatType{4} * magic_number * shear_relaxation + FloatType{2} -
252 void reset_boundary_handling(std::shared_ptr<BlockStorage>
const &blocks) {
257 FloatType pressure_tensor_correction_factor()
const {
261 void pressure_tensor_correction(Matrix3<FloatType> &tensor)
const {
262 auto const revert_factor = pressure_tensor_correction_factor();
263 for (
auto const i : {1u, 2u, 3u, 5u, 6u, 7u}) {
264 tensor[i] *= revert_factor;
268 void pressure_tensor_correction(std::span<FloatType, 9ul> tensor)
const {
269 auto const revert_factor = pressure_tensor_correction_factor();
270 for (
auto const i : {1u, 2u, 3u, 5u, 6u, 7u}) {
271 tensor[i] *= revert_factor;
275 class interpolation_illegal_access :
public std::runtime_error {
277 explicit interpolation_illegal_access(std::string
const &field,
279 std::array<int, 3>
const &node,
281 : std::runtime_error(
"Access to LB " + field +
" field failed") {
283 <<
"], weight " <<
weight <<
"\n";
290 std::string
const &reason)
291 : std::runtime_error(
"VTKOutput object '" + vtk_uid +
"' " + reason) {}
312#if defined(__CUDACC__)
313 std::optional<BlockDataID> m_pdf_cpu_field_id;
314 std::optional<BlockDataID> m_vel_cpu_field_id;
329 typename stencil::D3Q27>;
332 typename stencil::D3Q27>;
339 Architecture>::template RegularCommScheme<Stencil>;
340 template <
class Field>
361 std::shared_ptr<InterpolateAndShiftAtBoundary<_PdfField, FloatType>>
363 std::shared_ptr<InterpolateAndShiftAtBoundary<_VectorField, FloatType>>
365 std::shared_ptr<InterpolateAndShiftAtBoundary<_VectorField, FloatType>>
377#if defined(__CUDACC__)
378 std::shared_ptr<gpu::HostFieldAllocator<FloatType>> m_host_field_allocator;
381 [[nodiscard]] std::optional<CellInterval>
385 auto const &cell_min = lower_corner;
389 if (not lower_bc or not upper_bc) {
393 auto const block_extent =
395 auto const global_lower_cell = lower_bc->cell;
396 auto const global_upper_cell = upper_bc->cell +
to_cell(block_extent);
397 return {CellInterval(global_lower_cell, global_upper_cell)};
404 auto block_lower_corner =
m_lattice->get_block_corner(
block,
true);
405 if (not(upper_corner > block_lower_corner)) {
408 for (uint_t f = 0u; f < 3u; ++f) {
409 block_lower_corner[f] = std::max(block_lower_corner[f], lower_corner[f]);
411 auto block_upper_corner =
m_lattice->get_block_corner(
block,
false);
412 if (not(block_upper_corner > lower_corner)) {
415 for (uint_t f = 0u; f < 3u; ++f) {
416 block_upper_corner[f] = std::min(block_upper_corner[f], upper_corner[f]);
419 auto const block_lower_cell =
to_cell(block_lower_corner - block_offset);
420 auto const block_upper_cell =
to_cell(block_upper_corner - block_offset);
421 return {CellInterval(block_lower_cell, block_upper_cell)};
436 auto const &blocks =
m_lattice->get_blocks();
437 auto const n_ghost_layers =
m_lattice->get_ghost_layers();
439#ifdef ESPRESSO_BUILD_WITH_AVX_KERNELS
440#if defined(__AVX512F__)
441 constexpr uint_t alignment = 64u;
442#elif defined(__AVX__)
443 constexpr uint_t alignment = 32u;
444#elif defined(__SSE__)
445 constexpr uint_t alignment = 16u;
447#error "Unsupported arch, check walberla src/field/allocation/FieldAllocator.h"
449 using value_type =
typename Field::value_type;
450 using Allocator = field::AllocateAligned<value_type, alignment>;
451 auto const allocator = std::make_shared<Allocator>();
452 auto const empty_set = Set<SUID>::emptySet();
453 return field::addToStorage<Field>(
454 blocks, tag, field::internal::defaultSize, FloatType{0}, field::fzyx,
455 n_ghost_layers,
false, {}, empty_set, empty_set, allocator);
457 return field::addToStorage<Field>(blocks, tag, FloatType{0}, field::fzyx,
461#if defined(__CUDACC__)
463 auto field_id = gpu::addGPUFieldToStorage<GPUField>(
464 blocks, tag, Field::F_SIZE, field::fzyx, n_ghost_layers);
465 if constexpr (std::is_same_v<Field, _VectorField>) {
467 auto field =
block->template getData<GPUField>(field_id);
470 }
else if constexpr (std::is_same_v<Field, _PdfField>) {
472 auto field =
block->template getData<GPUField>(field_id);
474 field, std::array<FloatType, Stencil::Size>{});
483 auto const setup = [
this]<
typename PackInfoPdf,
typename PackInfoVec>() {
484 auto const &blocks =
m_lattice->get_blocks();
486 std::make_shared<PDFStreamingCommunicator>(blocks);
498 setup.template operator()<PackInfoPdf, PackInfoVec>();
508 auto const &blocks =
m_lattice->get_blocks();
509 auto const n_ghost_layers =
m_lattice->get_ghost_layers();
510 if (n_ghost_layers == 0u)
511 throw std::runtime_error(
"At least one ghost layer must be used");
520#if defined(__CUDACC__)
521 m_host_field_allocator =
522 std::make_shared<gpu::HostFieldAllocator<FloatType>>();
529 for (
auto &
block : *blocks) {
535 blocks,
"flag field", n_ghost_layers);
537 reset_boundary_handling(
m_lattice->get_blocks());
561 std::make_shared<BoundaryFullCommunicator>(blocks);
563 std::make_shared<field::communication::PackInfo<FlagField>>(
565 auto boundary_packinfo = std::make_shared<
575 m_reset_force = std::make_shared<ResetForce<PdfField, VectorField>>(
582 m_stream = std::make_shared<StreamSweep>(
587 void integrate_stream(std::shared_ptr<BlockStorage>
const &blocks) {
588 for (
auto &
block : *blocks)
592 void integrate_collide(std::shared_ptr<BlockStorage>
const &blocks) {
594 for (
auto &
block : *blocks) {
595 auto const block_variant = std::variant<IBlock *>(&
block);
596 std::visit(m_run_collide_sweep, cm_variant, block_variant);
598 if (
auto *cm = std::get_if<CollisionModelThermalized>(&cm_variant)) {
599 cm->setTime_step(cm->getTime_step() + 1u);
603 auto has_lees_edwards_bc()
const {
604 return std::holds_alternative<CollisionModelLeesEdwards>(
608 void apply_lees_edwards_pdf_interpolation(
609 std::shared_ptr<BlockStorage>
const &blocks) {
610 for (
auto &
block : *blocks)
614 void apply_lees_edwards_vel_interpolation_and_shift(
615 std::shared_ptr<BlockStorage>
const &blocks) {
616 for (
auto &
block : *blocks)
620 void apply_lees_edwards_last_applied_force_interpolation(
621 std::shared_ptr<BlockStorage>
const &blocks) {
622 for (
auto &
block : *blocks)
626 void integrate_reset_force(std::shared_ptr<BlockStorage>
const &blocks) {
627 for (
auto &
block : *blocks)
631 void integrate_boundaries(std::shared_ptr<BlockStorage>
const &blocks) {
632 for (
auto &
block : *blocks)
636 void integrate_push_scheme() {
639 integrate_reset_force(blocks);
641 integrate_collide(blocks);
645 integrate_boundaries(blocks);
648 integrate_stream(blocks);
657 void integrate_pull_scheme() {
661 integrate_boundaries(blocks);
664 integrate_stream(blocks);
666 integrate_collide(blocks);
668 integrate_reset_force(blocks);
680 auto &vtk_handle = it.second;
681 if (vtk_handle->enabled) {
682 vtk::writeFiles(vtk_handle->ptr)();
683 vtk_handle->execution_count++;
690 if (has_lees_edwards_bc()) {
691 integrate_pull_scheme();
693 integrate_push_scheme();
709 if (has_lees_edwards_bc()) {
711 apply_lees_edwards_pdf_interpolation(blocks);
720 if (has_lees_edwards_bc()) {
722 apply_lees_edwards_vel_interpolation_and_shift(blocks);
731 if (has_lees_edwards_bc()) {
733 apply_lees_edwards_last_applied_force_interpolation(blocks);
748 if (has_lees_edwards_bc()) {
750 apply_lees_edwards_pdf_interpolation(blocks);
751 apply_lees_edwards_vel_interpolation_and_shift(blocks);
752 apply_lees_edwards_last_applied_force_interpolation(blocks);
760 if (has_lees_edwards_bc()) {
763 apply_lees_edwards_pdf_interpolation(blocks);
764 apply_lees_edwards_vel_interpolation_and_shift(blocks);
765 apply_lees_edwards_last_applied_force_interpolation(blocks);
773 auto const omega = shear_mode_relaxation_rate();
774 auto const omega_odd = odd_mode_relaxation_rate(omega);
780 omega_odd, omega, seed, uint32_t{0u});
782 m_run_collide_sweep = CollideSweepVisitor(blocks);
787 std::unique_ptr<LeesEdwardsPack> &&lees_edwards_pack)
override {
789#if defined(__CUDACC__)
791 throw std::runtime_error(
"Lees-Edwards LB doesn't support GPU yet");
794 auto const shear_direction = lees_edwards_pack->shear_direction;
795 auto const shear_plane_normal = lees_edwards_pack->shear_plane_normal;
796 auto const shear_vel =
FloatType_c(lees_edwards_pack->get_shear_velocity());
797 auto const omega = shear_mode_relaxation_rate();
798 if (shear_plane_normal != 1u) {
799 throw std::domain_error(
800 "Lees-Edwards LB only supports shear_plane_normal=\"y\"");
803 auto const n_ghost_layers = lattice.get_ghost_layers();
804 auto const blocks = lattice.get_blocks();
805 if (lattice.get_node_grid()[shear_direction] != 1 or
806 lattice.get_node_grid()[shear_plane_normal] != 1 or
807 blocks->getSize(shear_direction) != 1ul or
808 blocks->getSize(shear_plane_normal) != 1ul) {
809 throw std::domain_error(
"LB LEbc doesn't support domain decomposition "
810 "along the shear and normal directions.");
813 FloatType_c(lattice.get_grid_dimensions()[shear_plane_normal]);
820 std::make_shared<InterpolateAndShiftAtBoundary<_PdfField, FloatType>>(
822 shear_direction, shear_plane_normal,
827 shear_direction, shear_plane_normal,
833 n_ghost_layers, shear_direction, shear_plane_normal,
839 unsigned int shear_plane_normal)
const override {
843 throw std::runtime_error(
844 "MD and LB Lees-Edwards boundary conditions disagree");
862 std::optional<Utils::Vector3d>
864 bool consider_ghosts =
false)
const override {
869 if (is_boundary and *is_boundary) {
877 auto field = bc->block->template uncheckedFastGetData<VectorField>(
892 auto pdf_field = bc->block->template getData<PdfField>(
m_pdf_field_id);
897 auto const vel = to_vector3<FloatType>(v);
918 template <
typename Kernel>
922 Kernel &&kernel)
const {
923 auto const local_grid =
to_vector3i(ci.max() - ci.min() +
Cell(1, 1, 1));
924 auto const block_grid =
to_vector3i(bci.max() - bci.min() +
Cell(1, 1, 1));
925 auto const lower_cell = bci.min();
926 auto const upper_cell = bci.max();
931 for (
auto x = lower_cell.x(), i = 0; x <= upper_cell.x(); ++x, ++i) {
932 for (
auto y = lower_cell.y(), j = 0; y <= upper_cell.y(); ++y, ++j) {
933 for (
auto z = lower_cell.z(), k = 0; z <= upper_cell.z(); ++z, ++k) {
939 kernel(
static_cast<unsigned>(block_index),
940 static_cast<unsigned>(local_index), node);
949 std::vector<double> out;
950 uint_t values_size = 0;
951 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
952 out = std::vector<double>(3u * ci->numCells());
954 for (
auto &
block : *lattice.get_blocks()) {
955 auto const block_offset = lattice.get_block_corner(
block,
true);
957 block_offset,
block)) {
961 assert(values.size() == 3u * bci->numCells());
962 values_size += 3u * bci->numCells();
964 auto kernel = [&values, &out,
this](
unsigned const block_index,
965 unsigned const local_index,
968 auto const &vec =
m_boundary->get_node_value_at_boundary(node);
969 for (uint_t f = 0u; f < 3u; ++f) {
970 out[3u * local_index + f] = double_c(vec[f]);
973 for (uint_t f = 0u; f < 3u; ++f) {
974 out[3u * local_index + f] =
975 double_c(values[3u * block_index + f]);
983 assert(values_size == 3u * ci->numCells());
990 std::vector<double>
const &
velocity)
override {
993 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
996 for (
auto &
block : *lattice.get_blocks()) {
997 auto const block_offset = lattice.get_block_corner(
block,
true);
999 block_offset,
block)) {
1001 auto force_field =
block.template getData<VectorField>(
1005 std::vector<FloatType> values(3u * bci->numCells());
1007 auto kernel = [&values, &
velocity](
unsigned const block_index,
1008 unsigned const local_index,
1010 for (uint_t f = 0u; f < 3u; ++f) {
1011 values[3u * block_index + f] =
1012 numeric_cast<FloatType>(
velocity[3u * local_index + f]);
1024 [[nodiscard]]
bool is_gpu() const noexcept
override {
1029 std::vector<Utils::Vector3d>
const &forces)
override {
1030 assert(pos.size() == forces.size());
1035 for (std::size_t i = 0ul; i < pos.size(); ++i) {
1039#if defined(__CUDACC__)
1042 auto const &
block = *(lattice.get_blocks()->begin());
1043 auto const origin =
block.getAABB().min();
1044 std::vector<FloatType> host_pos;
1045 std::vector<FloatType> host_force;
1046 host_pos.reserve(3ul * pos.size());
1047 host_force.reserve(3ul * forces.size());
1048 assert(lattice.get_blocks()->getNumberOfBlocks() == 1u);
1049 for (
auto const &vec : pos) {
1051 for (std::size_t i : {0ul, 1ul, 2ul}) {
1052 host_pos.emplace_back(
static_cast<FloatType
>(vec[i] - origin[i]));
1055 for (
auto const &vec : forces) {
1057 for (std::size_t i : {0ul, 1ul, 2ul}) {
1058 host_force.emplace_back(
static_cast<FloatType
>(vec[i]));
1061 auto const gl = lattice.get_ghost_layers();
1062 auto field =
block.template uncheckedFastGetData<VectorField>(
1069 std::vector<Utils::Vector3d>
1074 std::vector<Utils::Vector3d> vel{};
1076 vel.reserve(pos.size());
1077 for (
auto const &vec : pos) {
1079 assert(res.has_value());
1080 vel.emplace_back(*res);
1083#if defined(__CUDACC__)
1086 auto const &
block = *(lattice.get_blocks()->begin());
1087 auto const origin =
block.getAABB().min();
1088 std::vector<FloatType> host_pos;
1089 host_pos.reserve(3ul * pos.size());
1090 assert(lattice.get_blocks()->getNumberOfBlocks() == 1u);
1091 for (
auto const &vec : pos) {
1093 for (std::size_t i : {0ul, 1ul, 2ul}) {
1094 host_pos.emplace_back(
static_cast<FloatType
>(vec[i] - origin[i]));
1097 auto const gl = lattice.get_ghost_layers();
1101 vel.reserve(res.size() / 3ul);
1102 for (
auto it = res.begin(); it != res.end(); it += 3) {
1104 static_cast<double>(*(it + 1)),
1105 static_cast<double>(*(it + 2))});
1112 std::optional<Utils::Vector3d>
1114 bool consider_points_in_halo =
false)
const override {
1117 if (!consider_points_in_halo and !
m_lattice->pos_in_local_domain(pos))
1118 return std::nullopt;
1119 if (consider_points_in_halo and !
m_lattice->pos_in_local_halo(pos))
1120 return std::nullopt;
1123 pos, [
this, &v, &pos](std::array<int, 3>
const node,
double weight) {
1129 throw interpolation_illegal_access(
"velocity", pos, node,
weight);
1134 return {std::move(v)};
1137 std::optional<double>
1139 bool consider_points_in_halo =
false)
const override {
1141 if (!consider_points_in_halo and !
m_lattice->pos_in_local_domain(pos))
1142 return std::nullopt;
1143 if (consider_points_in_halo and !
m_lattice->pos_in_local_halo(pos))
1144 return std::nullopt;
1147 pos, [
this, &dens, &pos](std::array<int, 3>
const node,
double weight) {
1153 throw interpolation_illegal_access(
"density", pos, node,
weight);
1158 return {std::move(dens)};
1166 auto const force_at_node = [
this, &force](std::array<int, 3>
const node,
1174 auto const weighted_force = to_vector3<FloatType>(
weight * force);
1176 bc->block->template uncheckedFastGetData<VectorField>(
1185 std::optional<Utils::Vector3d>
1189 return std::nullopt;
1197 std::optional<Utils::Vector3d>
1199 bool consider_ghosts =
false)
const override {
1203 return std::nullopt;
1219 auto pdf_field = bc->block->template getData<PdfField>(
m_pdf_field_id);
1224 auto const vec = to_vector3<FloatType>(force);
1233 std::vector<double> out;
1234 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
1235 out = std::vector<double>(3u * ci->numCells());
1237 for (
auto const &
block : *lattice.get_blocks()) {
1238 auto const block_offset = lattice.get_block_corner(
block,
true);
1240 block_offset,
block)) {
1241 auto const field =
block.template getData<VectorField>(
1244 assert(values.size() == 3u * bci->numCells());
1246 auto kernel = [&values, &out](
unsigned const block_index,
1247 unsigned const local_index,
1249 for (uint_t f = 0u; f < 3u; ++f) {
1250 out[3u * local_index + f] = values[3u * block_index + f];
1263 std::vector<double>
const &force)
override {
1266 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
1267 assert(force.size() == 3u * ci->numCells());
1269 for (
auto &
block : *lattice.get_blocks()) {
1270 auto const block_offset = lattice.get_block_corner(
block,
true);
1272 block_offset,
block)) {
1274 auto force_field =
block.template getData<VectorField>(
1278 std::vector<FloatType> values(3u * bci->numCells());
1280 auto kernel = [&values, &force](
unsigned const block_index,
1281 unsigned const local_index,
1283 for (uint_t f = 0u; f < 3u; ++f) {
1284 values[3u * block_index + f] =
1285 numeric_cast<FloatType>(force[3u * local_index + f]);
1298 std::optional<std::vector<double>>
1300 bool consider_ghosts =
false)
const override {
1304 return std::nullopt;
1306 auto pdf_field = bc->block->template getData<PdfField>(
m_pdf_field_id);
1308 std::vector<double> population(Stencil::Size);
1309 for (uint_t f = 0u; f < Stencil::Size; ++f) {
1310 population[f] = double_c(pop[f]);
1313 return {std::move(population)};
1317 std::vector<double>
const &population)
override {
1324 auto pdf_field = bc->block->template getData<PdfField>(
m_pdf_field_id);
1329 std::array<FloatType, Stencil::Size> pop;
1330 for (uint_t f = 0u; f < Stencil::Size; ++f) {
1342 std::vector<double> out;
1343 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
1344 out = std::vector<double>(
stencil_size() * ci->numCells());
1346 for (
auto const &
block : *lattice.get_blocks()) {
1347 auto const block_offset = lattice.get_block_corner(
block,
true);
1349 block_offset,
block)) {
1350 auto const pdf_field =
1353 assert(values.size() ==
stencil_size() * bci->numCells());
1355 auto kernel = [&values, &out,
this](
unsigned const block_index,
1356 unsigned const local_index,
1373 std::vector<double>
const &population)
override {
1374 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
1375 assert(population.size() ==
stencil_size() * ci->numCells());
1377 for (
auto &
block : *lattice.get_blocks()) {
1378 auto const block_offset = lattice.get_block_corner(
block,
true);
1380 block_offset,
block)) {
1382 auto force_field =
block.template getData<VectorField>(
1386 std::vector<FloatType> values(
stencil_size() * bci->numCells());
1388 auto kernel = [&values, &population,
1389 this](
unsigned const block_index,
1390 unsigned const local_index,
1394 numeric_cast<FloatType>(
1408 std::optional<double>
1410 bool consider_ghosts =
false)
const override {
1414 return std::nullopt;
1417 bc->block->template uncheckedFastGetData<PdfField>(
m_pdf_field_id);
1428 auto pdf_field = bc->block->template getData<PdfField>(
m_pdf_field_id);
1437 std::vector<double> out;
1438 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
1439 out = std::vector<double>(ci->numCells());
1441 for (
auto const &
block : *lattice.get_blocks()) {
1442 auto const block_offset = lattice.get_block_corner(
block,
true);
1444 block_offset,
block)) {
1445 auto const pdf_field =
1448 assert(values.size() == bci->numCells());
1450 auto kernel = [&values, &out](
unsigned const block_index,
1451 unsigned const local_index,
1453 out[local_index] = values[block_index];
1465 std::vector<double>
const &
density)
override {
1467 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
1468 assert(
density.size() == ci->numCells());
1470 for (
auto &
block : *lattice.get_blocks()) {
1471 auto const block_offset = lattice.get_block_corner(
block,
true);
1473 block_offset,
block)) {
1475 std::vector<FloatType> values(bci->numCells());
1477 auto kernel = [&values, &
density](
unsigned const block_index,
1478 unsigned const local_index,
1480 values[block_index] = numeric_cast<FloatType>(
density[local_index]);
1490 std::optional<Utils::Vector3d>
1492 bool consider_ghosts =
false)
const override {
1495 if (!bc or !
m_boundary->node_is_boundary(node))
1496 return std::nullopt;
1511 node, to_vector3<FloatType>(
velocity), *bc);
1513 return bc.has_value();
1519 std::vector<std::optional<Utils::Vector3d>> out;
1520 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
1521 out = std::vector<std::optional<Utils::Vector3d>>(ci->numCells());
1523 for (
auto const &
block : *lattice.get_blocks()) {
1524 auto const block_offset = lattice.get_block_corner(
block,
true);
1526 block_offset,
block)) {
1528 auto kernel = [&out,
this](
unsigned const,
unsigned const local_index,
1534 out[local_index] = std::nullopt;
1541 assert(out.size() == ci->numCells());
1548 std::vector<std::optional<Utils::Vector3d>>
const &
velocity)
override {
1551 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
1554 for (
auto &
block : *lattice.get_blocks()) {
1555 auto const block_offset = lattice.get_block_corner(
block,
true);
1557 block_offset,
block)) {
1560 this](
unsigned const,
unsigned const local_index,
1563 assert(bc->block->getAABB() ==
block.getAABB());
1564 auto const &opt =
velocity[local_index];
1567 node, to_vector3<FloatType>(*opt), *bc);
1569 m_boundary->remove_node_from_boundary(node, *bc);
1579 std::optional<Utils::Vector3d>
1582 if (!bc or !
m_boundary->node_is_boundary(node))
1583 return std::nullopt;
1594 m_boundary->remove_node_from_boundary(node, *bc);
1596 return bc.has_value();
1601 bool consider_ghosts =
false)
const override {
1605 return std::nullopt;
1613 std::vector<bool> out;
1614 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
1615 out = std::vector<bool>(ci->numCells());
1617 for (
auto const &
block : *lattice.get_blocks()) {
1618 auto const block_offset = lattice.get_block_corner(
block,
true);
1620 block_offset,
block)) {
1622 auto kernel = [&out,
this](
unsigned const,
unsigned const local_index,
1624 out[local_index] =
m_boundary->node_is_boundary(node);
1630 assert(out.size() == ci->numCells());
1646 reset_boundary_handling(
get_lattice().get_blocks());
1655 std::vector<double>
const &data_flat)
override {
1666 std::optional<Utils::VectorXd<9>>
1670 return std::nullopt;
1672 auto pdf_field = bc->block->template getData<PdfField>(
m_pdf_field_id);
1674 pressure_tensor_correction(tensor);
1682 std::vector<double> out;
1683 if (
auto const ci =
get_interval(lower_corner, upper_corner)) {
1684 out = std::vector<double>(9u * ci->numCells());
1686 for (
auto const &
block : *lattice.get_blocks()) {
1687 auto const block_offset = lattice.get_block_corner(
block,
true);
1689 block_offset,
block)) {
1690 auto const pdf_field =
1693 assert(values.size() == 9u * bci->numCells());
1695 auto kernel = [&values, &out,
this](
unsigned const block_index,
1696 unsigned const local_index,
1698 pressure_tensor_correction(
1699 std::span<FloatType, 9ul>(&values[9u * block_index], 9ul));
1700 for (uint_t f = 0u; f < 9u; ++f) {
1701 out[9u * local_index + f] = values[9u * block_index + f];
1714 Matrix3<FloatType> tensor(FloatType{0});
1721 pressure_tensor_correction(tensor);
1722 return to_vector9d(tensor) * (1. /
static_cast<double>(number_of_nodes));
1727 Vector3<FloatType> mom(FloatType{0});
1746 [[nodiscard]]
double get_kT() const noexcept
override {
1747 return numeric_cast<double>(
m_kT);
1750 [[nodiscard]]
unsigned int get_seed() const noexcept
override {
1756 if (!cm or
m_kT == 0.) {
1757 return std::nullopt;
1759 return {
static_cast<uint64_t
>(cm->getTime_step())};
1764 if (!cm or
m_kT == 0.) {
1765 throw std::runtime_error(
"This LB instance is unthermalized");
1768 static_cast<uint32_t
>(std::numeric_limits<uint_t>::max()));
1769 cm->setTime_step(
static_cast<uint32_t
>(counter));
1787 vtk_obj.addCellExclusionFilter(fluid_filter);
1791 template <
typename Field_T, u
int_t F_SIZE_ARG,
typename OutputType>
1792 class VTKWriter :
public vtk::BlockCellDataWriter<OutputType, F_SIZE_ARG> {
1794 VTKWriter(ConstBlockDataID
const &block_id, std::string
const &
id,
1795 FloatType unit_conversion)
1796 : vtk::BlockCellDataWriter<OutputType, F_SIZE_ARG>(id),
1802 WALBERLA_ASSERT_NOT_NULLPTR(this->block_);
1811 template <
typename OutputType =
float>
1816 using Base::evaluate;
1819 OutputType
evaluate(cell_idx_t
const x, cell_idx_t
const y,
1820 cell_idx_t
const z, cell_idx_t
const)
override {
1821 WALBERLA_ASSERT_NOT_NULLPTR(this->
m_field);
1828 template <
typename OutputType =
float>
1833 using Base::evaluate;
1836 OutputType
evaluate(cell_idx_t
const x, cell_idx_t
const y,
1837 cell_idx_t
const z, cell_idx_t
const f)
override {
1838 WALBERLA_ASSERT_NOT_NULLPTR(this->
m_field);
1845 template <
typename OutputType =
float>
1850 using Base::evaluate;
1853 std::string
const &
id, FloatType unit_conversion,
1854 FloatType off_diag_factor)
1855 :
Base(block_id, id, unit_conversion),
1859 OutputType
evaluate(cell_idx_t
const x, cell_idx_t
const y,
1860 cell_idx_t
const z, cell_idx_t
const f)
override {
1861 WALBERLA_ASSERT_NOT_NULLPTR(this->
m_field);
1862 auto const pressure =
1864 auto const revert_factor =
1866 return numeric_cast<OutputType>(this->
m_conversion * revert_factor *
1867 pressure[uint_c(f)]);
1875 int flag_observables)
override {
1876#if defined(__CUDACC__)
1877 auto const allocate_cpu_field_if_empty =
1878 [&]<
typename Field>(
auto const &blocks, std::string name,
1879 std::optional<BlockDataID> &cpu_field) {
1880 if (not cpu_field) {
1881 cpu_field = field::addToStorage<Field>(
1882 blocks, name, FloatType{0}, field::fzyx,
1883 m_lattice->get_ghost_layers(), m_host_field_allocator);
1888 auto const unit_conversion =
FloatType_c(units.at(
"density"));
1889#if defined(__CUDACC__)
1891 auto const &blocks =
m_lattice->get_blocks();
1892 allocate_cpu_field_if_empty.template operator()<PdfFieldCpu>(
1893 blocks,
"pdfs_cpu", m_pdf_cpu_field_id);
1894 vtk_obj.addBeforeFunction(gpu::fieldCpyFunctor<PdfFieldCpu, PdfField>(
1902 auto const unit_conversion =
FloatType_c(units.at(
"velocity"));
1903#if defined(__CUDACC__)
1905 auto const &blocks =
m_lattice->get_blocks();
1906 allocate_cpu_field_if_empty.template operator()<VectorFieldCpu>(
1907 blocks,
"vel_cpu", m_vel_cpu_field_id);
1908 vtk_obj.addBeforeFunction(
1909 gpu::fieldCpyFunctor<VectorFieldCpu, VectorField>(
1917 auto const unit_conversion =
FloatType_c(units.at(
"pressure"));
1918#if defined(__CUDACC__)
1920 auto const &blocks =
m_lattice->get_blocks();
1921 allocate_cpu_field_if_empty.template operator()<PdfFieldCpu>(
1922 blocks,
"pdfs_cpu", m_pdf_cpu_field_id);
1923 vtk_obj.addBeforeFunction(gpu::fieldCpyFunctor<PdfFieldCpu, PdfField>(
1927 vtk_obj.addCellDataWriter(
1930 pressure_tensor_correction_factor()));
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
static DEVICE_QUALIFIER constexpr Vector< T, N > broadcast(typename Base::value_type const &value) noexcept
Create a vector that has all entries set to the same value.
Boundary class optimized for sparse data.
field::FlagField< uint8_t > FlagField
OutputType evaluate(cell_idx_t const x, cell_idx_t const y, cell_idx_t const z, cell_idx_t const) override
OutputType evaluate(cell_idx_t const x, cell_idx_t const y, cell_idx_t const z, cell_idx_t const f) override
FloatType const m_off_diag_factor
PressureTensorVTKWriter(ConstBlockDataID const &block_id, std::string const &id, FloatType unit_conversion, FloatType off_diag_factor)
void configure() override
VTKWriter(ConstBlockDataID const &block_id, std::string const &id, FloatType unit_conversion)
FloatType const m_conversion
ConstBlockDataID const m_block_id
OutputType evaluate(cell_idx_t const x, cell_idx_t const y, cell_idx_t const z, cell_idx_t const f) override
Class that runs and controls the LB on waLBerla.
void add_forces_at_pos(std::vector< Utils::Vector3d > const &pos, std::vector< Utils::Vector3d > const &forces) override
typename FieldTrait< FloatType, Architecture >::template RegularCommScheme< typename stencil::D3Q27 > RegularFullCommunicator
Full communicator.
std::vector< double > get_slice_last_applied_force(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const override
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
void copy_block_buffer(CellInterval const &bci, CellInterval const &ci, Utils::Vector3i const &block_offset, Utils::Vector3i const &lower_corner, Kernel &&kernel) const
Synchronize data between a sliced block and a container.
std::optional< Utils::Vector3d > get_node_velocity(Utils::Vector3i const &node, bool consider_ghosts=false) const override
void reallocate_ubb_field() override
std::shared_ptr< RegularFullCommunicator > m_full_communicator
BlockDataID m_pdf_tmp_field_id
typename detail::KernelTrait< FloatType, Architecture >::CollisionModelLeesEdwards CollisionModelLeesEdwards
std::size_t get_force_field_id() const noexcept override
BlockDataID m_pdf_field_id
std::shared_ptr< CollisionModel > m_collision_model
typename FieldTrait< FloatType, Architecture >::VectorField VectorField
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
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
BlockDataID m_vel_tmp_field_id
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
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::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
void update_boundary_from_shape(std::vector< int > const &raster_flat, std::vector< double > const &data_flat) override
std::shared_ptr< BoundaryModel > m_boundary
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
std::variant< CollisionModelThermalized, CollisionModelLeesEdwards > CollisionModel
std::vector< Utils::Vector3d > get_velocities_at_pos(std::vector< Utils::Vector3d > const &pos) override
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()
BlockDataID m_flag_field_id
std::shared_ptr< StreamSweep > m_stream
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
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()
typename detail::KernelTrait< FloatType, Architecture >::InitialPDFsSetter InitialPDFsSetter
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
typename BoundaryModel::FlagField FlagField
std::optional< double > get_node_density(Utils::Vector3i const &node, bool consider_ghosts=false) const override
void check_lebc(unsigned int shear_direction, unsigned int shear_plane_normal) const override
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
typename FieldTrait< FloatType >::PdfField _PdfField
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
std::size_t get_velocity_field_id() const noexcept override
Utils::VectorXd< 9 > get_pressure_tensor() const override
std::optional< CellInterval > get_block_interval(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, Utils::Vector3i const &block_offset, IBlock const &block) const
std::shared_ptr< InterpolateAndShiftAtBoundary< _PdfField, FloatType > > m_lees_edwards_pdf_interpol_sweep
void set_external_force(Utils::Vector3d const &ext_force) override
std::optional< Utils::Vector3d > get_velocity_at_pos(Utils::Vector3d const &pos, bool consider_points_in_halo=false) const override
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.
void set_collision_model(std::unique_ptr< LeesEdwardsPack > &&lees_edwards_pack) override
std::shared_ptr< RegularFullCommunicator > m_vel_communicator
typename FieldTrait< FloatType, Architecture >::template BoundaryCommScheme< typename stencil::D3Q27 > BoundaryFullCommunicator
std::bitset< GhostComm::SIZE > m_pending_ghost_comm
typename FieldTrait< FloatType, Architecture >::template RegularCommScheme< Stencil > PDFStreamingCommunicator
Regular communicator.
LatticeWalberla const & get_lattice() const noexcept override
void set_slice_population(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &population) override
typename FieldTrait< FloatType, Architecture >::template PackInfo< Field > PackInfo
double get_density() const noexcept override
typename detail::KernelTrait< FloatType, Architecture >::CollisionModelThermalized CollisionModelThermalized
typename FieldTrait< FloatType, Architecture >::PdfField PdfField
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
typename FieldTrait< FloatType >::VectorField _VectorField
bool set_node_velocity(Utils::Vector3i const &node, Utils::Vector3d const &v) override
void clear_boundaries() override
std::optional< CellInterval > get_interval(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const
bool set_node_population(Utils::Vector3i const &node, std::vector< double > const &population) override
bool is_gpu() const noexcept override
void ghost_communication_push_scheme()
std::shared_ptr< PDFStreamingCommunicator > m_pdf_streaming_communicator
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
typename detail::KernelTrait< FloatType, Architecture >::StreamSweep StreamSweep
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 weight(int type, double r_cut, double k, double r)
static double * block(double *p, std::size_t index, std::size_t size)
T product(Vector< T, N > const &v)
int get_linear_index(int a, int b, int c, const Vector3i &adim, MemoryOrder memory_order=MemoryOrder::COLUMN_MAJOR)
get the linear index from the position (a,b,c) in a 3D grid of dimensions adim.
void set(GhostLayerField< double, uint_t{19u}> *pdf_field, double const rho_in, Cell const &cell)
double get(GhostLayerField< double, uint_t{19u}> const *pdf_field, 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, Cell const &cell)
std::vector< double > get(gpu::GPUField< double > const *vec_field, std::vector< double > const &pos, uint gl)
void set(gpu::GPUField< double > const *vec_field, std::vector< double > const &pos, std::vector< double > const &forces, uint gl)
auto reduce(GhostLayerField< double, uint_t{19u}> const *pdf_field, GhostLayerField< double, uint_t{3u}> const *force_field)
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 get(GhostLayerField< double, uint_t{19u}> const *pdf_field, Cell const &cell)
auto reduce(GhostLayerField< double, uint_t{19u}> const *pdf_field)
void initialize(GhostLayerField< double, uint_t{3u}> *vec_field, Vector3< double > const &vec)
void add(GhostLayerField< double, uint_t{3u}> *vec_field, Vector3< double > const &vec, 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
std::optional< BlockAndCell > get_block_and_cell(::LatticeWalberla const &lattice, Utils::Vector3i const &node, bool consider_ghost_layers)
auto to_vector3d(Vector3< T > const &v) noexcept
void interpolate_bspline_at_pos(Utils::Vector3d const &pos, Function const &f)
void set_boundary_from_grid(BoundaryModel &boundary, LatticeWalberla const &lattice, std::vector< int > const &raster_flat, std::vector< DataType > const &data_flat)
auto get_min_corner(IBlock const &block)
Get the block-local coordinates of the lower corner of a block.
Cell to_cell(Utils::Vector3i const &xyz)
Utils::Vector3i to_vector3i(Vector3< int > const &v) noexcept
auto to_vector9d(Matrix3< T > const &m) noexcept
std::vector< Utils::Vector3d > fill_3D_vector_array(std::vector< double > const &vec_flat, Utils::Vector3i const &grid_size)
static Utils::Vector3d velocity(Particle const &p_ref, Particle const &p_vs)
Velocity of the virtual site.
DEVICE_QUALIFIER constexpr size_type size() const noexcept
typename detail::KernelTrait< FT, AT >::PackInfoVec PackInfoStreamingVec
typename detail::KernelTrait< FT, AT >::PackInfoPdf PackInfoStreamingPdf
field::GhostLayerField< FT, uint_t{3u}> VectorField
field::communication::PackInfo< Field > PackInfo
field::GhostLayerField< FT, Stencil::Size > PdfField
blockforest::communication::UniformBufferedScheme< Stencil > RegularCommScheme
blockforest::communication::UniformBufferedScheme< Stencil > BoundaryCommScheme
GhostCommFlags
Ghost communication operations.
@ VEL
velocities communication
@ LAF
last applied forces communication
@ UBB
boundaries communication