70 void unpackData(IBlock *receiver, stencil::Direction dir,
71 mpi::RecvBuffer &buffer)
override {
73 auto *flag_field = receiver->getData<GhostLayerField_T>(bdId_);
74 WALBERLA_ASSERT_NOT_NULLPTR(flag_field);
75 WALBERLA_ASSERT_NOT_NULLPTR(m_boundary);
76 WALBERLA_ASSERT_NOT_NULLPTR(m_lattice);
78 auto const boundary_flag = flag_field->getFlag(
Boundary_flag);
79 auto const gl = numberOfGhostLayersToCommunicate(flag_field);
80 auto const begin = [gl, dir](
auto const *flag_field) {
81 return flag_field->beginGhostLayerOnly(gl, dir);
85 uint_t xSize, ySize, zSize, bSize;
86 buffer >> xSize >> ySize >> zSize >> bSize;
88 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
89 if (isFlagSet(it, boundary_flag)) {
93 WALBERLA_ASSERT_EQUAL(xSize, flag_field->xSize());
94 WALBERLA_ASSERT_EQUAL(ySize, flag_field->ySize());
95 WALBERLA_ASSERT_EQUAL(zSize, flag_field->zSize());
96 WALBERLA_ASSERT_EQUAL(bSize, buf_size);
99 auto const offset = std::get<0>(m_lattice->get_local_grid_range());
100 typename Boundary_T::value_type value;
101 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
102 if (isFlagSet(it, boundary_flag)) {
105 m_boundary->unpack_node(node, value);
112 mpi::SendBuffer &buffer)
const override {
114 auto const *flag_field = sender->getData<GhostLayerField_T>(bdId_);
115 WALBERLA_ASSERT_NOT_NULLPTR(flag_field);
116 WALBERLA_ASSERT_NOT_NULLPTR(m_boundary);
117 WALBERLA_ASSERT_NOT_NULLPTR(m_lattice);
119 auto const boundary_flag = flag_field->getFlag(
Boundary_flag);
120 auto const gl = numberOfGhostLayersToCommunicate(flag_field);
121 auto const begin = [gl, dir](
auto const *flag_field) {
122 return flag_field->beginSliceBeforeGhostLayer(dir, cell_idx_c(gl));
127 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
128 if (isFlagSet(it, boundary_flag)) {
132 buffer << flag_field->xSize() << flag_field->ySize() << flag_field->zSize()
136 auto const offset = std::get<0>(m_lattice->get_local_grid_range());
137 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
138 if (isFlagSet(it, boundary_flag)) {
140 buffer << m_boundary->get_node_value_at_boundary(node);