Commit ab6d4854 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed 'scale' parameter from tnl-view and MeshFunction and VectorField writers

parent 24816b45
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -151,8 +151,7 @@ class MeshFunction :
      void boundLoad( const String& fileName );

      bool write( const String& fileName,
                  const String& format = "vtk",
                  const double& scale = 1.0 ) const;
                  const String& format = "vtk" ) const;

      using Object::save;

+6 −9
Original line number Diff line number Diff line
@@ -74,8 +74,7 @@ public:
   using GlobalIndex = typename MeshType::GlobalIndexType;

   static bool write( const MeshFunction& function,
                      std::ostream& str,
                      const double& scale = 1.0 )
                      std::ostream& str )
   {
      const MeshType& mesh = function.getMesh();
      const GlobalIndex entitiesCount = mesh.template getEntitiesCount< EntityType >();
@@ -84,7 +83,7 @@ public:
         typename MeshType::PointType v = center< EntityType >::get( entity );
         for( int j = 0; j < v.getSize(); j++ )
            str << v[ j ] << " ";
         str << scale * function.getData().getElement( i ) << "\n";
         str << function.getData().getElement( i ) << "\n";
      }
      return true;
   }
@@ -104,8 +103,7 @@ public:
   using GlobalIndex = typename MeshType::GlobalIndexType;

   static bool write( const MeshFunction& function,
                      std::ostream& str,
                      const double& scale = 1.0 )
                      std::ostream& str )
   {
      const MeshType& grid = function.getMesh();
      EntityType entity( grid );
@@ -119,7 +117,7 @@ public:
            //std::cerr << entity.getCoordinates() << " -> " << v << std::endl;
            for( int j = 0; j < v.getSize(); j++ )
               str << v[ j ] << " ";
            str << scale * function.getData().getElement( entity.getIndex() ) << "\n";
            str << function.getData().getElement( entity.getIndex() ) << "\n";
         }
         str << "\n";
      }
@@ -141,8 +139,7 @@ public:
   using GlobalIndex = typename MeshType::GlobalIndexType;

   static bool write( const MeshFunction& function,
                      std::ostream& str,
                      const double& scale = 1.0 )
                      std::ostream& str )
   {
      const MeshType& grid = function.getMesh();
      EntityType entity( grid );
@@ -156,7 +153,7 @@ public:
               typename MeshType::PointType v = center< EntityType >::get( entity );
               for( int j = 0; j < v.getSize(); j++ )
                  str << v[ j ] << " ";
               str << scale * function.getData().getElement( entity.getIndex() ) << "\n";
               str << function.getData().getElement( entity.getIndex() ) << "\n";
            }
            str << "\n";
         }
+3 −5
Original line number Diff line number Diff line
@@ -26,12 +26,11 @@ class MeshFunctionVTKWriter
public:
   static bool write( const MeshFunction& function,
                      std::ostream& str,
                      const double& scale = 1.0,
                      const String& functionName = "cellFunctionValues" )
   {
      const MeshType& mesh = function.getMesh();
      MeshWriter::template writeEntities< MeshFunction::getEntitiesDimension() >( mesh, str );
      appendFunction( function, str, functionName, scale );
      appendFunction( function, str, functionName );
      return true;
   }

@@ -40,8 +39,7 @@ public:
   // with different function name.
   static void appendFunction( const MeshFunction& function,
                               std::ostream& str,
                               const String& functionName,
                               const double& scale = 1.0 )
                               const String& functionName )
   {
      const MeshType& mesh = function.getMesh();
      const GlobalIndex entitiesCount = mesh.template getEntitiesCount< EntityType >();
@@ -49,7 +47,7 @@ public:
      str << "SCALARS " << functionName << " " << getType< typename MeshFunction::RealType >() << " 1" << std::endl;
      str << "LOOKUP_TABLE default" << std::endl;
      for( GlobalIndex i = 0; i < entitiesCount; i++ ) {
         str << scale * function.getData().getElement( i ) << "\n";
         str << function.getData().getElement( i ) << "\n";
      }
   }
};
+3 −4
Original line number Diff line number Diff line
@@ -506,8 +506,7 @@ template< typename Mesh,
bool
MeshFunction< Mesh, MeshEntityDimension, Real >::
write( const String& fileName,
       const String& format,
       const double& scale ) const
       const String& format ) const
{
   std::fstream file;
   file.open( fileName.getString(), std::ios::out );
@@ -517,9 +516,9 @@ write( const String& fileName,
      return false;
   }
   if( format == "vtk" )
      return MeshFunctionVTKWriter< MeshFunction >::write( *this, file, scale );
      return MeshFunctionVTKWriter< MeshFunction >::write( *this, file );
   else if( format == "gnuplot" )
      return MeshFunctionGnuplotWriter< MeshFunction >::write( *this, file, scale );
      return MeshFunctionGnuplotWriter< MeshFunction >::write( *this, file );
   else {
      std::cerr << "Unknown output format: " << format << std::endl;
      return false;
+3 −4
Original line number Diff line number Diff line
@@ -285,8 +285,7 @@ class VectorField< Size, MeshFunction< Mesh, MeshEntityDimension, Real > >
      }

      bool write( const String& fileName,
                  const String& format = "vtk",
                  const double& scale = 1.0 ) const
                  const String& format = "vtk" ) const
      {
         std::fstream file;
         file.open( fileName.getString(), std::ios::out );
@@ -296,9 +295,9 @@ class VectorField< Size, MeshFunction< Mesh, MeshEntityDimension, Real > >
            return false;
         }
         if( format == "vtk" )
            return VectorFieldVTKWriter< VectorField >::write( *this, file, scale );
            return VectorFieldVTKWriter< VectorField >::write( *this, file );
         else if( format == "gnuplot" )
            return VectorFieldGnuplotWriter< VectorField >::write( *this, file, scale );
            return VectorFieldGnuplotWriter< VectorField >::write( *this, file );
         else {
            std::cerr << "Unknown output format: " << format << std::endl;
            return false;
Loading