From fb6d90966d27dd765c0e53c5d8d8e5b11a737981 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Sun, 23 Oct 2011 08:34:23 +0000 Subject: [PATCH] fixes; add a const_cast hack to allow writing of const grids [[Imported from SVN: r7995]] --- dune/gfe/cosseratamirameshwriter.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dune/gfe/cosseratamirameshwriter.hh b/dune/gfe/cosseratamirameshwriter.hh index f03b6e9a..19b6336d 100644 --- a/dune/gfe/cosseratamirameshwriter.hh +++ b/dune/gfe/cosseratamirameshwriter.hh @@ -63,7 +63,7 @@ class CosseratAmiraMeshWriter public: - static void write(GridType& grid, + static void write(const GridType& grid, const std::vector<RigidBodyMotion<3> >& configuration, const std::string& filePrefix) { @@ -72,10 +72,11 @@ public: DeformationFunction<typename GridType::LeafGridView> deformationFunction(grid.leafView(), configuration); - DeformedGridType deformedGrid(grid, deformationFunction); + // stupid, can't instantiate deformedGrid with a const grid + DeformedGridType deformedGrid(const_cast<GridType&>(grid), deformationFunction); if (dim==2) - Dune::LeafAmiraMeshWriter<DeformedGridType>::writeSurfaceGrid(deformedGrid.leafView(), "cosseratGrid"); + Dune::LeafAmiraMeshWriter<DeformedGridType>::writeSurfaceGrid(deformedGrid.leafView(), filePrefix + "Grid"); else { Dune::LeafAmiraMeshWriter<DeformedGridType> amiramesh(deformedGrid); amiramesh.write(filePrefix + "Grid"); -- GitLab