[Dune-devel] Efficiency of VtkFunction

Aleksejs Fomins aleksejs.fomins at lspr.ch
Tue Dec 1 17:34:45 CET 2015


Dear Dune,

Currently, the Dune::VTKFunction<typename Grid::LeafGridView> has the query interface

virtual double evaluate(int comp, const EntityElement & element, const LocalCoordinate &xi) const

I this interface inefficient in my code for two reasons:
1) My field is vectorial. The code naturally computes a vectorial field for a given coordinate. It is much cheaper than recomputing it for every coordinate component "comp"
2) My field is based on basis functions, which need a small initialization step. Thus for me the ideal interface would be

template<mydim>
VTKFunction

and

VTKFunction::VTKFunction(const EntityElement & element)

and

virtual Dune::FieldVector<ctype, mydim> evaluate(const LocalCoordinate &xi) const

initializing the VtkFunction separately for each element.

Is there a neat way to achieve the desired functionality at the moment?

Greetings,
Aleksejs




More information about the Dune-devel mailing list