diff --git a/src/pe/vtk/EllipsoidVtkOutput.cpp b/src/pe/vtk/EllipsoidVtkOutput.cpp index ec43aa33d6c643517b730e09d4118bc2fc289e6f..ffe1520ad1c03fe64ce1f863d6d88448ff65160a 100644 --- a/src/pe/vtk/EllipsoidVtkOutput.cpp +++ b/src/pe/vtk/EllipsoidVtkOutput.cpp @@ -33,7 +33,7 @@ std::vector< EllipsoidVtkOutput::Attributes > EllipsoidVtkOutput::getAttributes( { std::vector< Attributes > attributes; attributes.push_back( Attributes( vtk::typeToString< float >(), "mass", uint_c(1) ) ); - attributes.push_back( Attributes( vtk::typeToString< float >(), "tensorGlyph", uint_c(9) ) ); + attributes.push_back( Attributes( vtk::typeToString< float >(), "tensorGlyph", uint_c(6) ) ); attributes.push_back( Attributes( vtk::typeToString< float >(), "velocity", uint_c(3) ) ); attributes.push_back( Attributes( vtk::typeToString< int >(), "rank", uint_c(1) ) ); attributes.push_back( Attributes( vtk::typeToString< id_t >(), "id", uint_c(1) ) ); @@ -69,7 +69,9 @@ void EllipsoidVtkOutput::configure() Mat3 bxb = math::dyadicProduct(directionVectorY, directionVectorY); Mat3 cxc = math::dyadicProduct(directionVectorZ, directionVectorZ); Mat3 tensor = axa * semiAxes[0] + bxb * semiAxes[1] + cxc * semiAxes[2]; - tensorGlyphs_.push_back(tensor); + // use symmetry to only write 6 of the 9 elements: XX YY ZZ XY YZ XZ + tensorGlyphs_.push_back({tensor(0,0), tensor(1,1), tensor(2,2), + tensor(0,1), tensor(1,2), tensor(0,2)}); } } } diff --git a/src/pe/vtk/EllipsoidVtkOutput.h b/src/pe/vtk/EllipsoidVtkOutput.h index 43bcec3e34d1f98fb0199acd73bf96e4520d1630..e12f91879e6aaf0d2eb3d74f04b5d5ab3103feea 100644 --- a/src/pe/vtk/EllipsoidVtkOutput.h +++ b/src/pe/vtk/EllipsoidVtkOutput.h @@ -34,8 +34,7 @@ #include "vtk/UtilityFunctions.h" #include <vector> - -#include <boost/array.hpp> +#include <array> namespace walberla { namespace pe { @@ -61,14 +60,14 @@ private: ConstBlockDataID storageID_; const BlockStorage & blockStorage_; std::vector< ConstEllipsoidID > bodies_; - std::vector< Mat3 > tensorGlyphs_; + std::vector< std::array<real_t,6> > tensorGlyphs_; }; void EllipsoidVtkOutput::push( std::ostream& os, const uint_t data, const uint_t point, const uint_t component ) { WALBERLA_ASSERT_LESS( point, bodies_.size() ); - WALBERLA_ASSERT_LESS( component, 9u ); + WALBERLA_ASSERT_LESS( component, 6u ); switch( data ) { @@ -99,7 +98,7 @@ void EllipsoidVtkOutput::push( std::ostream& os, const uint_t data, const uint_t void EllipsoidVtkOutput::push( vtk::Base64Writer& b64, const uint_t data, const uint_t point, const uint_t component ) { WALBERLA_ASSERT_LESS( point, bodies_.size() ); - WALBERLA_ASSERT_LESS( component, 9u ); + WALBERLA_ASSERT_LESS( component, 6u ); switch( data ) {