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

Merge branch 'vtk-mass' into 'master'

Fix VTK output for bodies with infinite mass

See merge request walberla/walberla!167
parents 5d1b7f16 c02050cf
No related merge requests found
......@@ -72,7 +72,14 @@ void EllipsoidVtkOutput::push( std::ostream& os, const uint_t data, const uint_t
switch( data )
{
case 0:
vtk::toStream( os, numeric_cast< float >(bodies_.at( point )->getMass()) );
if( bodies_.at( point )->hasInfiniteMass() )
{
vtk::toStream( os, std::numeric_limits< float >::infinity() );
}
else
{
vtk::toStream( os, numeric_cast< float >(bodies_.at( point )->getMass()) );
}
break;
case 1:
vtk::toStream( os, numeric_cast< float >(tensorGlyphs_.at(point)[component]) );
......@@ -103,7 +110,14 @@ void EllipsoidVtkOutput::push( vtk::Base64Writer& b64, const uint_t data, const
switch( data )
{
case 0:
b64 << numeric_cast< float >(bodies_.at( point )->getMass());
if( bodies_.at( point )->hasInfiniteMass() )
{
b64 << std::numeric_limits< float >::infinity();
}
else
{
b64 << numeric_cast< float >(bodies_.at( point )->getMass());
}
break;
case 1:
b64 << numeric_cast< float >(tensorGlyphs_.at(point)[component]);
......
......@@ -73,7 +73,14 @@ void SphereVtkOutput::push( std::ostream& os, const uint_t data, const uint_t po
switch( data )
{
case 0:
vtk::toStream( os, numeric_cast< float >(bodies_.at( point )->getMass()) );
if( bodies_.at( point )->hasInfiniteMass() )
{
vtk::toStream( os, std::numeric_limits< float >::infinity() );
}
else
{
vtk::toStream( os, numeric_cast< float >(bodies_.at( point )->getMass()) );
}
break;
case 1:
vtk::toStream( os, numeric_cast< float >(bodies_.at( point )->getRadius()) );
......@@ -107,7 +114,14 @@ void SphereVtkOutput::push( vtk::Base64Writer& b64, const uint_t data, const uin
switch( data )
{
case 0:
b64 << numeric_cast< float >(bodies_.at( point )->getMass());
if( bodies_.at( point )->hasInfiniteMass() )
{
b64 << std::numeric_limits< float >::infinity();
}
else
{
b64 << numeric_cast< float >(bodies_.at( point )->getMass());
}
break;
case 1:
b64 << numeric_cast< float >(bodies_.at( point )->getRadius());
......
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