diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..a70b45abe2f7bd9b20e4e347f42d811721b98c05
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,59 @@
+centos_build:
+  stage: build
+  tags:
+    - centos
+  artifacts:
+    paths:
+      - ./openfpm_io/build/src/io
+      - ./openfpm_io/test_data
+  script:
+    - ./build.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS NO $CI_COMMIT_REF_NAME
+
+centos_run:
+  stage: test
+  tags:
+    - centos
+  dependencies:
+    - centos_build
+  script:
+    - ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS NO $CI_COMMIT_REF_NAME
+
+mac_build:
+  stage: build
+  tags:
+    - mac
+  artifacts:
+    paths:
+      - ./openfpm_io/build/src/io
+      - ./openfpm_io/test_data
+  script:
+    - ./build.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS NO $CI_COMMIT_REF_NAME
+
+mac_run:
+  stage: test
+  tags:
+    - mac
+  dependencies:
+    - mac_build
+  script:
+    - ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS NO $CI_COMMIT_REF_NAME
+
+ubuntu_build:
+  stage: build
+  tags:
+    - ubuntu
+  artifacts:
+    paths:
+      - ./openfpm_io/build/src/io
+      - ./openfpm_io/test_data
+  script:
+    - ./build.sh $CI_PROJECT_DIR $CI_RUNNER_EXECUTABLE_TAGS NO $CI_COMMIT_REF_NAME
+
+ubuntu_run:
+  stage: test
+  tags:
+    - ubuntu
+  dependencies:
+    - ubuntu_build
+  script:
+    - ./run.sh $CI_PROJECT_DIR $CI_RUNNER_TAGS NO $CI_COMMIT_REF_NAME
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee92db08f5acf185f18eddde6ff2d44d2cbdf901..d2530cc7992bbdba69149f6d619e3fb5e80ed9b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,16 @@
 cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
 project(openfpm_pdata LANGUAGES C CXX)
 
+if (POLICY CMP0074)
+        cmake_policy(SET CMP0074 OLD)
+endif ()
 
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake_modules/)
 
+if (POLICY CMP0074)
+  cmake_policy(SET CMP0074 NEW)
+endif()
+
 set(BOOST_INCLUDE ${Boost_INCLUDE_DIR} CACHE PATH "Include directory for BOOST")
 set(HDF5_ROOT CACHE PATH "HDF5 root path")
 set(SE_CLASS1 CACHE BOOL "Activate compilation with SE_CLASS1")
@@ -11,6 +18,9 @@ set(SE_CLASS2 CACHE BOOL "Activate compilation with SE_CLASS2")
 set(SE_CLASS3 CACHE BOOL "Activate compilation with SE_CLASS3")
 set(ENV{HDF5_ROOT} ${HDF5_ROOT})
 set(OPENFPM_PDATA_DIR CACHE PATH "OpenFPM_pdata dirs")
+set(PETSC_ROOT CACHE PATH "If compiling with linear algebra indicate the PETSC root directory")
+set(ENV{PETSC_DIR} ${PETSC_ROOT})
+
 
 set (CMAKE_CXX_STANDARD 11)
 set (CMAKE_CUDA_STANDARD 11)
@@ -25,12 +35,26 @@ set(HDF5_PREFER_PARALLEL TRUE)
 if(ENABLE_GPU)
 	enable_language(CUDA)
 	find_package(CUDA)
+
+        if (CUDA_VERSION_MAJOR EQUAL 9 AND CUDA_VERSION_MINOR EQUAL 2)
+                message("CUDA is compatible")
+                set(WARNING_SUPPRESSION_AND_OPTION_NVCC  -Xcudafe "--display_error_number --diag_suppress=611 --diag_suppress=2885 --diag_suppress=2886  --diag_suppress=2887  --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111 " --expt-extended-lambda)
+        elseif ( CUDA_VERSION_MAJOR EQUAL 10 AND CUDA_VERSION_MINOR EQUAL 1 )
+                message("CUDA is compatible")
+                set(WARNING_SUPPRESSION_AND_OPTION_NVCC  -Xcudafe "--display_error_number --diag_suppress=2915 --diag_suppress=2912 --diag_suppress=2913 --diag_suppress=111 --diag_suppress=186 --diag_suppress=611 " --expt-extended-lambda)
+        elseif ( CUDA_VERSION_MAJOR EQUAL 10 AND CUDA_VERSION_MINOR EQUAL 2 )
+                message("CUDA is compatible")
+                set(WARNING_SUPPRESSION_AND_OPTION_NVCC  -Xcudafe "--display_error_number --diag_suppress=2977 --diag_suppress=2976 --diag_suppress=2979 --diag_suppress=186" --expt-extended-lambda)
+        else()
+                message(FATAL_ERROR "CUDA is incompatible, version 9.2 10.1 and 10.2 is only supported")
+        endif()
 endif()
 
 find_package(Boost 1.66.0 REQUIRED COMPONENTS unit_test_framework iostreams program_options)
 find_package(MPI REQUIRED)
 find_package(HDF5 REQUIRED)
-find_package(TinyObjLoader )
+find_package(TinyObjLoader)
+find_package(PETSc)
 
 if(CUDA_FOUND)
 	set(OPENFPM_INIT_FILE "initialize/initialize_wrapper_cuda.cu")
@@ -62,6 +86,10 @@ else()
 	message( FATAL_ERROR "MPI is required in order to install OpenFPM" )
 endif()
 
+if(PETSC_FOUND)
+        set(DEFINE_HAVE_PETSC "#define HAVE_PETSC")
+endif()
+
 if (Boost_FOUND)
 	set(DEFINE_HAVE_BOOST "#define HAVE_BOOST")
 	set(DEFINE_HAVE_BOOST_IOSTREAMS "#define HAVE_BOOST_IOSTREAMS")
diff --git a/build.sh b/build.sh
index cc7256a86c889ffe07a5fad66cef3cc8f9c262ca..b2e14c5a9dea7c1153ace40a724e90fcd9e321bf 100755
--- a/build.sh
+++ b/build.sh
@@ -19,13 +19,19 @@ mv /tmp/openfpm_io openfpm_io
 
 git clone git@git.mpi-cbg.de:openfpm/openfpm_devices.git openfpm_devices
 cd openfpm_devices
+git checkout master
 cd ..
 git clone git@git.mpi-cbg.de:openfpm/openfpm_data.git openfpm_data
 cd openfpm_data
+git checkout master
 cd ..
 git clone git@git.mpi-cbg.de:openfpm/openfpm_pdata.git openfpm_pdata
+cd openfpm_pdata
+git checkout master
+cd ..
 git clone git@git.mpi-cbg.de:openfpm/openfpm_vcluster.git openfpm_vcluster
 cd openfpm_vcluster
+git checkout master
 cd ..
 
 cd "$1/openfpm_io"
diff --git a/cmake_modules/CorrectWindowsPaths.cmake b/cmake_modules/CorrectWindowsPaths.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..09bcdd67dcd04fd001d2b7acbd904b5014ebe42b
--- /dev/null
+++ b/cmake_modules/CorrectWindowsPaths.cmake
@@ -0,0 +1,14 @@
+# CorrectWindowsPaths - this module defines one macro
+#
+# CONVERT_CYGWIN_PATH( PATH )
+#  This uses the command cygpath (provided by cygwin) to convert
+#  unix-style paths into paths useable by cmake on windows
+
+macro (CONVERT_CYGWIN_PATH _path)
+  if (WIN32)
+    EXECUTE_PROCESS(COMMAND cygpath.exe -m ${${_path}}
+      OUTPUT_VARIABLE ${_path})
+    string (STRIP ${${_path}} ${_path})
+  endif (WIN32)
+endmacro (CONVERT_CYGWIN_PATH)
+
diff --git a/cmake_modules/FindPETSc.cmake b/cmake_modules/FindPETSc.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..f8ea15b67fbb5a237169411fe37fa5227e6b7aee
--- /dev/null
+++ b/cmake_modules/FindPETSc.cmake
@@ -0,0 +1,349 @@
+# - Try to find PETSc
+# Once done this will define
+#
+#  PETSC_FOUND        - system has PETSc
+#  PETSC_INCLUDES     - the PETSc include directories
+#  PETSC_LIBRARIES    - Link these to use PETSc
+#  PETSC_COMPILER     - Compiler used by PETSc, helpful to find a compatible MPI
+#  PETSC_DEFINITIONS  - Compiler switches for using PETSc
+#  PETSC_MPIEXEC      - Executable for running MPI programs
+#  PETSC_VERSION      - Version string (MAJOR.MINOR.SUBMINOR)
+#
+#  Usage:
+#  find_package(PETSc COMPONENTS CXX)  - required if build --with-clanguage=C++ --with-c-support=0
+#  find_package(PETSc COMPONENTS C)    - standard behavior of checking build using a C compiler
+#  find_package(PETSc)                 - same as above
+#
+# Setting these changes the behavior of the search
+#  PETSC_DIR - directory in which PETSc resides
+#  PETSC_ARCH - build architecture
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+cmake_policy(VERSION 3.3)
+
+set(PETSC_VALID_COMPONENTS
+  C
+  CXX)
+
+if(NOT PETSc_FIND_COMPONENTS)
+  get_property (_enabled_langs GLOBAL PROPERTY ENABLED_LANGUAGES)
+  if ("C" IN_LIST _enabled_langs)
+    set(PETSC_LANGUAGE_BINDINGS "C")
+  else ()
+    set(PETSC_LANGUAGE_BINDINGS "CXX")
+  endif ()
+else()
+  # Right now, this is designed for compatability with the --with-clanguage option, so
+  # only allow one item in the components list.
+  list(LENGTH ${PETSc_FIND_COMPONENTS} components_length)
+  if(${components_length} GREATER 1)
+    message(FATAL_ERROR "Only one component for PETSc is allowed to be specified")
+  endif()
+  # This is a stub for allowing multiple components should that time ever come. Perhaps
+  # to also test Fortran bindings?
+  foreach(component ${PETSc_FIND_COMPONENTS})
+    list(FIND PETSC_VALID_COMPONENTS ${component} component_location)
+    if(${component_location} EQUAL -1)
+      message(FATAL_ERROR "\"${component}\" is not a valid PETSc component.")
+    else()
+      list(APPEND PETSC_LANGUAGE_BINDINGS ${component})
+    endif()
+  endforeach()
+endif()
+
+function (petsc_get_version)
+  if (EXISTS "${PETSC_DIR}/include/petscversion.h")
+    file (STRINGS "${PETSC_DIR}/include/petscversion.h" vstrings REGEX "#define PETSC_VERSION_(RELEASE|MAJOR|MINOR|SUBMINOR|PATCH) ")
+    foreach (line ${vstrings})
+      string (REGEX REPLACE " +" ";" fields ${line}) # break line into three fields (the first is always "#define")
+      list (GET fields 1 var)
+      list (GET fields 2 val)
+      set (${var} ${val} PARENT_SCOPE)
+      set (${var} ${val})         # Also in local scope so we have access below
+    endforeach ()
+    if (PETSC_VERSION_RELEASE)
+      if ($(PETSC_VERSION_PATCH) GREATER 0)
+        set (PETSC_VERSION "${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}p${PETSC_VERSION_PATCH}" CACHE INTERNAL "PETSc version")
+      else ()
+        set (PETSC_VERSION "${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}" CACHE INTERNAL "PETSc version")
+      endif ()
+    else ()
+      # make dev version compare higher than any patch level of a released version
+      set (PETSC_VERSION "${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}.99" CACHE INTERNAL "PETSc version")
+    endif ()
+  else ()
+    message (SEND_ERROR "PETSC_DIR can not be used, ${PETSC_DIR}/include/petscversion.h does not exist")
+  endif ()
+endfunction ()
+
+# Debian uses versioned paths e.g /usr/lib/petscdir/3.5/
+file (GLOB DEB_PATHS "/usr/lib/petscdir/*")
+
+find_path (PETSC_DIR include/petsc.h
+  HINTS ENV PETSC_DIR
+  PATHS
+  /usr/lib/petsc
+  # Debian paths
+  ${DEB_PATHS}
+  # Arch Linux path
+  /opt/petsc/linux-c-opt
+  # MacPorts path
+  /opt/local/lib/petsc
+  $ENV{HOME}/petsc
+  DOC "PETSc Directory")
+
+find_program (MAKE_EXECUTABLE NAMES make gmake)
+
+if (PETSC_DIR AND NOT PETSC_ARCH)
+  set (_petsc_arches
+    $ENV{PETSC_ARCH}                   # If set, use environment variable first
+    linux-gnu-c-debug linux-gnu-c-opt  # Debian defaults
+    x86_64-unknown-linux-gnu i386-unknown-linux-gnu)
+  set (petscconf "NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
+  foreach (arch ${_petsc_arches})
+    if (NOT PETSC_ARCH)
+      find_path (petscconf petscconf.h
+        HINTS ${PETSC_DIR}
+        PATH_SUFFIXES ${arch}/include bmake/${arch}
+        NO_DEFAULT_PATH)
+      if (petscconf)
+        set (PETSC_ARCH "${arch}" CACHE STRING "PETSc build architecture")
+      endif (petscconf)
+    endif (NOT PETSC_ARCH)
+  endforeach (arch)
+  set (petscconf "NOTFOUND" CACHE INTERNAL "Scratch variable" FORCE)
+endif (PETSC_DIR AND NOT PETSC_ARCH)
+
+set (petsc_slaves LIBRARIES_SYS LIBRARIES_VEC LIBRARIES_MAT LIBRARIES_DM LIBRARIES_KSP LIBRARIES_SNES LIBRARIES_TS
+  INCLUDE_DIR INCLUDE_CONF)
+include (FindPackageMultipass)
+find_package_multipass (PETSc petsc_config_current
+  STATES DIR ARCH
+  DEPENDENTS INCLUDES LIBRARIES COMPILER MPIEXEC ${petsc_slaves})
+
+# Determine whether the PETSc layout is old-style (through 2.3.3) or
+# new-style (>= 3.0.0)
+if (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/petscvariables") # > 3.5
+  set (petsc_conf_rules "${PETSC_DIR}/lib/petsc/conf/rules")
+  set (petsc_conf_variables "${PETSC_DIR}/lib/petsc/conf/variables")
+elseif (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h")   # > 2.3.3
+  set (petsc_conf_rules "${PETSC_DIR}/conf/rules")
+  set (petsc_conf_variables "${PETSC_DIR}/conf/variables")
+elseif (EXISTS "${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h") # <= 2.3.3
+  set (petsc_conf_rules "${PETSC_DIR}/bmake/common/rules")
+  set (petsc_conf_variables "${PETSC_DIR}/bmake/common/variables")
+elseif (PETSC_DIR)
+  message (SEND_ERROR "The pair PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} do not specify a valid PETSc installation")
+endif ()
+
+if (petsc_conf_rules AND petsc_conf_variables AND NOT petsc_config_current)
+  petsc_get_version()
+
+  # Put variables into environment since they are needed to get
+  # configuration (petscvariables) in the PETSc makefile
+  set (ENV{PETSC_DIR} "${PETSC_DIR}")
+  set (ENV{PETSC_ARCH} "${PETSC_ARCH}")
+
+  # A temporary makefile to probe the PETSc configuration
+  set (petsc_config_makefile "${PROJECT_BINARY_DIR}/Makefile.petsc")
+  file (WRITE "${petsc_config_makefile}"
+"## This file was autogenerated by FindPETSc.cmake
+# PETSC_DIR  = ${PETSC_DIR}
+# PETSC_ARCH = ${PETSC_ARCH}
+include ${petsc_conf_rules}
+include ${petsc_conf_variables}
+show :
+\t-@echo -n \${\${VARIABLE}}
+")
+
+  macro (PETSC_GET_VARIABLE name var)
+    set (${var} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
+    execute_process (COMMAND ${MAKE_EXECUTABLE} --no-print-directory -f ${petsc_config_makefile} show VARIABLE=${name}
+      OUTPUT_VARIABLE ${var}
+      RESULT_VARIABLE petsc_return)
+  endmacro (PETSC_GET_VARIABLE)
+  petsc_get_variable (PETSC_LIB_DIR            petsc_lib_dir)
+  petsc_get_variable (PETSC_EXTERNAL_LIB_BASIC petsc_libs_external)
+  petsc_get_variable (PETSC_CCPPFLAGS          petsc_cpp_line)
+  petsc_get_variable (PETSC_INCLUDE            petsc_include)
+  petsc_get_variable (PCC                      petsc_cc)
+  petsc_get_variable (PCC_FLAGS                petsc_cc_flags)
+  petsc_get_variable (MPIEXEC                  petsc_mpiexec)
+  # We are done with the temporary Makefile, calling PETSC_GET_VARIABLE after this point is invalid!
+  file (REMOVE ${petsc_config_makefile})
+
+  execute_process(COMMAND ${MPI_C_COMPILER} --showme:compile OUTPUT_VARIABLE mpi_compile_options ERROR_VARIABLE mpi_compile_error)
+  set(petsc_cpp_line ${petsc_cpp_line} ${mpi_compile_options})
+
+  include (ResolveCompilerPaths)
+  # Extract include paths and libraries from compile command line
+  resolve_includes (petsc_includes_all "${petsc_cpp_line}")
+
+  #on windows we need to make sure we're linking against the right
+  #runtime library
+  if (WIN32)
+    if (petsc_cc_flags MATCHES "-MT")
+      set(using_md False)
+      foreach(flag_var
+          CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+          CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+          CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+          CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+        if(${flag_var} MATCHES "/MD")
+          set(using_md True)
+        endif(${flag_var} MATCHES "/MD")
+      endforeach(flag_var)
+      if(${using_md} MATCHES "True")
+        message(WARNING "PETSc was built with /MT, but /MD is currently set.
+ See http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F")
+      endif(${using_md} MATCHES "True")
+    endif (petsc_cc_flags MATCHES "-MT")
+  endif (WIN32)
+
+  include (CorrectWindowsPaths)
+  convert_cygwin_path(petsc_lib_dir)
+  message (STATUS "petsc_lib_dir ${petsc_lib_dir}")
+
+  macro (PETSC_FIND_LIBRARY suffix name)
+    set (PETSC_LIBRARY_${suffix} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE) # Clear any stale value, if we got here, we need to find it again
+    if (WIN32)
+      set (libname lib${name}) #windows expects "libfoo", linux expects "foo"
+    else (WIN32)
+      set (libname ${name})
+    endif (WIN32)
+    find_library (PETSC_LIBRARY_${suffix} NAMES ${libname} HINTS ${petsc_lib_dir} NO_DEFAULT_PATH)
+    set (PETSC_LIBRARIES_${suffix} "${PETSC_LIBRARY_${suffix}}")
+    mark_as_advanced (PETSC_LIBRARY_${suffix})
+  endmacro (PETSC_FIND_LIBRARY suffix name)
+
+  # Look for petscvec first, if it doesn't exist, we must be using single-library
+  petsc_find_library (VEC petscvec)
+  if (PETSC_LIBRARY_VEC)
+    petsc_find_library (SYS  "petscsys;petsc") # libpetscsys is called libpetsc prior to 3.1 (when single-library was introduced)
+    petsc_find_library (MAT  petscmat)
+    petsc_find_library (DM   petscdm)
+    petsc_find_library (KSP  petscksp)
+    petsc_find_library (SNES petscsnes)
+    petsc_find_library (TS   petscts)
+    macro (PETSC_JOIN libs deps)
+      list (APPEND PETSC_LIBRARIES_${libs} ${PETSC_LIBRARIES_${deps}})
+    endmacro (PETSC_JOIN libs deps)
+    petsc_join (VEC  SYS)
+    petsc_join (MAT  VEC)
+    petsc_join (DM   MAT)
+    petsc_join (KSP  DM)
+    petsc_join (SNES KSP)
+    petsc_join (TS   SNES)
+    petsc_join (ALL  TS)
+  else ()
+    set (PETSC_LIBRARY_VEC "NOTFOUND" CACHE INTERNAL "Cleared" FORCE) # There is no libpetscvec
+    petsc_find_library (SINGLE petsc)
+    # Debian 9/Ubuntu 16.04 uses _real and _complex extensions when using libraries in /usr/lib/petsc.
+    if (NOT PETSC_LIBRARY_SINGLE)
+      petsc_find_library (SINGLE petsc_real)
+    endif()
+    if (NOT PETSC_LIBRARY_SINGLE)
+      petsc_find_library (SINGLE petsc_complex)
+    endif()
+    foreach (pkg SYS VEC MAT DM KSP SNES TS ALL)
+      set (PETSC_LIBRARIES_${pkg} "${PETSC_LIBRARY_SINGLE}")
+    endforeach ()
+  endif ()
+  if (PETSC_LIBRARY_TS)
+    message (STATUS "Recognized PETSc install with separate libraries for each package")
+  else ()
+    message (STATUS "Recognized PETSc install with single library for all packages")
+  endif ()
+
+  include(Check${PETSC_LANGUAGE_BINDINGS}SourceRuns)
+  macro (PETSC_TEST_RUNS includes libraries runs)
+    if (PETSC_VERSION VERSION_GREATER 3.1)
+      set (_PETSC_TSDestroy "TSDestroy(&ts)")
+    else ()
+      set (_PETSC_TSDestroy "TSDestroy(ts)")
+    endif ()
+
+    set(_PETSC_TEST_SOURCE "
+static const char help[] = \"PETSc test program.\";
+#include <petscts.h>
+int main(int argc,char *argv[]) {
+  PetscErrorCode ierr;
+  TS ts;
+
+  ierr = PetscInitialize(&argc,&argv,0,help);CHKERRQ(ierr);
+  ierr = TSCreate(PETSC_COMM_WORLD,&ts);CHKERRQ(ierr);
+  ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
+  ierr = ${_PETSC_TSDestroy};CHKERRQ(ierr);
+  ierr = PetscFinalize();CHKERRQ(ierr);
+  return 0;
+}
+")
+    multipass_source_runs ("${includes}" "${libraries}" "${_PETSC_TEST_SOURCE}" ${runs} "${PETSC_LANGUAGE_BINDINGS}")
+    if (${${runs}})
+      set (PETSC_EXECUTABLE_RUNS "YES" CACHE BOOL
+        "Can the system successfully run a PETSc executable?  This variable can be manually set to \"YES\" to force CMake to accept a given PETSc configuration, but this will almost always result in a broken build.  If you change PETSC_DIR, PETSC_ARCH, or PETSC_CURRENT you would have to reset this variable." FORCE)
+    endif (${${runs}})
+  endmacro (PETSC_TEST_RUNS)
+
+
+  find_path (PETSC_INCLUDE_DIR petscts.h HINTS "${PETSC_DIR}" PATH_SUFFIXES include NO_DEFAULT_PATH)
+  find_path (PETSC_INCLUDE_CONF petscconf.h HINTS "${PETSC_DIR}" PATH_SUFFIXES "${PETSC_ARCH}/include" "bmake/${PETSC_ARCH}" NO_DEFAULT_PATH)
+  mark_as_advanced (PETSC_INCLUDE_DIR PETSC_INCLUDE_CONF)
+  set (petsc_includes_minimal ${PETSC_INCLUDE_CONF} ${PETSC_INCLUDE_DIR})
+
+  petsc_test_runs ("${petsc_includes_minimal}" "${PETSC_LIBRARIES_TS}" petsc_works_minimal)
+  if (petsc_works_minimal)
+    message (STATUS "Minimal PETSc includes and libraries work.  This probably means we are building with shared libs.")
+    set (petsc_includes_needed "${petsc_includes_minimal}")
+  else (petsc_works_minimal)     # Minimal includes fail, see if just adding full includes fixes it
+    petsc_test_runs ("${petsc_includes_all}" "${PETSC_LIBRARIES_TS}" petsc_works_allincludes)
+    if (petsc_works_allincludes) # It does, we just need all the includes (
+      message (STATUS "PETSc requires extra include paths, but links correctly with only interface libraries.  This is an unexpected configuration (but it seems to work fine).")
+      set (petsc_includes_needed ${petsc_includes_all})
+    else (petsc_works_allincludes) # We are going to need to link the external libs explicitly
+      resolve_libraries (petsc_libraries_external "${petsc_libs_external}")
+      foreach (pkg SYS VEC MAT DM KSP SNES TS ALL)
+        list (APPEND PETSC_LIBRARIES_${pkg}  ${petsc_libraries_external})
+      endforeach (pkg)
+      petsc_test_runs ("${petsc_includes_minimal}" "${PETSC_LIBRARIES_TS}" petsc_works_alllibraries)
+      if (petsc_works_alllibraries)
+         message (STATUS "PETSc only need minimal includes, but requires explicit linking to all dependencies.  This is expected when PETSc is built with static libraries.")
+        set (petsc_includes_needed ${petsc_includes_minimal})
+      else (petsc_works_alllibraries)
+        # It looks like we really need everything, should have listened to Matt
+        set (petsc_includes_needed ${petsc_includes_all})
+        petsc_test_runs ("${petsc_includes_all}" "${PETSC_LIBRARIES_TS}" petsc_works_all)
+        if (petsc_works_all) # We fail anyways
+          message (STATUS "PETSc requires extra include paths and explicit linking to all dependencies.  This probably means you have static libraries and something unexpected in PETSc headers.")
+        else (petsc_works_all) # We fail anyways
+          message (STATUS "PETSc could not be used, maybe the install is broken.")
+        endif (petsc_works_all)
+      endif (petsc_works_alllibraries)
+    endif (petsc_works_allincludes)
+  endif (petsc_works_minimal)
+
+  # We do an out-of-source build so __FILE__ will be an absolute path, hence __INSDIR__ is superfluous
+  if (${PETSC_VERSION} VERSION_LESS 3.1)
+    set (PETSC_DEFINITIONS "-D__SDIR__=\"\"" CACHE STRING "PETSc definitions" FORCE)
+  else ()
+    set (PETSC_DEFINITIONS "-D__INSDIR__=" CACHE STRING "PETSc definitions" FORCE)
+  endif ()
+  # Sometimes this can be used to assist FindMPI.cmake
+  set (PETSC_MPIEXEC ${petsc_mpiexec} CACHE FILEPATH "Executable for running PETSc MPI programs" FORCE)
+  set (PETSC_INCLUDES ${petsc_includes_needed} CACHE STRING "PETSc include path" FORCE)
+  set (PETSC_LIBRARIES ${PETSC_LIBRARIES_ALL} CACHE STRING "PETSc libraries" FORCE)
+  set (PETSC_COMPILER ${petsc_cc} CACHE FILEPATH "PETSc compiler" FORCE)
+  # Note that we have forced values for all these choices.  If you
+  # change these, you are telling the system to trust you that they
+  # work.  It is likely that you will end up with a broken build.
+  mark_as_advanced (PETSC_INCLUDES PETSC_LIBRARIES PETSC_COMPILER PETSC_DEFINITIONS PETSC_MPIEXEC PETSC_EXECUTABLE_RUNS)
+endif ()
+
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (PETSc
+  REQUIRED_VARS PETSC_INCLUDES PETSC_LIBRARIES PETSC_EXECUTABLE_RUNS
+  VERSION_VAR PETSC_VERSION
+  FAIL_MESSAGE "PETSc could not be found.  Be sure to set PETSC_DIR and PETSC_ARCH.")
diff --git a/cmake_modules/FindPackageMultipass.cmake b/cmake_modules/FindPackageMultipass.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..fbf06a7f0fc3aa20a0387f091eac4f74e7ffdab2
--- /dev/null
+++ b/cmake_modules/FindPackageMultipass.cmake
@@ -0,0 +1,106 @@
+# PackageMultipass - this module defines two macros
+#
+# FIND_PACKAGE_MULTIPASS (Name CURRENT
+#  STATES VAR0 VAR1 ...
+#  DEPENDENTS DEP0 DEP1 ...)
+#
+#  This function creates a cache entry <UPPERCASED-Name>_CURRENT which
+#  the user can set to "NO" to trigger a reconfiguration of the package.
+#  The first time this function is called, the values of
+#  <UPPERCASED-Name>_VAR0, ... are saved.  If <UPPERCASED-Name>_CURRENT
+#  is false or if any STATE has changed since the last time
+#  FIND_PACKAGE_MULTIPASS() was called, then CURRENT will be set to "NO",
+#  otherwise CURRENT will be "YES".  IF not CURRENT, then
+#  <UPPERCASED-Name>_DEP0, ... will be FORCED to NOTFOUND.
+#  Example:
+#    find_path (FOO_DIR include/foo.h)
+#    FIND_PACKAGE_MULTIPASS (Foo foo_current
+#      STATES DIR
+#      DEPENDENTS INCLUDES LIBRARIES)
+#    if (NOT foo_current)
+#      # Make temporary files, run programs, etc, to determine FOO_INCLUDES and FOO_LIBRARIES
+#    endif (NOT foo_current)
+#
+# MULTIPASS_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS LANGUAGE)
+#  Always runs the given test, use this when you need to re-run tests
+#  because parent variables have made old cache entries stale. The LANGUAGE
+#  variable is either C or CXX indicating which compiler the test should
+#  use.
+# MULTIPASS_C_SOURCE_RUNS (Name INCLUDES LIBRARIES SOURCE RUNS)
+#  DEPRECATED! This is only included for backwards compatability. Use
+#  the more general MULTIPASS_SOURCE_RUNS instead.
+#  Always runs the given test, use this when you need to re-run tests
+#  because parent variables have made old cache entries stale.
+
+macro (FIND_PACKAGE_MULTIPASS _name _current)
+  string (TOUPPER ${_name} _NAME)
+  set (_args ${ARGV})
+  list (REMOVE_AT _args 0 1)
+
+  set (_states_current "YES")
+  list (GET _args 0 _cmd)
+  if (_cmd STREQUAL "STATES")
+    list (REMOVE_AT _args 0)
+    list (GET _args 0 _state)
+    while (_state AND NOT _state STREQUAL "DEPENDENTS")
+      # The name of the stored value for the given state
+      set (_stored_var PACKAGE_MULTIPASS_${_NAME}_${_state})
+      if (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
+        set (_states_current "NO")
+      endif (NOT "${${_stored_var}}" STREQUAL "${${_NAME}_${_state}}")
+      set (${_stored_var} "${${_NAME}_${_state}}" CACHE INTERNAL "Stored state for ${_name}." FORCE)
+      list (REMOVE_AT _args 0)
+      list (GET _args 0 _state)
+    endwhile (_state AND NOT _state STREQUAL "DEPENDENTS")
+  endif (_cmd STREQUAL "STATES")
+
+  set (_stored ${_NAME}_CURRENT)
+  if (NOT ${_stored})
+    set (${_stored} "YES" CACHE BOOL "Is the configuration for ${_name} current?  Set to \"NO\" to reconfigure." FORCE)
+    set (_states_current "NO")
+  endif (NOT ${_stored})
+
+  set (${_current} ${_states_current})
+  if (NOT ${_current} AND PACKAGE_MULTIPASS_${_name}_CALLED)
+    message (STATUS "Clearing ${_name} dependent variables")
+    # Clear all the dependent variables so that the module can reset them
+    list (GET _args 0 _cmd)
+    if (_cmd STREQUAL "DEPENDENTS")
+      list (REMOVE_AT _args 0)
+      foreach (dep ${_args})
+        set (${_NAME}_${dep} "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
+      endforeach (dep)
+    endif (_cmd STREQUAL "DEPENDENTS")
+    set (${_NAME}_FOUND "NOTFOUND" CACHE INTERNAL "Cleared" FORCE)
+  endif ()
+  set (PACKAGE_MULTIPASS_${name}_CALLED YES CACHE INTERNAL "Private" FORCE)
+endmacro (FIND_PACKAGE_MULTIPASS)
+
+
+macro (MULTIPASS_SOURCE_RUNS includes libraries source runs language)
+  include (Check${language}SourceRuns)
+  # This is a ridiculous hack.  CHECK_${language}_SOURCE_* thinks that if the
+  # *name* of the return variable doesn't change, then the test does
+  # not need to be re-run.  We keep an internal count which we
+  # increment to guarantee that every test name is unique.  If we've
+  # gotten here, then the configuration has changed enough that the
+  # test *needs* to be rerun.
+  if (NOT MULTIPASS_TEST_COUNT)
+    set (MULTIPASS_TEST_COUNT 00)
+  endif (NOT MULTIPASS_TEST_COUNT)
+  math (EXPR _tmp "${MULTIPASS_TEST_COUNT} + 1") # Why can't I add to a cache variable?
+  set (MULTIPASS_TEST_COUNT ${_tmp} CACHE INTERNAL "Unique test ID")
+  set (testname MULTIPASS_TEST_${MULTIPASS_TEST_COUNT}_${runs})
+  set (CMAKE_REQUIRED_INCLUDES ${includes})
+  set (CMAKE_REQUIRED_LIBRARIES ${libraries})
+  if(${language} STREQUAL "C")
+    check_c_source_runs ("${source}" ${testname})
+  elseif(${language} STREQUAL "CXX")
+    check_cxx_source_runs ("${source}" ${testname})
+  endif()
+  set (${runs} "${${testname}}")
+endmacro (MULTIPASS_SOURCE_RUNS)
+
+macro (MULTIPASS_C_SOURCE_RUNS includes libraries source runs)
+  multipass_source_runs("${includes}" "${libraries}" "${source}" ${runs} "C")
+endmacro (MULTIPASS_C_SOURCE_RUNS)
diff --git a/cmake_modules/FindTinyObjLoader.cmake b/cmake_modules/FindTinyObjLoader.cmake
index 98bdae4d34b20e541c783cda224c40881694d974..3410fb89255b171376592f8a3aa4ccaf0a8bc9e9 100644
--- a/cmake_modules/FindTinyObjLoader.cmake
+++ b/cmake_modules/FindTinyObjLoader.cmake
@@ -1,10 +1,10 @@
 # - Try to find LibHilbert
 # Once done this will define
 #
-#  TINYOBJLOADER_FOUND        - system has LibHilbert
-#  TINYOBJLOADER_INCLUDE_DIRS - include directories for PETSc
-#  TINYOBJLOADER_LIBRARY_DIRS - library directories for PETSc
-#  TINYOBJLOADER_LIBRARIES    - libraries for PETSc
+#  TINYOBJLOADER_FOUND        - system has TinyObjLoader
+#  TINYOBJLOADER_INCLUDE_DIRS - include directories for TinyObjLoader
+#  TINYOBJLOADER_LIBRARY_DIRS - library directories for TinyObjLoader
+#  TINYOBJLOADER_LIBRARIES    - libraries for TinyObjLoader
 #
 #=============================================================================
 # Copyright (C) 2010-2016 Pietro Incardona
diff --git a/cmake_modules/ResolveCompilerPaths.cmake b/cmake_modules/ResolveCompilerPaths.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..54787fa38ffa50136414e6c788c50fb3c63746b8
--- /dev/null
+++ b/cmake_modules/ResolveCompilerPaths.cmake
@@ -0,0 +1,105 @@
+# ResolveCompilerPaths - this module defines two macros
+#
+# RESOLVE_LIBRARIES (XXX_LIBRARIES LINK_LINE)
+#  This macro is intended to be used by FindXXX.cmake modules.
+#  It parses a compiler link line and resolves all libraries
+#  (-lfoo) using the library path contexts (-L/path) in scope.
+#  The result in XXX_LIBRARIES is the list of fully resolved libs.
+#  Example:
+#
+#    RESOLVE_LIBRARIES (FOO_LIBRARIES "-L/A -la -L/B -lb -lc -ld")
+#
+#  will be resolved to
+#
+#    FOO_LIBRARIES:STRING="/A/liba.so;/B/libb.so;/A/libc.so;/usr/lib/libd.so"
+#
+#  if the filesystem looks like
+#
+#    /A:       liba.so         libc.so
+#    /B:       liba.so libb.so
+#    /usr/lib: liba.so libb.so libc.so libd.so
+#
+#  and /usr/lib is a system directory.
+#
+#  Note: If RESOLVE_LIBRARIES() resolves a link line differently from
+#  the native linker, there is a bug in this macro (please report it).
+#
+# RESOLVE_INCLUDES (XXX_INCLUDES INCLUDE_LINE)
+#  This macro is intended to be used by FindXXX.cmake modules.
+#  It parses a compile line and resolves all includes
+#  (-I/path/to/include) to a list of directories.  Other flags are ignored.
+#  Example:
+#
+#    RESOLVE_INCLUDES (FOO_INCLUDES "-I/A -DBAR='\"irrelevant -I/string here\"' -I/B")
+#
+#  will be resolved to
+#
+#    FOO_INCLUDES:STRING="/A;/B"
+#
+#  assuming both directories exist.
+#  Note: as currently implemented, the -I/string will be picked up mistakenly (cry, cry)
+include (CorrectWindowsPaths)
+
+macro (RESOLVE_LIBRARIES LIBS LINK_LINE)
+  string (REGEX MATCHALL "((-L|-l|-Wl)([^\" ]+|\"[^\"]+\")|[^\" ]+\\.(a|so|dll|lib))" _all_tokens "${LINK_LINE}")
+  set (_libs_found "")
+  set (_directory_list "")
+  foreach (token ${_all_tokens})
+    if (token MATCHES "-L([^\" ]+|\"[^\"]+\")")
+      # If it's a library path, add it to the list
+      string (REGEX REPLACE "^-L" "" token ${token})
+      string (REGEX REPLACE "//" "/" token ${token})
+      convert_cygwin_path(token)
+      list (APPEND _directory_list ${token})
+    elseif (token MATCHES "^(-l([^\" ]+|\"[^\"]+\")|[^\" ]+\\.(a|so|dll|lib))")
+      # It's a library, resolve the path by looking in the list and then (by default) in system directories
+      if (WIN32) #windows expects "libfoo", linux expects "foo"
+        string (REGEX REPLACE "^-l" "lib" token ${token})
+      else (WIN32)
+        string (REGEX REPLACE "^-l" "" token ${token})
+      endif (WIN32)
+      set (_root "")
+      if (token MATCHES "^/")	# We have an absolute path
+        #separate into a path and a library name:
+        string (REGEX MATCH "[^/]*\\.(a|so|dll|lib)$" libname ${token})
+        string (REGEX MATCH ".*[^${libname}$]" libpath ${token})
+        convert_cygwin_path(libpath)
+        set (_directory_list ${_directory_list} ${libpath})
+        set (token ${libname})
+      endif (token MATCHES "^/")
+      set (_lib "NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
+      find_library (_lib ${token} HINTS ${_directory_list} ${_root})
+      if (_lib)
+	string (REPLACE "//" "/" _lib ${_lib})
+        list (APPEND _libs_found ${_lib})
+      else (_lib)
+        message (STATUS "Unable to find library ${token}")
+      endif (_lib)
+    endif (token MATCHES "-L([^\" ]+|\"[^\"]+\")")
+  endforeach (token)
+  set (_lib "NOTFOUND" CACHE INTERNAL "Scratch variable" FORCE)
+  # only the LAST occurence of each library is required since there should be no circular dependencies
+  if (_libs_found)
+    list (REVERSE _libs_found)
+    list (REMOVE_DUPLICATES _libs_found)
+    list (REVERSE _libs_found)
+  endif (_libs_found)
+  set (${LIBS} "${_libs_found}")
+endmacro (RESOLVE_LIBRARIES)
+
+macro (RESOLVE_INCLUDES INCS COMPILE_LINE)
+  string (REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" _all_tokens "${COMPILE_LINE}")
+  set (_incs_found "")
+  foreach (token ${_all_tokens})
+    string (REGEX REPLACE "^-I" "" token ${token})
+    string (REGEX REPLACE "//" "/" token ${token})
+    convert_cygwin_path(token)
+    if (EXISTS ${token})
+      list (APPEND _incs_found ${token})
+    else (EXISTS ${token})
+      message (STATUS "Include directory ${token} does not exist")
+    endif (EXISTS ${token})
+  endforeach (token)
+  list (REMOVE_DUPLICATES _incs_found)
+  set (${INCS} "${_incs_found}")
+endmacro (RESOLVE_INCLUDES)
diff --git a/run.sh b/run.sh
index c820dd3c9fcbdaa34d4fa0974fb6a0b2b422c71e..0af9464b804cbfcf3cc08226342d8b99a0b009cd 100755
--- a/run.sh
+++ b/run.sh
@@ -5,15 +5,11 @@ branch=$3
 
 # Make a directory in /tmp/openfpm_data
 
-cd "$1/openfpm_io"
-
-if [ "$2" == "gin" ]
-then
- module load gcc/4.9.2
- module load boost/1.54.0
-fi
+cd "openfpm_io"
 
+echo "CHECKING MACHINE"
 if [ x"$hostname" == x"cifarm-centos-node.mpi-cbg.de"  ]; then
+	echo "CENTOS"
         export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/openfpm_dependencies/openfpm_io/$branch/HDF5/lib"
 	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/openfpm_dependencies/openfpm_io/$branch/BOOST/lib"
 fi
@@ -24,14 +20,13 @@ if [ x"$hostname" == x"cifarm-ubuntu-node"  ]; then
 fi
 
 if [ x"$hostname" == x"cifarm-mac-node.mpi-cbg.de"  ]; then
+	echo "MACOS X"
         export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$HOME/openfpm_dependencies/openfpm_io/$branch/HDF5/lib"
 	export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$HOME/openfpm_dependencies/openfpm_io/$branch/BOOST/lib"
 fi
 
+pwd
+
 ./build/src/io
-if [ $? -ne 0 ]; then
-   curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to complete the openfpm_io test \" }] }" https://hooks.slack.com/services/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
-   exit 1 ; 
-fi
 
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8f05ae1eb490035ed55574e236dcac0ad8e12636..87dafed2448824d29b617e398601b3c855f883a6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -22,10 +22,15 @@ endif()
 ###########################
 
 if (CUDA_FOUND)
-	target_compile_options(io PUBLIC $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe "--display_error_number --diag_suppress=611 --diag_suppress=2885 --diag_suppress=2886  --diag_suppress=2887  --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111" --expt-extended-lambda>)
+	target_compile_options(io PUBLIC $<$<COMPILE_LANGUAGE:CUDA>: ${WARNING_SUPPRESSION_AND_OPTION_NVCC} >)
 	target_include_directories (io PUBLIC ${MPI_C_INCLUDE_DIRS})
+
+   	if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 )
+        	add_compile_options( "-fabi-version=6" )
+    	endif()
+
         if (TEST_COVERAGE)
-                target_compile_options(io PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler "-fprofile-arcs -ftest-coverage">)
+                target_compile_options(io PRIVATE $<$<COMPILE_LANGUAGE:CUDA>: -Xcompiler "-fprofile-arcs -ftest-coverage" >)
         endif()
 endif()
 
@@ -46,8 +51,8 @@ if (PETSC_FOUND)
 endif()
 
 target_link_libraries(io ${Boost_LIBRARIES})
-target_link_libraries(io -L${HDF5_ROOT}/lib hdf5 hdf5_hl)
-target_link_libraries(io -L${TINYOBJLOADER_LIBRARY_DIRS} -ltinyobjloader )
+target_link_libraries(io ${HDF5_LIBRARIES})
+target_link_libraries(io ${TINYOBJLOADER_LIBRARIES} )
 if (PETSC_FOUND)
 	target_link_libraries(io ${PETSC_LIBRARIES})
 endif()
diff --git a/src/CSVWriter/CSVWriter.hpp b/src/CSVWriter/CSVWriter.hpp
index cd50cd221ac9f577c0ceae797e471b5c7979ff92..c7abc933923e4115cf88a2e057ff287cc6279924 100644
--- a/src/CSVWriter/CSVWriter.hpp
+++ b/src/CSVWriter/CSVWriter.hpp
@@ -14,7 +14,7 @@
 #include <fstream>
 #include "util/common.hpp"
 #include <boost/mpl/range_c.hpp>
-#include <boost/mpl/for_each.hpp>
+#include "util/for_each_ref_host.hpp"
 #include "csv_multiarray.hpp"
 #include "util/util.hpp"
 #include "is_csv_writable.hpp"
@@ -56,12 +56,12 @@ struct csv_prp
     template<typename T>
     void operator()(T& t)
     {
-		// This is the type of the csv column
-		typedef decltype(obj.template get<T::value>()) col_type;
+        // This is the type of the csv column
+        typedef typename boost::mpl::at<typename Tobj::type,T>::type col_type;
 
-		// Remove the reference from the column type
-		typedef typename boost::remove_reference<col_type>::type col_rtype;
-		typedef typename std::remove_all_extents<col_rtype>::type base_col_rtype;
+        // Remove the reference from the column type
+        typedef typename boost::remove_reference<col_type>::type col_rtype;
+        typedef typename std::remove_all_extents<col_rtype>::type base_col_rtype;
 
     	csv_value_str<col_rtype, is_csv_writable<base_col_rtype>::value >(obj.template get<T::value>(),str);
     }
@@ -183,7 +183,7 @@ class CSVWriter
 		csv_col<typename v_prp::value_type,has_attributes<typename v_prp::value_type>::value> col(str);
 
 		// Iterate through all the vertex and create the vertex list
-		boost::mpl::for_each< boost::mpl::range_c<int,0,v_prp::value_type::max_prop> >(col);
+		boost::mpl::for_each_ref_host< boost::mpl::range_c<int,0,v_prp::value_type::max_prop> >(col);
 
 		str << "\n";
 
@@ -225,7 +225,7 @@ class CSVWriter
 			csv_prp<decltype(obj)> c_prp(str,obj);
 
 			// write the properties to the stream string
-			boost::mpl::for_each< boost::mpl::range_c<int,0,v_prp::value_type::max_prop> >(c_prp);
+			boost::mpl::for_each_ref_host< boost::mpl::range_c<int,0,v_prp::value_type::max_prop> >(c_prp);
 
 			str << "\n";
 		}
diff --git a/src/CSVWriter/csv_multiarray.hpp b/src/CSVWriter/csv_multiarray.hpp
index f8ff9f815d4b67998115e7e71aa73494b3383a92..6d91899f626798730a0dc77fed1a953ee44c2e78 100644
--- a/src/CSVWriter/csv_multiarray.hpp
+++ b/src/CSVWriter/csv_multiarray.hpp
@@ -137,7 +137,8 @@ struct csv_value_str
 template<typename T,size_t N1, bool is_writable>
 struct csv_value_str<T[N1], is_writable>
 {
-	inline csv_value_str(const T v[N1], std::stringstream & str)
+	template<typename ArrObject>
+	inline csv_value_str(const ArrObject v, std::stringstream & str)
 	{
 		for (size_t i = 0 ; i < N1 ; i++)
 			str << "," << v[i];
@@ -148,7 +149,8 @@ struct csv_value_str<T[N1], is_writable>
 template<typename T,size_t N1,size_t N2, bool is_writable>
 struct csv_value_str<T[N1][N2], is_writable>
 {
-	inline csv_value_str(const T v[N1][N2], std::stringstream & str)
+	template<typename ArrObject>
+	inline csv_value_str(const ArrObject v, std::stringstream & str)
 	{
 		for (size_t i1 = 0 ; i1 < N1 ; i1++)
 		{
@@ -164,7 +166,8 @@ struct csv_value_str<T[N1][N2], is_writable>
 template<typename T,size_t N1,size_t N2,size_t N3, bool is_writable>
 struct csv_value_str<T[N1][N2][N3], is_writable>
 {
-	inline csv_value_str(const T v[N1][N2][N3], std::stringstream & str)
+	template<typename ArrObject>
+	inline csv_value_str(const  ArrObject v, std::stringstream & str)
 	{
 		for (size_t i1 = 0 ; i1 < N1 ; i1++)
 		{
@@ -183,7 +186,8 @@ struct csv_value_str<T[N1][N2][N3], is_writable>
 template<typename T,size_t N1,size_t N2,size_t N3,size_t N4, bool is_writable>
 struct csv_value_str<T[N1][N2][N3][N4],is_writable>
 {
-	inline csv_value_str(const T v[N1][N2][N3][N4], std::stringstream & str)
+	template<typename ArrObject>
+	inline csv_value_str(const ArrObject v, std::stringstream & str)
 	{
 		for (size_t i1 = 0 ; i1 < N1 ; i1++)
 		{
diff --git a/src/CSVWriter/is_csv_writable.hpp b/src/CSVWriter/is_csv_writable.hpp
index b7268b09d9cb62b3f9671c146d06147f1f4cd25a..48beba760ab6169b962bc252a6ba38f615d57e05 100644
--- a/src/CSVWriter/is_csv_writable.hpp
+++ b/src/CSVWriter/is_csv_writable.hpp
@@ -141,5 +141,37 @@ struct is_csv_writable<bool>
 	};
 };
 
+//! Indicate if the property T is writable in CSV
+template<typename T, unsigned int N1>
+struct is_csv_writable<T[N1]>
+{
+	//! bool is writable
+	enum
+	{
+		value = true
+	};
+};
+
+//! Indicate if the property T is writable in CSV
+template<typename T, unsigned int N1, unsigned int N2>
+struct is_csv_writable<T[N1][N2]>
+{
+	//! bool is writable
+	enum
+	{
+		value = true
+	};
+};
+
+//! Indicate if the property T is writable in CSV
+template<typename T, unsigned int N1, unsigned int N2, unsigned int N3>
+struct is_csv_writable<T[N1][N2][N3]>
+{
+	//! bool is writable
+	enum
+	{
+		value = true
+	};
+};
 
 #endif /* OPENFPM_IO_SRC_CSVWRITER_IS_CSV_WRITABLE_HPP_ */
diff --git a/src/GraphMLWriter/GraphMLWriter.hpp b/src/GraphMLWriter/GraphMLWriter.hpp
index b4f76c7737ee169c178d589f2f9f94ba321427ab..d34504e9220116119f086da98002418a606b61ed 100644
--- a/src/GraphMLWriter/GraphMLWriter.hpp
+++ b/src/GraphMLWriter/GraphMLWriter.hpp
@@ -125,17 +125,17 @@ struct vertex_prop
     		{cnt++; return ;}
 
     		// Create a property string based on the type of the property
-    		if (typeid(T) == typeid(float))
+    		if (std::is_same<T,float>::value)
     			v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"float\"/>\n";
-    		else if (typeid(T) == typeid(double))
+    		else if (std::is_same<T,double>::value)
     			v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"double\"/>\n";
-    		else if (typeid(T) == typeid(int))
+    		else if (std::is_same<T,int>::value)
     			v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"int\"/>\n";
-    		else if (typeid(T) == typeid(long int))
+    		else if (std::is_same<T,long int>::value)
     			v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"long\"/>\n";
-    		else if (typeid(T) == typeid(bool))
+    		else if (std::is_same<T,bool>::value)
     			v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"boolean\"/>\n";
-    		else if (typeid(T) == typeid(std::string))
+    		else if (std::is_same<T,std::string>::value)
     			v_prop += "<key id=\"vk" + std::to_string(cnt) + "\" for=\"node\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"string\"/>\n";
     	}
 
@@ -278,18 +278,20 @@ struct vertex_node
     	//! Create an entry for the attribute
     	if (T::value < n_attr)
     	{
+    		typedef typename std::remove_reference<decltype(vo.template get<T::value>())>::type type_get;
+
     		// Create a property string based on the type of the property
-    		if (typeid(decltype(vo.template get<T::value>())) == typeid(float))
+    		if (std::is_same<type_get,float>::value)
     			v_node += "  <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
-    		else if (typeid(decltype(vo.template get<T::value>())) == typeid(double))
+    		else if (std::is_same<type_get,double>::value)
     			v_node += "  <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
-    		else if (typeid(decltype(vo.template get<T::value>())) == typeid(int))
+    		else if (std::is_same<type_get,int>::value )
     			v_node += "  <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
-    		else if (typeid(decltype(vo.template get<T::value>())) == typeid(long int))
+    		else if (std::is_same<type_get,long int>::value)
     			v_node += "  <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
-    		else if (typeid(decltype(vo.template get<T::value>())) == typeid(bool))
+    		else if (std::is_same<type_get,bool>::value)
     			v_node += "  <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
-    		else if (typeid(decltype(vo.template get<T::value>())) == typeid(std::string))
+    		else if (std::is_same<type_get,std::string>::value)
     			v_node += "  <data key=\"vk" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
     	}
 
@@ -379,17 +381,17 @@ struct edge_prop
     	if (cnt < n_attr)
     	{
     		// Create a property string based on the type of the property
-    		if (typeid(T) == typeid(float))
+    		if (std::is_same<T,float>::value)
     			e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"float\"/>\n";
-    		else if (typeid(T) == typeid(double))
+    		else if (std::is_same<T,double>::value)
     			e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"double\"/>\n";
-    		else if (typeid(T) == typeid(int))
+    		else if (std::is_same<T,int>::value)
     			e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"int\"/>\n";
-    		else if (typeid(T) == typeid(long int))
+    		else if (std::is_same<T,long int>::value)
     			e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"long\"/>\n";
-    		else if (typeid(T) == typeid(bool))
+    		else if (std::is_same<T,bool>::value)
     			e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"boolean\"/>\n";
-    		else if (typeid(T) == typeid(std::string))
+    		else if (std::is_same<T,std::string>::value)
     			e_prop += "<key id=\"ek" + std::to_string(cnt) + "\" for=\"edge\" attr.name=\"" + attributes_names[cnt] + "\" attr.type=\"string\"/>\n";
     	}
 
@@ -510,18 +512,20 @@ struct edge_node
     	//! Create an entry for the attribute
     	if (T::value < n_attr)
     	{
+    		typedef typename std::remove_reference<decltype(vo.template get<T::value>())>::type type_get;
+
     		// Create a property string based on the type of the property
-    		if (typeid(decltype(vo.template get<T::value>())) == typeid(float))
+    		if (std::is_same<type_get,float>::value)
     			e_node += "  <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
-    		else if (typeid(decltype(vo.template get<T::value>())) == typeid(double))
+    		else if (std::is_same<type_get,double>::value)
     			e_node += "  <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
-    		else if (typeid(decltype(vo.template get<T::value>())) == typeid(int))
+    		else if (std::is_same<type_get,int>::value)
     			e_node += "  <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
-    		else if (typeid(decltype(vo.template get<T::value>())) == typeid(long int))
+    		else if (std::is_same<type_get,long int>::value)
     			e_node += "  <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
-    		else if (typeid(decltype(vo.template get<T::value>())) == typeid(bool))
+    		else if (std::is_same<type_get,bool>::value)
     			e_node += "  <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
-    		else if (typeid(decltype(vo.template get<T::value>())) == typeid(std::string))
+    		else if (std::is_same<type_get,std::string>::value)
     			e_node += "  <data key=\"ek" + std::to_string(cnt) + "\">" + std::to_string(vo.template get<T::value>()) + "</data>\n";
     	}
 
diff --git a/src/HDF5_wr/HDF5_reader_gd.hpp b/src/HDF5_wr/HDF5_reader_gd.hpp
index 7da37708d2acfe39cb5f415a51e46bb07f9b0abc..500f9715b3cdb76a685f1c4eb49243b950bdeb3e 100644
--- a/src/HDF5_wr/HDF5_reader_gd.hpp
+++ b/src/HDF5_wr/HDF5_reader_gd.hpp
@@ -19,7 +19,7 @@ class HDF5_reader<GRID_DIST>
 {
 	template<typename device_grid> void load_block(long int bid,
 			        hssize_t mpi_size_old,
-					int * metadata_out,
+					long int * metadata_out,
 					openfpm::vector<size_t> & metadata_accum,
 					hid_t plist_id,
 					hid_t dataset_2,
@@ -42,24 +42,47 @@ class HDF5_reader<GRID_DIST>
 
 	    hsize_t count[1] = {1};
 
+		// allocate the memory
+		HeapMemory pmem;
+		//pmem.allocate(req);
+		ExtPreAlloc<HeapMemory> & mem = *(new ExtPreAlloc<HeapMemory>(block[0],pmem));
+		mem.incRef();
+
 		//Select file dataspace
 		hid_t file_dataspace_id_2 = H5Dget_space(dataset_2);
 
-        H5Sselect_hyperslab(file_dataspace_id_2, H5S_SELECT_SET, offset, NULL, count, block);
+	    size_t to_read = block[0];
+	    size_t coffset = 0;
 
-        hsize_t mdim_2[1] = {block[0]};
+	    auto & v_cl = create_vcluster();
 
-		//Create data space in memory
-		hid_t mem_dataspace_id_2 = H5Screate_simple(1, mdim_2, NULL);
+	    int read_test = (to_read != 0);
+	    v_cl.max(read_test);
+	    v_cl.execute();
 
-		// allocate the memory
-		HeapMemory pmem;
-		//pmem.allocate(req);
-		ExtPreAlloc<HeapMemory> & mem = *(new ExtPreAlloc<HeapMemory>(block[0],pmem));
-		mem.incRef();
+	    while (read_test)
+	    {
+			hsize_t block_c[1];
+			block_c[0] = std::min((size_t)(to_read),(size_t)0x7FFFFFFF);
 
-	  	// Read the dataset.
-	    H5Dread(dataset_2, H5T_NATIVE_CHAR, mem_dataspace_id_2, file_dataspace_id_2, plist_id, (char *)mem.getPointer());
+			hsize_t offset_c[1] = {offset[0] + coffset};
+			H5Sselect_hyperslab(file_dataspace_id_2, H5S_SELECT_SET, offset_c, NULL, count, block_c);
+
+			hsize_t mdim_2[1] = {block_c[0]};
+
+			//Create data space in memory
+			hid_t mem_dataspace_id_2 = H5Screate_simple(1, mdim_2, NULL);
+
+			// Read the dataset.
+			H5Dread(dataset_2, H5T_NATIVE_CHAR, mem_dataspace_id_2, file_dataspace_id_2, plist_id, (char *)mem.getPointer() + coffset);
+
+			coffset += std::min((size_t)(to_read),(size_t)0x7FFFFFFF);
+			to_read -= std::min((size_t)(to_read),(size_t)0x7FFFFFFF);
+
+			read_test = (to_read != 0);
+			v_cl.max(read_test);
+			v_cl.execute();
+	    }
 
 		mem.allocate(pmem.size());
 
@@ -72,7 +95,10 @@ class HDF5_reader<GRID_DIST>
 		Unpacker<typename std::remove_reference<decltype(gdb_ext_old)>::type,HeapMemory>::unpack(mem,gdb_ext_old_unp,ps,1);
 
 		for (size_t i = 0; i < loc_grid_old_unp.size(); i++)
-			loc_grid_old.add(loc_grid_old_unp.get(i));
+		{
+			loc_grid_old.add();
+			loc_grid_old.last().swap(loc_grid_old_unp.get(i));
+		}
 
 		for (size_t i = 0; i < gdb_ext_old_unp.size(); i++)
 			gdb_ext_old.add(gdb_ext_old_unp.get(i));
@@ -120,7 +146,7 @@ public:
 			//printf ("\nOld MPI size: %llu\n", mpi_size_old);
 
 	  	//Where to read metadata
-	  	int metadata_out[mpi_size_old];
+	  	long int metadata_out[mpi_size_old];
 
 	  	for (int i = 0; i < mpi_size_old; i++)
 	  	{
@@ -133,30 +159,9 @@ public:
 		//Create data space in memory
 		hid_t mem_dataspace_id = H5Screate_simple(1, mdim, NULL);
 
-/*
-		if (mpi_rank == 0)
-		{
-			hssize_t size;
-
-			size = H5Sget_select_npoints (mem_dataspace_id);
-			printf ("\nmemspace_id size: %llu\n", size);
-			size = H5Sget_select_npoints (file_dataspace_id);
-			printf ("dataspace_id size: %llu\n", size);
-		}
-*/
 	  	// Read the dataset.
-	    H5Dread(dataset, H5T_NATIVE_INT, mem_dataspace_id, file_dataspace_id, plist_id, metadata_out);
-/*
-		if (mpi_rank == 0)
-		{
-			std::cout << "Metadata_out[]: ";
-			for (int i = 0; i < mpi_size_old; i++)
-			{
-				std::cout << metadata_out[i] << " ";
-			}
-			std::cout << " " << std::endl;
-		}
-*/
+	    H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace_id, file_dataspace_id, plist_id, metadata_out);
+
 
 	    openfpm::vector<size_t> metadata_accum;
 	    metadata_accum.resize(mpi_size_old);
@@ -183,12 +188,6 @@ public:
 
 	  	size_t rest_block = mpi_size_old % v_cl.getProcessingUnits();
 
-	  //	std::cout << "MPI size old: " << mpi_size_old << std::endl;
-	  	//std::cout << "MPI size: " << v_cl.getProcessingUnits() << std::endl;
-
-
-	  //	std::cout << "Rest block: " << rest_block << std::endl;
-
 	  	size_t max_block;
 
 	  	if (rest_block != 0)
diff --git a/src/HDF5_wr/HDF5_writer.hpp b/src/HDF5_wr/HDF5_writer.hpp
index 95b686cf9a4867d49d3110dddfef79ba492670c1..d0c2b673ddaf6efaddc1efe063f9bebe92f3fefc 100644
--- a/src/HDF5_wr/HDF5_writer.hpp
+++ b/src/HDF5_wr/HDF5_writer.hpp
@@ -10,7 +10,7 @@
 
 
 #include "VCluster/VCluster.hpp"
-#include <hdf5.h>
+#include "hdf5.h"
 
 template <unsigned int type>
 class HDF5_writer
diff --git a/src/HDF5_wr/HDF5_writer_gd.hpp b/src/HDF5_wr/HDF5_writer_gd.hpp
index 89ea004827824fc2b0dac30fed254a03dd1d3740..8a1b98e78d433c6975940e2373287c893e0f30c1 100644
--- a/src/HDF5_wr/HDF5_writer_gd.hpp
+++ b/src/HDF5_wr/HDF5_writer_gd.hpp
@@ -92,12 +92,6 @@ public:
 		//Create data space in file
 		hid_t file_dataspace_id_2 = H5Screate_simple(1, fdim2, NULL);
 
-		//Size for data space in memory
-		hsize_t mdim[1] = {pmem.size()};
-
-		//Create data space in memory
-		hid_t mem_dataspace_id = H5Screate_simple(1, mdim, NULL);
-
 		//if (mpi_rank == 0)
 			//std::cout << "Total object size: " << sum << std::endl;
 
@@ -105,7 +99,7 @@ public:
 		hid_t file_dataset = H5Dcreate (file, "grid_dist", H5T_NATIVE_CHAR, file_dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
 
 		//Create data set 2 in file
-		hid_t file_dataset_2 = H5Dcreate (file, "metadata", H5T_NATIVE_INT, file_dataspace_id_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+		hid_t file_dataset_2 = H5Dcreate (file, "metadata", H5T_NATIVE_LLONG, file_dataspace_id_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
 
 	    //H5Pclose(plist_id);
 	    H5Sclose(file_dataspace_id);
@@ -132,45 +126,51 @@ public:
 
 	//    std::cout << "MPI rank: " << mpi_rank << ", MPI size: " << mpi_size << ", Offset: " << offset[0] << ", Block: " << block[0] << std::endl;
 
-	    int metadata[mpi_size];
+	    long int metadata[mpi_size];
 
 	    for (int i = 0; i < mpi_size; i++)
 	    	metadata[i] = sz_others.get(i);
 
 	    //Select hyperslab in the file.
 	    file_dataspace_id = H5Dget_space(file_dataset);
-	    H5Sselect_hyperslab(file_dataspace_id, H5S_SELECT_SET, offset, NULL, count, block);
 
-	    file_dataspace_id_2 = H5Dget_space(file_dataset_2);
+            //Create property list for collective dataset write.
+            plist_id = H5Pcreate(H5P_DATASET_XFER);
+            H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE);
 
+	    // We slipt the write in chunk of 2GB maximum
+	    size_t to_write = block[0];
+	    size_t coffset = 0;
+	    while (to_write)
+	    {
+			hsize_t block_c[1];
+			block_c[0] = std::min((size_t)(to_write),(size_t)0x7FFFFFFF);
 
-	    //Create property list for collective dataset write.
-	    plist_id = H5Pcreate(H5P_DATASET_XFER);
-	    H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE);
+			//Create data space in memory
+			hid_t mem_dataspace_id = H5Screate_simple(1, block_c, NULL);
 
-		//Write a data set to a file
-		H5Dwrite(file_dataset, H5T_NATIVE_CHAR, mem_dataspace_id, file_dataspace_id, plist_id, (const char *)pmem.getPointer());
+			hsize_t offset_c[1] = {offset[0] + coffset};
+			H5Sselect_hyperslab(file_dataspace_id, H5S_SELECT_SET, offset_c, NULL, count, block_c);
 
-		//Write a data set 2 to a file
-		H5Dwrite(file_dataset_2, H5T_NATIVE_INT, H5S_ALL, file_dataspace_id_2, plist_id, metadata);
-/*
-		for (size_t i = 0; i < gdb_ext.size(); i++)
-		{
-			Box<dim,long int> box = gdb_ext.get(i).Dbox;
-			std::cout << "Dboxes saved: (" << box.getLow(0) << "; " << box.getLow(1) << "); (" << box.getHigh(0) << "; " << box.getHigh(1) << ")" << std::endl;
-		}
-
-		for (size_t i = 0; i < loc_grid.size(); i++)
-		{
-			std::cout << "loc_grids saved: (" << loc_grid.get(i).getGrid().getBox().getLow(0) << "; " << loc_grid.get(i).getGrid().getBox().getLow(1) << "); (" << loc_grid.get(i).getGrid().getBox().getHigh(0) << "; " << loc_grid.get(i).getGrid().getBox().getHigh(1) << ")" << std::endl;
-		}
-*/
+			//Write a data set to a file
+			H5Dwrite(file_dataset, H5T_NATIVE_CHAR, mem_dataspace_id, file_dataspace_id, plist_id, (const char *)pmem.getPointer() + coffset);
+
+			coffset += std::min((size_t)(to_write),(size_t)0x7FFFFFFF);
+			to_write -= std::min((size_t)(to_write),(size_t)0x7FFFFFFF);
+
+			H5Sclose(mem_dataspace_id);
+	    }
+
+	    file_dataspace_id_2 = H5Dget_space(file_dataset_2);
+
+	    //Write a data set 2 to a file
+	    H5Dwrite(file_dataset_2, H5T_NATIVE_LLONG, H5S_ALL, file_dataspace_id_2, plist_id, metadata);
+	    
 	    //Close/release resources.
 	    H5Dclose(file_dataset);
 	    H5Sclose(file_dataspace_id);
 	    H5Dclose(file_dataset_2);
 	    H5Sclose(file_dataspace_id_2);
-	    H5Sclose(mem_dataspace_id);
 	    H5Pclose(plist_id);
 	    H5Fclose(file);
 	}
diff --git a/src/Plot/GoogleChart.hpp b/src/Plot/GoogleChart.hpp
index 136e7b228c4ae2c7d9412616079a209d346f2353..b35bab5476911010cf5eb4a9e712899df3d5e639 100644
--- a/src/Plot/GoogleChart.hpp
+++ b/src/Plot/GoogleChart.hpp
@@ -10,6 +10,7 @@
 
 #include <fstream>
 #include "Vector/map_vector.hpp"
+#include <cmath>
 
 #define GGRAPH_COLUMS 1
 #define GGRAPH_POINTS 2
@@ -153,6 +154,33 @@ const std::string saving_javascript = "function save(i)\n\
 										var e = document.getElementById('chart_')\n\
 										e.getElementsByTagName('svg')[0].parentNode.innerHTML";
 
+template<typename T>
+struct check_nan
+{
+	static bool check(const T & n)
+	{
+		return false;
+	}
+};
+
+template<>
+struct check_nan<float>
+{
+	static bool check(const float & n)
+	{
+		return std::isnan(n);
+	}
+};
+
+template<>
+struct check_nan<double>
+{
+	static bool check(const double & n)
+	{
+		return std::isnan(n);
+	}
+};
+
 /////////////////////////////////////////////////////////////////////
 
 /*! \brief Small class to produce graph with Google chart in HTML
@@ -186,12 +214,213 @@ const std::string saving_javascript = "function save(i)\n\
  */
 class GoogleChart
 {
+	template<typename arg_0, typename ... args>
+	struct get_value_type
+	{
+		typedef typename arg_0::value_type type;
+	};
+
 	//! set of graphs
 	openfpm::vector<GGraph> set_of_graphs;
 
 	//! set inject HTML;
 	openfpm::vector<std::string> injectHTML;
 
+	//! Data has holes
+	bool holes = false;
+
+	/*! \brief Recursively sort variadic template of vectors
+	 *
+	 * \param x vector with x
+	 * \param y vector with y
+	 * \param xy all the other vectors
+	 *
+	 */
+	template<typename X, typename ... Xs>
+	void recursive_sort(X & x,X & y,Xs& ... xy)
+	{
+		struct srt_xy
+		{
+			typename X::value_type x;
+			unsigned int id;
+
+			bool operator<(const srt_xy & tmp) const
+			{
+				return x < tmp.x;
+			}
+		};
+
+		openfpm::vector<srt_xy> reord;
+		X y_tmp;
+
+		reord.resize(x.size());
+		y_tmp.resize(x.size());
+
+		for (size_t i = 0 ; i < x.size() ; i++)
+		{
+			reord.get(i).x = x.get(i);
+			reord.get(i).id = i;
+		}
+
+		reord.sort();
+
+		// reorder x and y
+
+		for (size_t i = 0 ; i < x.size() ; i++)
+		{
+			x.get(i) = reord.get(i).x;
+			y_tmp.get(i) = y.get(reord.get(i).id);
+		}
+
+		y_tmp.swap(y);
+
+		// sort x
+
+		recursive_sort(xy ...);
+	}
+
+	//! terminator for recursive sort
+	void recursive_sort()
+	{}
+
+	/*! \brief Recursively sort variadic template of vectors
+	 *
+	 * \param counters indexes
+	 * \param x vector with x
+	 * \param y vector with y
+	 * \param xy all the other vectors
+	 *
+	 */
+	template<typename X, typename ... Xs>
+	bool isNext(size_t * counters,X & x,X & y,Xs& ... xy)
+	{
+		if (counters[0] < x.size())
+		{
+			return true;
+		}
+		return isNext(&counters[1],xy ...);
+	}
+
+	/*! \brief Recursively sort variadic template of vectors
+	 *
+	 * \param counters indexes
+	 *
+	 */
+	bool isNext(size_t * counters)
+	{
+		return false;
+	}
+
+
+	/*! \brief Recursively sort variadic template of vectors
+	 *
+	 * \param counters indexes
+	 * \param x vector with x
+	 * \param y vector with y
+	 * \param xy all the other vectors
+	 *
+	 */
+	template<typename T, typename X, typename ... Xs>
+	T get_low(size_t * counters,X & x,X & y,Xs& ... xy)
+	{
+		if (sizeof...(Xs) != 0)
+		{
+			T low1;
+			if (counters[0] >= x.size())
+			{low1 = std::numeric_limits<typename X::value_type>::infinity();}
+			else
+			{low1 = x.get(counters[0]);}
+
+			T low2 = get_low<T>(&counters[1],xy ...);
+			return (low1 < low2)?low1:low2;
+		}
+
+		if (counters[0] >= x.size())
+		{return std::numeric_limits<typename X::value_type>::infinity();}
+		return x.get(counters[0]);
+	}
+
+	/*! \brief Recursively sort variadic template of vectors
+	 *
+	 * \param counters indexes
+	 *
+	 */
+	template<typename T>
+	T get_low(size_t * counters)
+	{
+		return 0.0;
+	}
+
+	/*! \brief Recursively sort variadic template of vectors
+	 *
+	 * \param x vector with x
+	 * \param y vector with y
+	 * \param xy all the other vectors
+	 *
+	 */
+	template<typename X, typename ... Xs>
+	void get_point(typename X::value_type low,
+			   typename X::value_type * point,
+			   size_t * counters,
+			   X & x,
+			   X & y,
+			   Xs& ... xy)
+	{
+		if (low == x.get(counters[0]))
+		{
+			point[0] = y.get(counters[0]);
+			counters[0]++;
+		}
+		else
+		{
+			point[0] = std::numeric_limits<typename X::value_type>::quiet_NaN();
+		}
+
+		get_point(low,&point[1],&counters[1],xy...);
+	}
+
+	/*! \brief Recursively sort variadic template of vectors
+	 *
+	 * \param x vector with x
+	 * \param y vector with y
+	 * \param xy all the other vectors
+	 *
+	 */
+	template<typename T>
+	void get_point(T low,
+			   T * point,
+			   size_t * counters)
+	{
+		return;
+	}
+
+	/*! \brief Recursively sort variadic template of vectors
+	 *
+	 * \param x vector with x
+	 * \param y vector with y
+	 * \param xy all the other vectors
+	 *
+	 */
+	template<typename ... Xs>
+	bool get_v(typename get_value_type<Xs...>::type & x,
+			   typename get_value_type<Xs...>::type * point,
+			   size_t * counters,
+			   Xs& ... xy)
+	{
+		// if exist the next element
+		if (isNext(counters,xy...) == false)
+		{return false;}
+
+		// get lowest x
+		typename get_value_type<Xs...>::type low = get_low<typename get_value_type<Xs...>::type>(counters,xy...);
+
+		x = low;
+
+		get_point(low,point,counters,xy...);
+
+		return true;
+	}
+
 	/*! \brief Given X and Y vector return the string representing the data section of the Google Chart
 	 *
 	 * \tparam X type for the X coordinates
@@ -215,7 +444,7 @@ class GoogleChart
 		// we require that the number of x elements are the same as y elements
 
 		if (x.size() != y.size())
-			std::cerr << "Error: " << __FILE__ << ":" << __LINE__ << " vector x and the vector y must have the same number of elements " << x.size() << "!=" << y.size() << "\n";
+		{std::cerr << "Error: " << __FILE__ << ":" << __LINE__ << " vector x and the vector y must have the same number of elements " << x.size() << "!=" << y.size() << "\n";}
 
 		// Google chart visualization
         data << "var data" << i << " = new google.visualization.DataTable();\n";
@@ -250,7 +479,17 @@ class GoogleChart
         				data << "["  << x.get(i);
         		}
         		else
-        			data << "," << y.get(i).get(j-1);
+        		{
+        			if (check_nan<typename Y::value_type>::check(y.get(i).get(j-1)) == false)
+        			{
+        				data << "," << y.get(i).get(j-1);
+        			}
+        			else
+        			{
+        				holes = true;
+        				data << "," << "null";
+        			}
+        		}
         	}
         	data << "],\n";
         }
@@ -351,6 +590,8 @@ class GoogleChart
 		of << "var options";
 		of << i;
 		of << "= {\n";
+		if (holes == true)
+		{of << "interpolateNulls : true,\n";}
 		of << opt;
 		of << "};\n";
 	}
@@ -513,16 +754,69 @@ public:
 		set_of_graphs.last().opt = opt;
 	}
 
+
 	/*! \brief Add lines graph
 	 *
-	 * \param y A vector of vectors of values. each vector is a graph of points
+	 * \param xy list of vectors like openfpm::vector<float> or openfpm::vector<double>. Suppose you have a dataset of points x1,y1
+	 *           and a dataset x2,y2 and you want to display all these points in one graph. Than you call this function with
+	 *           AddLines(x1,y1,x2,y2,opt)
 	 *
-	 * \param x Give a name or number to each x value, so can be a string or a number
+	 * \param opt Graph options
+	 *
+	 */
+	template<typename ... X> void AddLines(const openfpm::vector<std::string> & yn,
+										   const GCoptions & opt,
+										   X ... xy)
+	{
+		// first we sort the vectors
+		recursive_sort(xy ... );
+
+		size_t counters[sizeof...(X)];
+		memset(&counters,0,sizeof(counters));
+
+		typename get_value_type<X...>::type point[sizeof...(X)];
+		typename get_value_type<X...>::type xe;
+
+		openfpm::vector<typename get_value_type<X...>::type> x;
+
+		openfpm::vector<openfpm::vector<typename get_value_type<X...>::type>> y;
+
+
+		while (get_v(xe,point,counters,xy...))
+		{
+			y.add();
+			x.add(xe);
+
+			for (size_t i = 0 ; i < sizeof...(X)/2 ; i++)
+			{
+				y.last().add(point[i]);
+			}
+		}
+
+		AddLinesGraph(x,y,yn,opt);
+	}
+
+	/*! \brief Add lines graph
+	 *
+	 * If the x vector contain 0.0,0.1,0.2,0.3,0.4 and you want to draw two lines you specifying two y values for each of the x points
+	 * you create an openfpm::vector<openfpm::vector<float>> y such that
+	 *
+	 *  \verbatim
+                               ------  j  -------        |
+	   y.get(i).get(j) = 3.2   3.4    5.4    1.3    2.3  i
+	                     1.4   5.3    3.2    2.1    1.1  |
+
+	   \endverbatim
+	 *
+	 * \param y A vector of vectors of values. each vector contain the graph points, compared to AddLinesGraph the points are stored
+	 *
+	 *
+	 * \param x axis values
 	 *
 	 * \param opt Graph options
 	 *
 	 */
-	template<typename X, typename Y> void AddLines(openfpm::vector<X> & x, openfpm::vector<Y> & y , const GCoptions & opt)
+	template<typename X, typename Y> void AddLinesGraphT(openfpm::vector<X> & x, openfpm::vector<Y> & y , const GCoptions & opt)
 	{
 		openfpm::vector<std::string> yn;
 
@@ -568,6 +862,18 @@ public:
 
 	/*! \brief Add a simple lines graph
 	 *
+	 * If the x vector contain 0.0,0.1,0.2,0.3,0.4 and you want to draw two lines you specifying two y values for each of the x points
+	 * you create an openfpm::vector<openfpm::vector<float>> y such that
+	 *
+	 *  \verbatim
+                         --  j  --
+	   y.get(i).get(j) = 3.2   3.4
+	                     1.4   5.3 |
+	                     5.4   3.2 i
+	                     1.3   2.2 |
+                         2.3   1.1
+	   \endverbatim
+	 *
 	 * \param y A vector of vectors of values. The size of y indicate how many x values
 	 *          we have, while the internal vector can store multiple value of the same point,
 	 *          for example error bar
diff --git a/src/Plot/Plot_unit_tests.hpp b/src/Plot/Plot_unit_tests.hpp
index ddb4350e5dce1fdc39abf6a7ba198951906b1a2a..37a742f4dfde5ab96a73c051099fa06b3d06283e 100644
--- a/src/Plot/Plot_unit_tests.hpp
+++ b/src/Plot/Plot_unit_tests.hpp
@@ -124,7 +124,7 @@ BOOST_AUTO_TEST_CASE( google_chart )
 
 	//! [Producing an Histogram graph]
 
-	bool test = compare("gc_out.html","gc_out_test.html");
+	bool test = compare("gc_out.html","test_data/gc_out_test.html");
 	BOOST_REQUIRE_EQUAL(true,test);
 }
 
@@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE( google_chart2 )
 	cg.AddHistGraph(x,y,yn,options);
 	cg.write("gc_out2.html");
 
-	bool test = compare("gc_out2.html","gc_out2_test.html");
+	bool test = compare("gc_out2.html","test_data/gc_out2_test.html");
 	BOOST_REQUIRE_EQUAL(true,test);
 }
 
@@ -221,7 +221,7 @@ BOOST_AUTO_TEST_CASE( google_chart3 )
 	cg.AddHistGraph(x,y,yn,options);
 	cg.write("gc_out3.html");
 
-	bool test = compare("gc_out3.html","gc_out3_test.html");
+	bool test = compare("gc_out3.html","test_data/gc_out3_test.html");
 	BOOST_REQUIRE_EQUAL(true,test);
 }
 
@@ -262,7 +262,7 @@ BOOST_AUTO_TEST_CASE( google_chart4 )
 	cg.AddHistGraph(x,y,yn);
 	cg.write("gc_out4.html");
 
-	bool test = compare("gc_out4.html","gc_out4_test.html");
+	bool test = compare("gc_out4.html","test_data/gc_out4_test.html");
 	BOOST_REQUIRE_EQUAL(true,test);
 }
 
@@ -295,7 +295,7 @@ BOOST_AUTO_TEST_CASE( google_chart5 )
 	cg.AddHistGraph(x,y);
 	cg.write("gc_out5.html");
 
-	bool test = compare("gc_out5.html","gc_out5_test.html");
+	bool test = compare("gc_out5.html","test_data/gc_out5_test.html");
 	BOOST_REQUIRE_EQUAL(true,test);
 }
 
@@ -320,7 +320,7 @@ BOOST_AUTO_TEST_CASE( google_chart6 )
 	cg.AddHistGraph(y);
 	cg.write("gc_out6.html");
 
-	bool test = compare("gc_out6.html","gc_out6_test.html");
+	bool test = compare("gc_out6.html","test_data/gc_out6_test.html");
 	BOOST_REQUIRE_EQUAL(true,test);
 }
 
@@ -383,7 +383,127 @@ BOOST_AUTO_TEST_CASE( google_chart_with_inject_HTML )
 
 	//! [Producing a set of histograms graphs]
 
-	bool test = compare("gc_out7.html","gc_out7_test.html");
+	bool test = compare("gc_out7.html","test_data/gc_out7_test.html");
+	BOOST_REQUIRE_EQUAL(true,test);
+}
+
+BOOST_AUTO_TEST_CASE( google_chart_number )
+{
+	Vcluster<> & v_cl = create_vcluster();
+
+	if (v_cl.getProcessUnitID() != 0)
+		return;
+
+	//! [Producing a set of histograms graphs]
+
+	openfpm::vector<float> x;
+	openfpm::vector<openfpm::vector<size_t>> y;
+	openfpm::vector<std::string> yn;
+
+	x.add(0.1);
+	x.add(0.2);
+	x.add(0.3);
+	x.add(0.4);
+	x.add(0.5);
+	x.add(0.6);
+
+	// Each colum can have multiple data set (in this case 4 dataset)
+	// Each dataset can have a name
+	yn.add("dataset1");
+	yn.add("dataset2");
+	yn.add("dataset3");
+	yn.add("dataset4");
+
+	// Each colums can have multiple data-set
+	y.add({2,3,5,6});
+	y.add({5,6,1,6});
+	y.add({2,1,6,9});
+	y.add({1,6,3,2});
+	y.add({3,3,0,6});
+	y.add({2,1,4,6});
+
+	// Google charts options
+	GCoptions options;
+
+	options.title = std::string("Example");
+	options.yAxis = std::string("Y Axis");
+	options.xAxis = std::string("X Axis");
+	options.stype = std::string("line");
+
+	GoogleChart cg;
+	//
+	cg.AddLinesGraph(x,y,yn,options);
+	cg.write("gc_num_plot.html");
+
+	//! [Producing a set of histograms graphs]
+
+	bool test = compare("gc_num_plot.html","test_data/gc_num_plot_test.html");
+	BOOST_REQUIRE_EQUAL(true,test);
+}
+
+BOOST_AUTO_TEST_CASE( google_chart_number_lines_different_x )
+{
+	Vcluster<> & v_cl = create_vcluster();
+
+	if (v_cl.getProcessUnitID() != 0)
+		return;
+
+	//! [Producing a set of histograms graphs]
+
+	openfpm::vector<float> x1;
+	openfpm::vector<float> y1;
+	openfpm::vector<float> x2;
+	openfpm::vector<float> y2;
+	openfpm::vector<float> x3;
+	openfpm::vector<float> y3;
+	openfpm::vector<std::string> yn;
+
+	x1.add(0.1); y1.add(4.5);
+	x1.add(0.2); y1.add(3.0);
+	x1.add(0.3); y1.add(5.5);
+	x1.add(0.4); y1.add(3.3);
+	x1.add(0.5); y1.add(1.0);
+	x1.add(0.6); y1.add(7.0);
+
+	x2.add(0.15); y2.add(1.5);
+	x2.add(0.2); y2.add(4.5);
+	x2.add(0.35); y2.add(2.5);
+	x2.add(0.45); y2.add(6.5);
+
+	x3.add(0.1); y3.add(3.5);
+	x3.add(0.2); y3.add(6.5);
+	x3.add(0.63); y3.add(1.5);
+	x3.add(0.37); y3.add(1.5);
+	x3.add(0.7); y3.add(3.5);
+	x3.add(0.82); y3.add(2.5);
+	x3.add(0.4); y3.add(2.5);
+	x3.add(1.0); y3.add(1.5);
+	x3.add(0.5); y3.add(7.5);
+	x3.add(0.91); y3.add(5.5);
+
+	// Each colum can have multiple data set (in this case 4 dataset)
+	// Each dataset can have a name
+	yn.add("dataset1");
+	yn.add("dataset2");
+	yn.add("dataset3");
+
+
+	// Google charts options
+	GCoptions options;
+
+	options.title = std::string("Example");
+	options.yAxis = std::string("Y Axis");
+	options.xAxis = std::string("X Axis");
+	options.stype = std::string("line");
+
+	GoogleChart cg;
+
+	cg.AddLines(yn,options,x1,y1,x2,y2,x3,y3);
+	cg.write("gc_num_ydif_plot.html");
+
+	//! [Producing a set of histograms graphs]
+
+	bool test = compare("gc_num_ydif_plot.html","test_data/gc_num_ydif_plot_test.html");
 	BOOST_REQUIRE_EQUAL(true,test);
 }
 
@@ -450,7 +570,7 @@ BOOST_AUTO_TEST_CASE( google_chart_linear_plot )
 
 	//! [Producing lines graph with style]
 
-	bool test = compare("gc_plot_out.html","gc_plot_out_test.html");
+	bool test = compare("gc_plot_out.html","test_data/gc_plot_out_test.html");
 	BOOST_REQUIRE_EQUAL(true,test);
 }
 
@@ -499,7 +619,7 @@ BOOST_AUTO_TEST_CASE( google_chart_linear_plot2 )
 
 	//! [Producing lines]
 
-	bool test = compare("gc_plot2_out.html","gc_plot2_out_test.html");
+	bool test = compare("gc_plot2_out.html","test_data/gc_plot2_out_test.html");
 	BOOST_REQUIRE_EQUAL(true,test);
 }
 
diff --git a/src/VTKWriter/VTKWriter.hpp b/src/VTKWriter/VTKWriter.hpp
index d8fa3e328e45c5aa2358c101ed563d00d20ec8dc..16f5a1c9daa2c38aa6aaae6bb42cc4e11c39585e 100644
--- a/src/VTKWriter/VTKWriter.hpp
+++ b/src/VTKWriter/VTKWriter.hpp
@@ -24,27 +24,27 @@
 template <typename T> std::string getType()
 {
 	// Create a property string based on the type of the property
-	if (typeid(T) == typeid(float))
+	if (std::is_same<T,float>::value)
 		return "float";
-	else if (typeid(T) == typeid(double))
+	else if (std::is_same<T,double>::value)
 		return "double";
-	else if (typeid(T) == typeid(char))
+	else if (std::is_same<T,char>::value)
 		return "char";
-	else if (typeid(T) == typeid(unsigned char))
+	else if (std::is_same<T,unsigned char>::value)
 		return "unsigned_char";
-	else if (typeid(T) == typeid(short))
+	else if (std::is_same<T,short>::value)
 		return "short";
-	else if (typeid(T) == typeid(unsigned short))
+	else if (std::is_same<T,unsigned short>::value)
 		return "unsigned_short";
-	else if (typeid(T) == typeid(int))
+	else if (std::is_same<T,int>::value)
 		return "int";
-	else if (typeid(T) == typeid(unsigned int))
+	else if (std::is_same<T,unsigned int>::value)
 		return "unsigned_int";
-	else if (typeid(T) == typeid(long int))
+	else if (std::is_same<T,long int>::value)
 		return "int";
-	else if (typeid(T) == typeid(unsigned long int))
+	else if (std::is_same<T,unsigned long int>::value )
 		return "unsigned_int";
-	else if (typeid(T) == typeid(bool))
+	else if (std::is_same<T,bool>::value )
 		return "bit";
 
 	return "";
@@ -103,6 +103,7 @@ enum file_type
 #define VTK_WRITER 0x10000
 #define FORMAT_ASCII 0x0
 #define FORMAT_BINARY 0x10000000
+#define PRINT_GHOST 1
 
 template <typename Object, unsigned int imp>
 class VTKWriter
@@ -121,7 +122,6 @@ class VTKWriter
 #include "VTKWriter_dist_graph.hpp"
 #endif
 
-
 #include "VTKWriter_point_set.hpp"
 
 #endif /* VTKWRITER_HPP_ */
diff --git a/src/VTKWriter/VTKWriter_graph.hpp b/src/VTKWriter/VTKWriter_graph.hpp
index 18d4667808aea9f99c298d72dcadecb16bc78728..bb5be70cdf655d27b9a5913904e43f5ba80589fb 100644
--- a/src/VTKWriter/VTKWriter_graph.hpp
+++ b/src/VTKWriter/VTKWriter_graph.hpp
@@ -65,14 +65,13 @@ struct vtk_vertex_node_array_scalar_selector<true>
 	static inline void move(typename G::V_container &vo, s_type (&x)[3], bool &z_set)
 	{
 		if (G::V_type::attributes::name[T::value] != "x")
-			return;
+		{return;}
 
 		if (std::extent<ele_v>::value == 3)
-			z_set = true;
+		{z_set = true;}
 
 		for (size_t i = 0; i < std::extent<ele_v>::value; i++)
-			x[i] = convert<typename boost::remove_reference<decltype(vo.template get<T::value>()[i])>::type>::template to<s_type>(vo.template get<T::value>()[i]);
-
+		{x[i] = convert<typename boost::remove_reference<decltype(vo.template get<T::value>()[i])>::type>::template to<s_type>(vo.template get<T::value>()[i]);}
 	}
 };
 
diff --git a/src/VTKWriter/VTKWriter_grids.hpp b/src/VTKWriter/VTKWriter_grids.hpp
index 46059296bd512cab4ce3d72bd4458ae231b583dc..21c1848560b07903c3af325c309b9747ab3683bd 100644
--- a/src/VTKWriter/VTKWriter_grids.hpp
+++ b/src/VTKWriter/VTKWriter_grids.hpp
@@ -117,10 +117,36 @@ struct prop_out_g
 			// if there is the next element
 			while (it.isNext())
 			{
-				if (vg.get(k).dom.isInside(it.get().toPoint()) == true)
-					v_out += "1.0\n";
+				if (ft == file_type::ASCII)
+				{
+					if (vg.get(k).dom.isInside(it.get().toPoint()) == true)
+					{
+						float flag = 1.0;
+						flag += vg.get(k).g.getFlag(it.get()) * 2;
+						v_out += std::to_string(flag) + "\n";
+					}
+					else
+					{
+						float flag = 0.0;
+						flag += vg.get(k).g.getFlag(it.get()) * 2;
+						v_out += std::to_string(flag) + "\n";
+					}
+				}
 				else
-					v_out += "0.0\n";
+				{
+					if (vg.get(k).dom.isInside(it.get().toPoint()) == true)
+					{
+						float flag = 1.0;
+						flag = swap_endian_lt(flag);
+						v_out.append((const char *)&flag,sizeof(flag));
+					}
+					else
+					{
+						float flag = 0.0;
+						flag = swap_endian_lt(flag);
+						v_out.append((const char *)&flag,sizeof(flag));
+					}
+				}
 
 				// increment the iterator and counter
 				++it;
@@ -142,8 +168,8 @@ template <typename pair>
 class VTKWriter<pair,VECTOR_GRIDS>
 {
 	//! Vector of grids
-	openfpm::vector< ele_g<typename pair::first,typename pair::second> > vg;
 
+	openfpm::vector< ele_g<typename pair::first,typename pair::second> > vg;
 	/*! \brief Get the total number of points
 	 *
 	 * \return the total number
@@ -380,9 +406,9 @@ public:
 		prop_out_g< ele_g<typename pair::first,typename pair::second>, typename pair::second > pp(point_data, vg, prop_names, ft);
 
 		if (prp == -1)
-			boost::mpl::for_each< boost::mpl::range_c<int,0, pair::first::value_type::max_prop> >(pp);
+		{boost::mpl::for_each< boost::mpl::range_c<int,0, pair::first::value_type::max_prop> >(pp);}
 		else
-			boost::mpl::for_each< boost::mpl::range_c<int,prp, prp> >(pp);
+		{boost::mpl::for_each< boost::mpl::range_c<int,prp, prp> >(pp);}
 
 		// Add the last property
 		pp.lastProp();
diff --git a/src/VTKWriter/VTKWriter_grids_st.hpp b/src/VTKWriter/VTKWriter_grids_st.hpp
index 43b4167318ba3bdad75185e2a1523fb08706919f..b6b523a83e1f843f00aca92d44c541237e75f25d 100644
--- a/src/VTKWriter/VTKWriter_grids_st.hpp
+++ b/src/VTKWriter/VTKWriter_grids_st.hpp
@@ -371,7 +371,9 @@ class VTKWriter<pair,VECTOR_ST_GRIDS>
 		// if the type is not supported return
 		if (type.size() == 0)
 		{
+#ifndef DISABLE_ALL_RTTI
 			std::cerr << "Error " << __FILE__ << ":" << __LINE__ << " the type " << demangle(typeid(ctype).name()) << " is not supported by vtk\n";
+#endif
 			return "";
 		}
 
diff --git a/src/VTKWriter/VTKWriter_grids_util.hpp b/src/VTKWriter/VTKWriter_grids_util.hpp
index 8adc6e2e7d4a7a2e76e90c69a44eb0d1f146ec59..2e05b26defb337db772b3d97514ec0dfd5abe41d 100644
--- a/src/VTKWriter/VTKWriter_grids_util.hpp
+++ b/src/VTKWriter/VTKWriter_grids_util.hpp
@@ -89,7 +89,9 @@ template<unsigned int i, typename ele_g, bool has_attributes> std::string get_po
 			// if the type is not supported skip-it
 			if (type.size() == 0)
 			{
+#ifndef DISABLE_ALL_RTTI
 				std::cerr << "Error " << __FILE__ << ":" << __LINE__ << " the type " << demangle(typeid(ctype).name()) << " is not supported by vtk\n";
+#endif
 				return "";
 			}
 
@@ -200,17 +202,17 @@ public:
 	 */
 	template<typename vector, typename iterator, typename I> static void write(std::string & v_out, vector & vg, size_t k, iterator & it, file_type ft)
 	{
-		typedef decltype(vg.get(k).g.get_o(it.get()).template get<I::value>()) ctype_;
-		typedef typename std::remove_reference<ctype_>::type ctype;
+		typedef decltype(vg.get(k).g.template get<I::value>(it.get())) ctype_;
+		typedef typename std::remove_const<typename std::remove_reference<ctype_>::type>::type ctype;
 
 		if (ft == file_type::ASCII)
 		{
 			// Print the property
-			v_out += std::to_string(vg.get(k).g.get_o(it.get()).template get<I::value>()) + "\n";
+			v_out += std::to_string(vg.get(k).g.template get<I::value>(it.get())) + "\n";
 		}
 		else
 		{
-			typename is_vtk_writable<ctype>::base tmp = vg.get(k).g.get_o(it.get()).template get<I::value>();
+			typename is_vtk_writable<ctype>::base tmp = vg.get(k).g.template get<I::value>(it.get());
 			tmp = swap_endian_lt(tmp);
 			v_out.append((const char *)&tmp,sizeof(tmp));
 		}
@@ -309,10 +311,10 @@ struct meta_prop<I, ele_g,St,T[N1],is_writable>
 					{
 						// Print the properties
 						for (size_t i1 = 0 ; i1 < N1 ; i1++)
-						{v_out += std::to_string(vg.get(k).g.get_o(it.get()).template get<I::value>()[i1]) + " ";}
+						{v_out += std::to_string(vg.get(k).g.template get<I::value>(it.get())[i1]) + " ";}
 
 						if (N1 == 2)
-						{v_out += "0.0";}
+						{v_out += std::to_string((decltype(vg.get(k).g.template get<I::value>(it.get())[0])) 0);}
 
 						v_out += "\n";
 					}
@@ -323,7 +325,7 @@ struct meta_prop<I, ele_g,St,T[N1],is_writable>
 						// Print the properties
 						for (size_t i1 = 0 ; i1 < N1 ; i1++)
 						{
-							tmp = vg.get(k).g.get_o(it.get()).template get<I::value>()[i1];
+							tmp = vg.get(k).g.template get<I::value>(it.get())[i1];
 							tmp = swap_endian_lt(tmp);
 							v_out.append((const char *)&tmp,sizeof(T));
 						}
@@ -388,11 +390,11 @@ struct meta_prop<I, ele_g,St, T[N1][N2],is_writable>
 							if (ft == file_type::ASCII)
 							{
 								// Print the property
-								v_out += std::to_string(vg.get(k).g.get_o(it.get()).template get<I::value>()[i1][i2]) + "\n";
+								v_out += std::to_string(vg.get(k).g.template get<I::value>(it.get())[i1][i2]) + "\n";
 							}
 							else
 							{
-								tmp = vg.get(k).g.get_o(it.get()).template get<I::value>()[i1][i2];
+								tmp = vg.get(k).g.template get<I::value>(it.get())[i1][i2];
 								tmp = swap_endian_lt(tmp);
 								v_out.append((const char *)&tmp,sizeof(tmp));
 							}
diff --git a/src/VTKWriter/VTKWriter_point_set.hpp b/src/VTKWriter/VTKWriter_point_set.hpp
index ce920abdbae5bd71972416b427f98c67daadf626..b3060663d3327338b556fa092863ac83a5412cdd 100644
--- a/src/VTKWriter/VTKWriter_point_set.hpp
+++ b/src/VTKWriter/VTKWriter_point_set.hpp
@@ -343,7 +343,7 @@ class VTKWriter<pair,VECTOR_POINTS>
 	 * \param meta_data string with the meta-data to add
 	 *
 	 */
-	std::string add_meta_data(std::string & meta_data)
+	std::string add_meta_data(std::string & meta_data, file_type & opt)
 	{
 		std::string meta_string;
 
@@ -362,7 +362,13 @@ class VTKWriter<pair,VECTOR_POINTS>
 		{
 			meta_string += "FIELD FieldData 1\n";
 			meta_string += "TIME 1 1 double\n";
-			meta_string += std::to_string(time);
+			if (opt == file_type::ASCII)
+			{meta_string += std::to_string(time);}
+			else
+			{
+				time = swap_endian_lt(time);
+				meta_string.append((const char *)&time,sizeof(double));
+			}
 			meta_string += "\n";
 		}
 
@@ -446,7 +452,7 @@ public:
 		// Data type for graph is DATASET POLYDATA
 		vtk_header += "DATASET POLYDATA\n";
 
-		vtk_header += add_meta_data(meta_data);
+		vtk_header += add_meta_data(meta_data,ft);
 
 		// point properties header
 		point_prop_header = get_point_properties_list(ft);
diff --git a/src/VTKWriter/VTKWriter_unit_tests.hpp b/src/VTKWriter/VTKWriter_unit_tests.hpp
index de10b80628d954d9552138fbb1e0ff91df6b3d3b..b123d40c8730a1598af01adc4e4aaba110c5786b 100644
--- a/src/VTKWriter/VTKWriter_unit_tests.hpp
+++ b/src/VTKWriter/VTKWriter_unit_tests.hpp
@@ -1049,6 +1049,9 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set )
 
 	vtk_v3.write("vtk_points_pp_header.vtk",prp_names,"points","time=5.123");
 
+	// We try binary
+	vtk_v3.write("vtk_points_pp_header_bin.vtk",prp_names,"points","time=5.123",file_type::BINARY);
+
 #ifndef SE_CLASS3
 
 	// Check that match
diff --git a/src/util/GBoxes.hpp b/src/util/GBoxes.hpp
index 4f4304c454bb18d2c9c06a960b2c1ee5e66cbc42..8ece35653eded808bbf8aa4911b8f0bb30fafc85 100644
--- a/src/util/GBoxes.hpp
+++ b/src/util/GBoxes.hpp
@@ -45,6 +45,10 @@ struct GBoxes
 	//! origin of GDbox in global grid coordinates
 	Point<dim,long int> origin;
 
+	//! In case the grid is not defined everywhere but is defined by a set of boxes
+	//! indicate from which box it come from
+	size_t k;
+
 	/*! \brief Indicate that this structure has no pointers inside
 	 *
 	 * \return true
diff --git a/test_data/gc_num_plot_test.html b/test_data/gc_num_plot_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..455f7c46e1ee67ad0c4a5a38faad543bd4917c38
--- /dev/null
+++ b/test_data/gc_num_plot_test.html
@@ -0,0 +1,50 @@
+<html>
+  <head>
+    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
+	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
+    <script type="text/javascript">
+      google.charts.load('current', {'packages':['corechart']});
+      google.charts.setOnLoadCallback(drawVisualization);
+
+function exportToSVG(i)
+{
+var e = document.getElementById('chart_div'+i);
+var svg = e.getElementsByTagName('svg')[0].parentNode.innerHTML;
+var pos = svg.lastIndexOf("</svg>");
+pos += 6;
+svg = svg.substring(0,4)  + " xmlns='http://www.w3.org/2000/svg' xmlns:xlink= 'http://www.w3.org/1999/xlink' " + svg.substring(4,pos);
+svgData = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg);
+$(this).attr({'href': svgData,'target': '_blank'});
+}
+
+      function drawVisualization() {
+var data0 = new google.visualization.DataTable();
+data0.addColumn('number','X Axis');
+data0.addColumn('number','dataset1');
+data0.addColumn('number','dataset2');
+data0.addColumn('number','dataset3');
+data0.addColumn('number','dataset4');
+data0.addRows([
+[0.1,2,3,5,6],
+[0.2,5,6,1,6],
+[0.3,2,1,6,9],
+[0.4,1,6,3,2],
+[0.5,3,3,0,6],
+[0.6,2,1,4,6],
+]);
+var options0= {
+title : 'Example',
+vAxis: {title: 'Y Axis'},
+hAxis: {title: 'X Axis'},
+curveType: 'function',
+lineWidth: 4,
+intervals: { 'style':'area' }};
+$("#export_svg0").on("click", function (event) {exportToSVG.apply(this,[0]);});
+var chart = new google.visualization.ComboChart(document.getElementById('chart_div0'));
+chart.draw(data0, options0);
+}</script>
+</head>
+<body>
+<a href="#" download="graph1.svg" id="export_svg0"><button>Export data into svg</button></a><div id="chart_div0" style="width: 900px; height: 500px;"></div>
+</body>
+</html>
diff --git a/test_data/gc_num_ydif_plot_test.html b/test_data/gc_num_ydif_plot_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..0a54032227398f1544586ea733e28cf5c22cd276
--- /dev/null
+++ b/test_data/gc_num_ydif_plot_test.html
@@ -0,0 +1,59 @@
+<html>
+  <head>
+    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
+	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
+    <script type="text/javascript">
+      google.charts.load('current', {'packages':['corechart']});
+      google.charts.setOnLoadCallback(drawVisualization);
+
+function exportToSVG(i)
+{
+var e = document.getElementById('chart_div'+i);
+var svg = e.getElementsByTagName('svg')[0].parentNode.innerHTML;
+var pos = svg.lastIndexOf("</svg>");
+pos += 6;
+svg = svg.substring(0,4)  + " xmlns='http://www.w3.org/2000/svg' xmlns:xlink= 'http://www.w3.org/1999/xlink' " + svg.substring(4,pos);
+svgData = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg);
+$(this).attr({'href': svgData,'target': '_blank'});
+}
+
+      function drawVisualization() {
+var data0 = new google.visualization.DataTable();
+data0.addColumn('number','X Axis');
+data0.addColumn('number','dataset1');
+data0.addColumn('number','dataset2');
+data0.addColumn('number','dataset3');
+data0.addRows([
+[0.1,4.5,null,3.5],
+[0.15,null,1.5,null],
+[0.2,3,4.5,6.5],
+[0.3,5.5,null,null],
+[0.35,null,2.5,null],
+[0.37,null,null,1.5],
+[0.4,3.3,null,2.5],
+[0.45,null,6.5,null],
+[0.5,1,null,7.5],
+[0.6,7,null,null],
+[0.63,null,null,1.5],
+[0.7,null,null,3.5],
+[0.82,null,null,2.5],
+[0.91,null,null,5.5],
+[1,null,null,1.5],
+]);
+var options0= {
+interpolateNulls : true,
+title : 'Example',
+vAxis: {title: 'Y Axis'},
+hAxis: {title: 'X Axis'},
+curveType: 'function',
+lineWidth: 4,
+intervals: { 'style':'area' }};
+$("#export_svg0").on("click", function (event) {exportToSVG.apply(this,[0]);});
+var chart = new google.visualization.ComboChart(document.getElementById('chart_div0'));
+chart.draw(data0, options0);
+}</script>
+</head>
+<body>
+<a href="#" download="graph1.svg" id="export_svg0"><button>Export data into svg</button></a><div id="chart_div0" style="width: 900px; height: 500px;"></div>
+</body>
+</html>
diff --git a/gc_out2_test.html b/test_data/gc_out2_test.html
similarity index 100%
rename from gc_out2_test.html
rename to test_data/gc_out2_test.html
diff --git a/gc_out3_test.html b/test_data/gc_out3_test.html
similarity index 100%
rename from gc_out3_test.html
rename to test_data/gc_out3_test.html
diff --git a/gc_out4_test.html b/test_data/gc_out4_test.html
similarity index 100%
rename from gc_out4_test.html
rename to test_data/gc_out4_test.html
diff --git a/gc_out5_test.html b/test_data/gc_out5_test.html
similarity index 100%
rename from gc_out5_test.html
rename to test_data/gc_out5_test.html
diff --git a/gc_out6_test.html b/test_data/gc_out6_test.html
similarity index 100%
rename from gc_out6_test.html
rename to test_data/gc_out6_test.html
diff --git a/gc_out7_test.html b/test_data/gc_out7_test.html
similarity index 100%
rename from gc_out7_test.html
rename to test_data/gc_out7_test.html
diff --git a/gc_out_test.html b/test_data/gc_out_test.html
similarity index 100%
rename from gc_out_test.html
rename to test_data/gc_out_test.html
diff --git a/gc_plot2_out_test.html b/test_data/gc_plot2_out_test.html
similarity index 100%
rename from gc_plot2_out_test.html
rename to test_data/gc_plot2_out_test.html
diff --git a/gc_plot_out_test.html b/test_data/gc_plot_out_test.html
similarity index 100%
rename from gc_plot_out_test.html
rename to test_data/gc_plot_out_test.html
diff --git a/test_data/vtk_grids_prp_test.vtk b/test_data/vtk_grids_prp_test.vtk
index 600c2207429792f3c196a4c075e1c42e79dde1ee..f861b08723489bcc41f4c16cc5b792344b364fa9 100644
--- a/test_data/vtk_grids_prp_test.vtk
+++ b/test_data/vtk_grids_prp_test.vtk
@@ -6159,1027 +6159,1027 @@ LOOKUP_TABLE default
 1.000000
 SCALARS domain float
 LOOKUP_TABLE default
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-0.0
-0.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-0.0
-0.0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-1.0
-1.0
-1.0
-1.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
diff --git a/test_data/vtk_grids_test.vtk b/test_data/vtk_grids_test.vtk
index 5e292278af14dc4d2f5993d5492aa0e25e427016..bfb0de82b7e03a0f4f14026be4327f5d77beffc3 100644
--- a/test_data/vtk_grids_test.vtk
+++ b/test_data/vtk_grids_test.vtk
@@ -16418,1027 +16418,1027 @@ LOOKUP_TABLE default
 255.000000
 SCALARS domain float
 LOOKUP_TABLE default
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0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000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
diff --git a/test_data/vtk_grids_test_1d.vtk b/test_data/vtk_grids_test_1d.vtk
index 67aae8b5ba98195378710e35d6619f0847694e7f..76e6973b75c2f3fb6620405e1d1bf3997369840c 100644
--- a/test_data/vtk_grids_test_1d.vtk
+++ b/test_data/vtk_grids_test_1d.vtk
@@ -1058,67 +1058,67 @@ LOOKUP_TABLE default
 15.000000
 SCALARS domain float
 LOOKUP_TABLE default
-0.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-0.0
-0.0
-0.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-0.0
-0.0
-0.0
-0.0
-0.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-0.0
-0.0
-0.0
-0.0
-0.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-1.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.0
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+1.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000
+0.000000