[Dune] problem with subsampling

Arya Fallahi arya.fallahi at gmail.com
Wed Nov 20 13:05:06 CET 2013


Hi Christoph and Oliver,

Thank you very much for your reply. It helped me to solve the problem.
Actually, I had to remove the "true" variable in the initialization of
subsampling. I don't know why, but it worked in this way.

Best regards,
Arya


On Wed, Nov 20, 2013 at 7:47 AM, Christoph Grüninger <
christoph.grueninger at iws.uni-stuttgart.de> wrote:

> Hi Arya,
> do you use dune-grid directly or through an abstraction level like
> PDELab or dune-FEM? From PDELab it works for me, so in general it is
> working:
>
> > StaggeredQ0DGF staggeredQ0DGF(vsub, x);
> > P0DGF p0dgf(psub, x);
> > Dune::SubsamplingVTKWriter<GV> vtkwriter(gv, 1);
> > vtkwriter.addCellData(new
> Dune::PDELab::VTKGridFunctionAdapter<P0DGF>(p0dgf, "pressure"));
> > vtkwriter.addCellData(new
> Dune::PDELab::VTKGridFunctionAdapter<StaggeredQ0DGF>(staggeredQ0DGF,
> "velocity"));
> > sprintf(fname, "test_k-%04d", gridCells);
> > vtkwriter.write(fname, Dune::VTK::ascii);
>
> Maybe have a look at testsgrid in dune/grid/io/file/dgfparser/test.
> With these changes the subsampling writer seems to work (at least the
> output was not the same) for the grid, there was no data attached:
>
> --- a/dune/grid/io/file/dgfparser/test/main.cc
> +++ b/dune/grid/io/file/dgfparser/test/main.cc
> @@ -51,12 +51,12 @@ void display ( const std::string &name,
>      disp.display();
>    }
>  #endif // #if HAVE_GRAPE
> -  VTKWriter<GridView> vtkWriter(view);
> -  // SubsamplingVTKWriter<GridView> vtkWriter(view,6);
> +  //VTKWriter<GridView> vtkWriter(view);
> +  SubsamplingVTKWriter<GridView> vtkWriter(view,3);
>    if( nofElParams + nofVtxParams > 0 )
>    {
>      vtkWriter.addCellData( elDat, "el. Parameters", nofElParams );
> -    vtkWriter.addVertexData( vtxDat, "vtx. Parameters", nofVtxParams );
> +    //vtkWriter.addVertexData( vtxDat, "vtx. Parameters", nofVtxParams );
>    }
>    vtkWriter.write( name );
>  }
>
> Bye
> Christoph
>
> --
> Une science n'était vraiment développée que quand elle
> pouvait utiliser les mathématiques.    (Paul Lafargue)
> *********************************************
> CMWR 2014: 10th - 13th June 2014 in Stuttgart
>          Please visit www.cmwr14.de
> *********************************************
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20131120/a4d3ee48/attachment.htm>


More information about the Dune mailing list