Loading src/TNL/Functions/VectorField.h +1 −1 Original line number Diff line number Diff line Loading @@ -302,7 +302,7 @@ class VectorField< Size, MeshFunction< Mesh, MeshEntityDimension, Real > > return false; } if( format == "vtk" ) return VectorFieldVTKWriter< ThisType >::write( *this, file ); return VectorFieldVTKWriter< ThisType >::write( *this, file, scale ); else if( format == "gnuplot" ) return VectorFieldGnuplotWriter< ThisType >::write( *this, file, scale ); else { Loading src/TNL/Functions/VectorFieldVTKWriter.h +33 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 1, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 1, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -69,6 +70,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 1, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 0, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -94,6 +96,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 2, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 2, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -118,6 +121,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 2, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 1, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -142,6 +146,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 2, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 0, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -167,6 +172,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 3, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 3, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -191,6 +197,32 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 3, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 2, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, const double& scale ); static void writeHeader( const VectorFieldType& vectorField, std::ostream& str ); }; /*** * 3D grids edges */ template< typename MeshReal, typename Device, typename MeshIndex, typename Real, int VectorFieldSize > class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 1, Real > > > { public: typedef Meshes::Grid< 3, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 1, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -215,6 +247,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 3, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 0, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading src/TNL/Functions/VectorFieldVTKWriter_impl.h +60 −42 Original line number Diff line number Diff line Loading @@ -93,7 +93,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Cell entity = mesh.template getEntity< typename MeshType::Cell >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -122,13 +124,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, 0, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, 0, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -165,7 +167,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Vertex entity = mesh.template getEntity< typename MeshType::Vertex >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -194,13 +198,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 2, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 2, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -241,14 +245,16 @@ write( const VectorFieldType& vectorField, } str << std::endl << "CELL_DATA " << entitiesCount << std::endl; str << "VECTORS cellVectorFieldValues float 1" << std::endl; str << "VECTORS cellVectorFieldValues float" << std::endl; str << "LOOKUP_TABLE default" << std::endl; for( MeshIndex i = 0; i < entitiesCount; i++ ) { typename MeshType::Cell entity = mesh.template getEntity< typename MeshType::Cell >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -277,13 +283,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 1, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 1, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -340,7 +346,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Face entity = mesh.template getEntity< typename MeshType::Face >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -369,13 +377,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 0, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 0, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -422,7 +430,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Vertex entity = mesh.template getEntity< typename MeshType::Vertex >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -451,13 +461,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 3, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 3, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -521,7 +531,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Cell entity = mesh.template getEntity< typename MeshType::Cell >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -550,13 +562,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 2, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 2, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -643,7 +655,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Face entity = mesh.template getEntity< typename MeshType::Face >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -672,13 +686,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 1, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 1, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -759,7 +773,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Edge entity = mesh.template getEntity< typename MeshType::Edge >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -788,13 +804,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 0, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 0, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -849,7 +865,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Vertex entity = mesh.template getEntity< typename MeshType::Vertex >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading
src/TNL/Functions/VectorField.h +1 −1 Original line number Diff line number Diff line Loading @@ -302,7 +302,7 @@ class VectorField< Size, MeshFunction< Mesh, MeshEntityDimension, Real > > return false; } if( format == "vtk" ) return VectorFieldVTKWriter< ThisType >::write( *this, file ); return VectorFieldVTKWriter< ThisType >::write( *this, file, scale ); else if( format == "gnuplot" ) return VectorFieldGnuplotWriter< ThisType >::write( *this, file, scale ); else { Loading
src/TNL/Functions/VectorFieldVTKWriter.h +33 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 1, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 1, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -69,6 +70,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 1, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 0, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -94,6 +96,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 2, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 2, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -118,6 +121,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 2, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 1, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -142,6 +146,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 2, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 0, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -167,6 +172,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 3, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 3, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -191,6 +197,32 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 3, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 2, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, const double& scale ); static void writeHeader( const VectorFieldType& vectorField, std::ostream& str ); }; /*** * 3D grids edges */ template< typename MeshReal, typename Device, typename MeshIndex, typename Real, int VectorFieldSize > class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 1, Real > > > { public: typedef Meshes::Grid< 3, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 1, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading @@ -215,6 +247,7 @@ class VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes:: typedef Meshes::Grid< 3, MeshReal, Device, MeshIndex > MeshType; typedef Real RealType; typedef Functions::VectorField< VectorFieldSize, MeshFunction< MeshType, 0, RealType > > VectorFieldType; using VectorType = typename VectorFieldType::VectorType; static bool write( const VectorFieldType& function, std::ostream& str, Loading
src/TNL/Functions/VectorFieldVTKWriter_impl.h +60 −42 Original line number Diff line number Diff line Loading @@ -93,7 +93,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Cell entity = mesh.template getEntity< typename MeshType::Cell >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -122,13 +124,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, 0, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 1, MeshReal, Device, MeshIndex >, 0, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -165,7 +167,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Vertex entity = mesh.template getEntity< typename MeshType::Vertex >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -194,13 +198,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 2, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 2, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -241,14 +245,16 @@ write( const VectorFieldType& vectorField, } str << std::endl << "CELL_DATA " << entitiesCount << std::endl; str << "VECTORS cellVectorFieldValues float 1" << std::endl; str << "VECTORS cellVectorFieldValues float" << std::endl; str << "LOOKUP_TABLE default" << std::endl; for( MeshIndex i = 0; i < entitiesCount; i++ ) { typename MeshType::Cell entity = mesh.template getEntity< typename MeshType::Cell >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -277,13 +283,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 1, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 1, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -340,7 +346,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Face entity = mesh.template getEntity< typename MeshType::Face >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -369,13 +377,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 0, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 2, MeshReal, Device, MeshIndex >, 0, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -422,7 +430,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Vertex entity = mesh.template getEntity< typename MeshType::Vertex >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -451,13 +461,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 3, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 3, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -521,7 +531,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Cell entity = mesh.template getEntity< typename MeshType::Cell >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -550,13 +562,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 2, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 2, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -643,7 +655,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Face entity = mesh.template getEntity< typename MeshType::Face >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -672,13 +686,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 1, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 1, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -759,7 +773,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Edge entity = mesh.template getEntity< typename MeshType::Edge >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading Loading @@ -788,13 +804,13 @@ writeHeader( const VectorFieldType& vectorField, str << "DATASET UNSTRUCTURED_GRID" << std::endl; } template< int Size, typename MeshReal, template< typename MeshReal, typename Device, typename MeshIndex, typename Real > typename Real, int VectorFieldSize > bool VectorFieldVTKWriter< VectorField< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 0, Real > >:: VectorFieldVTKWriter< VectorField< VectorFieldSize, MeshFunction< Meshes::Grid< 3, MeshReal, Device, MeshIndex >, 0, Real > > >:: write( const VectorFieldType& vectorField, std::ostream& str, const double& scale ) Loading Loading @@ -849,7 +865,9 @@ write( const VectorFieldType& vectorField, { typename MeshType::Vertex entity = mesh.template getEntity< typename MeshType::Vertex >( i ); entity.refresh(); str << scale * vectorField.getData().getElement( entity.getIndex() ) << std::endl; const VectorType v = vectorField.getElement( entity.getIndex() ); for( int i = 0; i < 3; i++ ) str << scale * ( i < VectorFieldSize ? v[ i ] : 0.0 ) << std::endl; } return true; Loading