dune-vtk 2.12
Loading...
Searching...
No Matches
Dune::Vtk::GridFunction< GridView, ComponentMapper > Class Template Reference

A Vtk::GridFunction is a function-like object that can be bound to a grid element an that provides an evaluate method with a component argument. More...

#include <dune/vtk/gridfunctions/gridfunction.hh>

Inheritance diagram for Dune::Vtk::GridFunction< GridView, ComponentMapper >:
Inheritance graph

Public Member Functions

template<class F , class R = RangeType<ResolveRef_t<F>,Domain>>
 GridFunction (F &&f, std::string name, int numComponents=dimRange< R >())
 Constructor. Pass any type F supporting the Function interface wrappers the name of the function and a number of components in the range (optional).
 
template<class F , disableCopyMove< GridFunction, F > = 0, decltype(std::declval< F >().name(), bool{}) = true, decltype(std::declval< F >().numComponents(), bool{}) = true, decltype(std::declval< F >().dataType(), bool{}) = true>
 GridFunction (F &&f)
 
template<class F >
 GridFunction (F &&f, const Vtk::FieldInfo &info)
 Constructor. Pass any type F supporting the Function interface wrappers and the FieldInfo describing this function.
 
 GridFunction ()=default
 Default Constructor, creates an invalid function that must be assigned a valid function object.
 
 GridFunction (GridFunction &&)=default
 
GridFunction & operator= (GridFunction &&)=default
 
 GridFunction (const GridFunction &other)
 Copy constructor, clones the underlying implementation.
 
GridFunction & operator= (const GridFunction &other)
 Copy assignment operator, clones the underlying implementation.
 
Impl::RangeProxy< GridFunction, Domain > operator() (Domain const &x) const
 Return a proxy object to access the components of the range vector.
 
double evaluate (int i, Domain const &x) const
 Evaluate the ith component of the Range value at coordinate x
 
std::string const & name () const
 Return a name associated with the function.
 
void setName (std::string name)
 Set the function name.
 
int numComponents () const
 Return the number of components of the Range as it is written to the file.
 
const std::vector< int > & components () const
 Return the components vector.
 
void setComponents (std::vector< int > components)
 Set the components of the Range to visualize.
 
void setComponents (int ncomps)
 Set the number of components of the Range and generate component range [0...ncomps)
 
Vtk::DataTypes dataType () const
 Return the VTK Datatype associated with the functions range type.
 
void setDataType (Vtk::DataTypes type)
 Set the data-type for the components.
 
Vtk::RangeTypes rangeType () const
 The category of the range, SCALAR, VECTOR, TENSOR, or UNSPECIFIED.
 
void setRangeType (Vtk::RangeTypes type, std::size_t ncomp=1)
 Set the category of the range, SCALAR, VECTOR, TENSOR, or UNSPECIFIED.
 
void setFieldInfo (const Vtk::FieldInfo &info)
 Set all the parameters from a FieldInfo object.
 

Friends

LocalFunction localFunction (GridFunction const &self)
 Create the associated local function.
 

Detailed Description

template<class GridView, class ComponentMapper = DefaultComponentMapper>
class Dune::Vtk::GridFunction< GridView, ComponentMapper >

A Vtk::GridFunction is a function-like object that can be bound to a grid element an that provides an evaluate method with a component argument.

Stores internally a Vtk::LocalFunctionInterface object for the concrete evaluation.

Constructor & Destructor Documentation

◆ GridFunction() [1/6]

template<class GridView , class ComponentMapper = DefaultComponentMapper>
template<class F , class R = RangeType<ResolveRef_t<F>,Domain>>
Dune::Vtk::GridFunction< GridView, ComponentMapper >::GridFunction ( F &&  f,
std::string  name,
int  numComponents = dimRange<R>() 
)
inline

Constructor. Pass any type F supporting the Function interface wrappers the name of the function and a number of components in the range (optional).

◆ GridFunction() [2/6]

template<class GridView , class ComponentMapper = DefaultComponentMapper>
template<class F , disableCopyMove< GridFunction, F > = 0, decltype(std::declval< F >().name(), bool{}) = true, decltype(std::declval< F >().numComponents(), bool{}) = true, decltype(std::declval< F >().dataType(), bool{}) = true>
Dune::Vtk::GridFunction< GridView, ComponentMapper >::GridFunction ( F &&  f)
inline

◆ GridFunction() [3/6]

template<class GridView , class ComponentMapper = DefaultComponentMapper>
template<class F >
Dune::Vtk::GridFunction< GridView, ComponentMapper >::GridFunction ( F &&  f,
const Vtk::FieldInfo &  info 
)
inline

