Skip to content
Snippets Groups Projects
Commit c02050cf authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Fix VTK output for bodies with infinite mass

parent 5d1b7f16
Branches
Tags
No related merge requests found
...@@ -72,7 +72,14 @@ void EllipsoidVtkOutput::push( std::ostream& os, const uint_t data, const uint_t ...@@ -72,7 +72,14 @@ void EllipsoidVtkOutput::push( std::ostream& os, const uint_t data, const uint_t
switch( data ) switch( data )
{ {
case 0: 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; break;
case 1: case 1:
vtk::toStream( os, numeric_cast< float >(tensorGlyphs_.at(point)[component]) ); 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 ...@@ -103,7 +110,14 @@ void EllipsoidVtkOutput::push( vtk::Base64Writer& b64, const uint_t data, const
switch( data ) switch( data )
{ {
case 0: 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; break;
case 1: case 1:
b64 << numeric_cast< float >(tensorGlyphs_.at(point)[component]); 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 ...@@ -73,7 +73,14 @@ void SphereVtkOutput::push( std::ostream& os, const uint_t data, const uint_t po
switch( data ) switch( data )
{ {
case 0: 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; break;
case 1: case 1:
vtk::toStream( os, numeric_cast< float >(bodies_.at( point )->getRadius()) ); 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 ...@@ -107,7 +114,14 @@ void SphereVtkOutput::push( vtk::Base64Writer& b64, const uint_t data, const uin
switch( data ) switch( data )
{ {
case 0: 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; break;
case 1: case 1:
b64 << numeric_cast< float >(bodies_.at( point )->getRadius()); 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