Skip to content
Snippets Groups Projects
Commit c0c6ab22 authored by Ondřej Székely's avatar Ondřej Székely
Browse files

VTK writer added.

parent eb3d9161
No related branches found
No related tags found
No related merge requests found
...@@ -24,13 +24,190 @@ class tnlMeshFunctionVTKWriter ...@@ -24,13 +24,190 @@ class tnlMeshFunctionVTKWriter
public: public:
static bool write( const MeshFunction& function, static bool write( const MeshFunction& function,
ostream& str ) ostream& str );
{ static void writeHeader(const MeshFunction& function,
std::cerr << "VTK writer for mesh functions defined on mesh type " << MeshFunction::MeshType::getType() << " is not (yet) implmeneted." << std::endl; ostream& str ){}
return false;
}
}; };
/***
* 1D grid, cells
*/
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real >
class tnlMeshFunctionVTKWriter< tnlMeshFunction< tnlGrid< 1, MeshReal, Device, MeshIndex >, 1, Real > >
{
public:
typedef tnlGrid< 1, MeshReal, Device, MeshIndex > MeshType;
typedef Real RealType;
typedef tnlMeshFunction< MeshType, 1, RealType > MeshFunctionType;
static bool write( const MeshFunctionType& function,
ostream& str );
static void writeHeader(const MeshFunctionType& function,
ostream& str );
};
/***
* 1D grid, vertices
*/
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real >
class tnlMeshFunctionVTKWriter< tnlMeshFunction< tnlGrid< 1, MeshReal, Device, MeshIndex >, 0, Real > >
{
public:
typedef tnlGrid< 1, MeshReal, Device, MeshIndex > MeshType;
typedef Real RealType;
typedef tnlMeshFunction< MeshType, 0, RealType > MeshFunctionType;
static bool write( const MeshFunctionType& function,
ostream& str );
static void writeHeader(const MeshFunctionType& function,
ostream& str );
};
/***
* 2D grid, cells
*/
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real >
class tnlMeshFunctionVTKWriter< tnlMeshFunction< tnlGrid< 2, MeshReal, Device, MeshIndex >, 2, Real > >
{
public:
typedef tnlGrid< 2, MeshReal, Device, MeshIndex > MeshType;
typedef Real RealType;
typedef tnlMeshFunction< MeshType, 2, RealType > MeshFunctionType;
static bool write( const MeshFunctionType& function,
ostream& str );
static void writeHeader(const MeshFunctionType& function,
ostream& str );
};
/***
* 2D grid, faces
*/
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real >
class tnlMeshFunctionVTKWriter< tnlMeshFunction< tnlGrid< 2, MeshReal, Device, MeshIndex >, 1, Real > >
{
public:
typedef tnlGrid< 2, MeshReal, Device, MeshIndex > MeshType;
typedef Real RealType;
typedef tnlMeshFunction< MeshType, 1, RealType > MeshFunctionType;
static bool write( const MeshFunctionType& function,
ostream& str );
static void writeHeader(const MeshFunctionType& function,
ostream& str );
};
/***
* 2D grid, vertices
*/
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real >
class tnlMeshFunctionVTKWriter< tnlMeshFunction< tnlGrid< 2, MeshReal, Device, MeshIndex >, 0, Real > >
{
public:
typedef tnlGrid< 2, MeshReal, Device, MeshIndex > MeshType;
typedef Real RealType;
typedef tnlMeshFunction< MeshType, 0, RealType > MeshFunctionType;
static bool write( const MeshFunctionType& function,
ostream& str );
static void writeHeader(const MeshFunctionType& function,
ostream& str );
};
/***
* 3D grid, cells
*/
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real >
class tnlMeshFunctionVTKWriter< tnlMeshFunction< tnlGrid< 3, MeshReal, Device, MeshIndex >, 3, Real > >
{
public:
typedef tnlGrid< 3, MeshReal, Device, MeshIndex > MeshType;
typedef Real RealType;
typedef tnlMeshFunction< MeshType, 3, RealType > MeshFunctionType;
static bool write( const MeshFunctionType& function,
ostream& str );
static void writeHeader(const MeshFunctionType& function,
ostream& str );
};
/***
* 3D grid, faces
*/
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real >
class tnlMeshFunctionVTKWriter< tnlMeshFunction< tnlGrid< 3, MeshReal, Device, MeshIndex >, 2, Real > >
{
public:
typedef tnlGrid< 3, MeshReal, Device, MeshIndex > MeshType;
typedef Real RealType;
typedef tnlMeshFunction< MeshType, 2, RealType > MeshFunctionType;
static bool write( const MeshFunctionType& function,
ostream& str );
static void writeHeader(const MeshFunctionType& function,
ostream& str );
};
/***
* 3D grid, edges
*/
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real >
class tnlMeshFunctionVTKWriter< tnlMeshFunction< tnlGrid< 3, MeshReal, Device, MeshIndex >, 1, Real > >
{
public:
typedef tnlGrid< 3, MeshReal, Device, MeshIndex > MeshType;
typedef Real RealType;
typedef tnlMeshFunction< MeshType, 1, RealType > MeshFunctionType;
static bool write( const MeshFunctionType& function,
ostream& str );
static void writeHeader(const MeshFunctionType& function,
ostream& str );
};
/***
* 3D grid, vertices
*/
template< typename MeshReal,
typename Device,
typename MeshIndex,
typename Real >
class tnlMeshFunctionVTKWriter< tnlMeshFunction< tnlGrid< 3, MeshReal, Device, MeshIndex >, 0, Real > >
{
public:
typedef tnlGrid< 3, MeshReal, Device, MeshIndex > MeshType;
typedef Real RealType;
typedef tnlMeshFunction< MeshType, 0, RealType > MeshFunctionType;
static bool write( const MeshFunctionType& function,
ostream& str );
static void writeHeader(const MeshFunctionType& function,
ostream& str );
};
#endif /* TNLMESHFUNCTIONVTKWRITER_H */ #endif /* TNLMESHFUNCTIONVTKWRITER_H */
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment