86 void unpackData(IBlock *receiver, stencil::Direction dir,
87 mpi::RecvBuffer &buffer)
override {
89 auto *flag_field = receiver->getData<GhostLayerField_T>(bdId_);
90 WALBERLA_ASSERT_NOT_NULLPTR(flag_field);
91 WALBERLA_ASSERT_NOT_NULLPTR(m_boundary);
92 WALBERLA_ASSERT_NOT_NULLPTR(m_lattice);
94 auto const boundary_flag = flag_field->getFlag(
Boundary_flag);
95 auto const gl = numberOfGhostLayersToCommunicate(flag_field);
96 auto const begin = [gl, dir](
auto const *field) {
97 return field->beginGhostLayerOnly(gl, dir);
101 uint_t xSize, ySize, zSize, bSize;
102 buffer >> xSize >> ySize >> zSize >> bSize;
104 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
105 if (isFlagSet(it, boundary_flag)) {
109 WALBERLA_ASSERT_EQUAL(xSize, flag_field->xSize());
110 WALBERLA_ASSERT_EQUAL(ySize, flag_field->ySize());
111 WALBERLA_ASSERT_EQUAL(zSize, flag_field->zSize());
112 WALBERLA_ASSERT_EQUAL(bSize, buf_size);
115 auto const offset = m_lattice->get_block_corner(*receiver,
true);
116 typename Boundary_T::value_type value;
117 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
118 if (isFlagSet(it, boundary_flag)) {
121 m_boundary->unpack_node(node, value);
128 mpi::SendBuffer &buffer)
const override {
130 auto const *flag_field = sender->getData<GhostLayerField_T>(bdId_);
131 WALBERLA_ASSERT_NOT_NULLPTR(flag_field);
132 WALBERLA_ASSERT_NOT_NULLPTR(m_boundary);
133 WALBERLA_ASSERT_NOT_NULLPTR(m_lattice);
135 auto const boundary_flag = flag_field->getFlag(
Boundary_flag);
136 auto const gl = numberOfGhostLayersToCommunicate(flag_field);
137 auto const begin = [gl, dir](
auto const *field) {
138 return field->beginSliceBeforeGhostLayer(dir, cell_idx_c(gl));
143 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
144 if (isFlagSet(it, boundary_flag)) {
148 buffer << flag_field->xSize() << flag_field->ySize() << flag_field->zSize()
152 auto const offset = m_lattice->get_block_corner(*sender,
true);
153 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
154 if (isFlagSet(it, boundary_flag)) {
156 buffer << m_boundary->get_node_value_at_boundary(node);