[dune-functions] Question about the VTKWriter

Christian Engwer christian.engwer at uni-muenster.de
Thu Mar 26 21:07:48 CET 2015


On Thu, Mar 26, 2015 at 08:57:10PM +0100, Carsten Gräser wrote:
> Am 26.03.2015 um 16:27 schrieb Oliver Sander:
> > Hi guys,
> > I must have missed a detail.  At the end of poisson-pq2.cc it says:
> > 
> >   Dune::Functions::DiscreteScalarGlobalBasisFunction<decltype(feBasis),decltype(x)> xFunction(feBasis,x);
> >   auto localXFunction = localFunction(xFunction);
> >   SubsamplingVTKWriter<GridView> vtkWriter(gridView,2);
> >   vtkWriter.addVertexData(localXFunction, VTK::FieldInfo("x", VTK::FieldInfo::Type::scalar, 1));
> >   vtkWriter.write("poisson-pq2");
> > 
> > Why does the writer get a _local_ function?  Shouldn't it be able to request all the
> > information it needs from the DiscreteScalarGlobalBasisFunction?
> I don't know. I just looked at the VTKWriter code to figure
> out what to pass and adjusted the example accordingly.
> However I'd also say that passing the grid function directly
> would be nicer.

I'd say you want both... in some cases you have a function which is
only defined per cell and you don't add the infrastructure to do the
global evaluation. Using the concepts to should be straight forward
to add the code for both, schouldn't it? If a gridfunction is passed
in, the vtkwriter should create a localfunction and use this, and if a
localfunction is passed in, this should be used directly.

Ciao
Christian




More information about the dune-functions mailing list