Commit e7c94c16 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'issue/dune-2-6' into 'master'

Remove VTK::Precision for dune-grid < 2.7

See merge request extensions/dune-vtk!19
parents 0178bba1 31c11c7d
...@@ -93,6 +93,7 @@ std::string to_string (Vtk::DataTypes type) ...@@ -93,6 +93,7 @@ std::string to_string (Vtk::DataTypes type)
} }
} }
#if DUNE_VERSION_GTE(DUNE_GRID,2,7)
Vtk::DataTypes dataTypeOf (Dune::VTK::Precision p) Vtk::DataTypes dataTypeOf (Dune::VTK::Precision p)
{ {
switch (p) { switch (p) {
...@@ -106,6 +107,7 @@ Vtk::DataTypes dataTypeOf (Dune::VTK::Precision p) ...@@ -106,6 +107,7 @@ Vtk::DataTypes dataTypeOf (Dune::VTK::Precision p)
std::abort(); std::abort();
} }
} }
#endif
Vtk::DataTypes dataTypeOf (std::string s) Vtk::DataTypes dataTypeOf (std::string s)
{ {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <dune/common/ftraits.hh> #include <dune/common/ftraits.hh>
#include <dune/common/typelist.hh> #include <dune/common/typelist.hh>
#include <dune/common/version.hh>
#include <dune/geometry/type.hh> #include <dune/geometry/type.hh>
#include <dune/grid/io/file/vtk/common.hh> #include <dune/grid/io/file/vtk/common.hh>
#include <dune/vtk/utility/arguments.hh> #include <dune/vtk/utility/arguments.hh>
...@@ -57,8 +58,10 @@ namespace Dune ...@@ -57,8 +58,10 @@ namespace Dune
}; };
std::string to_string (Vtk::DataTypes); std::string to_string (Vtk::DataTypes);
#if DUNE_VERSION_GTE(DUNE_GRID,2,7)
// Map a dune-grid Precision type to DataTypes // Map a dune-grid Precision type to DataTypes
Vtk::DataTypes dataTypeOf (Dune::VTK::Precision); Vtk::DataTypes dataTypeOf (Dune::VTK::Precision);
#endif
// Map a string to DataTypes // Map a string to DataTypes
Vtk::DataTypes dataTypeOf (std::string); Vtk::DataTypes dataTypeOf (std::string);
...@@ -231,7 +234,11 @@ namespace Dune ...@@ -231,7 +234,11 @@ namespace Dune
// Construct from dune-grid FieldInfo // Construct from dune-grid FieldInfo
FieldInfo (Dune::VTK::FieldInfo info) FieldInfo (Dune::VTK::FieldInfo info)
#if DUNE_VERSION_LT(DUNE_GRID,2,7)
: FieldInfo(info.name(), info.size(), rangeTypeOf(info.type()))
#else
: FieldInfo(info.name(), info.size(), rangeTypeOf(info.type()), dataTypeOf(info.precision())) : FieldInfo(info.name(), info.size(), rangeTypeOf(info.type()), dataTypeOf(info.precision()))
#endif
{} {}
/// The name of the data field /// The name of the data field
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment