[Dune] problem with subsampling
Christoph Grüninger
christoph.grueninger at iws.uni-stuttgart.de
Wed Nov 20 07:47:04 CET 2013
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
*********************************************
More information about the Dune
mailing list