Dune Core Modules (unstable)

Dune::P1VTKFunction< GV, V > Class Template Referenceabstract

Take a vector and interpret it as point data for the VTKWriter. More...

#include <dune/grid/io/file/vtk/function.hh>

Public Member Functions

int ncomps () const override
 return number of components
 
double evaluate ([[maybe_unused]] int comp, const Entity &e, const Dune::FieldVector< ctype, dim > &xi) const override
 evaluate
 
std::string name () const override
 get name
 
VTK::Precision precision () const override
 get output precision for the field
 
 P1VTKFunction (const GV &gv, const V &v_, const std::string &s_, int ncomps=1, int mycomp=0, VTK::Precision prec=VTK::Precision::float32)
 construct from a vector and a name More...
 
virtual ~P1VTKFunction ()
 destructor
 
virtual double evaluate (int comp, const Entity &e, const Dune::FieldVector< ctype, dim > &xi) const=0
 evaluate single component comp in the entity e at local coordinates xi More...
 

Detailed Description

template<typename GV, typename V>
class Dune::P1VTKFunction< GV, V >

Take a vector and interpret it as point data for the VTKWriter.

This class turns a generic vector containing point data into a VTKFunction. The vector must allow read access to the data via operator[]() and store the data in the order given by MultipleCodimMultipleGeomTypeMapper with a layout class that allows only vertices. Also, it must support the method size().

While the number of components of the function is always 1, the vector may represent a field with multiple components of which one may be selected.

Template Parameters
GVType of GridView the vector applies to.
VType of vector.

Constructor & Destructor Documentation

◆ P1VTKFunction()

template<typename GV , typename V >
Dune::P1VTKFunction< GV, V >::P1VTKFunction ( const GV &  gv,
const V &  v_,
const std::string &  s_,
int  ncomps = 1,
int  mycomp = 0,
VTK::Precision  prec = VTK::Precision::float32 
)
inline

construct from a vector and a name

Parameters
gvGridView to operate on (used to instantiate a MultipleCodimMultipleGeomTypeMapper, otherwise no reference or copy is stored). Note that this must be the GridView the vector applies to as well as the GridView later used by the VTKWriter – i.e. we do not implicitly restrict or prolongate the data.
v_Reference to the vector holding the data. The reference is stored internally and must be valid for as long as this functions evaluate method is used.
s_Name of this function in the VTK file.
ncompsNumber of components of the field represented by the vector.
mycompNumber of the field component this function is responsible for.
precthe precision with which to output the field

Member Function Documentation

◆ evaluate()

virtual double Dune::VTKFunction< GV >::evaluate ( int  comp,
const Entity &  e,
const Dune::FieldVector< ctype, dim > &  xi 
) const
pure virtualinherited

evaluate single component comp in the entity e at local coordinates xi

Evaluate the function in an entity at local coordinates.

Parameters
[in]compnumber of component to be evaluated
[in]ereference to grid entity of codimension 0
[in]xipoint in local coordinates of the reference element of e
Returns
value of the component

Implemented in Dune::P0VTKFunction< GV, V >.


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Mar 27, 23:31, 2024)