[dune-pdelab] Writing subtree of a CompositeGridFunctionSpace to VTK

Jö Fahlke jorrit at jorrit.de
Mon Jun 22 12:47:07 CEST 2015


Am Mon, 22. Jun 2015, 06:21:41 +0200 schrieb Oliver Sander:
> Date: Mon, 22 Jun 2015 06:21:41 +0200
> From: Oliver Sander <sander at igpm.rwth-aachen.de>
> To: dune-pdelab mailing list <dune-pdelab at dune-project.org>
> Subject: [dune-pdelab] Writing subtree of a CompositeGridFunctionSpace to
>  VTK
> 
> Dear pdelab team,
> I have written a program that uses a CompositeGridFunctionSpace with two childen,
> each of which is a VectorGridFunctionSpace.  Simulation results are written to
> VTK using [roughly]
> 
>   VTKWriter<GridView> vtkWriter(grid->leafGridView());
>   VectorContainer x(compositeGFS);
>   PDELab::addSolutionToVTKWriter(vtkWriter,compositeGFS,x);
> 
> which works.  However, I actually only want the first subtree in the file.
> How do I do that?

I'm not 100% certain, but I would try the GridFunctionSubspace:
https://www.dune-project.org/doc-pdelab-2.0.0/doxygen/html/classDune_1_1PDELab_1_1GridFunctionSubSpace.html
With that your code should become something like that:

  VTKWriter<GridView> vtkWriter(grid->leafGridView());
  VectorContainer x(compositeGFS);
  PDELab::GridFunctionSubSpace<GFS, TypeTree::TreePath<0> >
    subGFS(stackobject_to_shared_ptr(compositeGFS));
  PDELab::addSolutionToVTKWriter(vtkWriter,subGFS,x);

That is quite ugly.  Maybe Steffen knows a better way?

Regards,
Jö.

-- 
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729

If God had intended Man to Smoke, He would have set him on Fire.
-- fortune
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20150622/a278ec6b/attachment.sig>


More information about the dune-pdelab mailing list