[dune-functions] Question about the VTKWriter

Oliver Sander sander at igpm.rwth-aachen.de
Thu Mar 26 22:33:27 CET 2015


Am 26.03.2015 um 21:07 schrieb Christian Engwer:
> 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.

Yes, this is what I would expect.  dune-fufem (kind-of) does this in
a few places.
Cheers,
Oliver

> 
> Ciao
> Christian
> 
> _______________________________________________
> dune-functions mailing list
> dune-functions at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-functions
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-functions/attachments/20150326/04eea9c9/attachment.sig>


More information about the dune-functions mailing list