88 void unpackData(IBlock *receiver, stencil::Direction dir,
89 mpi::RecvBuffer &buffer)
override {
91 auto *flag_field = receiver->getData<GhostLayerField_T>(bdId_);
92 WALBERLA_ASSERT_NOT_NULLPTR(flag_field);
93 WALBERLA_ASSERT_NOT_NULLPTR(m_boundary);
94 WALBERLA_ASSERT_NOT_NULLPTR(m_lattice);
96 auto const boundary_flag = flag_field->getFlag(
Boundary_flag);
97 auto const gl = numberOfGhostLayersToCommunicate(flag_field);
98 auto const begin = [gl, dir](
auto const *field) {
99 return field->beginGhostLayerOnly(gl, dir);
103 uint_t xSize, ySize, zSize, bSize;
104 buffer >> xSize >> ySize >> zSize >> bSize;
106 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
107 if (isFlagSet(it, boundary_flag)) {
111 WALBERLA_ASSERT_EQUAL(xSize, flag_field->xSize());
112 WALBERLA_ASSERT_EQUAL(ySize, flag_field->ySize());
113 WALBERLA_ASSERT_EQUAL(zSize, flag_field->zSize());
114 WALBERLA_ASSERT_EQUAL(bSize, buf_size);
117 auto const offset = m_lattice->get_block_corner(*receiver,
true);
118 typename Boundary_T::value_type value;
119 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
120 if (isFlagSet(it, boundary_flag)) {
123 m_boundary->unpack_node(node, value);
130 mpi::SendBuffer &buffer)
const override {
132 auto const *flag_field = sender->getData<GhostLayerField_T>(bdId_);
133 WALBERLA_ASSERT_NOT_NULLPTR(flag_field);
134 WALBERLA_ASSERT_NOT_NULLPTR(m_boundary);
135 WALBERLA_ASSERT_NOT_NULLPTR(m_lattice);
137 auto const boundary_flag = flag_field->getFlag(
Boundary_flag);
138 auto const gl = numberOfGhostLayersToCommunicate(flag_field);
139 auto const begin = [gl, dir](
auto const *field) {
140 return field->beginSliceBeforeGhostLayer(dir, cell_idx_c(gl));
145 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
146 if (isFlagSet(it, boundary_flag)) {
150 buffer << flag_field->xSize() << flag_field->ySize() << flag_field->zSize()
154 auto const offset = m_lattice->get_block_corner(*sender,
true);
155 for (
auto it = begin(flag_field); it != flag_field->end(); ++it) {
156 if (isFlagSet(it, boundary_flag)) {
158 buffer << m_boundary->get_node_value_at_boundary(node);