Constructor. Pass any type F supporting the Function interface wrappers and the FieldInfo describing this function.

◆ GridFunction() [4/6]

template<class GridView , class ComponentMapper = DefaultComponentMapper>
Dune::Vtk::GridFunction< GridView, ComponentMapper >::GridFunction ( )
default

Default Constructor, creates an invalid function that must be assigned a valid function object.

◆ GridFunction() [5/6]

template<class GridView , class ComponentMapper = DefaultComponentMapper>
Dune::Vtk::GridFunction< GridView, ComponentMapper >::GridFunction ( GridFunction< GridView, ComponentMapper > &&  )
default

◆ GridFunction() [6/6]

template<class GridView , class ComponentMapper = DefaultComponentMapper>
Dune::Vtk::GridFunction< GridView, ComponentMapper >::GridFunction ( const GridFunction< GridView, ComponentMapper > &  other)
inline

Copy constructor, clones the underlying implementation.

Member Function Documentation

◆ components()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
const std::vector< int > & Dune::Vtk::GridFunction< GridView, ComponentMapper >::components ( ) const
inline

Return the components vector.

◆ dataType()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
Vtk::DataTypes Dune::Vtk::GridFunction< GridView, ComponentMapper >::dataType ( ) const
inline

Return the VTK Datatype associated with the functions range type.

◆ evaluate()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
double Dune::Vtk::GridFunction< GridView, ComponentMapper >::evaluate ( int  i,
Domain const &  x 
) const
inline

Evaluate the ith component of the Range value at coordinate x

◆ name()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
std::string const & Dune::Vtk::GridFunction< GridView, ComponentMapper >::name ( ) const
inline

Return a name associated with the function.

◆ numComponents()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
int Dune::Vtk::GridFunction< GridView, ComponentMapper >::numComponents ( ) const
inline

Return the number of components of the Range as it is written to the file.

◆ operator()()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
Impl::RangeProxy< GridFunction, Domain > Dune::Vtk::GridFunction< GridView, ComponentMapper >::operator() ( Domain const &  x) const
inline

Return a proxy object to access the components of the range vector.

◆ operator=() [1/2]

template<class GridView , class ComponentMapper = DefaultComponentMapper>
GridFunction & Dune::Vtk::GridFunction< GridView, ComponentMapper >::operator= ( const GridFunction< GridView, ComponentMapper > &  other)
inline

Copy assignment operator, clones the underlying implementation.

◆ operator=() [2/2]

template<class GridView , class ComponentMapper = DefaultComponentMapper>
GridFunction & Dune::Vtk::GridFunction< GridView, ComponentMapper >::operator= ( GridFunction< GridView, ComponentMapper > &&  )
default

◆ rangeType()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
Vtk::RangeTypes Dune::Vtk::GridFunction< GridView, ComponentMapper >::rangeType ( ) const
inline

The category of the range, SCALAR, VECTOR, TENSOR, or UNSPECIFIED.

◆ setComponents() [1/2]

template<class GridView , class ComponentMapper = DefaultComponentMapper>
void Dune::Vtk::GridFunction< GridView, ComponentMapper >::setComponents ( int  ncomps)
inline

Set the number of components of the Range and generate component range [0...ncomps)

◆ setComponents() [2/2]

template<class GridView , class ComponentMapper = DefaultComponentMapper>
void Dune::Vtk::GridFunction< GridView, ComponentMapper >::setComponents ( std::vector< int >  components)
inline

Set the components of the Range to visualize.

◆ setDataType()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
void Dune::Vtk::GridFunction< GridView, ComponentMapper >::setDataType ( Vtk::DataTypes  type)
inline

Set the data-type for the components.

◆ setFieldInfo()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
void Dune::Vtk::GridFunction< GridView, ComponentMapper >::setFieldInfo ( const Vtk::FieldInfo &  info)
inline

Set all the parameters from a FieldInfo object.

◆ setName()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
void Dune::Vtk::GridFunction< GridView, ComponentMapper >::setName ( std::string  name)
inline

Set the function name.

◆ setRangeType()

template<class GridView , class ComponentMapper = DefaultComponentMapper>
void Dune::Vtk::GridFunction< GridView, ComponentMapper >::setRangeType ( Vtk::RangeTypes  type,
std::size_t  ncomp = 1 
)
inline

Set the category of the range, SCALAR, VECTOR, TENSOR, or UNSPECIFIED.

Friends And Related Symbol Documentation

◆ localFunction

template<class GridView , class ComponentMapper = DefaultComponentMapper>
LocalFunction localFunction ( GridFunction< GridView, ComponentMapper > const &  self)
friend

Create the associated local function.


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