Skip to content
Snippets Groups Projects
Commit 6b11de8c authored by Christoph Rettinger's avatar Christoph Rettinger
Browse files

Improved ellipsoid vtk output

parent 2a5396a4
No related merge requests found
......@@ -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)});
}
}
}
......
......@@ -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 )
{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment