From 773ef8e95f130228670400370c4c8c2c1a1ba42d Mon Sep 17 00:00:00 2001 From: Oliver Sander <oliver.sander@tu-dresden.de> Date: Sat, 12 Oct 2024 22:27:21 +0200 Subject: [PATCH] Make dune-vtk a required dependency It is required by dune-fufem anyway. --- dune.module | 4 ++-- src/cosserat-continuum.cc | 6 ------ src/rod3d.cc | 11 +---------- src/simofoxshell.cc | 6 ------ 4 files changed, 3 insertions(+), 24 deletions(-) diff --git a/dune.module b/dune.module index 93dba47b..923d968c 100644 --- a/dune.module +++ b/dune.module @@ -7,5 +7,5 @@ Module: dune-gfe Version: svn Maintainer: oliver.sander@tu-dresden.de #depending on -Depends: dune-grid(>=2.9) dune-uggrid dune-istl dune-localfunctions dune-functions (>=2.9) dune-solvers dune-fufem dune-elasticity (>=2.9) dune-gmsh4 -Suggests: dune-foamgrid dune-parmg dune-vtk dune-curvedgrid +Depends: dune-grid(>=2.9) dune-uggrid dune-istl dune-localfunctions dune-functions (>=2.9) dune-solvers dune-fufem dune-elasticity (>=2.9) dune-gmsh4 dune-vtk +Suggests: dune-foamgrid dune-parmg dune-curvedgrid diff --git a/src/cosserat-continuum.cc b/src/cosserat-continuum.cc index 51d8ce7b..2d752db3 100644 --- a/src/cosserat-continuum.cc +++ b/src/cosserat-continuum.cc @@ -83,9 +83,7 @@ #include <dune/gfe/spaces/rotation.hh> #endif -#if HAVE_DUNE_VTK #include <dune/vtk/vtkreader.hh> -#endif #include <dune/gmsh4/gmsh4reader.hh> #include <dune/gmsh4/gridcreators/lagrangegridcreator.hh> @@ -229,14 +227,10 @@ int main (int argc, char *argv[]) try reader.read(path + "/" + gridFile); grid = factory.createGrid(); } else if (suffix == ".vtu" or suffix == ".vtp") -#if HAVE_DUNE_VTK #if DUNE_VERSION_GTE(DUNE_VTK, 2, 10) grid = Vtk::VtkReader<GridType>::createGridFromFile(path + "/" + gridFile); #else grid = VtkReader<GridType>::createGridFromFile(path + "/" + gridFile); -#endif -#else - DUNE_THROW(NotImplemented, "Please install dune-vtk for VTK reading support!"); #endif } diff --git a/src/rod3d.cc b/src/rod3d.cc index 9e199f71..3c2e4f32 100644 --- a/src/rod3d.cc +++ b/src/rod3d.cc @@ -24,12 +24,8 @@ #include <dune/solvers/solvers/iterativesolver.hh> #include <dune/solvers/norms/energynorm.hh> -#if HAVE_DUNE_VTK #include <dune/vtk/vtkwriter.hh> #include <dune/vtk/datacollectors/lagrangedatacollector.hh> -#else -#include <dune/gfe/cosseratvtkwriter.hh> -#endif #include <dune/fufem/boundarypatch.hh> #include <dune/fufem/functiontools/boundarydofs.hh> @@ -244,7 +240,7 @@ int main (int argc, char *argv[]) try // ////////////////////////////// // Output result // ////////////////////////////// -#if HAVE_DUNE_VTK + using DataCollector = Vtk::LagrangeDataCollector<GridView,order>; DataCollector dataCollector(gridView); VtkUnstructuredGridWriter<GridView,DataCollector> vtkWriter(gridView, Vtk::FormatTypes::ASCII); @@ -291,11 +287,6 @@ int main (int argc, char *argv[]) try } vtkWriter.write(resultPath + "rod3d-result"); -#else - std::cout << "Falling back to legacy file writing. Get dune-vtk for better results" << std::endl; - // Fall-back solution for users without dune-vtk - CosseratVTKWriter<GridView>::write<ScalarBasis>(scalarBasis,x, resultPath + "rod3d-result"); -#endif } catch (Exception& e) diff --git a/src/simofoxshell.cc b/src/simofoxshell.cc index f6d7484e..76c7db57 100644 --- a/src/simofoxshell.cc +++ b/src/simofoxshell.cc @@ -40,9 +40,7 @@ #include <dune/gfe/spaces/productmanifold.hh> #endif -#if HAVE_DUNE_VTK #include <dune/vtk/vtkreader.hh> -#endif template <int dim, class ctype, class LocalFiniteElement, class TS> using LocalFEFunction = Dune::GFE::LocalProjectedFEFunction<dim,ctype,LocalFiniteElement,TS>; @@ -136,11 +134,7 @@ int main(int argc, char *argv[]) try if (suffix == ".msh") grid = std::shared_ptr<Grid>(GmshReader<Grid>::read(path + "/" + gridFile)); else if (suffix == ".vtu" or suffix == ".vtp") -#if HAVE_DUNE_VTK grid = VtkReader<Grid>::createGridFromFile(path + "/" + gridFile); -#else - DUNE_THROW(NotImplemented, "Please install dune-vtk for VTK reading support!"); -#endif } grid->globalRefine(numLevels - 1); -- GitLab