4 #ifndef DUNE_GRID_IO_FILE_VTK_FUNCTION_HH
5 #define DUNE_GRID_IO_FILE_VTK_FUNCTION_HH
9 #include <dune/common/exceptions.hh>
10 #include <dune/common/fvector.hh>
12 #include <dune/geometry/type.hh>
13 #include <dune/geometry/referenceelements.hh>
36 template<
class Gr
idView >
42 typedef typename GridView::template Codim< 0 >::Entity
Entity;
46 virtual int ncomps ()
const = 0;
57 const Dune::FieldVector<ctype,dim>& xi)
const = 0;
60 virtual std::string
name ()
const = 0;
86 template<
typename GV,
typename V>
120 const Dune::FieldVector<ctype,dim>& xi)
const
122 return v[mapper.
map(e)*ncomps_+mycomp_];
126 virtual std::string
name ()
const
149 int ncomps=1,
int mycomp=0 )
156 if (v.size()!=(
unsigned int)(mapper.
size()*ncomps_))
157 DUNE_THROW(IOError,
"P0VTKFunction: size mismatch");
189 template<
typename GV,
typename V>
223 const Dune::FieldVector<ctype,dim>& xi)
const
228 for (
int i=0; i<e.template count<dim>(); ++i)
230 Dune::FieldVector<ctype,dim> local =
231 Dune::ReferenceElements<ctype,dim>::general(gt)
234 if (local.infinity_norm()<
min)
236 min = local.infinity_norm();
240 return v[mapper.
map(e,imin,
dim)*ncomps_+mycomp_];
244 virtual std::string
name ()
const
267 int ncomps=1,
int mycomp=0 )
274 if (v.size()!=(
unsigned int)(mapper.
size()*ncomps_))
275 DUNE_THROW(IOError,
"P1VTKFunction: size mismatch");
286 #endif // DUNE_GRID_IO_FILE_VTK_FUNCTION_HH