Loading src/TNL/Functions/MeshFunction.h +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading src/TNL/Functions/MeshFunctionGnuplotWriter.h +6 −9 Original line number Diff line number Diff line Loading @@ -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 >(); Loading @@ -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; } Loading @@ -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 ); Loading @@ -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"; } Loading @@ -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 ); Loading @@ -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"; } Loading src/TNL/Functions/MeshFunctionVTKWriter.h +3 −5 Original line number Diff line number Diff line Loading @@ -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; } Loading @@ -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 >(); Loading @@ -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"; } } }; Loading src/TNL/Functions/MeshFunction_impl.h +3 −4 Original line number Diff line number Diff line Loading @@ -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 ); Loading @@ -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; Loading src/TNL/Functions/VectorField.h +3 −4 Original line number Diff line number Diff line Loading @@ -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 ); Loading @@ -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 Loading
src/TNL/Functions/MeshFunction.h +1 −2 Original line number Diff line number Diff line Loading @@ -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; Loading
src/TNL/Functions/MeshFunctionGnuplotWriter.h +6 −9 Original line number Diff line number Diff line Loading @@ -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 >(); Loading @@ -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; } Loading @@ -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 ); Loading @@ -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"; } Loading @@ -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 ); Loading @@ -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"; } Loading
src/TNL/Functions/MeshFunctionVTKWriter.h +3 −5 Original line number Diff line number Diff line Loading @@ -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; } Loading @@ -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 >(); Loading @@ -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"; } } }; Loading
src/TNL/Functions/MeshFunction_impl.h +3 −4 Original line number Diff line number Diff line Loading @@ -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 ); Loading @@ -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; Loading
src/TNL/Functions/VectorField.h +3 −4 Original line number Diff line number Diff line Loading @@ -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 ); Loading @@ -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