Skip to content

[!396] Make UGGrid LBMessageBuffer depend on the data type

Oliver Sander requested to merge cherry-pick-f9596238 into releases/2.7

Merge branch 'make-uggrid-message-buffer-more-robust' into 'master'

ref:core/dune-grid> Previously, the methods LBMessageBuffer::read and LBMessageBuffer::write depended on the DataType, but the LBMessageBuffer class itself did not. This lead to subtle bugs: I wanted to send a vector of doubles, stored in a std::map. By error, I set the DataType to std::map::value_type, which is a std::pair<IdType,double> rather than to the correct type std::map::mapped_type (aka double). Still, my DataHandle only wrote double values into the message buffer, which lead to strange memory corruption.

This patch makes sure the compiler finds such a bug.

See merge request core/dune-grid!396

(cherry picked from commit f9596238)

a826381e Make UGGrid LBMessageBuffer depend on the data type

Merge request reports

Loading