PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::DataFileWriter< DIM > Struct Template Referenceabstract

Base type for an object to write out data to a file. More...

#include <ptems/io/datafilewriter.hpp>

Inheritance diagram for ptems::DataFileWriter< 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

virtual operator bool () const
 Checks if the writer is still valid. More...
 
virtual bool HasError () const =0
 Checks if the writer is invalid (as error) More...
 
template<typename T >
void OutputFunction (const std::string &name, const T &func)
 Write out a continuous function. More...
 
virtual void OutputFunction (const std::string &name, const ContinuousFunction< int64_t > &func)=0
 Write out a continuous function of integer values. More...
 
virtual void OutputFunction (const std::string &name, const ContinuousFunction< double > &func)=0
 Write out a continuous function of double values. More...
 
virtual void OutputFunction (const std::string &name, const ContinuousFunction< std::complex< double >> func)=0
 Write out a continuous function of complex values. More...
 
template<typename T >
void OutputPiecewiseFunction (const std::string &name, const T &func, bool continuous)
 Write out a continuous function. More...
 
virtual void OutputPiecewiseFunction (const std::string &name, const PiecewiseFunction< int64_t > &func, bool continuous)=0
 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)=0
 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)=0
 Write out a piecewise function of complex values which is defined over a mesh (continuous on each element) More...
 
template<typename T >
void OutputPiecewiseConstantFunction (const std::string &name, const T &func)
 Write out a continuous function. More...
 
virtual void OutputPiecewiseConstantFunction (const std::string &name, const PiecewiseConstantFunction< int64_t > &func)=0
 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)=0
 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)=0
 Write out a piecewise constant function of complex values which is defined over a mesh (constant for each each element) More...
 

Detailed Description

template<std::size_t DIM>
struct ptems::DataFileWriter< DIM >

Base type for an object to write out data to a file.

Member Typedef Documentation

◆ ContinuousFunction

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

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)>

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>&)>

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

Template Parameters
TThe return type of the function

Member Function Documentation

◆ HasError()

template<std::size_t DIM>
virtual bool ptems::DataFileWriter< DIM >::HasError ( ) const
pure virtual

Checks if the writer is invalid (as error)

Returns
true if error; false otherwise

Implemented in ptems::VTKLegacyFileWriter< DIM >, and ptems::MatlabMATFileWriter< DIM >.

◆ operator bool()

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

Checks if the writer is still valid.

Returns
true if valid; false otherwise

◆ OutputFunction() [1/4]

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

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

Implemented in ptems::VTKLegacyFileWriter< DIM >, and ptems::MatlabMATFileWriter< DIM >.

◆ OutputFunction() [2/4]

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

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

Implemented in ptems::VTKLegacyFileWriter< DIM >, and ptems::MatlabMATFileWriter< DIM >.

◆ OutputFunction() [3/4]

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

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

Implemented in ptems::VTKLegacyFileWriter< DIM >, and ptems::MatlabMATFileWriter< DIM >.

◆ OutputFunction() [4/4]

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

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::DataFileWriter< DIM >::OutputPiecewiseConstantFunction ( const std::string name,
const PiecewiseConstantFunction< double > &  func 
)
pure virtual

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

Implemented in ptems::VTKLegacyFileWriter< DIM >, and ptems::MatlabMATFileWriter< DIM >.

◆ OutputPiecewiseConstantFunction() [2/4]

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

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

Implemented in ptems::VTKLegacyFileWriter< DIM >, and ptems::MatlabMATFileWriter< DIM >.

◆ OutputPiecewiseConstantFunction() [3/4]

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

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

Implemented in ptems::VTKLegacyFileWriter< DIM >, and ptems::MatlabMATFileWriter< DIM >.

◆ OutputPiecewiseConstantFunction() [4/4]

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

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::DataFileWriter< DIM >::OutputPiecewiseFunction ( const std::string name,
const PiecewiseFunction< double > &  func,
bool  continuous 
)
pure virtual

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

Implemented in ptems::VTKLegacyFileWriter< DIM >, and ptems::MatlabMATFileWriter< DIM >.

◆ OutputPiecewiseFunction() [2/4]

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

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

Implemented in ptems::VTKLegacyFileWriter< DIM >, and ptems::MatlabMATFileWriter< DIM >.

◆ OutputPiecewiseFunction() [3/4]

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

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

Implemented in ptems::VTKLegacyFileWriter< DIM >, and ptems::MatlabMATFileWriter< 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 
)
inline

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 struct was generated from the following file: