diff --git a/R/vtu.R b/R/vtu.R
index 57fcafc1bae8feb84133674abeca04ebe1ed6fb0..d6e03c82ffe5cc3e3b5a24bdd76846a6b356d549 100644
--- a/R/vtu.R
+++ b/R/vtu.R
@@ -1,45 +1,269 @@
-# Functions for adding .vtu data to a OGS6 simulation object
 
+#===== OGS6_mesh =====
 
-#'r2ogs6_mesh
-#'@description Wrapper class, so far only has a reference to a .vtu file
-#'@param mesh_ref A reference to a .vtu file
+
+#'OGS6_mesh
+#'@description Constructor for the OGS6_mesh base class
 #'@export
-r2ogs6_mesh <- function(mesh_ref){
-    new_r2ogs6_mesh(mesh_ref)
-}
+OGS6_mesh <- R6::R6Class(
+    "OGS6_mesh",
+    public = list(
+
+        #'@description
+        #'Creates new OGS6_mesh object
+        #'@param mesh_path string:
+        initialize = function(mesh_path) {
+            self$mesh_path <- mesh_path
+        }
+    ),
+
+    active = list(
+        #'@field mesh_path
+        #'Access to private parameter '.mesh_path'
+        mesh_path = function(value) {
+            if (missing(value)) {
+                private$.mesh_path
+            } else{
+                assertthat::assert_that(assertthat::is.string(value))
+                private$.mesh_path <- value
+                private$.mesh_filename <- basename(value)
+            }
+        },
+
+        #'@field mesh_filename
+        #'Access to private parameter '.mesh_filename'
+        mesh_filename = function() {
+            private$.mesh_filename
+        },
+
+        #'@field is_subclass
+        #'Access to private parameter '.is_subclass'
+        is_subclass = function() {
+            private$.is_subclass
+        },
 
-new_r2ogs6_mesh <- function(mesh_ref){
+        #'@field subclasses_names
+        #'Access to private parameter '.subclasses_names'
+        subclasses_names = function() {
+            private$.subclasses_names
+        },
 
-    assertthat::assert_that(assertthat::is.string(mesh_ref))
+        #'@field attr_names
+        #'Access to private parameter '.attr_names'
+        attr_names = function() {
+            private$.attr_names
+        }
+    ),
 
-    structure(
-        list(
-            mesh_ref = mesh_ref,
-            tag_name = "mesh",
-            is_subclass = FALSE,
-            attr_names = character(),
-            flatten_on_exp = character()
-            ),
-        class = "r2ogs6_mesh"
+    private = list(
+        .mesh_path = NULL,
+        .mesh_filename = NULL,
+        .is_subclass = FALSE,
+        .subclasses_names = character(),
+        .attr_names = character()
     )
-}
+)
+
+
+#===== OGS6_UnstructuredGrid =====
+
+
+#'OGS6_UnstructuredGrid
+#'@description Constructor for the OGS6_UnstructuredGrid base class
+#'@export
+OGS6_UnstructuredGrid <- R6::R6Class(
+    "OGS6_UnstructuredGrid",
+    public = list(
+
+        #'@description
+        #'Creates new OGS6_UnstructuredGrid object
+        #'@param Piece OGS6_Piece:
+        #'@param FieldData character, length == 2:
+        initialize = function(Piece,
+                              FieldData = NULL) {
+            self$Piece <- Piece
+            self$FieldData <- FieldData
+        }
+    ),
+
+    active = list(
+        #'@field Piece
+        #'Access to private parameter '.Piece'
+        Piece = function(value) {
+            if (missing(value)) {
+                private$.Piece
+            } else{
+                private$.Piece <- value
+            }
+        },
+
+        #'@field FieldData
+        #'Access to private parameter '.FieldData'
+        FieldData = function(value) {
+            if (missing(value)) {
+                private$.FieldData
+            } else{
+                private$.FieldData <- value
+            }
+        },
+
+        #'@field is_subclass
+        #'Access to private parameter '.is_subclass'
+        is_subclass = function() {
+            private$.is_subclass
+        },
+
+        #'@field subclasses_names
+        #'Access to private parameter '.subclasses_names'
+        subclasses_names = function() {
+            private$.subclasses_names
+        },
+
+        #'@field attr_names
+        #'Access to private parameter '.attr_names'
+        attr_names = function() {
+            private$.attr_names
+        }
+    ),
+
+    private = list(
+        .Piece = NULL,
+        .FieldData = NULL,
+        .is_subclass = TRUE,
+        .subclasses_names = character(),
+        .attr_names = character()
+    )
+)
 
-#'as_node.r2ogs6_curve
-#'@description Implementation of generic function as_node for S3 class r2ogs6_mesh
-#'@param x A r2ogs6_mesh class object
-as_node.r2ogs6_mesh <- function(x){
-    node <- list(mesh = structure(list(x$mesh_ref)))
-    return(node)
-}
+
+#===== OGS6_Piece =====
+
+
+OGS6_Piece <- R6::R6Class(
+    "OGS6_Piece",
+    public = list(
+        initialize = function(NumberOfPoints,
+                              NumberOfCells,
+                              PointData,
+                              Points,
+                              Cells,
+                              CellData = NULL) {
+
+            self$NumberOfPoints <- NumberOfPoints
+            self$NumberOfCells <- NumberOfCells
+            self$PointData <- PointData
+            self$Points <- Points
+            self$Cells <- Cells
+            self$CellData <- CellData
+        }
+    ),
+
+    active = list(
+
+        #'@field NumberOfPoints
+        #'Access to private parameter '.NumberOfPoints'
+        NumberOfPoints = function(value) {
+            if (missing(value)) {
+                private$.NumberOfPoints
+            } else{
+                private$.NumberOfPoints <- value
+            }
+        },
+
+        #'@field NumberOfCells
+        #'Access to private parameter '.NumberOfCells'
+        NumberOfCells = function(value) {
+            if (missing(value)) {
+                private$.NumberOfCells
+            } else{
+                private$.NumberOfCells <- value
+            }
+        },
+
+        #'@field PointData
+        #'Access to private parameter '.PointData'
+        PointData = function(value) {
+            if (missing(value)) {
+                private$.PointData
+            } else{
+                private$.PointData <- value
+            }
+        },
+
+        #'@field Points
+        #'Access to private parameter '.Points'
+        Points = function(value) {
+            if (missing(value)) {
+                private$.Points
+            } else{
+                private$.Points <- value
+            }
+        },
+
+        #'@field Cells
+        #'Access to private parameter '.Cells'
+        Cells = function(value) {
+            if (missing(value)) {
+                private$.Cells
+            } else{
+                private$.Cells <- value
+            }
+        },
+
+        #'@field CellData
+        #'Access to private parameter '.CellData'
+        CellData = function(value) {
+            if (missing(value)) {
+                private$.CellData
+            } else{
+                private$.CellData <- value
+            }
+        },
+
+        #'@field is_subclass
+        #'Access to private parameter '.is_subclass'
+        is_subclass = function() {
+            private$.is_subclass
+        },
+
+        #'@field subclasses_names
+        #'Access to private parameter '.subclasses_names'
+        subclasses_names = function() {
+            private$.subclasses_names
+        },
+
+        #'@field attr_names
+        #'Access to private parameter '.attr_names'
+        attr_names = function() {
+            private$.attr_names
+        }
+    ),
+
+    private = list(
+        .NumberOfPoints = NULL,
+        .NumberOfCells = NULL,
+        .PointData = NULL,
+        .Points = NULL,
+        .Cells = NULL,
+        .CellData = NULL,
+        .is_subclass = TRUE,
+        .subclasses_names = character(),
+        .attr_names = c("NumberOfPoints",
+                        "NumberOfCells")
+    )
+)
+
+
+#===== generate_structured_mesh =====
 
 
 #'generate_structured_mesh
-#'@description Wrapper function to call generateStructuredMesh.exe (VTK mesh generator).
-#'For full documentation see https://www.opengeosys.org/docs/tools/meshing/structured-mesh-generation/
-#'@param ogs6_obj A OGS6 class object (containing the path to the ogs6 bin/ folder)
-#'@param call_str The arguments the script will be called with (EXCEPT -o output_file_name, this will
-#' be generated automatically!)
+#'@description Wrapper function to call generateStructuredMesh.exe
+#' (VTK mesh generator). For full documentation see
+#'https://www.opengeosys.org/docs/tools/meshing/structured-mesh-generation/
+#'@param ogs6_obj OGS6: Simulation object
+#'@param call_str The arguments the script will be called with
+#' (EXCEPT -o output_file_name, this will be generated automatically!)
 #'@return The newly generated .vtu file path
 #'@export
 generate_structured_mesh = function(ogs6_obj, call_str) {
@@ -55,15 +279,14 @@ generate_structured_mesh = function(ogs6_obj, call_str) {
         mesh_number <- length(ogs6_obj$meshes) + 1
     }
 
+    mesh_dir_path <- tempdir()
     mesh_output_file_name <- paste0(ogs6_obj$sim_name, "_", mesh_number, ".vtu")
-    mesh_output_file <- paste0(ogs6_obj$sim_path, mesh_output_file_name)
-
-    #sysname <- Sys.info()[['sysname']]
+    mesh_path <- paste0(mesh_dir_path, mesh_output_file_name)
 
     system(command = paste0(ogs6_obj$ogs_bin_path, "generateStructuredMesh.exe",
-                            " -o ", mesh_output_file, " ", call_str))
+                            " -o ", mesh_path, " ", call_str))
 
-    ogs6_obj$add_mesh(r2ogs6_mesh(mesh_output_file_name))
+    ogs6_obj$add_mesh(OGS6_mesh$new(mesh_path))
 
-    return(invisible(mesh_output_file_name))
-}
\ No newline at end of file
+    return(invisible(mesh_path))
+}