...
 
Commits (2)
......@@ -8,6 +8,7 @@
#include <ostream>
#include <string>
#include <dune/common/version.hh>
#include <dune/dpg/type_traits.hh>
#include <dune/dpg/functions/localindexsetiteration.hh>
#include <dune/grid/io/file/vtk/vtuwriter.hh>
......@@ -79,8 +80,14 @@ namespace Dune
{
writer.beginPointData(dataName);
{
#if DUNE_VERSION_NEWER(DUNE_GRID,2,7)
std::unique_ptr<VTK::DataArrayWriter> arraywriter
(writer.makeArrayWriter(dataName, 1, npoints,
VTK::Precision::float32));
#else
std::unique_ptr<VTK::DataArrayWriter<float>> arraywriter
(writer.makeArrayWriter<float>(dataName, 1, npoints));
#endif
auto localView = feBasis.localView();
using GridView = typename FEBasis::GridView;
......@@ -122,8 +129,14 @@ namespace Dune
void writePoints(const FEBasis& feBasis) {
writer.beginPoints();
{
#if DUNE_VERSION_NEWER(DUNE_GRID,2,7)
std::unique_ptr<VTK::DataArrayWriter> arraywriter
(writer.makeArrayWriter("Coordinates", 3, npoints,
VTK::Precision::float32));
#else
std::unique_ptr<VTK::DataArrayWriter<float>> arraywriter
(writer.makeArrayWriter<float>("Coordinates", 3, npoints));
#endif
auto localView = feBasis.localView();
using GridView = typename FEBasis::GridView;
const GridView gridView = feBasis.gridView();
......@@ -154,14 +167,26 @@ namespace Dune
using GridView = typename FEBasis::GridView;
writer.beginCells();
{ // connectivity
#if DUNE_VERSION_NEWER(DUNE_GRID,2,7)
std::unique_ptr<VTK::DataArrayWriter> arraywriter
(writer.makeArrayWriter("connectivity", 1, ncorners,
VTK::Precision::int32));
#else
std::unique_ptr<VTK::DataArrayWriter<int>> arraywriter
(writer.makeArrayWriter<int>("connectivity", 1, ncorners));
#endif
for(unsigned i = 0; i < ncorners; i++)
arraywriter->write(i);
}
{ // connectivity
#if DUNE_VERSION_NEWER(DUNE_GRID,2,7)
std::unique_ptr<VTK::DataArrayWriter> arraywriter
(writer.makeArrayWriter("offsets", 1, ncells,
VTK::Precision::int32));
#else
std::unique_ptr<VTK::DataArrayWriter<int>> arraywriter
(writer.makeArrayWriter<int>("offsets", 1, ncells));
#endif
int offset = 0;
auto localView = feBasis.localView();
const GridView gridView = feBasis.gridView();
......@@ -177,8 +202,13 @@ namespace Dune
}
}
{ // types
#if DUNE_VERSION_NEWER(DUNE_GRID,2,7)
std::unique_ptr<VTK::DataArrayWriter> arraywriter
(writer.makeArrayWriter("types", 1, ncells, VTK::Precision::uint8));
#else
std::unique_ptr<VTK::DataArrayWriter<unsigned char>> arraywriter
(writer.makeArrayWriter<unsigned char>("types", 1, ncells));
#endif
auto localView = feBasis.localView();
const GridView gridView = feBasis.gridView();
for(const auto& e : elements(gridView)) {
......
......@@ -9,6 +9,7 @@
#include <dune/common/exceptions.hh>
#include <dune/common/hybridutilities.hh>
#include <dune/common/reservedvector.hh>
#include <dune/localfunctions/optimaltestfunctions/optimaltest.hh>
#include <dune/localfunctions/optimaltestfunctions/refinedoptimaltest.hh>
......@@ -433,7 +434,7 @@ protected:
* \tparam testIndex index of the optimal test space in the test space tuple
*/
template<typename TestspaceCoefficientMatrix, std::size_t testIndex = 0>
using OptimalTestBasis = std::conditional
using OptimalTestBasis = typename std::conditional
< Dune::is_RefinedFiniteElement<
typename std::tuple_element<testIndex,
typename TestspaceCoefficientMatrix::TestSpaces
......