PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::VTKLegacyFileWriter< DIM > Class Template Reference

File writer for writing output data to legacy VTK files. More...

#include <ptems/io/vtklegacyfilewriter.hpp>

Inheritance diagram for ptems::VTKLegacyFileWriter< DIM >:
Collaboration diagram for ptems::VTKLegacyFileWriter< DIM >:

Public Types

template<typename T >
using ContinuousFunction = std::function< T(const Vector< DIM > &)>
 Type used for an argument denoting a continuous function. More...
 
template<typename T >
using PiecewiseFunction = std::function< T(std::size_t, const Vector< DIM > &)>
 Type used for an argument denoting a piecewise function on a mesh. More...
 
template<typename T >
using PiecewiseConstantFunction = std::function< T(std::size_t)>
 Type used for an argument denoting a piecewise constant function on a mesh. More...
 

Public Member Functions

 VTKLegacyFileWriter (std::ostream &file, const std::shared_ptr< FEMesh< DIM >> &mesh)
 Create object for writing data to legacy VTK file. More...
 
virtual bool HasError () const override
 Checks if the writer is invalid (as error) More...
 
virtual void OutputFunction (const std::string &name, const ContinuousFunction< int64_t > &func) override
 Write out a continuous function of integer values. More...
 
virtual void OutputFunction (const std::string &name, const ContinuousFunction< double > &func) override
 Write out a continuous function of double values. More...
 
virtual void OutputFunction (const std::string &name, const ContinuousFunction< std::complex< double >> func) override
 Write out a continuous function of complex values. More...
 
virtual void OutputPiecewiseFunction (const std::string &name, const PiecewiseFunction< int64_t > &func, bool continuous) override
 Write out a piecewise function of integer values which is defined over a mesh (continuous on each element) More...
 
virtual void OutputPiecewiseFunction (const std::string &name, const PiecewiseFunction< double > &func, bool continuous) override
 Write out a piecewise function of double values which is defined over a mesh (continuous on each element) More...
 
virtual void OutputPiecewiseFunction (const std::string &name, const PiecewiseFunction< std::complex< double >> &func, bool continuous) override
 Write out a piecewise function of complex values which is defined over a mesh (continuous on each element) More...
 
virtual void OutputPiecewiseConstantFunction (const std::string &name, const PiecewiseConstantFunction< int64_t > &func) override
 Write out a piecewise constant function of integer values which is defined over a mesh (constant for each each element) More...
 
virtual void OutputPiecewiseConstantFunction (const std::string &name, const PiecewiseConstantFunction< double > &func) override
 Write out a piecewise constant function of double values which is defined over a mesh (constant for each each element) More...
 
virtual void OutputPiecewiseConstantFunction (const std::string &name, const PiecewiseConstantFunction< std::complex< double >> &func) override
 Write out a piecewise constant function of complex values which is defined over a mesh (constant for each each element) More...
 
virtual operator bool () const
 Checks if the writer is still valid. More...
 
template<typename T >
void OutputFunction (const std::string &name, const T &func)
 Write out a continuous function. More...
 
template<typename T >
void OutputPiecewiseFunction (const std::string &name, const T &func, bool continuous)
 Write out a continuous function. More...
 
template<typename T >
void OutputPiecewiseConstantFunction (const std::string &name, const T &func)
 Write out a continuous function. More...
 

Detailed Description

template<std::size_t DIM>
class ptems::VTKLegacyFileWriter< DIM >

File writer for writing output data to legacy VTK files.

Todo:
Hack code - still work in progress:
  • VTK for non concave polygons seems buggy
  • PointData and CellData shouldn't be interleaved

Member Typedef Documentation

◆ ContinuousFunction

template<std::size_t DIM>
template<typename T >
using ptems::DataFileWriter< DIM >::ContinuousFunction = std::function<T(const Vector<DIM>&)>
inherited

Type used for an argument denoting a continuous function.

Template Parameters
TThe return type of the function

◆ PiecewiseConstantFunction

template<std::size_t DIM>
template<typename T >
using ptems::DataFileWriter< DIM >::PiecewiseConstantFunction = std::function<T(std::size_t)>
inherited

Type used for an argument denoting a piecewise constant function on a mesh.

Template Parameters
TThe return type of the function

◆ PiecewiseFunction

template<std::size_t DIM>
template<typename T >
using ptems::DataFileWriter< DIM >::PiecewiseFunction = std::function<T(std::size_t, const Vector<DIM>&)>
inherited

Type used for an argument denoting a piecewise function on a mesh.

Template Parameters
TThe return type of the function

Constructor & Destructor Documentation

◆ VTKLegacyFileWriter()

template<std::size_t DIM>
ptems::VTKLegacyFileWriter< DIM >::VTKLegacyFileWriter ( std::ostream file,
const std::shared_ptr< FEMesh< DIM >> &  mesh 
)
inline

Create object for writing data to legacy VTK file.

Parameters
fileThe stream to write to
meshThe mesh to write to the file

Member Function Documentation

◆ HasError()

template<std::size_t DIM>
virtual bool ptems::VTKLegacyFileWriter< DIM >::HasError ( ) const
inlineoverridevirtual

Checks if the writer is invalid (as error)

Returns
true if error; false otherwise

Implements ptems::DataFileWriter< DIM >.

◆ operator bool()

template<std::size_t DIM>
virtual ptems::DataFileWriter< DIM >::operator bool ( ) const
inlineexplicitvirtualinherited

Checks if the writer is still valid.

Returns
true if valid; false otherwise

◆ OutputFunction() [1/4]

template<std::size_t DIM>
virtual void ptems::VTKLegacyFileWriter< DIM >::OutputFunction ( const std::string name,
const ContinuousFunction< double > &  func 
)
inlineoverridevirtual

Write out a continuous function of double values.

Parameters
nameName of the function
funcFunctor which takes a point and returns the function value at that point

Implements ptems::DataFileWriter< DIM >.

◆ OutputFunction() [2/4]

template<std::size_t DIM>
virtual void ptems::VTKLegacyFileWriter< DIM >::OutputFunction ( const std::string name,
const ContinuousFunction< int64_t > &  func 
)
inlineoverridevirtual

Write out a continuous function of integer values.

Parameters
nameName of the function
funcFunctor which takes a point and returns the function value at that point

Implements ptems::DataFileWriter< DIM >.

◆ OutputFunction() [3/4]

template<std::size_t DIM>
virtual void ptems::VTKLegacyFileWriter< DIM >::OutputFunction ( const std::string name,
const ContinuousFunction< std::complex< double >>  func 
)
inlineoverridevirtual

Write out a continuous function of complex values.

Parameters
nameName of the function
funcFunctor which takes a point and returns the function value at that point

Implements ptems::DataFileWriter< DIM >.

◆ OutputFunction() [4/4]

template<std::size_t DIM>
template<typename T >
void ptems::DataFileWriter< DIM >::OutputFunction ( const std::string name,
const T &  func 
)
inlineinherited

Write out a continuous function.

Template Parameters
TType of the functor
Parameters
nameName of the function
funcFunctor which takes a point and returns the function value at that point

◆ OutputPiecewiseConstantFunction() [1/4]

template<std::size_t DIM>
virtual void ptems::VTKLegacyFileWriter< DIM >::OutputPiecewiseConstantFunction ( const std::string name,
const PiecewiseConstantFunction< double > &  func 
)
inlineoverridevirtual

Write out a piecewise constant function of double values which is defined over a mesh (constant for each each element)

Parameters
nameName of the function
funcFunctor which takes an element index and returns the constant function value for that element

Implements ptems::DataFileWriter< DIM >.

◆ OutputPiecewiseConstantFunction() [2/4]

template<std::size_t DIM>
virtual void ptems::VTKLegacyFileWriter< DIM >::OutputPiecewiseConstantFunction ( const std::string name,
const PiecewiseConstantFunction< int64_t > &  func 
)
inlineoverridevirtual

Write out a piecewise constant function of integer values which is defined over a mesh (constant for each each element)

Parameters
nameName of the function
funcFunctor which takes an element index and returns the constant function value for that element

Implements ptems::DataFileWriter< DIM >.

◆ OutputPiecewiseConstantFunction() [3/4]

template<std::size_t DIM>
virtual void ptems::VTKLegacyFileWriter< DIM >::OutputPiecewiseConstantFunction ( const std::string name,
const PiecewiseConstantFunction< std::complex< double >> &  func 
)
inlineoverridevirtual

Write out a piecewise constant function of complex values which is defined over a mesh (constant for each each element)

Parameters
nameName of the function
funcFunctor which takes an element index and returns the constant function value for that element

Implements ptems::DataFileWriter< DIM >.

◆ OutputPiecewiseConstantFunction() [4/4]

template<std::size_t DIM>
template<typename T >
void ptems::DataFileWriter< DIM >::OutputPiecewiseConstantFunction ( const std::string name,
const T &  func 
)
inlineinherited

Write out a continuous function.

Template Parameters
TType of the functor
Parameters
nameName of the function
funcFunctor which takes a point and returns the function value at that point

◆ OutputPiecewiseFunction() [1/4]

template<std::size_t DIM>
virtual void ptems::VTKLegacyFileWriter< DIM >::OutputPiecewiseFunction ( const std::string name,
const PiecewiseFunction< double > &  func,
bool  continuous 
)
inlineoverridevirtual

Write out a piecewise function of double values which is defined over a mesh (continuous on each element)

Parameters
nameName of the function
funcFunctor which takes an element index and a point in the element's local coordinate system and returns the function value at that point
continuousSpecifies if the function is continuous

Implements ptems::DataFileWriter< DIM >.

◆ OutputPiecewiseFunction() [2/4]

template<std::size_t DIM>
virtual void ptems::VTKLegacyFileWriter< DIM >::OutputPiecewiseFunction ( const std::string name,
const PiecewiseFunction< int64_t > &  func,
bool  continuous 
)
inlineoverridevirtual

Write out a piecewise function of integer values which is defined over a mesh (continuous on each element)

Parameters
nameName of the function
funcFunctor which takes an element index and a point in the element's local coordinate system and returns the function value at that point
continuousSpecifies if the function is continuous

Implements ptems::DataFileWriter< DIM >.

◆ OutputPiecewiseFunction() [3/4]

template<std::size_t DIM>
virtual void ptems::VTKLegacyFileWriter< DIM >::OutputPiecewiseFunction ( const std::string name,
const PiecewiseFunction< std::complex< double >> &  func,
bool  continuous 
)
inlineoverridevirtual

Write out a piecewise function of complex values which is defined over a mesh (continuous on each element)

Parameters
nameName of the function
funcFunctor which takes an element index and a point in the element's local coordinate system and returns the function value at that point
continuousSpecifies if the function is continuous

Implements ptems::DataFileWriter< DIM >.

◆ OutputPiecewiseFunction() [4/4]

template<std::size_t DIM>
template<typename T >
void ptems::DataFileWriter< DIM >::OutputPiecewiseFunction ( const std::string name,
const T &  func,
bool  continuous 
)
inlineinherited

Write out a continuous function.

Template Parameters
TType of the functor
Parameters
nameName of the function
funcFunctor which takes a point and returns the function value at that point
continuousSpecifies if the function is continuous

The documentation for this class was generated from the following file: