From ef46ee59a533f6f2e00cdb2e0a8098e81e278eab Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <github@naumov.de>
Date: Sat, 14 May 2016 17:52:16 +0000
Subject: [PATCH] [MeL] Tabs to whitespaces.

---
 MeshLib/CMakeLists.txt                        |   16 +-
 MeshLib/ElementStatus.cpp                     |  130 +-
 MeshLib/ElementStatus.h                       |   68 +-
 MeshLib/Elements/CellRule.cpp                 |   34 +-
 MeshLib/Elements/CellRule.h                   |   24 +-
 MeshLib/Elements/EdgeReturn.cpp               |   38 +-
 MeshLib/Elements/EdgeReturn.h                 |   18 +-
 MeshLib/Elements/EdgeRule.h                   |   30 +-
 MeshLib/Elements/Element.cpp                  |  206 +--
 MeshLib/Elements/Element.h                    |  338 ++--
 MeshLib/Elements/FaceRule.cpp                 |   12 +-
 MeshLib/Elements/FaceRule.h                   |   30 +-
 MeshLib/Elements/HexRule20.cpp                |   54 +-
 MeshLib/Elements/HexRule20.h                  |   28 +-
 MeshLib/Elements/HexRule8.cpp                 |  128 +-
 MeshLib/Elements/HexRule8.h                   |   78 +-
 MeshLib/Elements/LineRule2.cpp                |   28 +-
 MeshLib/Elements/LineRule2.h                  |   58 +-
 MeshLib/Elements/LineRule3.h                  |    8 +-
 MeshLib/Elements/Point.h                      |    2 +-
 MeshLib/Elements/PointRule1.cpp               |   20 +-
 MeshLib/Elements/PointRule1.h                 |   62 +-
 MeshLib/Elements/PrismRule15.cpp              |   62 +-
 MeshLib/Elements/PrismRule15.h                |   32 +-
 MeshLib/Elements/PrismRule6.cpp               |  126 +-
 MeshLib/Elements/PrismRule6.h                 |   82 +-
 MeshLib/Elements/PyramidRule13.cpp            |   60 +-
 MeshLib/Elements/PyramidRule13.h              |   32 +-
 MeshLib/Elements/PyramidRule5.cpp             |  120 +-
 MeshLib/Elements/PyramidRule5.h               |   82 +-
 MeshLib/Elements/QuadRule4.cpp                |   56 +-
 MeshLib/Elements/QuadRule4.h                  |   62 +-
 MeshLib/Elements/QuadRule8.cpp                |    8 +-
 MeshLib/Elements/QuadRule8.h                  |   16 +-
 MeshLib/Elements/QuadRule9.h                  |    8 +-
 MeshLib/Elements/TemplateElement-impl.h       |   50 +-
 MeshLib/Elements/TemplateElement.h            |  236 +--
 MeshLib/Elements/TetRule10.cpp                |   38 +-
 MeshLib/Elements/TetRule10.h                  |   28 +-
 MeshLib/Elements/TetRule4.cpp                 |   72 +-
 MeshLib/Elements/TetRule4.h                   |   78 +-
 MeshLib/Elements/TriRule3.cpp                 |   40 +-
 MeshLib/Elements/TriRule3.h                   |   62 +-
 MeshLib/Elements/TriRule6.cpp                 |    6 +-
 MeshLib/Elements/TriRule6.h                   |   16 +-
 MeshLib/Elements/VertexRule.h                 |   48 +-
 MeshLib/IO/Legacy/MeshIO.cpp                  |  528 +++---
 MeshLib/IO/Legacy/MeshIO.h                    |   32 +-
 MeshLib/IO/VtkIO/VtuInterface-impl.h          |   68 +-
 MeshLib/IO/VtkIO/VtuInterface.cpp             |   90 +-
 MeshLib/IO/VtkIO/VtuInterface.h               |   34 +-
 MeshLib/IO/readMeshFromFile.cpp               |   24 +-
 MeshLib/IO/writeMeshToFile.cpp                |   22 +-
 MeshLib/Mesh.cpp                              |  356 ++--
 MeshLib/Mesh.h                                |  206 +--
 MeshLib/MeshEditing/AddLayerToMesh.cpp        |  260 +--
 MeshLib/MeshEditing/AddLayerToMesh.h          |   14 +-
 .../MeshEditing/DuplicateMeshComponents.cpp   |   64 +-
 MeshLib/MeshEditing/DuplicateMeshComponents.h |   38 +-
 .../MeshEditing/ElementValueModification.cpp  |  166 +-
 .../MeshEditing/ElementValueModification.h    |   70 +-
 MeshLib/MeshEditing/FlipElements.cpp          |   56 +-
 .../Mesh2MeshPropertyInterpolation.cpp        |  238 +--
 .../Mesh2MeshPropertyInterpolation.h          |   72 +-
 MeshLib/MeshEditing/MeshRevision.cpp          | 1448 ++++++++---------
 MeshLib/MeshEditing/MeshRevision.h            |  302 ++--
 MeshLib/MeshEditing/RemoveMeshComponents.cpp  |  204 +--
 MeshLib/MeshEditing/RemoveMeshComponents.h    |    2 +-
 MeshLib/MeshEditing/moveMeshNodes.h           |   36 +-
 MeshLib/MeshEditing/projectMeshOntoPlane.h    |   32 +-
 MeshLib/MeshEnums.cpp                         |  170 +-
 MeshLib/MeshEnums.h                           |   76 +-
 .../MeshGenerators/LayeredMeshGenerator.cpp   |   48 +-
 MeshLib/MeshGenerators/LayeredMeshGenerator.h |  106 +-
 MeshLib/MeshGenerators/LayeredVolume.cpp      |  278 ++--
 MeshLib/MeshGenerators/LayeredVolume.h        |   50 +-
 MeshLib/MeshGenerators/MeshGenerator.cpp      |  732 ++++-----
 MeshLib/MeshGenerators/MeshGenerator.h        |   48 +-
 MeshLib/MeshGenerators/MeshLayerMapper.cpp    |  332 ++--
 MeshLib/MeshGenerators/MeshLayerMapper.h      |   72 +-
 MeshLib/MeshGenerators/RasterToMesh.cpp       |  382 ++---
 MeshLib/MeshGenerators/RasterToMesh.h         |  160 +-
 MeshLib/MeshGenerators/VtkMeshConverter.cpp   |  362 ++---
 MeshLib/MeshGenerators/VtkMeshConverter.h     |  142 +-
 MeshLib/MeshInformation.cpp                   |   32 +-
 MeshLib/MeshInformation.h                     |   62 +-
 MeshLib/MeshQuality/AngleSkewMetric.cpp       |  278 ++--
 MeshLib/MeshQuality/AngleSkewMetric.h         |   30 +-
 MeshLib/MeshQuality/EdgeRatioMetric.cpp       |  304 ++--
 MeshLib/MeshQuality/ElementErrorCode.h        |   54 +-
 MeshLib/MeshQuality/ElementQualityInterface.h |  136 +-
 MeshLib/MeshQuality/ElementQualityMetric.cpp  |   30 +-
 MeshLib/MeshQuality/ElementQualityMetric.h    |   36 +-
 MeshLib/MeshQuality/ElementSizeMetric.cpp     |  132 +-
 MeshLib/MeshQuality/ElementSizeMetric.h       |   12 +-
 MeshLib/MeshQuality/MeshValidation.cpp        |  234 +--
 MeshLib/MeshQuality/MeshValidation.h          |   78 +-
 MeshLib/MeshQuality/SizeDifferenceMetric.cpp  |   58 +-
 MeshLib/MeshQuality/SizeDifferenceMetric.h    |    6 +-
 MeshLib/MeshSearch/ElementSearch.cpp          |   92 +-
 MeshLib/MeshSearch/ElementSearch.h            |  126 +-
 MeshLib/MeshSearch/MeshElementGrid.cpp        |  420 ++---
 MeshLib/MeshSearch/MeshElementGrid.h          |  122 +-
 MeshLib/MeshSearch/NodeSearch.cpp             |  104 +-
 MeshLib/MeshSearch/NodeSearch.h               |   26 +-
 MeshLib/MeshSurfaceExtraction.cpp             |  426 ++---
 MeshLib/MeshSurfaceExtraction.h               |   70 +-
 MeshLib/Node.cpp                              |   22 +-
 MeshLib/Node.h                                |  106 +-
 MeshLib/Properties-impl.h                     |  160 +-
 MeshLib/Properties.cpp                        |   94 +-
 MeshLib/Properties.h                          |  160 +-
 MeshLib/PropertyVector.h                      |  298 ++--
 MeshLib/VtkOGSEnum.cpp                        |  160 +-
 MeshLib/convertMeshToGeo.cpp                  |  150 +-
 MeshLib/convertMeshToGeo.h                    |   38 +-
 116 files changed, 7103 insertions(+), 7103 deletions(-)

diff --git a/MeshLib/CMakeLists.txt b/MeshLib/CMakeLists.txt
index 130eda1e0dd..643a6926a67 100644
--- a/MeshLib/CMakeLists.txt
+++ b/MeshLib/CMakeLists.txt
@@ -3,7 +3,7 @@ GET_SOURCE_FILES(SOURCES_MESHLIB)
 
 # It should be removed too for other MPI based DDC approach in future.
 if(NOT OGS_USE_PETSC)
-	list(REMOVE_ITEM SOURCES_MESHLIB NodePartitionedMesh.h)
+    list(REMOVE_ITEM SOURCES_MESHLIB NodePartitionedMesh.h)
 endif()
 
 GET_SOURCE_FILES(SOURCES_ELEMENTS Elements)
@@ -22,19 +22,19 @@ set(SOURCES ${SOURCES_MESHLIB} ${SOURCES_ELEMENTS} ${SOURCES_EDITING}
 
 # It could be used for other MPI based DDC approach in future.
 if(OGS_USE_PETSC)
-	GET_SOURCE_FILES(SOURCES_MPI_IO IO/MPI_IO)
-	set(SOURCES ${SOURCES} ${SOURCES_MPI_IO})
+    GET_SOURCE_FILES(SOURCES_MPI_IO IO/MPI_IO)
+    set(SOURCES ${SOURCES} ${SOURCES_MPI_IO})
 endif()
 
 # Create the library
 add_library(MeshLib STATIC ${SOURCES})
 
 target_link_libraries(MeshLib
-	BaseLib
-	GeoLib
-	MathLib
-	InSituLib # VtkMappedMeshSource
-	${VTK_LIBRARIES}
+    BaseLib
+    GeoLib
+    MathLib
+    InSituLib # VtkMappedMeshSource
+    ${VTK_LIBRARIES}
 )
 
 ADD_VTK_DEPENDENCY(MeshLib)
diff --git a/MeshLib/ElementStatus.cpp b/MeshLib/ElementStatus.cpp
index 40e5b38276d..5c8b5139e67 100644
--- a/MeshLib/ElementStatus.cpp
+++ b/MeshLib/ElementStatus.cpp
@@ -25,104 +25,104 @@ ElementStatus::ElementStatus(Mesh const* const mesh, bool hasAnyInactive)
       _element_status(mesh->getNElements(), true),
       _hasAnyInactive(hasAnyInactive)
 {
-	const std::vector<MeshLib::Node*>& nodes(_mesh->getNodes());
-	for (auto node : nodes)
-		_active_nodes.push_back(node->getNElements());
+    const std::vector<MeshLib::Node*>& nodes(_mesh->getNodes());
+    for (auto node : nodes)
+        _active_nodes.push_back(node->getNElements());
 }
 
 ElementStatus::ElementStatus(Mesh const* const mesh,
                              std::vector<int> const& vec_inactive_matIDs)
     : ElementStatus(mesh, !vec_inactive_matIDs.empty())
 {
-	auto materialIds = mesh->getProperties().getPropertyVector<int>("MaterialIDs");
-	if (materialIds) {
-		for (auto material_id : vec_inactive_matIDs) {
-			for (auto e : _mesh->getElements()) {
-				if ((*materialIds)[e->getID()] == material_id) {
-					setElementStatus(e->getID(), false);
-				}
-			}
-		}
-	}
+    auto materialIds = mesh->getProperties().getPropertyVector<int>("MaterialIDs");
+    if (materialIds) {
+        for (auto material_id : vec_inactive_matIDs) {
+            for (auto e : _mesh->getElements()) {
+                if ((*materialIds)[e->getID()] == material_id) {
+                    setElementStatus(e->getID(), false);
+                }
+            }
+        }
+    }
 
-	_vec_active_eles.reserve(getNActiveElements());
-	const std::size_t nElems (_mesh->getNElements());
-	for (std::size_t i=0; i<nElems; ++i)
-		if (_element_status[i])
-			_vec_active_eles.push_back(const_cast<MeshLib::Element*>(_mesh->getElement(i)));
+    _vec_active_eles.reserve(getNActiveElements());
+    const std::size_t nElems (_mesh->getNElements());
+    for (std::size_t i=0; i<nElems; ++i)
+        if (_element_status[i])
+            _vec_active_eles.push_back(const_cast<MeshLib::Element*>(_mesh->getElement(i)));
 
-	_vec_active_nodes.reserve(this->getNActiveNodes());
-	const std::size_t nNodes (_mesh->getNNodes());
-	for (std::size_t i=0; i<nNodes; ++i)
-		if (_active_nodes[i]>0)
-			_vec_active_nodes.push_back(const_cast<MeshLib::Node*>(_mesh->getNode(i)));
+    _vec_active_nodes.reserve(this->getNActiveNodes());
+    const std::size_t nNodes (_mesh->getNNodes());
+    for (std::size_t i=0; i<nNodes; ++i)
+        if (_active_nodes[i]>0)
+            _vec_active_nodes.push_back(const_cast<MeshLib::Node*>(_mesh->getNode(i)));
 
-	DBUG(
-	    "Deactivated %d materials and resulting active %d nodes and %d "
-	    "elements",
-	    vec_inactive_matIDs.size(),
-	    _vec_active_nodes.size(),
-	    _vec_active_eles.size());
+    DBUG(
+        "Deactivated %d materials and resulting active %d nodes and %d "
+        "elements",
+        vec_inactive_matIDs.size(),
+        _vec_active_nodes.size(),
+        _vec_active_eles.size());
 }
 
 std::vector<MeshLib::Element*> const& ElementStatus::getActiveElements() const
 {
-	if (_hasAnyInactive)
-		return _vec_active_eles;
-	else
-		return _mesh->getElements();
+    if (_hasAnyInactive)
+        return _vec_active_eles;
+    else
+        return _mesh->getElements();
 }
 
 std::vector<MeshLib::Node*> const& ElementStatus::getActiveNodes() const
 {
-	if (_hasAnyInactive)
-		return _vec_active_nodes;
-	else
-		return _mesh->getNodes();
+    if (_hasAnyInactive)
+        return _vec_active_nodes;
+    else
+        return _mesh->getNodes();
 }
 
 std::vector<MeshLib::Element*> ElementStatus::getActiveElementsAtNode(std::size_t node_id) const
 {
-	const std::size_t nActiveElements (_active_nodes[node_id]);
-	std::vector<MeshLib::Element*> active_elements;
-	active_elements.reserve(nActiveElements);
-	for (auto elem : _mesh->getNode(node_id)->getElements())
-	{
-		if (active_elements.size() == nActiveElements)
-			return active_elements;
-		if (_element_status[elem->getID()])
-			active_elements.push_back(elem);
-	}
-	return active_elements;
+    const std::size_t nActiveElements (_active_nodes[node_id]);
+    std::vector<MeshLib::Element*> active_elements;
+    active_elements.reserve(nActiveElements);
+    for (auto elem : _mesh->getNode(node_id)->getElements())
+    {
+        if (active_elements.size() == nActiveElements)
+            return active_elements;
+        if (_element_status[elem->getID()])
+            active_elements.push_back(elem);
+    }
+    return active_elements;
 }
 
 std::size_t ElementStatus::getNActiveNodes() const
 {
-	return _active_nodes.size() - std::count(_active_nodes.cbegin(), _active_nodes.cend(), 0);
+    return _active_nodes.size() - std::count(_active_nodes.cbegin(), _active_nodes.cend(), 0);
 }
 
 std::size_t ElementStatus::getNActiveElements() const
 {
-	return static_cast<std::size_t>(
-	    std::count(_element_status.cbegin(), _element_status.cend(), true));
+    return static_cast<std::size_t>(
+        std::count(_element_status.cbegin(), _element_status.cend(), true));
 }
 
 void ElementStatus::setElementStatus(std::size_t i, bool status)
 {
-	if (_element_status[i] != status)
-	{
-		const int change = (status) ? 1 : -1;
-		_element_status[i] = status;
-		const unsigned nElemNodes (_mesh->getElement(i)->getNBaseNodes());
-		MeshLib::Node const*const*const nodes = _mesh->getElement(i)->getNodes();
-		for (unsigned j=0; j<nElemNodes; ++j)
-		{
-			assert(_active_nodes[j] < 255);  // if one node has >255 connected
-			                                 // elements the data type is too
-			                                 // small
-			_active_nodes[nodes[j]->getID()] += change;
-		}
-	}
+    if (_element_status[i] != status)
+    {
+        const int change = (status) ? 1 : -1;
+        _element_status[i] = status;
+        const unsigned nElemNodes (_mesh->getElement(i)->getNBaseNodes());
+        MeshLib::Node const*const*const nodes = _mesh->getElement(i)->getNodes();
+        for (unsigned j=0; j<nElemNodes; ++j)
+        {
+            assert(_active_nodes[j] < 255);  // if one node has >255 connected
+                                             // elements the data type is too
+                                             // small
+            _active_nodes[nodes[j]->getID()] += change;
+        }
+    }
 }
 
 }
diff --git a/MeshLib/ElementStatus.h b/MeshLib/ElementStatus.h
index 93f240fbe66..ddd4ed8a591 100644
--- a/MeshLib/ElementStatus.h
+++ b/MeshLib/ElementStatus.h
@@ -18,54 +18,54 @@
 #include <vector>
 
 namespace MeshLib {
-	class Mesh;
-	class Element;
-	class Node;
+    class Mesh;
+    class Element;
+    class Node;
 
 class ElementStatus
 {
 
 public:
-	/// Constructor assuming all nodes and elements
-	explicit ElementStatus(MeshLib::Mesh const* const mesh,
-	                       bool hasAnyInactive = false);
+    /// Constructor assuming all nodes and elements
+    explicit ElementStatus(MeshLib::Mesh const* const mesh,
+                           bool hasAnyInactive = false);
 
-	/// Constructor taking a vector of inactive material IDs
-	ElementStatus(MeshLib::Mesh const* const mesh,
-	              std::vector<int> const& vec_inactive_matIDs);
+    /// Constructor taking a vector of inactive material IDs
+    ElementStatus(MeshLib::Mesh const* const mesh,
+                  std::vector<int> const& vec_inactive_matIDs);
 
-	/// Returns a vector of active element IDs
-	std::vector<MeshLib::Element*> const& getActiveElements() const;
+    /// Returns a vector of active element IDs
+    std::vector<MeshLib::Element*> const& getActiveElements() const;
 
-	/// Returns a vector of active node IDs
-	std::vector<MeshLib::Node*> const& getActiveNodes() const;
+    /// Returns a vector of active node IDs
+    std::vector<MeshLib::Node*> const& getActiveNodes() const;
 
-	/// Returns the status of element i
-	bool isActive(std::size_t i) const { return _element_status[i]; }
+    /// Returns the status of element i
+    bool isActive(std::size_t i) const { return _element_status[i]; }
 
-	/// Returns a vector of active elements connected to a node
-	std::vector<MeshLib::Element*> getActiveElementsAtNode(std::size_t node_id) const;
+    /// Returns a vector of active elements connected to a node
+    std::vector<MeshLib::Element*> getActiveElementsAtNode(std::size_t node_id) const;
 
-	/// Returns the total number of active nodes
-	std::size_t getNActiveNodes() const;
+    /// Returns the total number of active nodes
+    std::size_t getNActiveNodes() const;
 
-	/// Returns the total number of active elements
-	std::size_t getNActiveElements() const;
+    /// Returns the total number of active elements
+    std::size_t getNActiveElements() const;
 
 protected:
-	/// Sets the status of element i
-	void setElementStatus(std::size_t i, bool status);
-
-	/// The mesh for which the element status is administrated
-	MeshLib::Mesh const*const _mesh;
-	/// Element status for each mesh element (active/inactive = true/false)
-	std::vector<bool> _element_status;
-	/// Node status for each mesh node (value = number of active elements connected to node, 0 means inactive)
-	std::vector<unsigned char> _active_nodes;
-
-	bool const _hasAnyInactive;
-	std::vector<MeshLib::Node*> _vec_active_nodes;
-	std::vector<MeshLib::Element*> _vec_active_eles;
+    /// Sets the status of element i
+    void setElementStatus(std::size_t i, bool status);
+
+    /// The mesh for which the element status is administrated
+    MeshLib::Mesh const*const _mesh;
+    /// Element status for each mesh element (active/inactive = true/false)
+    std::vector<bool> _element_status;
+    /// Node status for each mesh node (value = number of active elements connected to node, 0 means inactive)
+    std::vector<unsigned char> _active_nodes;
+
+    bool const _hasAnyInactive;
+    std::vector<MeshLib::Node*> _vec_active_nodes;
+    std::vector<MeshLib::Element*> _vec_active_eles;
 
 }; /* class */
 
diff --git a/MeshLib/Elements/CellRule.cpp b/MeshLib/Elements/CellRule.cpp
index f0944ef470a..1d9485e474e 100644
--- a/MeshLib/Elements/CellRule.cpp
+++ b/MeshLib/Elements/CellRule.cpp
@@ -18,23 +18,23 @@ namespace MeshLib {
 
 bool CellRule::testElementNodeOrder(const Element* e)
 {
-	const MathLib::Vector3 c (e->getCenterOfGravity());
-	const unsigned nFaces (e->getNFaces());
-	for (unsigned j=0; j<nFaces; ++j)
-	{
-		MeshLib::Element const*const face (e->getFace(j));
-		// Node 1 is checked below because that way all nodes are used for the test
-		// at some point, while for node 0 at least one node in every element
-		// type would be used for checking twice and one wouldn't be checked at
-		// all. (based on the definition of the _face_nodes variable)
-		const MeshLib::Node x (*(face->getNode(1)));
-		const MathLib::Vector3 cx (c, x);
-		const double s = MathLib::scalarProduct(FaceRule::getSurfaceNormal(face), cx);
-		delete face;
-		if (s >= 0)
-			return false;
-	}
-	return true;
+    const MathLib::Vector3 c (e->getCenterOfGravity());
+    const unsigned nFaces (e->getNFaces());
+    for (unsigned j=0; j<nFaces; ++j)
+    {
+        MeshLib::Element const*const face (e->getFace(j));
+        // Node 1 is checked below because that way all nodes are used for the test
+        // at some point, while for node 0 at least one node in every element
+        // type would be used for checking twice and one wouldn't be checked at
+        // all. (based on the definition of the _face_nodes variable)
+        const MeshLib::Node x (*(face->getNode(1)));
+        const MathLib::Vector3 cx (c, x);
+        const double s = MathLib::scalarProduct(FaceRule::getSurfaceNormal(face), cx);
+        delete face;
+        if (s >= 0)
+            return false;
+    }
+    return true;
 }
 
 } /* namespace */
diff --git a/MeshLib/Elements/CellRule.h b/MeshLib/Elements/CellRule.h
index 358a5d34c53..e5e702b9b6b 100644
--- a/MeshLib/Elements/CellRule.h
+++ b/MeshLib/Elements/CellRule.h
@@ -18,18 +18,18 @@ class Element;
 class CellRule
 {
 public:
-	/// Constant: Dimension of this mesh element
-	static const unsigned dimension = 3u;
-
-	/**
-	 * Checks if the node order of an element is correct by testing surface normals.
-	 * For 3D elements true is returned if the normals of all faces points away from the centre of
-	 * the element.
-	 * Note: This method might give wrong results if something else is wrong with the element
-	 * (non-planar faces, non-convex geometry, possibly zero volume) which causes the calculated
-	 * center of gravity to lie outside of the actual element
-	 */
-	static bool testElementNodeOrder(const Element* /*e*/);
+    /// Constant: Dimension of this mesh element
+    static const unsigned dimension = 3u;
+
+    /**
+     * Checks if the node order of an element is correct by testing surface normals.
+     * For 3D elements true is returned if the normals of all faces points away from the centre of
+     * the element.
+     * Note: This method might give wrong results if something else is wrong with the element
+     * (non-planar faces, non-convex geometry, possibly zero volume) which causes the calculated
+     * center of gravity to lie outside of the actual element
+     */
+    static bool testElementNodeOrder(const Element* /*e*/);
 }; /* class */
 
 } /* namespace */
diff --git a/MeshLib/Elements/EdgeReturn.cpp b/MeshLib/Elements/EdgeReturn.cpp
index bc177113114..06e1ba9e30a 100644
--- a/MeshLib/Elements/EdgeReturn.cpp
+++ b/MeshLib/Elements/EdgeReturn.cpp
@@ -20,29 +20,29 @@ namespace MeshLib
 
 const Element* LinearEdgeReturn::getEdge(const Element* e, unsigned i)
 {
-	if (i < e->getNEdges())
-	{
-		Node** nodes = new Node*[2];
-		nodes[0] = const_cast<Node*>(e->getEdgeNode(i,0));
-		nodes[1] = const_cast<Node*>(e->getEdgeNode(i,1));
-		return new Line(nodes);
-	}
-	ERR("Error in MeshLib::Element::getEdge() - Index does not exist.");
-	return nullptr;
+    if (i < e->getNEdges())
+    {
+        Node** nodes = new Node*[2];
+        nodes[0] = const_cast<Node*>(e->getEdgeNode(i,0));
+        nodes[1] = const_cast<Node*>(e->getEdgeNode(i,1));
+        return new Line(nodes);
+    }
+    ERR("Error in MeshLib::Element::getEdge() - Index does not exist.");
+    return nullptr;
 }
 
 const Element* QuadraticEdgeReturn::getEdge(const Element* e, unsigned i)
 {
-	if (i < e->getNEdges())
-	{
-		Node** nodes = new Node*[3];
-		nodes[0] = const_cast<Node*>(e->getEdgeNode(i,0));
-		nodes[1] = const_cast<Node*>(e->getEdgeNode(i,1));
-		nodes[2] = const_cast<Node*>(e->getEdgeNode(i,2));
-		return new Line3(nodes);
-	}
-	ERR("Error in MeshLib::Element::getEdge() - Index does not exist.");
-	return nullptr;
+    if (i < e->getNEdges())
+    {
+        Node** nodes = new Node*[3];
+        nodes[0] = const_cast<Node*>(e->getEdgeNode(i,0));
+        nodes[1] = const_cast<Node*>(e->getEdgeNode(i,1));
+        nodes[2] = const_cast<Node*>(e->getEdgeNode(i,2));
+        return new Line3(nodes);
+    }
+    ERR("Error in MeshLib::Element::getEdge() - Index does not exist.");
+    return nullptr;
 }
 
 } // end MeshLib
diff --git a/MeshLib/Elements/EdgeReturn.h b/MeshLib/Elements/EdgeReturn.h
index d290ff7b15f..f1a1cca19a0 100644
--- a/MeshLib/Elements/EdgeReturn.h
+++ b/MeshLib/Elements/EdgeReturn.h
@@ -19,27 +19,27 @@ class Element;
 class NoEdgeReturn
 {
 public:
-	/// Returns i-th edge of the given element
-	static const Element* getEdge(const Element* /*e*/, unsigned /*i*/)
-	{
-		return nullptr;
-	}
+    /// Returns i-th edge of the given element
+    static const Element* getEdge(const Element* /*e*/, unsigned /*i*/)
+    {
+        return nullptr;
+    }
 };
 
 /// Returns linear order edge
 class LinearEdgeReturn
 {
 public:
-	/// Returns i-th edge of the given element
-	static const Element* getEdge(const Element* e, unsigned i);
+    /// Returns i-th edge of the given element
+    static const Element* getEdge(const Element* e, unsigned i);
 };
 
 /// Returns quadratic order edge
 class QuadraticEdgeReturn
 {
 public:
-	/// Returns i-th edge of the given element
-	static const Element* getEdge(const Element* e, unsigned i);
+    /// Returns i-th edge of the given element
+    static const Element* getEdge(const Element* e, unsigned i);
 };
 
 } // end MeshLib
diff --git a/MeshLib/Elements/EdgeRule.h b/MeshLib/Elements/EdgeRule.h
index 2a0b4e5b94b..8b4f541870d 100644
--- a/MeshLib/Elements/EdgeRule.h
+++ b/MeshLib/Elements/EdgeRule.h
@@ -18,26 +18,26 @@ class Element;
 class EdgeRule
 {
 public:
-	/// Constant: Dimension of this mesh element
-	static const unsigned dimension = 1u;
+    /// Constant: Dimension of this mesh element
+    static const unsigned dimension = 1u;
 
-	/// Constant: The number of faces
-	static const unsigned n_faces = 0;
+    /// Constant: The number of faces
+    static const unsigned n_faces = 0;
 
-	/// Constant: The number of edges
-	static const unsigned n_edges = 0;
+    /// Constant: The number of edges
+    static const unsigned n_edges = 0;
 
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned /*i*/) { return 0; }
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned /*i*/) { return 0; }
 
-	/// Returns the i-th face of the element.
-	static const Element* getFace(const Element* /*e*/, unsigned /*i*/) { return nullptr; }
+    /// Returns the i-th face of the element.
+    static const Element* getFace(const Element* /*e*/, unsigned /*i*/) { return nullptr; }
 
-	/**
-	* Checks if the node order of an element is correct by testing surface normals.
-	* For 1D elements this always returns true.
-	*/
-	static bool testElementNodeOrder(const Element* /*e*/) { return true; }
+    /**
+    * Checks if the node order of an element is correct by testing surface normals.
+    * For 1D elements this always returns true.
+    */
+    static bool testElementNodeOrder(const Element* /*e*/) { return true; }
 
 }; /* class */
 
diff --git a/MeshLib/Elements/Element.cpp b/MeshLib/Elements/Element.cpp
index b95922e7bbf..e5b5c0d1388 100644
--- a/MeshLib/Elements/Element.cpp
+++ b/MeshLib/Elements/Element.cpp
@@ -24,161 +24,161 @@
 namespace MeshLib {
 
 Element::Element(std::size_t id)
-	: _nodes(nullptr), _id(id), _content(-1.0), _neighbors(nullptr)
+    : _nodes(nullptr), _id(id), _content(-1.0), _neighbors(nullptr)
 {
 }
 
 Element::~Element()
 {
-	delete [] this->_nodes;
-	delete [] this->_neighbors;
+    delete [] this->_nodes;
+    delete [] this->_neighbors;
 }
 
 void Element::setNeighbor(Element* neighbor, unsigned const face_id)
 {
-	if (neighbor == this)
-		return;
+    if (neighbor == this)
+        return;
 
-	this->_neighbors[face_id] = neighbor;
+    this->_neighbors[face_id] = neighbor;
 }
 
 boost::optional<unsigned> Element::addNeighbor(Element* e)
 {
-	if (e == this ||
-		e == nullptr ||
-		e->getDimension() != this->getDimension())
-		return boost::optional<unsigned>();
-
-	if (this->hasNeighbor(e))
-		return boost::optional<unsigned>();
-
-	Node* face_nodes[3];
-	const unsigned nNodes (this->getNBaseNodes());
-	const unsigned eNodes (e->getNBaseNodes());
-	const Node* const* e_nodes = e->getNodes();
-	unsigned count(0);
-	const unsigned dim (this->getDimension());
-	for (unsigned i(0); i<nNodes; i++)
-		for (unsigned j(0); j<eNodes; j++)
-			if (_nodes[i] == e_nodes[j])
-			{
-				face_nodes[count] = _nodes[i];
-				// increment shared nodes counter and check if enough nodes are similar to be sure e is a neighbour of this
-				if ((++count)>=dim)
-				{
-					_neighbors[ this->identifyFace(face_nodes) ] = e;
-					return boost::optional<unsigned>(e->identifyFace(face_nodes));
-				}
-			}
-
-	return boost::optional<unsigned>();
+    if (e == this ||
+        e == nullptr ||
+        e->getDimension() != this->getDimension())
+        return boost::optional<unsigned>();
+
+    if (this->hasNeighbor(e))
+        return boost::optional<unsigned>();
+
+    Node* face_nodes[3];
+    const unsigned nNodes (this->getNBaseNodes());
+    const unsigned eNodes (e->getNBaseNodes());
+    const Node* const* e_nodes = e->getNodes();
+    unsigned count(0);
+    const unsigned dim (this->getDimension());
+    for (unsigned i(0); i<nNodes; i++)
+        for (unsigned j(0); j<eNodes; j++)
+            if (_nodes[i] == e_nodes[j])
+            {
+                face_nodes[count] = _nodes[i];
+                // increment shared nodes counter and check if enough nodes are similar to be sure e is a neighbour of this
+                if ((++count)>=dim)
+                {
+                    _neighbors[ this->identifyFace(face_nodes) ] = e;
+                    return boost::optional<unsigned>(e->identifyFace(face_nodes));
+                }
+            }
+
+    return boost::optional<unsigned>();
 }
 
 MeshLib::Node Element::getCenterOfGravity() const
 {
-	const unsigned nNodes (this->getNBaseNodes());
-	MeshLib::Node center(0,0,0);
-	for (unsigned i=0; i<nNodes; ++i)
-	{
-		center[0] += (*_nodes[i])[0];
-		center[1] += (*_nodes[i])[1];
-		center[2] += (*_nodes[i])[2];
-	}
-	center[0] /= nNodes;
-	center[1] /= nNodes;
-	center[2] /= nNodes;
-	return center;
+    const unsigned nNodes (this->getNBaseNodes());
+    MeshLib::Node center(0,0,0);
+    for (unsigned i=0; i<nNodes; ++i)
+    {
+        center[0] += (*_nodes[i])[0];
+        center[1] += (*_nodes[i])[1];
+        center[2] += (*_nodes[i])[2];
+    }
+    center[0] /= nNodes;
+    center[1] /= nNodes;
+    center[2] /= nNodes;
+    return center;
 }
 
 void Element::computeSqrEdgeLengthRange(double &min, double &max) const
 {
-	min = std::numeric_limits<double>::max();
-	max = 0;
-	const unsigned nEdges (this->getNEdges());
-	for (unsigned i=0; i<nEdges; i++)
-	{
-		const double dist (MathLib::sqrDist(*getEdgeNode(i,0), *getEdgeNode(i,1)));
-		min = (dist<min) ? dist : min;
-		max = (dist>max) ? dist : max;
-	}
+    min = std::numeric_limits<double>::max();
+    max = 0;
+    const unsigned nEdges (this->getNEdges());
+    for (unsigned i=0; i<nEdges; i++)
+    {
+        const double dist (MathLib::sqrDist(*getEdgeNode(i,0), *getEdgeNode(i,1)));
+        min = (dist<min) ? dist : min;
+        max = (dist>max) ? dist : max;
+    }
 }
 
 void Element::computeSqrNodeDistanceRange(double &min, double &max, bool check_allnodes) const
 {
-	min = std::numeric_limits<double>::max();
-	max = 0;
-	const unsigned nnodes = check_allnodes ? getNNodes() : getNBaseNodes();
-	for (unsigned i=0; i<nnodes; i++)
-	{
-		for (unsigned j=i+1; j<nnodes; j++)
-		{
-			const double dist (MathLib::sqrDist(*getNode(i), *getNode(j)));
-			min = std::min(dist, min);
-			max = std::max(dist, max);
-		}
-	}
+    min = std::numeric_limits<double>::max();
+    max = 0;
+    const unsigned nnodes = check_allnodes ? getNNodes() : getNBaseNodes();
+    for (unsigned i=0; i<nnodes; i++)
+    {
+        for (unsigned j=i+1; j<nnodes; j++)
+        {
+            const double dist (MathLib::sqrDist(*getNode(i), *getNode(j)));
+            min = std::min(dist, min);
+            max = std::max(dist, max);
+        }
+    }
 }
 
 const Element* Element::getNeighbor(unsigned i) const
 {
 #ifndef NDEBUG
-	if (i < getNNeighbors())
+    if (i < getNNeighbors())
 #endif
-		return _neighbors[i];
+        return _neighbors[i];
 #ifndef NDEBUG
-	ERR("Error in MeshLib::Element::getNeighbor() - Index does not exist.");
-	return nullptr;
+    ERR("Error in MeshLib::Element::getNeighbor() - Index does not exist.");
+    return nullptr;
 #endif
 }
 
 unsigned Element::getNodeIDinElement(const MeshLib::Node* node) const
 {
-	const unsigned nNodes (this->getNBaseNodes());
-	for (unsigned i(0); i<nNodes; i++)
-		if (node == _nodes[i])
-			return i;
-	return std::numeric_limits<unsigned>::max();
+    const unsigned nNodes (this->getNBaseNodes());
+    for (unsigned i(0); i<nNodes; i++)
+        if (node == _nodes[i])
+            return i;
+    return std::numeric_limits<unsigned>::max();
 }
 
 const Node* Element::getNode(unsigned i) const
 {
 #ifndef NDEBUG
-	if (i < getNNodes())
+    if (i < getNNodes())
 #endif
-		return _nodes[i];
+        return _nodes[i];
 #ifndef NDEBUG
-	ERR("Error in MeshLib::Element::getNode() - Index %d in %s", i, MeshElemType2String(getGeomType()).c_str());
-	return nullptr;
+    ERR("Error in MeshLib::Element::getNode() - Index %d in %s", i, MeshElemType2String(getGeomType()).c_str());
+    return nullptr;
 #endif
 }
 
 void Element::setNode(unsigned idx, Node* node)
 {
 #ifndef NDEBUG
-	if (idx < getNNodes())
+    if (idx < getNNodes())
 #endif
-		_nodes[idx] = node;
+        _nodes[idx] = node;
 }
 
 unsigned Element::getNodeIndex(unsigned i) const
 {
 #ifndef NDEBUG
-	if (i<getNNodes())
+    if (i<getNNodes())
 #endif
-		return _nodes[i]->getID();
+        return _nodes[i]->getID();
 #ifndef NDEBUG
-	ERR("Error in MeshLib::Element::getNodeIndex() - Index does not exist.");
-	return std::numeric_limits<unsigned>::max();
+    ERR("Error in MeshLib::Element::getNodeIndex() - Index does not exist.");
+    return std::numeric_limits<unsigned>::max();
 #endif
 }
 
 bool Element::hasNeighbor(Element* elem) const
 {
-	unsigned nNeighbors (this->getNNeighbors());
-	for (unsigned i=0; i<nNeighbors; i++)
-		if (this->_neighbors[i]==elem)
-			return true;
-	return false;
+    unsigned nNeighbors (this->getNNeighbors());
+    for (unsigned i=0; i<nNeighbors; i++)
+        if (this->_neighbors[i]==elem)
+            return true;
+    return false;
 }
 
 bool Element::isBoundaryElement() const
@@ -190,18 +190,18 @@ bool Element::isBoundaryElement() const
 #ifndef NDEBUG
 std::ostream& operator<<(std::ostream& os, Element const& e)
 {
-	os << "Element #" << e._id << " @ " << &e << " with " << e.getNNeighbors()
-	   << " neighbours\n";
-
-	unsigned const nnodes = e.getNNodes();
-	MeshLib::Node* const* const nodes = e.getNodes();
-	os << "MeshElemType: "
-		<< static_cast<std::underlying_type<MeshElemType>::type>(e.getGeomType())
-		<< " with " << nnodes << " nodes: { ";
-	for (unsigned n = 0; n < nnodes; ++n)
-		os << nodes[n]->getID() << " @ " << nodes[n] << "  ";
-	os << "}\n";
-	return os;
+    os << "Element #" << e._id << " @ " << &e << " with " << e.getNNeighbors()
+       << " neighbours\n";
+
+    unsigned const nnodes = e.getNNodes();
+    MeshLib::Node* const* const nodes = e.getNodes();
+    os << "MeshElemType: "
+        << static_cast<std::underlying_type<MeshElemType>::type>(e.getGeomType())
+        << " with " << nnodes << " nodes: { ";
+    for (unsigned n = 0; n < nnodes; ++n)
+        os << nodes[n]->getID() << " @ " << nodes[n] << "  ";
+    os << "}\n";
+    return os;
 }
 #endif  // NDEBUG
 
diff --git a/MeshLib/Elements/Element.h b/MeshLib/Elements/Element.h
index 40b3993002f..3923c1690ef 100644
--- a/MeshLib/Elements/Element.h
+++ b/MeshLib/Elements/Element.h
@@ -34,186 +34,186 @@ class Node;
  */
 class Element
 {
-	/* friend classes */
-	friend class Mesh;//void Mesh::setElementInformationForNodes();
+    /* friend classes */
+    friend class Mesh;//void Mesh::setElementInformationForNodes();
 
 public:
-	/// Compute the minimum and maximum squared edge length for this element
-	virtual void computeSqrEdgeLengthRange(double &min, double &max) const;
-
-	/// Compute the minimum and maximum node distances for this element.
-	virtual void computeSqrNodeDistanceRange(double &min, double &max, bool check_allnodes=true) const;
-
-	/**
-	 * \brief Tries to add an element e as neighbour to this element.
-	 * If the elements really are neighbours, the element is added to the
-	 * neighbour-list and the face id of the neighbour connected to this element
-	 * is returned. Otherwise the maximum value of the value type is returned.
-	 */
-	boost::optional<unsigned> addNeighbor(Element* e);
-
-	/// Calculates the center of gravity for the mesh element
-	MeshLib::Node getCenterOfGravity() const;
-
-	/// Returns the length, area or volume of a 1D, 2D or 3D element
-	double getContent() const { return _content; }
-
-	/**
-	 * Get node with local index i where i should be at most the number
-	 * of nodes of the element
-	 * @param i local index of node, at most the number of nodes of the
-	 * element that you can obtain with Element::getNBaseNodes()
-	 * @return a pointer to the appropriate (and constant, i.e. not
-	 * modifiable by the user) instance of class Node or a NULL pointer
-	 * @sa Element::getNodeIndex()
-	 */
-	const Node* getNode(unsigned i) const;
-
-	/**
-	 * (Re)Sets the node of the element.
-	 * @param idx the index of the pointer to a node within the element
-	 * @param node a pointer to a node
-	 */
-	void setNode(unsigned idx, Node* node);
-
-	/// Get array of element nodes.
-	Node* const* getNodes() const { return _nodes; }
-
-	/// Get dimension of the mesh element.
-	virtual unsigned getDimension() const = 0;
-
-	/// Returns the i-th edge of the element.
-	virtual const Element* getEdge(unsigned i) const = 0;
-
-	/// Returns the i-th face of the element.
-	virtual const Element* getFace(unsigned i) const = 0;
-
-	/// Returns the ID of the element.
-	virtual std::size_t getID() const final { return _id; }
-
-	/// Get the number of edges for this element.
-	virtual unsigned getNEdges() const = 0;
-
-	/// Get the number of nodes for face i.
-	virtual unsigned getNFaceNodes(unsigned i) const = 0;
-
-	/// Get the number of faces for this element.
-	virtual unsigned getNFaces() const = 0;
-
-	/// Get the specified neighbor.
-	const Element* getNeighbor(unsigned i) const;
-
-	/// Get the number of neighbors for this element.
-	virtual unsigned getNNeighbors() const = 0;
-
-	/**
-	 * Returns the number of linear nodes.
-	 */
-	virtual unsigned getNBaseNodes() const = 0;
-
-	/// Returns the number of all nodes including both linear and nonlinear nodes
-	virtual unsigned getNNodes() const = 0;
-
-	/// Returns the position of the given node in the node array of this element.
-	virtual unsigned getNodeIDinElement(const MeshLib::Node* node) const;
-
-	/**
-	 * Get the global index for the Node with local index i.
-	 * The index i should be at most the number of nodes of the element.
-	 * @param i local index of Node, at most the number of nodes of the
-	 * element that you can obtain with Element::getNBaseNodes()
-	 * @return the global index or std::numeric_limits<unsigned>::max()
-	 * @sa Element::getNode()
-	 */
-	unsigned getNodeIndex(unsigned i) const;
-
-	/**
-	 * Get the type of the mesh element in geometric context (as a MeshElemType-enum).
-	 */
-	virtual MeshElemType getGeomType() const = 0;
-
-	/**
-	 * Get the type of the element in context of the finite element method.
-	 * @return a value of the enum FEMElemType::type
-	 */
-	virtual CellType getCellType() const = 0;
-
-
-	/**
-	 * Returns true if the element has zero length/area/volume.
-	 */
-	bool hasZeroVolume() const { return this->getContent() < std::numeric_limits<double>::epsilon(); }
-
-	/// Returns true if the element is located at a boundary (i.e. has at least one face without neighbour)
-	virtual bool isBoundaryElement() const;
-
-	/// Returns true if these two indeces form an edge and false otherwise
-	virtual bool isEdge(unsigned i, unsigned j) const = 0;
-
-	/**
-	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::Point3d object
-	 * @param eps tolerance for numerical algorithm used or computing the property
-	 * @return true if the point is not outside the element, false otherwise
-	 */
-	virtual bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const = 0;
-
-	/**
-	 * Tests if the element is geometrically valid.
-	 */
-	virtual ElementErrorCode validate() const = 0;
-
-	/// Returns true if elem is a neighbour of this element and false otherwise.
-	bool hasNeighbor(Element* elem) const;
-
-	/// Destructor
-	virtual ~Element();
+    /// Compute the minimum and maximum squared edge length for this element
+    virtual void computeSqrEdgeLengthRange(double &min, double &max) const;
+
+    /// Compute the minimum and maximum node distances for this element.
+    virtual void computeSqrNodeDistanceRange(double &min, double &max, bool check_allnodes=true) const;
+
+    /**
+     * \brief Tries to add an element e as neighbour to this element.
+     * If the elements really are neighbours, the element is added to the
+     * neighbour-list and the face id of the neighbour connected to this element
+     * is returned. Otherwise the maximum value of the value type is returned.
+     */
+    boost::optional<unsigned> addNeighbor(Element* e);
+
+    /// Calculates the center of gravity for the mesh element
+    MeshLib::Node getCenterOfGravity() const;
+
+    /// Returns the length, area or volume of a 1D, 2D or 3D element
+    double getContent() const { return _content; }
+
+    /**
+     * Get node with local index i where i should be at most the number
+     * of nodes of the element
+     * @param i local index of node, at most the number of nodes of the
+     * element that you can obtain with Element::getNBaseNodes()
+     * @return a pointer to the appropriate (and constant, i.e. not
+     * modifiable by the user) instance of class Node or a NULL pointer
+     * @sa Element::getNodeIndex()
+     */
+    const Node* getNode(unsigned i) const;
+
+    /**
+     * (Re)Sets the node of the element.
+     * @param idx the index of the pointer to a node within the element
+     * @param node a pointer to a node
+     */
+    void setNode(unsigned idx, Node* node);
+
+    /// Get array of element nodes.
+    Node* const* getNodes() const { return _nodes; }
+
+    /// Get dimension of the mesh element.
+    virtual unsigned getDimension() const = 0;
+
+    /// Returns the i-th edge of the element.
+    virtual const Element* getEdge(unsigned i) const = 0;
+
+    /// Returns the i-th face of the element.
+    virtual const Element* getFace(unsigned i) const = 0;
+
+    /// Returns the ID of the element.
+    virtual std::size_t getID() const final { return _id; }
+
+    /// Get the number of edges for this element.
+    virtual unsigned getNEdges() const = 0;
+
+    /// Get the number of nodes for face i.
+    virtual unsigned getNFaceNodes(unsigned i) const = 0;
+
+    /// Get the number of faces for this element.
+    virtual unsigned getNFaces() const = 0;
+
+    /// Get the specified neighbor.
+    const Element* getNeighbor(unsigned i) const;
+
+    /// Get the number of neighbors for this element.
+    virtual unsigned getNNeighbors() const = 0;
+
+    /**
+     * Returns the number of linear nodes.
+     */
+    virtual unsigned getNBaseNodes() const = 0;
+
+    /// Returns the number of all nodes including both linear and nonlinear nodes
+    virtual unsigned getNNodes() const = 0;
+
+    /// Returns the position of the given node in the node array of this element.
+    virtual unsigned getNodeIDinElement(const MeshLib::Node* node) const;
+
+    /**
+     * Get the global index for the Node with local index i.
+     * The index i should be at most the number of nodes of the element.
+     * @param i local index of Node, at most the number of nodes of the
+     * element that you can obtain with Element::getNBaseNodes()
+     * @return the global index or std::numeric_limits<unsigned>::max()
+     * @sa Element::getNode()
+     */
+    unsigned getNodeIndex(unsigned i) const;
+
+    /**
+     * Get the type of the mesh element in geometric context (as a MeshElemType-enum).
+     */
+    virtual MeshElemType getGeomType() const = 0;
+
+    /**
+     * Get the type of the element in context of the finite element method.
+     * @return a value of the enum FEMElemType::type
+     */
+    virtual CellType getCellType() const = 0;
+
+
+    /**
+     * Returns true if the element has zero length/area/volume.
+     */
+    bool hasZeroVolume() const { return this->getContent() < std::numeric_limits<double>::epsilon(); }
+
+    /// Returns true if the element is located at a boundary (i.e. has at least one face without neighbour)
+    virtual bool isBoundaryElement() const;
+
+    /// Returns true if these two indeces form an edge and false otherwise
+    virtual bool isEdge(unsigned i, unsigned j) const = 0;
+
+    /**
+     * Checks if a point is inside the element.
+     * @param pnt a 3D MathLib::Point3d object
+     * @param eps tolerance for numerical algorithm used or computing the property
+     * @return true if the point is not outside the element, false otherwise
+     */
+    virtual bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const = 0;
+
+    /**
+     * Tests if the element is geometrically valid.
+     */
+    virtual ElementErrorCode validate() const = 0;
+
+    /// Returns true if elem is a neighbour of this element and false otherwise.
+    bool hasNeighbor(Element* elem) const;
+
+    /// Destructor
+    virtual ~Element();
 
-	/**
-	 * Method clone is a pure virtual method in the abstract base class Element.
-	 * It has to be implemented in the derived classes (for instance in class Hex).
-	 * @return an exact copy of the object
-	 */
-	virtual Element* clone() const = 0;
+    /**
+     * Method clone is a pure virtual method in the abstract base class Element.
+     * It has to be implemented in the derived classes (for instance in class Hex).
+     * @return an exact copy of the object
+     */
+    virtual Element* clone() const = 0;
 
-	/**
-	 * Computes the length / area / volumen of this element. This is automatically
-	 * done at initalisation time but can be repeated by calling this function at any time.
-	 */
-	virtual double computeVolume() = 0;
+    /**
+     * Computes the length / area / volumen of this element. This is automatically
+     * done at initalisation time but can be repeated by calling this function at any time.
+     */
+    virtual double computeVolume() = 0;
 
-	/// Returns the ID of a face given an array of nodes.
-	virtual unsigned identifyFace(Node* nodes[3]) const = 0;
+    /// Returns the ID of a face given an array of nodes.
+    virtual unsigned identifyFace(Node* nodes[3]) const = 0;
 
-	/**
-	 * Checks if the node order of an element is correct by testing surface normals.
-	 */
-	virtual bool testElementNodeOrder() const = 0;
-
-	/// Return a specific edge node.
-	virtual Node* getEdgeNode(unsigned edge_id, unsigned node_id) const = 0;
+    /**
+     * Checks if the node order of an element is correct by testing surface normals.
+     */
+    virtual bool testElementNodeOrder() const = 0;
+
+    /// Return a specific edge node.
+    virtual Node* getEdgeNode(unsigned edge_id, unsigned node_id) const = 0;
 
 #ifndef NDEBUG
-	friend std::ostream& operator<<(std::ostream& os, Element const& e);
+    friend std::ostream& operator<<(std::ostream& os, Element const& e);
 #endif  // NDEBUG
 
 protected:
-	/// Constructor for a generic mesh element without an array of mesh nodes.
-	/// @param id     element id
-	explicit Element(std::size_t id);
-
-	/// Sets the element ID.
-	virtual void setID(std::size_t id) final { _id = id; }
-
-	Node** _nodes;
-	std::size_t _id;
-	/// Content corresponds to length for 1D, area for 2D, and volume for 3D elements
-	double _content;
-
-	Element** _neighbors;
-	/// Sets the neighbor over the face with \c face_id to the given \c
-	/// neighbor.
-	void setNeighbor(Element* neighbor, unsigned const face_id);
+    /// Constructor for a generic mesh element without an array of mesh nodes.
+    /// @param id     element id
+    explicit Element(std::size_t id);
+
+    /// Sets the element ID.
+    virtual void setID(std::size_t id) final { _id = id; }
+
+    Node** _nodes;
+    std::size_t _id;
+    /// Content corresponds to length for 1D, area for 2D, and volume for 3D elements
+    double _content;
+
+    Element** _neighbors;
+    /// Sets the neighbor over the face with \c face_id to the given \c
+    /// neighbor.
+    void setNeighbor(Element* neighbor, unsigned const face_id);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/FaceRule.cpp b/MeshLib/Elements/FaceRule.cpp
index f1d8a237fc6..d3ef3a334c4 100644
--- a/MeshLib/Elements/FaceRule.cpp
+++ b/MeshLib/Elements/FaceRule.cpp
@@ -18,16 +18,16 @@ namespace MeshLib
 
 bool FaceRule::testElementNodeOrder(const Element* e)
 {
-	MathLib::Vector3 up_vec (0,0,1);
-	return (MathLib::scalarProduct(getSurfaceNormal(e), up_vec) < 0) ? true : false;
+    MathLib::Vector3 up_vec (0,0,1);
+    return (MathLib::scalarProduct(getSurfaceNormal(e), up_vec) < 0) ? true : false;
 }
 
 MathLib::Vector3 FaceRule::getSurfaceNormal(const Element* e)
 {
-	Node * const * _nodes = e->getNodes();
-	const MathLib::Vector3 u (*_nodes[1], *_nodes[0]);
-	const MathLib::Vector3 v (*_nodes[1], *_nodes[2]);
-	return MathLib::crossProduct(u,v);
+    Node * const * _nodes = e->getNodes();
+    const MathLib::Vector3 u (*_nodes[1], *_nodes[0]);
+    const MathLib::Vector3 v (*_nodes[1], *_nodes[2]);
+    return MathLib::crossProduct(u,v);
 }
 
 } /* namespace */
diff --git a/MeshLib/Elements/FaceRule.h b/MeshLib/Elements/FaceRule.h
index 93ee7b3f214..24610e9522f 100644
--- a/MeshLib/Elements/FaceRule.h
+++ b/MeshLib/Elements/FaceRule.h
@@ -19,26 +19,26 @@ namespace MeshLib
 class FaceRule
 {
 public:
-	/// Constant: Dimension of this mesh element
-	static const unsigned dimension = 2u;
+    /// Constant: Dimension of this mesh element
+    static const unsigned dimension = 2u;
 
-	/// Returns the face i of the element.
-	static const Element* getFace(const Element* e, unsigned i) { return e->getEdge(i); }
+    /// Returns the face i of the element.
+    static const Element* getFace(const Element* e, unsigned i) { return e->getEdge(i); }
 
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned /*i*/) { return 2; }
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned /*i*/) { return 2; }
 
-	/// Constant: The number of faces
-	static const unsigned n_faces = 0;
+    /// Constant: The number of faces
+    static const unsigned n_faces = 0;
 
-	/**
-	 * Checks if the node order of an element is correct by testing surface normals.
-	 * For 2D elements true is returned if the normal points (roughly) upwards.
-	 */
-	static bool testElementNodeOrder(const Element* /*e*/);
+    /**
+     * Checks if the node order of an element is correct by testing surface normals.
+     * For 2D elements true is returned if the normal points (roughly) upwards.
+     */
+    static bool testElementNodeOrder(const Element* /*e*/);
 
-	/// Returns the surface normal of a 2D element.
-	static MathLib::Vector3 getSurfaceNormal(const Element* e);
+    /// Returns the surface normal of a 2D element.
+    static MathLib::Vector3 getSurfaceNormal(const Element* e);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/HexRule20.cpp b/MeshLib/Elements/HexRule20.cpp
index a7350aa5cc8..0faad43b65f 100644
--- a/MeshLib/Elements/HexRule20.cpp
+++ b/MeshLib/Elements/HexRule20.cpp
@@ -23,41 +23,41 @@ namespace MeshLib {
 
 const unsigned HexRule20::face_nodes[6][8] =
 {
-	{0, 3, 2, 1, 11, 10,  9,  8}, // Face 0
-	{0, 1, 5, 4,  8, 17, 12, 11}, // Face 1
-	{1, 2, 6, 5,  9, 18, 13, 17}, // Face 2
-	{2, 3, 7, 6, 10, 19, 14, 18}, // Face 3
-	{3, 0, 4, 7, 11, 16, 15, 19}, // Face 4
-	{4, 5, 6, 7, 12, 13, 14, 15}  // Face 5
+    {0, 3, 2, 1, 11, 10,  9,  8}, // Face 0
+    {0, 1, 5, 4,  8, 17, 12, 11}, // Face 1
+    {1, 2, 6, 5,  9, 18, 13, 17}, // Face 2
+    {2, 3, 7, 6, 10, 19, 14, 18}, // Face 3
+    {3, 0, 4, 7, 11, 16, 15, 19}, // Face 4
+    {4, 5, 6, 7, 12, 13, 14, 15}  // Face 5
 };
 
 const unsigned HexRule20::edge_nodes[12][3] =
 {
-	{0, 1, 8}, // Edge 0
-	{1, 2, 9}, // Edge 1
-	{2, 3, 10}, // Edge 2
-	{0, 3, 11}, // Edge 3
-	{4, 5, 12}, // Edge 4
-	{5, 6, 13}, // Edge 5
-	{6, 7, 14}, // Edge 6
-	{4, 7, 15}, // Edge 7
-	{0, 4, 16}, // Edge 8
-	{1, 5, 17}, // Edge 9
-	{2, 6, 18}, // Edge 10
-	{3, 7, 19}  // Edge 11
+    {0, 1, 8}, // Edge 0
+    {1, 2, 9}, // Edge 1
+    {2, 3, 10}, // Edge 2
+    {0, 3, 11}, // Edge 3
+    {4, 5, 12}, // Edge 4
+    {5, 6, 13}, // Edge 5
+    {6, 7, 14}, // Edge 6
+    {4, 7, 15}, // Edge 7
+    {0, 4, 16}, // Edge 8
+    {1, 5, 17}, // Edge 9
+    {2, 6, 18}, // Edge 10
+    {3, 7, 19}  // Edge 11
 };
 
 const Element* HexRule20::getFace(const Element* e, unsigned i)
 {
-	if (i < n_faces)
-	{
-		std::array<Node*, 8> nodes;
-		for (unsigned j=0; j<8; j++)
-			nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
-		return new Quad8(nodes);
-	}
-	ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
-	return nullptr;
+    if (i < n_faces)
+    {
+        std::array<Node*, 8> nodes;
+        for (unsigned j=0; j<8; j++)
+            nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
+        return new Quad8(nodes);
+    }
+    ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
+    return nullptr;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/HexRule20.h b/MeshLib/Elements/HexRule20.h
index ba576ae9b24..7361b7da401 100644
--- a/MeshLib/Elements/HexRule20.h
+++ b/MeshLib/Elements/HexRule20.h
@@ -46,26 +46,26 @@ namespace MeshLib
 class HexRule20 : public HexRule8
 {
 public:
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 20u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 20u;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::HEX20;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::HEX20;
 
-	/// Constant: Local node index table for faces
-	static const unsigned face_nodes[6][8];
+    /// Constant: Local node index table for faces
+    static const unsigned face_nodes[6][8];
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[12][3];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[12][3];
 
-	/// Returns the i-th edge of the element.
-	typedef QuadraticEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef QuadraticEdgeReturn EdgeReturn;
 
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned /*i*/) { return 8; }
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned /*i*/) { return 8; }
 
-	/// Returns the i-th face of the element.
-	static const Element* getFace(const Element* e, unsigned i);
+    /// Returns the i-th face of the element.
+    static const Element* getFace(const Element* e, unsigned i);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/HexRule8.cpp b/MeshLib/Elements/HexRule8.cpp
index f9694cef44d..8847cfc43d4 100644
--- a/MeshLib/Elements/HexRule8.cpp
+++ b/MeshLib/Elements/HexRule8.cpp
@@ -23,94 +23,94 @@ namespace MeshLib {
 
 const unsigned HexRule8::face_nodes[6][4] =
 {
-	{0, 3, 2, 1}, // Face 0
-	{0, 1, 5, 4}, // Face 1
-	{1, 2, 6, 5}, // Face 2
-	{2, 3, 7, 6}, // Face 3
-	{3, 0, 4, 7}, // Face 4
-	{4, 5, 6, 7}  // Face 5
+    {0, 3, 2, 1}, // Face 0
+    {0, 1, 5, 4}, // Face 1
+    {1, 2, 6, 5}, // Face 2
+    {2, 3, 7, 6}, // Face 3
+    {3, 0, 4, 7}, // Face 4
+    {4, 5, 6, 7}  // Face 5
 };
 
 const unsigned HexRule8::edge_nodes[12][2] =
 {
-	{0, 1}, // Edge 0
-	{1, 2}, // Edge 1
-	{2, 3}, // Edge 2
-	{0, 3}, // Edge 3
-	{4, 5}, // Edge 4
-	{5, 6}, // Edge 5
-	{6, 7}, // Edge 6
-	{4, 7}, // Edge 7
-	{0, 4}, // Edge 8
-	{1, 5}, // Edge 9
-	{2, 6}, // Edge 10
-	{3, 7}  // Edge 11
+    {0, 1}, // Edge 0
+    {1, 2}, // Edge 1
+    {2, 3}, // Edge 2
+    {0, 3}, // Edge 3
+    {4, 5}, // Edge 4
+    {5, 6}, // Edge 5
+    {6, 7}, // Edge 6
+    {4, 7}, // Edge 7
+    {0, 4}, // Edge 8
+    {1, 5}, // Edge 9
+    {2, 6}, // Edge 10
+    {3, 7}  // Edge 11
 };
 
 const Element* HexRule8::getFace(const Element* e, unsigned i)
 {
-	if (i < n_faces)
-	{
-		std::array<Node*, 4> nodes;
-		for (unsigned j=0; j<4; j++)
-			nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
-		return new Quad(nodes);
-	}
-	ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
-	return nullptr;
+    if (i < n_faces)
+    {
+        std::array<Node*, 4> nodes;
+        for (unsigned j=0; j<4; j++)
+            nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
+        return new Quad(nodes);
+    }
+    ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
+    return nullptr;
 }
 
 double HexRule8::computeVolume(Node const* const* _nodes)
 {
-	return GeoLib::calcTetrahedronVolume(*_nodes[4], *_nodes[7], *_nodes[5], *_nodes[0])
-		 + GeoLib::calcTetrahedronVolume(*_nodes[5], *_nodes[3], *_nodes[1], *_nodes[0])
-		 + GeoLib::calcTetrahedronVolume(*_nodes[5], *_nodes[7], *_nodes[3], *_nodes[0])
-		 + GeoLib::calcTetrahedronVolume(*_nodes[5], *_nodes[7], *_nodes[6], *_nodes[2])
-		 + GeoLib::calcTetrahedronVolume(*_nodes[1], *_nodes[3], *_nodes[5], *_nodes[2])
-		 + GeoLib::calcTetrahedronVolume(*_nodes[3], *_nodes[7], *_nodes[5], *_nodes[2]);
+    return GeoLib::calcTetrahedronVolume(*_nodes[4], *_nodes[7], *_nodes[5], *_nodes[0])
+         + GeoLib::calcTetrahedronVolume(*_nodes[5], *_nodes[3], *_nodes[1], *_nodes[0])
+         + GeoLib::calcTetrahedronVolume(*_nodes[5], *_nodes[7], *_nodes[3], *_nodes[0])
+         + GeoLib::calcTetrahedronVolume(*_nodes[5], *_nodes[7], *_nodes[6], *_nodes[2])
+         + GeoLib::calcTetrahedronVolume(*_nodes[1], *_nodes[3], *_nodes[5], *_nodes[2])
+         + GeoLib::calcTetrahedronVolume(*_nodes[3], *_nodes[7], *_nodes[5], *_nodes[2]);
 }
 
 bool HexRule8::isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps)
 {
-	return (GeoLib::isPointInTetrahedron(pnt, *_nodes[4], *_nodes[7], *_nodes[5], *_nodes[0], eps) ||
-			GeoLib::isPointInTetrahedron(pnt, *_nodes[5], *_nodes[3], *_nodes[1], *_nodes[0], eps) ||
-			GeoLib::isPointInTetrahedron(pnt, *_nodes[5], *_nodes[7], *_nodes[3], *_nodes[0], eps) ||
-			GeoLib::isPointInTetrahedron(pnt, *_nodes[5], *_nodes[7], *_nodes[6], *_nodes[2], eps) ||
-			GeoLib::isPointInTetrahedron(pnt, *_nodes[1], *_nodes[3], *_nodes[5], *_nodes[2], eps) ||
-			GeoLib::isPointInTetrahedron(pnt, *_nodes[3], *_nodes[7], *_nodes[5], *_nodes[2], eps));
+    return (GeoLib::isPointInTetrahedron(pnt, *_nodes[4], *_nodes[7], *_nodes[5], *_nodes[0], eps) ||
+            GeoLib::isPointInTetrahedron(pnt, *_nodes[5], *_nodes[3], *_nodes[1], *_nodes[0], eps) ||
+            GeoLib::isPointInTetrahedron(pnt, *_nodes[5], *_nodes[7], *_nodes[3], *_nodes[0], eps) ||
+            GeoLib::isPointInTetrahedron(pnt, *_nodes[5], *_nodes[7], *_nodes[6], *_nodes[2], eps) ||
+            GeoLib::isPointInTetrahedron(pnt, *_nodes[1], *_nodes[3], *_nodes[5], *_nodes[2], eps) ||
+            GeoLib::isPointInTetrahedron(pnt, *_nodes[3], *_nodes[7], *_nodes[5], *_nodes[2], eps));
 }
 
 unsigned HexRule8::identifyFace(Node const* const* _nodes, Node* nodes[3])
 {
-	for (unsigned i=0; i<6; i++)
-	{
-		unsigned flag(0);
-		for (unsigned j=0; j<4; j++)
-			for (unsigned k=0; k<3; k++)
-				if (_nodes[face_nodes[i][j]] == nodes[k])
-					flag++;
-		if (flag==3)
-			return i;
-	}
-	return std::numeric_limits<unsigned>::max();
+    for (unsigned i=0; i<6; i++)
+    {
+        unsigned flag(0);
+        for (unsigned j=0; j<4; j++)
+            for (unsigned k=0; k<3; k++)
+                if (_nodes[face_nodes[i][j]] == nodes[k])
+                    flag++;
+        if (flag==3)
+            return i;
+    }
+    return std::numeric_limits<unsigned>::max();
 }
 
 ElementErrorCode HexRule8::validate(const Element* e)
 {
-	ElementErrorCode error_code;
-	error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
-
-	for (unsigned i=0; i<6; ++i)
-	{
-		if (error_code.all())
-			break;
-
-		const MeshLib::Element* quad (e->getFace(i));
-		error_code |= quad->validate();
-		delete quad;
-	}
-	error_code[ElementErrorFlag::NodeOrder]  = !e->testElementNodeOrder();
-	return error_code;
+    ElementErrorCode error_code;
+    error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
+
+    for (unsigned i=0; i<6; ++i)
+    {
+        if (error_code.all())
+            break;
+
+        const MeshLib::Element* quad (e->getFace(i));
+        error_code |= quad->validate();
+        delete quad;
+    }
+    error_code[ElementErrorFlag::NodeOrder]  = !e->testElementNodeOrder();
+    return error_code;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/HexRule8.h b/MeshLib/Elements/HexRule8.h
index 47f981cdb80..ef99bd1da18 100644
--- a/MeshLib/Elements/HexRule8.h
+++ b/MeshLib/Elements/HexRule8.h
@@ -46,60 +46,60 @@ namespace MeshLib
 class HexRule8 : public CellRule
 {
 public:
-	/// Constant: The number of base nodes for this element
-	static const unsigned n_base_nodes = 8u;
+    /// Constant: The number of base nodes for this element
+    static const unsigned n_base_nodes = 8u;
 
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 8u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 8u;
 
-	/// Constant: The geometric type of the element
-	static const MeshElemType mesh_elem_type = MeshElemType::HEXAHEDRON;
+    /// Constant: The geometric type of the element
+    static const MeshElemType mesh_elem_type = MeshElemType::HEXAHEDRON;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::HEX8;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::HEX8;
 
-	/// Constant: The number of faces
-	static const unsigned n_faces = 6;
+    /// Constant: The number of faces
+    static const unsigned n_faces = 6;
 
-	/// Constant: The number of edges
-	static const unsigned n_edges = 12;
+    /// Constant: The number of edges
+    static const unsigned n_edges = 12;
 
-	/// Constant: The number of neighbors
-	static const unsigned n_neighbors = 6;
+    /// Constant: The number of neighbors
+    static const unsigned n_neighbors = 6;
 
-	/// Constant: Local node index table for faces
-	static const unsigned face_nodes[6][4];
+    /// Constant: Local node index table for faces
+    static const unsigned face_nodes[6][4];
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[12][2];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[12][2];
 
-	/// Returns the i-th edge of the element.
-	typedef LinearEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef LinearEdgeReturn EdgeReturn;
 
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned /*i*/) { return 4; }
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned /*i*/) { return 4; }
 
-	/// Returns the i-th face of the element.
-	static const Element* getFace(const Element* e, unsigned i);
+    /// Returns the i-th face of the element.
+    static const Element* getFace(const Element* e, unsigned i);
 
-	/**
-	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::Point3D object
-	 * @param eps tolerance for numerical algorithm used or computing the property
-	 * @return true if the point is not outside the element, false otherwise
-	 */
-	static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
+    /**
+     * Checks if a point is inside the element.
+     * @param pnt a 3D MathLib::Point3D object
+     * @param eps tolerance for numerical algorithm used or computing the property
+     * @return true if the point is not outside the element, false otherwise
+     */
+    static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
 
-	/**
-	 * Tests if the element is geometrically valid.
-	 */
-	static ElementErrorCode validate(const Element* e);
+    /**
+     * Tests if the element is geometrically valid.
+     */
+    static ElementErrorCode validate(const Element* e);
 
-	/// Returns the ID of a face given an array of nodes.
-	static unsigned identifyFace(Node const* const*, Node* nodes[3]);
+    /// Returns the ID of a face given an array of nodes.
+    static unsigned identifyFace(Node const* const*, Node* nodes[3]);
 
-	/// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
-	static double computeVolume(Node const* const* _nodes);
+    /// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
+    static double computeVolume(Node const* const* _nodes);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/LineRule2.cpp b/MeshLib/Elements/LineRule2.cpp
index b40ad618124..e441b93b547 100644
--- a/MeshLib/Elements/LineRule2.cpp
+++ b/MeshLib/Elements/LineRule2.cpp
@@ -19,36 +19,36 @@ namespace MeshLib {
 
 const unsigned LineRule2::edge_nodes[1][2] =
 {
-	{0, 1} // Edge 0
+    {0, 1} // Edge 0
 };
 
 double LineRule2::computeVolume(Node const* const* _nodes)
 {
-	return sqrt(MathLib::sqrDist(_nodes[0]->getCoords(), _nodes[1]->getCoords()));
+    return sqrt(MathLib::sqrDist(_nodes[0]->getCoords(), _nodes[1]->getCoords()));
 }
 
 bool LineRule2::isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps)
 {
-	double tmp;
-	double tmp_dst(0);
-	double const dist =MathLib::calcProjPntToLineAndDists(pnt.getCoords(), _nodes[0]->getCoords(), _nodes[1]->getCoords(), tmp, tmp_dst);
-	return (dist < eps);
+    double tmp;
+    double tmp_dst(0);
+    double const dist =MathLib::calcProjPntToLineAndDists(pnt.getCoords(), _nodes[0]->getCoords(), _nodes[1]->getCoords(), tmp, tmp_dst);
+    return (dist < eps);
 }
 
 unsigned LineRule2::identifyFace(Node const* const* _nodes, Node* nodes[1])
 {
-	if (nodes[0] == _nodes[0])
-		return 0;
-	if (nodes[0] == _nodes[1])
-		return 1;
-	return std::numeric_limits<unsigned>::max();
+    if (nodes[0] == _nodes[0])
+        return 0;
+    if (nodes[0] == _nodes[1])
+        return 1;
+    return std::numeric_limits<unsigned>::max();
 }
 
 ElementErrorCode LineRule2::validate(const Element* e)
 {
-	ElementErrorCode error_code;
-	error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
-	return error_code;
+    ElementErrorCode error_code;
+    error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
+    return error_code;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/LineRule2.h b/MeshLib/Elements/LineRule2.h
index e15e76adfa2..8deb5d7c98f 100644
--- a/MeshLib/Elements/LineRule2.h
+++ b/MeshLib/Elements/LineRule2.h
@@ -27,45 +27,45 @@ namespace MeshLib
 class LineRule2 : public EdgeRule
 {
 public:
-	/// Constant: The number of base nodes for this element
-	static const unsigned n_base_nodes = 2u;
+    /// Constant: The number of base nodes for this element
+    static const unsigned n_base_nodes = 2u;
 
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 2u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 2u;
 
-	/// Constant: The geometric type of the element
-	static const MeshElemType mesh_elem_type = MeshElemType::LINE;
+    /// Constant: The geometric type of the element
+    static const MeshElemType mesh_elem_type = MeshElemType::LINE;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::LINE2;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::LINE2;
 
-	/// Constant: The number of neighbors
-	static const unsigned n_neighbors = 2;
+    /// Constant: The number of neighbors
+    static const unsigned n_neighbors = 2;
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[1][2];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[1][2];
 
-	/// Edge rule
-	typedef NoEdgeReturn EdgeReturn;
+    /// Edge rule
+    typedef NoEdgeReturn EdgeReturn;
 
-	/**
-	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::Point3d object
-	 * @param eps tolerance for numerical algorithm used or computing the property
-	 * @return true if the point is not outside the element, false otherwise
-	 */
-	static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
+    /**
+     * Checks if a point is inside the element.
+     * @param pnt a 3D MathLib::Point3d object
+     * @param eps tolerance for numerical algorithm used or computing the property
+     * @return true if the point is not outside the element, false otherwise
+     */
+    static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
 
-	/**
-	 * Tests if the element is geometrically valid.
-	 */
-	static ElementErrorCode validate(const Element* e);
+    /**
+     * Tests if the element is geometrically valid.
+     */
+    static ElementErrorCode validate(const Element* e);
 
-	/// Returns the ID of a face given an array of nodes.
-	static unsigned identifyFace(Node const* const*, Node* nodes[1]);
+    /// Returns the ID of a face given an array of nodes.
+    static unsigned identifyFace(Node const* const*, Node* nodes[1]);
 
-	/// Calculates the length of a line
-	static double computeVolume(Node const* const* _nodes);
+    /// Calculates the length of a line
+    static double computeVolume(Node const* const* _nodes);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/LineRule3.h b/MeshLib/Elements/LineRule3.h
index a24d114ca1b..173a0c0834e 100644
--- a/MeshLib/Elements/LineRule3.h
+++ b/MeshLib/Elements/LineRule3.h
@@ -25,11 +25,11 @@ namespace MeshLib
 class LineRule3 : public LineRule2
 {
 public:
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 3u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 3u;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::LINE3;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::LINE3;
 }; /* class */
 
 } /* namespace */
diff --git a/MeshLib/Elements/Point.h b/MeshLib/Elements/Point.h
index 578ab06a39d..24c04c45eaa 100644
--- a/MeshLib/Elements/Point.h
+++ b/MeshLib/Elements/Point.h
@@ -17,7 +17,7 @@ extern template class MeshLib::TemplateElement<MeshLib::PointRule1>;
 
 namespace MeshLib
 {
-	using Point = TemplateElement<PointRule1>;
+    using Point = TemplateElement<PointRule1>;
 }
 
 #endif  // MESHLIB_POINT_H_
diff --git a/MeshLib/Elements/PointRule1.cpp b/MeshLib/Elements/PointRule1.cpp
index 8e91fc03d4f..15a69671c5c 100644
--- a/MeshLib/Elements/PointRule1.cpp
+++ b/MeshLib/Elements/PointRule1.cpp
@@ -16,32 +16,32 @@ namespace MeshLib {
 
 const unsigned PointRule1::edge_nodes[1][1] =
 {
-	{0}
+    {0}
 };
 
 double PointRule1::computeVolume(Node const* const* /*_nodes*/)
 {
-	return 0;
+    return 0;
 }
 
 bool PointRule1::isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps)
 {
-	double const dist = MathLib::sqrDist(*_nodes[0], pnt);
-	return (dist < eps);
+    double const dist = MathLib::sqrDist(*_nodes[0], pnt);
+    return (dist < eps);
 }
 
 unsigned PointRule1::identifyFace(Node const* const* _nodes, Node* nodes[1])
 {
-	if (nodes[0] == _nodes[0])
-		return 0;
-	return std::numeric_limits<unsigned>::max();
+    if (nodes[0] == _nodes[0])
+        return 0;
+    return std::numeric_limits<unsigned>::max();
 }
 
 ElementErrorCode PointRule1::validate(const Element* e)
 {
-	ElementErrorCode error_code;
-	error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
-	return error_code;
+    ElementErrorCode error_code;
+    error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
+    return error_code;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/PointRule1.h b/MeshLib/Elements/PointRule1.h
index 48ee46fab28..d807cea2866 100644
--- a/MeshLib/Elements/PointRule1.h
+++ b/MeshLib/Elements/PointRule1.h
@@ -22,47 +22,47 @@ namespace MeshLib
 class PointRule1 : public VertexRule
 {
 public:
-	/// Constant: The number of base nodes for this element
-	static const unsigned n_base_nodes = 1u;
+    /// Constant: The number of base nodes for this element
+    static const unsigned n_base_nodes = 1u;
 
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 1u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 1u;
 
-	/// Constant: The geometric type of the element
-	static const MeshElemType mesh_elem_type = MeshElemType::POINT;
+    /// Constant: The geometric type of the element
+    static const MeshElemType mesh_elem_type = MeshElemType::POINT;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::POINT1;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::POINT1;
 
-	/// Constant: The number of neighbors
-	static const unsigned n_neighbors = 2;
+    /// Constant: The number of neighbors
+    static const unsigned n_neighbors = 2;
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[1][1];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[1][1];
 
-	/// Edge rule
-	typedef NoEdgeReturn EdgeReturn;
+    /// Edge rule
+    typedef NoEdgeReturn EdgeReturn;
 
-	/// Checks if a point is inside the element.
-	///
-	/// Specifically this function tests if the squared euclidean distance
-	/// between the points \c _nodes and \c pnt is less then \c eps.
-	///
-	/// \param pnt a 3D MathLib::Point3d object
-	/// \param eps tolerance for numerical algorithm used for computing the
-	/// property
-	/// \return true if the point is not outside the element, false otherwise
-	static bool isPntInElement(Node const* const* _nodes,
-	                           MathLib::Point3d const& pnt, double eps);
+    /// Checks if a point is inside the element.
+    ///
+    /// Specifically this function tests if the squared euclidean distance
+    /// between the points \c _nodes and \c pnt is less then \c eps.
+    ///
+    /// \param pnt a 3D MathLib::Point3d object
+    /// \param eps tolerance for numerical algorithm used for computing the
+    /// property
+    /// \return true if the point is not outside the element, false otherwise
+    static bool isPntInElement(Node const* const* _nodes,
+                               MathLib::Point3d const& pnt, double eps);
 
-	/// Tests if the element is geometrically valid.
-	static ElementErrorCode validate(const Element* e);
+    /// Tests if the element is geometrically valid.
+    static ElementErrorCode validate(const Element* e);
 
-	/// Returns the ID of a face given an array of nodes.
-	static unsigned identifyFace(Node const* const*, Node* nodes[1]);
+    /// Returns the ID of a face given an array of nodes.
+    static unsigned identifyFace(Node const* const*, Node* nodes[1]);
 
-	/// Calculates the length of a line
-	static double computeVolume(Node const* const* _nodes);
+    /// Calculates the length of a line
+    static double computeVolume(Node const* const* _nodes);
 };
 }
 
diff --git a/MeshLib/Elements/PrismRule15.cpp b/MeshLib/Elements/PrismRule15.cpp
index 43efdc7527c..0647616f3a6 100644
--- a/MeshLib/Elements/PrismRule15.cpp
+++ b/MeshLib/Elements/PrismRule15.cpp
@@ -21,52 +21,52 @@ namespace MeshLib {
 
 const unsigned PrismRule15::face_nodes[5][8] =
 {
-	{0, 2, 1,  8,  7,  6, 99, 99}, // Face 0
-	{0, 1, 4,  3,  6, 10, 12,  9}, // Face 1
-	{1, 2, 5,  4,  7, 11, 13, 10}, // Face 2
-	{2, 0, 3,  5,  8,  9, 14, 11}, // Face 3
-	{3, 4, 5, 12, 13, 14, 99, 99}  // Face 4
+    {0, 2, 1,  8,  7,  6, 99, 99}, // Face 0
+    {0, 1, 4,  3,  6, 10, 12,  9}, // Face 1
+    {1, 2, 5,  4,  7, 11, 13, 10}, // Face 2
+    {2, 0, 3,  5,  8,  9, 14, 11}, // Face 3
+    {3, 4, 5, 12, 13, 14, 99, 99}  // Face 4
 };
 
 const unsigned PrismRule15::edge_nodes[9][3] =
 {
-	{0, 1, 6}, // Edge 0
-	{1, 2, 7}, // Edge 1
-	{0, 2, 8}, // Edge 2
-	{0, 3, 9}, // Edge 3
-	{1, 4, 10}, // Edge 4
-	{2, 5, 11}, // Edge 5
-	{3, 4, 12}, // Edge 6
-	{4, 5, 13}, // Edge 7
-	{3, 5, 14}  // Edge 8
+    {0, 1, 6}, // Edge 0
+    {1, 2, 7}, // Edge 1
+    {0, 2, 8}, // Edge 2
+    {0, 3, 9}, // Edge 3
+    {1, 4, 10}, // Edge 4
+    {2, 5, 11}, // Edge 5
+    {3, 4, 12}, // Edge 6
+    {4, 5, 13}, // Edge 7
+    {3, 5, 14}  // Edge 8
 };
 
 const unsigned PrismRule15::n_face_nodes[5] = { 6, 8, 8, 8, 6 };
 
 unsigned PrismRule15::getNFaceNodes(unsigned i)
 {
-	if (i<5)
-		return n_face_nodes[i];
-	ERR("Error in MeshLib::Element::getNFaceNodes() - Index %d does not exist.", i);
-	return 0;
+    if (i<5)
+        return n_face_nodes[i];
+    ERR("Error in MeshLib::Element::getNFaceNodes() - Index %d does not exist.", i);
+    return 0;
 }
 
 const Element* PrismRule15::getFace(const Element* e, unsigned i)
 {
-	if (i < n_faces)
-	{
-		unsigned nFaceNodes (e->getNFaceNodes(i));
-		Node** nodes = new Node*[nFaceNodes];
-		for (unsigned j=0; j<nFaceNodes; j++)
-			nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
+    if (i < n_faces)
+    {
+        unsigned nFaceNodes (e->getNFaceNodes(i));
+        Node** nodes = new Node*[nFaceNodes];
+        for (unsigned j=0; j<nFaceNodes; j++)
+            nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
 
-		if (i==0 || i==4)
-			return new Tri6(nodes);
-		else
-			return new Quad8(nodes);
-	}
-	ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
-	return nullptr;
+        if (i==0 || i==4)
+            return new Tri6(nodes);
+        else
+            return new Quad8(nodes);
+    }
+    ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
+    return nullptr;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/PrismRule15.h b/MeshLib/Elements/PrismRule15.h
index 8542402cd51..0d738283a13 100644
--- a/MeshLib/Elements/PrismRule15.h
+++ b/MeshLib/Elements/PrismRule15.h
@@ -44,29 +44,29 @@ namespace MeshLib
 class PrismRule15 : public PrismRule6
 {
 public:
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 15u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 15u;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::PRISM15;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::PRISM15;
 
-	/// Constant: Local node index table for faces
-	static const unsigned face_nodes[5][8];
+    /// Constant: Local node index table for faces
+    static const unsigned face_nodes[5][8];
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[9][3];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[9][3];
 
-	/// Constant: Table for the number of nodes for each face
-	static const unsigned n_face_nodes[5];
+    /// Constant: Table for the number of nodes for each face
+    static const unsigned n_face_nodes[5];
 
-	/// Returns the i-th edge of the element.
-	typedef QuadraticEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef QuadraticEdgeReturn EdgeReturn;
 
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned i);
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned i);
 
-	/// Returns the i-th face of the element.
-	static const Element* getFace(const Element* e, unsigned i);
+    /// Returns the i-th face of the element.
+    static const Element* getFace(const Element* e, unsigned i);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/PrismRule6.cpp b/MeshLib/Elements/PrismRule6.cpp
index 46eff941228..c0bbd49367a 100644
--- a/MeshLib/Elements/PrismRule6.cpp
+++ b/MeshLib/Elements/PrismRule6.cpp
@@ -21,99 +21,99 @@ namespace MeshLib {
 
 const unsigned PrismRule6::face_nodes[5][4] =
 {
-	{0, 2, 1, 99}, // Face 0
-	{0, 1, 4,  3}, // Face 1
-	{1, 2, 5,  4}, // Face 2
-	{2, 0, 3,  5}, // Face 3
-	{3, 4, 5, 99}  // Face 4
+    {0, 2, 1, 99}, // Face 0
+    {0, 1, 4,  3}, // Face 1
+    {1, 2, 5,  4}, // Face 2
+    {2, 0, 3,  5}, // Face 3
+    {3, 4, 5, 99}  // Face 4
 };
 
 const unsigned PrismRule6::edge_nodes[9][2] =
 {
-	{0, 1}, // Edge 0
-	{1, 2}, // Edge 1
-	{0, 2}, // Edge 2
-	{0, 3}, // Edge 3
-	{1, 4}, // Edge 4
-	{2, 5}, // Edge 5
-	{3, 4}, // Edge 6
-	{4, 5}, // Edge 7
-	{3, 5}  // Edge 8
+    {0, 1}, // Edge 0
+    {1, 2}, // Edge 1
+    {0, 2}, // Edge 2
+    {0, 3}, // Edge 3
+    {1, 4}, // Edge 4
+    {2, 5}, // Edge 5
+    {3, 4}, // Edge 6
+    {4, 5}, // Edge 7
+    {3, 5}  // Edge 8
 };
 
 const unsigned PrismRule6::n_face_nodes[5] = { 3, 4, 4, 4, 3 };
 
 unsigned PrismRule6::getNFaceNodes(unsigned i)
 {
-	if (i<5)
-		return n_face_nodes[i];
-	ERR("Error in MeshLib::Element::getNFaceNodes() - Index %d does not exist.", i);
-	return 0;
+    if (i<5)
+        return n_face_nodes[i];
+    ERR("Error in MeshLib::Element::getNFaceNodes() - Index %d does not exist.", i);
+    return 0;
 }
 
 const Element* PrismRule6::getFace(const Element* e, unsigned i)
 {
-	if (i < n_faces)
-	{
-		unsigned nFaceNodes (e->getNFaceNodes(i));
-		Node** nodes = new Node*[nFaceNodes];
-		for (unsigned j=0; j<nFaceNodes; j++)
-			nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
-
-		if (i==0 || i==4)
-			return new Tri(nodes);
-		else
-			return new Quad(nodes);
-	}
-	ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
-	return nullptr;
+    if (i < n_faces)
+    {
+        unsigned nFaceNodes (e->getNFaceNodes(i));
+        Node** nodes = new Node*[nFaceNodes];
+        for (unsigned j=0; j<nFaceNodes; j++)
+            nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
+
+        if (i==0 || i==4)
+            return new Tri(nodes);
+        else
+            return new Quad(nodes);
+    }
+    ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
+    return nullptr;
 }
 
 double PrismRule6::computeVolume(Node const* const* _nodes)
 {
-	return GeoLib::calcTetrahedronVolume(*_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3])
-		 + GeoLib::calcTetrahedronVolume(*_nodes[1], *_nodes[4], *_nodes[2], *_nodes[3])
-		 + GeoLib::calcTetrahedronVolume(*_nodes[2], *_nodes[4], *_nodes[5], *_nodes[3]);
+    return GeoLib::calcTetrahedronVolume(*_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3])
+         + GeoLib::calcTetrahedronVolume(*_nodes[1], *_nodes[4], *_nodes[2], *_nodes[3])
+         + GeoLib::calcTetrahedronVolume(*_nodes[2], *_nodes[4], *_nodes[5], *_nodes[3]);
 }
 
 bool PrismRule6::isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps)
 {
-	return (GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3], eps) ||
-			GeoLib::isPointInTetrahedron(pnt, *_nodes[1], *_nodes[4], *_nodes[2], *_nodes[3], eps) ||
-			GeoLib::isPointInTetrahedron(pnt, *_nodes[2], *_nodes[4], *_nodes[5], *_nodes[3], eps));
+    return (GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3], eps) ||
+            GeoLib::isPointInTetrahedron(pnt, *_nodes[1], *_nodes[4], *_nodes[2], *_nodes[3], eps) ||
+            GeoLib::isPointInTetrahedron(pnt, *_nodes[2], *_nodes[4], *_nodes[5], *_nodes[3], eps));
 }
 
 unsigned PrismRule6::identifyFace(Node const* const* _nodes, Node* nodes[3])
 {
-	for (unsigned i=0; i<5; i++)
-	{
-		unsigned flag(0);
-		for (unsigned j=0; j<4; j++)
-			for (unsigned k=0; k<3; k++)
-				if (face_nodes[i][j] != 99 && _nodes[face_nodes[i][j]] == nodes[k])
-					flag++;
-		if (flag==3)
-			return i;
-	}
-	return std::numeric_limits<unsigned>::max();
+    for (unsigned i=0; i<5; i++)
+    {
+        unsigned flag(0);
+        for (unsigned j=0; j<4; j++)
+            for (unsigned k=0; k<3; k++)
+                if (face_nodes[i][j] != 99 && _nodes[face_nodes[i][j]] == nodes[k])
+                    flag++;
+        if (flag==3)
+            return i;
+    }
+    return std::numeric_limits<unsigned>::max();
 }
 
 ElementErrorCode PrismRule6::validate(const Element* e)
 {
-	ElementErrorCode error_code;
-	error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
-
-	for (unsigned i=1; i<4; ++i)
-	{
-		const MeshLib::Quad* quad (dynamic_cast<const MeshLib::Quad*>(e->getFace(i)));
-		if (quad)
-			error_code |= quad->validate();
-		else
-			error_code.set(ElementErrorFlag::NodeOrder);
-		delete quad;
-	}
-	error_code[ElementErrorFlag::NodeOrder] = !e->testElementNodeOrder();
-	return error_code;
+    ElementErrorCode error_code;
+    error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
+
+    for (unsigned i=1; i<4; ++i)
+    {
+        const MeshLib::Quad* quad (dynamic_cast<const MeshLib::Quad*>(e->getFace(i)));
+        if (quad)
+            error_code |= quad->validate();
+        else
+            error_code.set(ElementErrorFlag::NodeOrder);
+        delete quad;
+    }
+    error_code[ElementErrorFlag::NodeOrder] = !e->testElementNodeOrder();
+    return error_code;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/PrismRule6.h b/MeshLib/Elements/PrismRule6.h
index c86a5b7454d..296727e738c 100644
--- a/MeshLib/Elements/PrismRule6.h
+++ b/MeshLib/Elements/PrismRule6.h
@@ -44,63 +44,63 @@ namespace MeshLib
 class PrismRule6 : public CellRule
 {
 public:
-	/// Constant: The number of base nodes for this element
-	static const unsigned n_base_nodes = 6u;
+    /// Constant: The number of base nodes for this element
+    static const unsigned n_base_nodes = 6u;
 
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 6u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 6u;
 
-	/// Constant: The geometric type of the element
-	static const MeshElemType mesh_elem_type = MeshElemType::PRISM;
+    /// Constant: The geometric type of the element
+    static const MeshElemType mesh_elem_type = MeshElemType::PRISM;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::PRISM6;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::PRISM6;
 
-	/// Constant: The number of faces
-	static const unsigned n_faces = 5;
+    /// Constant: The number of faces
+    static const unsigned n_faces = 5;
 
-	/// Constant: The number of edges
-	static const unsigned n_edges = 9;
+    /// Constant: The number of edges
+    static const unsigned n_edges = 9;
 
-	/// Constant: The number of neighbors
-	static const unsigned n_neighbors = 5;
+    /// Constant: The number of neighbors
+    static const unsigned n_neighbors = 5;
 
-	/// Constant: Local node index table for faces
-	static const unsigned face_nodes[5][4];
+    /// Constant: Local node index table for faces
+    static const unsigned face_nodes[5][4];
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[9][2];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[9][2];
 
-	/// Constant: Table for the number of nodes for each face
-	static const unsigned n_face_nodes[5];
+    /// Constant: Table for the number of nodes for each face
+    static const unsigned n_face_nodes[5];
 
-	/// Returns the i-th edge of the element.
-	typedef LinearEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef LinearEdgeReturn EdgeReturn;
 
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned i);
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned i);
 
-	/// Returns the i-th face of the element.
-	static const Element* getFace(const Element* e, unsigned i);
+    /// Returns the i-th face of the element.
+    static const Element* getFace(const Element* e, unsigned i);
 
-	/**
-	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::Point3d object
-	 * @param eps tolerance for numerical algorithm used or computing the property
-	 * @return true if the point is not outside the element, false otherwise
-	 */
-	static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
+    /**
+     * Checks if a point is inside the element.
+     * @param pnt a 3D MathLib::Point3d object
+     * @param eps tolerance for numerical algorithm used or computing the property
+     * @return true if the point is not outside the element, false otherwise
+     */
+    static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
 
-	/**
-	 * Tests if the element is geometrically valid.
-	 */
-	static ElementErrorCode validate(const Element* e);
+    /**
+     * Tests if the element is geometrically valid.
+     */
+    static ElementErrorCode validate(const Element* e);
 
-	/// Returns the ID of a face given an array of nodes.
-	static unsigned identifyFace(Node const* const*, Node* nodes[3]);
+    /// Returns the ID of a face given an array of nodes.
+    static unsigned identifyFace(Node const* const*, Node* nodes[3]);
 
-	/// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
-	static double computeVolume(Node const* const* _nodes);
+    /// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
+    static double computeVolume(Node const* const* _nodes);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/PyramidRule13.cpp b/MeshLib/Elements/PyramidRule13.cpp
index 7435d85d56d..79847ee445d 100644
--- a/MeshLib/Elements/PyramidRule13.cpp
+++ b/MeshLib/Elements/PyramidRule13.cpp
@@ -21,51 +21,51 @@ namespace MeshLib {
 
 const unsigned PyramidRule13::face_nodes[5][8] =
 {
-	{0, 1, 4, 5, 10, 9, 99, 99}, // Face 0
-	{1, 2, 4, 6, 11, 10, 99, 99}, // Face 1
-	{2, 3, 4, 7, 12, 11, 99, 99}, // Face 2
-	{3, 0, 4, 8, 9, 12, 99, 99}, // Face 3
-	{0, 3, 2, 1, 8, 7, 6, 5}  // Face 4
+    {0, 1, 4, 5, 10, 9, 99, 99}, // Face 0
+    {1, 2, 4, 6, 11, 10, 99, 99}, // Face 1
+    {2, 3, 4, 7, 12, 11, 99, 99}, // Face 2
+    {3, 0, 4, 8, 9, 12, 99, 99}, // Face 3
+    {0, 3, 2, 1, 8, 7, 6, 5}  // Face 4
 };
 
 const unsigned PyramidRule13::edge_nodes[8][3] =
 {
-	{0, 1, 5}, // Edge 0
-	{1, 2, 6}, // Edge 1
-	{2, 3, 7}, // Edge 2
-	{0, 3, 8}, // Edge 3
-	{0, 4, 9}, // Edge 4
-	{1, 4, 10}, // Edge 5
-	{2, 4, 11}, // Edge 6
-	{3, 4, 12}  // Edge 7
+    {0, 1, 5}, // Edge 0
+    {1, 2, 6}, // Edge 1
+    {2, 3, 7}, // Edge 2
+    {0, 3, 8}, // Edge 3
+    {0, 4, 9}, // Edge 4
+    {1, 4, 10}, // Edge 5
+    {2, 4, 11}, // Edge 6
+    {3, 4, 12}  // Edge 7
 };
 
 const unsigned PyramidRule13::n_face_nodes[5] = { 6, 6, 6, 6, 8 };
 
 unsigned PyramidRule13::getNFaceNodes(unsigned i)
 {
-	if (i<5)
-		return n_face_nodes[i];
-	ERR("Error in MeshLib::Element::getNFaceNodes() - Index %d does not exist.", i);
-	return 0;
+    if (i<5)
+        return n_face_nodes[i];
+    ERR("Error in MeshLib::Element::getNFaceNodes() - Index %d does not exist.", i);
+    return 0;
 }
 
 const Element* PyramidRule13::getFace(const Element* e, unsigned i)
 {
-	if (i<e->getNFaces())
-	{
-		unsigned nFaceNodes (e->getNFaceNodes(i));
-		Node** nodes = new Node*[nFaceNodes];
-		for (unsigned j=0; j<nFaceNodes; j++)
-			nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
+    if (i<e->getNFaces())
+    {
+        unsigned nFaceNodes (e->getNFaceNodes(i));
+        Node** nodes = new Node*[nFaceNodes];
+        for (unsigned j=0; j<nFaceNodes; j++)
+            nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
 
-		if (i<4)
-			return new Tri6(nodes);
-		else
-			return new Quad8(nodes);
-	}
-	ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
-	return nullptr;
+        if (i<4)
+            return new Tri6(nodes);
+        else
+            return new Quad8(nodes);
+    }
+    ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
+    return nullptr;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/PyramidRule13.h b/MeshLib/Elements/PyramidRule13.h
index a9c6d03c3fe..78c1fbba8b4 100644
--- a/MeshLib/Elements/PyramidRule13.h
+++ b/MeshLib/Elements/PyramidRule13.h
@@ -43,29 +43,29 @@ namespace MeshLib
 class PyramidRule13 : public PyramidRule5
 {
 public:
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 13u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 13u;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::PYRAMID13;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::PYRAMID13;
 
-	/// Constant: Local node index table for faces
-	static const unsigned face_nodes[5][8];
+    /// Constant: Local node index table for faces
+    static const unsigned face_nodes[5][8];
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[8][3];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[8][3];
 
-	/// Constant: Table for the number of nodes for each face
-	static const unsigned n_face_nodes[5];
+    /// Constant: Table for the number of nodes for each face
+    static const unsigned n_face_nodes[5];
 
-	/// Returns the i-th edge of the element.
-	typedef QuadraticEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef QuadraticEdgeReturn EdgeReturn;
 
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned i);
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned i);
 
-	/// Returns the i-th face of the element.
-	static const Element* getFace(const Element* e, unsigned i);
+    /// Returns the i-th face of the element.
+    static const Element* getFace(const Element* e, unsigned i);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/PyramidRule5.cpp b/MeshLib/Elements/PyramidRule5.cpp
index 7cccaa9e0f1..4c3ec3e15a1 100644
--- a/MeshLib/Elements/PyramidRule5.cpp
+++ b/MeshLib/Elements/PyramidRule5.cpp
@@ -21,96 +21,96 @@ namespace MeshLib {
 
 const unsigned PyramidRule5::face_nodes[5][4] =
 {
-	{0, 1, 4, 99}, // Face 0
-	{1, 2, 4, 99}, // Face 1
-	{2, 3, 4, 99}, // Face 2
-	{3, 0, 4, 99}, // Face 3
-	{0, 3, 2,  1}  // Face 4
+    {0, 1, 4, 99}, // Face 0
+    {1, 2, 4, 99}, // Face 1
+    {2, 3, 4, 99}, // Face 2
+    {3, 0, 4, 99}, // Face 3
+    {0, 3, 2,  1}  // Face 4
 };
 
 const unsigned PyramidRule5::edge_nodes[8][2] =
 {
-	{0, 1}, // Edge 0
-	{1, 2}, // Edge 1
-	{2, 3}, // Edge 2
-	{0, 3}, // Edge 3
-	{0, 4}, // Edge 4
-	{1, 4}, // Edge 5
-	{2, 4}, // Edge 6
-	{3, 4}  // Edge 7
+    {0, 1}, // Edge 0
+    {1, 2}, // Edge 1
+    {2, 3}, // Edge 2
+    {0, 3}, // Edge 3
+    {0, 4}, // Edge 4
+    {1, 4}, // Edge 5
+    {2, 4}, // Edge 6
+    {3, 4}  // Edge 7
 };
 
 const unsigned PyramidRule5::n_face_nodes[5] = { 3, 3, 3, 3, 4 };
 
 unsigned PyramidRule5::getNFaceNodes(unsigned i)
 {
-	if (i<5)
-		return n_face_nodes[i];
-	ERR("Error in MeshLib::Element::getNFaceNodes() - Index %d does not exist.", i);
-	return 0;
+    if (i<5)
+        return n_face_nodes[i];
+    ERR("Error in MeshLib::Element::getNFaceNodes() - Index %d does not exist.", i);
+    return 0;
 }
 
 const Element* PyramidRule5::getFace(const Element* e, unsigned i)
 {
-	if (i<e->getNFaces())
-	{
-		unsigned nFaceNodes (e->getNFaceNodes(i));
-		Node** nodes = new Node*[nFaceNodes];
-		for (unsigned j=0; j<nFaceNodes; j++)
-			nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
-
-		if (i<4)
-			return new Tri(nodes);
-		else
-			return new Quad(nodes);
-	}
-	ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
-	return nullptr;
+    if (i<e->getNFaces())
+    {
+        unsigned nFaceNodes (e->getNFaceNodes(i));
+        Node** nodes = new Node*[nFaceNodes];
+        for (unsigned j=0; j<nFaceNodes; j++)
+            nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
+
+        if (i<4)
+            return new Tri(nodes);
+        else
+            return new Quad(nodes);
+    }
+    ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
+    return nullptr;
 }
 
 double PyramidRule5::computeVolume(Node const* const* _nodes)
 {
-	return GeoLib::calcTetrahedronVolume(*_nodes[0], *_nodes[1], *_nodes[2], *_nodes[4])
-		 + GeoLib::calcTetrahedronVolume(*_nodes[2], *_nodes[3], *_nodes[0], *_nodes[4]);
+    return GeoLib::calcTetrahedronVolume(*_nodes[0], *_nodes[1], *_nodes[2], *_nodes[4])
+         + GeoLib::calcTetrahedronVolume(*_nodes[2], *_nodes[3], *_nodes[0], *_nodes[4]);
 }
 
 bool PyramidRule5::isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps)
 {
-	return (GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[1], *_nodes[2], *_nodes[4], eps) ||
-			GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[2], *_nodes[3], *_nodes[4], eps));
+    return (GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[1], *_nodes[2], *_nodes[4], eps) ||
+            GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[2], *_nodes[3], *_nodes[4], eps));
 }
 
 unsigned PyramidRule5::identifyFace(Node const* const* _nodes, Node* nodes[3])
 {
-	for (unsigned i=0; i<5; i++)
-	{
-		unsigned flag(0);
-		for (unsigned j=0; j<4; j++)
-			for (unsigned k=0; k<3; k++)
-				if (face_nodes[i][j] != 99 && _nodes[face_nodes[i][j]] == nodes[k])
-					flag++;
-		if (flag==3)
-			return i;
-	}
-	return std::numeric_limits<unsigned>::max();
+    for (unsigned i=0; i<5; i++)
+    {
+        unsigned flag(0);
+        for (unsigned j=0; j<4; j++)
+            for (unsigned k=0; k<3; k++)
+                if (face_nodes[i][j] != 99 && _nodes[face_nodes[i][j]] == nodes[k])
+                    flag++;
+        if (flag==3)
+            return i;
+    }
+    return std::numeric_limits<unsigned>::max();
 }
 
 ElementErrorCode PyramidRule5::validate(const Element* e)
 {
-	ElementErrorCode error_code;
-	error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
-
-	const MeshLib::Quad* base (dynamic_cast<const MeshLib::Quad*>(e->getFace(4)));
-	if (base)
-	{
-		error_code |= base->validate();
-		error_code[ElementErrorFlag::NodeOrder] = !e->testElementNodeOrder();
-	}
-	else
-		error_code.set(ElementErrorFlag::NodeOrder);
-	delete base;
-
-	return error_code;
+    ElementErrorCode error_code;
+    error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
+
+    const MeshLib::Quad* base (dynamic_cast<const MeshLib::Quad*>(e->getFace(4)));
+    if (base)
+    {
+        error_code |= base->validate();
+        error_code[ElementErrorFlag::NodeOrder] = !e->testElementNodeOrder();
+    }
+    else
+        error_code.set(ElementErrorFlag::NodeOrder);
+    delete base;
+
+    return error_code;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/PyramidRule5.h b/MeshLib/Elements/PyramidRule5.h
index 8f333f3f18e..fda9a350feb 100644
--- a/MeshLib/Elements/PyramidRule5.h
+++ b/MeshLib/Elements/PyramidRule5.h
@@ -43,63 +43,63 @@ namespace MeshLib
 class PyramidRule5 : public CellRule
 {
 public:
-	/// Constant: The number of base nodes for this element
-	static const unsigned n_base_nodes = 5u;
+    /// Constant: The number of base nodes for this element
+    static const unsigned n_base_nodes = 5u;
 
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 5u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 5u;
 
-	/// Constant: The geometric type of the element
-	static const MeshElemType mesh_elem_type = MeshElemType::PYRAMID;
+    /// Constant: The geometric type of the element
+    static const MeshElemType mesh_elem_type = MeshElemType::PYRAMID;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::PYRAMID5;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::PYRAMID5;
 
-	/// Constant: The number of faces
-	static const unsigned n_faces = 5;
+    /// Constant: The number of faces
+    static const unsigned n_faces = 5;
 
-	/// Constant: The number of edges
-	static const unsigned n_edges = 8;
+    /// Constant: The number of edges
+    static const unsigned n_edges = 8;
 
-	/// Constant: The number of neighbors
-	static const unsigned n_neighbors = 5;
+    /// Constant: The number of neighbors
+    static const unsigned n_neighbors = 5;
 
-	/// Constant: Local node index table for faces
-	static const unsigned face_nodes[5][4];
+    /// Constant: Local node index table for faces
+    static const unsigned face_nodes[5][4];
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[8][2];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[8][2];
 
-	/// Constant: Table for the number of nodes for each face
-	static const unsigned n_face_nodes[5];
+    /// Constant: Table for the number of nodes for each face
+    static const unsigned n_face_nodes[5];
 
-	/// Returns the i-th edge of the element.
-	typedef LinearEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef LinearEdgeReturn EdgeReturn;
 
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned i);
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned i);
 
-	/// Returns the i-th face of the element.
-	static const Element* getFace(const Element* e, unsigned i);
+    /// Returns the i-th face of the element.
+    static const Element* getFace(const Element* e, unsigned i);
 
-	/**
-	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::Point3d object
-	 * @param eps tolerance for numerical algorithm used or computing the property
-	 * @return true if the point is not outside the element, false otherwise
-	 */
-	static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
+    /**
+     * Checks if a point is inside the element.
+     * @param pnt a 3D MathLib::Point3d object
+     * @param eps tolerance for numerical algorithm used or computing the property
+     * @return true if the point is not outside the element, false otherwise
+     */
+    static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
 
-	/**
-	 * Tests if the element is geometrically valid.
-	 */
-	static ElementErrorCode validate(const Element* e);
+    /**
+     * Tests if the element is geometrically valid.
+     */
+    static ElementErrorCode validate(const Element* e);
 
-	/// Returns the ID of a face given an array of nodes.
-	static unsigned identifyFace(Node const* const*, Node* nodes[3]);
+    /// Returns the ID of a face given an array of nodes.
+    static unsigned identifyFace(Node const* const*, Node* nodes[3]);
 
-	/// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
-	static double computeVolume(Node const* const* _nodes);
+    /// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
+    static double computeVolume(Node const* const* _nodes);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/QuadRule4.cpp b/MeshLib/Elements/QuadRule4.cpp
index 01708d5ee82..b1ec6e43cb6 100644
--- a/MeshLib/Elements/QuadRule4.cpp
+++ b/MeshLib/Elements/QuadRule4.cpp
@@ -19,51 +19,51 @@ namespace MeshLib {
 
 const unsigned QuadRule4::edge_nodes[4][2] =
 {
-		{0, 1}, // Edge 0
-		{1, 2}, // Edge 1
-		{2, 3}, // Edge 2
-		{0, 3}  // Edge 3
+        {0, 1}, // Edge 0
+        {1, 2}, // Edge 1
+        {2, 3}, // Edge 2
+        {0, 3}  // Edge 3
 };
 
 double QuadRule4::computeVolume(Node const* const* _nodes)
 {
-	return GeoLib::calcTriangleArea(*_nodes[0], *_nodes[1], *_nodes[2])
+    return GeoLib::calcTriangleArea(*_nodes[0], *_nodes[1], *_nodes[2])
          + GeoLib::calcTriangleArea(*_nodes[2], *_nodes[3], *_nodes[0]);
 }
 
 bool QuadRule4::isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps)
 {
-	return (GeoLib::isPointInTriangle(pnt, *_nodes[0], *_nodes[1], *_nodes[2], eps) ||
-	        GeoLib::isPointInTriangle(pnt, *_nodes[0], *_nodes[2], *_nodes[3], eps));
+    return (GeoLib::isPointInTriangle(pnt, *_nodes[0], *_nodes[1], *_nodes[2], eps) ||
+            GeoLib::isPointInTriangle(pnt, *_nodes[0], *_nodes[2], *_nodes[3], eps));
 }
 
 unsigned QuadRule4::identifyFace(Node const* const* _nodes, Node* nodes[3])
 {
-	for (unsigned i=0; i<4; i++)
-	{
-		unsigned flag(0);
-		for (unsigned j=0; j<2; j++)
-			for (unsigned k=0; k<2; k++)
-				if (_nodes[edge_nodes[i][j]] == nodes[k])
-					flag++;
-		if (flag==2)
-			return i;
-	}
-	return std::numeric_limits<unsigned>::max();
+    for (unsigned i=0; i<4; i++)
+    {
+        unsigned flag(0);
+        for (unsigned j=0; j<2; j++)
+            for (unsigned k=0; k<2; k++)
+                if (_nodes[edge_nodes[i][j]] == nodes[k])
+                    flag++;
+        if (flag==2)
+            return i;
+    }
+    return std::numeric_limits<unsigned>::max();
 }
 
 ElementErrorCode QuadRule4::validate(const Element* e)
 {
-	ElementErrorCode error_code;
-	error_code[ElementErrorFlag::ZeroVolume]  = e->hasZeroVolume();
-	Node const* const* _nodes = e->getNodes();
-	error_code[ElementErrorFlag::NonCoplanar] = (!GeoLib::isCoplanar(*_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3]));
-	// for collapsed quads (i.e. reduced to a line) this test might result "false" as all four points are actually located on a line.
-	if (!error_code[ElementErrorFlag::ZeroVolume])
-		error_code[ElementErrorFlag::NonConvex]   = (!(GeoLib::dividedByPlane(*_nodes[0], *_nodes[2], *_nodes[1], *_nodes[3]) &&
-			                                           GeoLib::dividedByPlane(*_nodes[1], *_nodes[3], *_nodes[0], *_nodes[2])));
-	error_code[ElementErrorFlag::NodeOrder]  = !e->testElementNodeOrder();
-	return error_code;
+    ElementErrorCode error_code;
+    error_code[ElementErrorFlag::ZeroVolume]  = e->hasZeroVolume();
+    Node const* const* _nodes = e->getNodes();
+    error_code[ElementErrorFlag::NonCoplanar] = (!GeoLib::isCoplanar(*_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3]));
+    // for collapsed quads (i.e. reduced to a line) this test might result "false" as all four points are actually located on a line.
+    if (!error_code[ElementErrorFlag::ZeroVolume])
+        error_code[ElementErrorFlag::NonConvex]   = (!(GeoLib::dividedByPlane(*_nodes[0], *_nodes[2], *_nodes[1], *_nodes[3]) &&
+                                                       GeoLib::dividedByPlane(*_nodes[1], *_nodes[3], *_nodes[0], *_nodes[2])));
+    error_code[ElementErrorFlag::NodeOrder]  = !e->testElementNodeOrder();
+    return error_code;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/QuadRule4.h b/MeshLib/Elements/QuadRule4.h
index 4445b48105c..8cad04ddc4e 100644
--- a/MeshLib/Elements/QuadRule4.h
+++ b/MeshLib/Elements/QuadRule4.h
@@ -37,48 +37,48 @@ namespace MeshLib
 class QuadRule4 : public FaceRule
 {
 public:
-	/// Constant: The number of base nodes for this element
-	static const unsigned n_base_nodes = 4u;
+    /// Constant: The number of base nodes for this element
+    static const unsigned n_base_nodes = 4u;
 
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 4u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 4u;
 
-	/// Constant: The geometric type of the element
-	static const MeshElemType mesh_elem_type = MeshElemType::QUAD;
+    /// Constant: The geometric type of the element
+    static const MeshElemType mesh_elem_type = MeshElemType::QUAD;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::QUAD4;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::QUAD4;
 
-	/// Constant: The number of edges
-	static const unsigned n_edges = 4;
+    /// Constant: The number of edges
+    static const unsigned n_edges = 4;
 
-	/// Constant: The number of neighbors
-	static const unsigned n_neighbors = 4;
+    /// Constant: The number of neighbors
+    static const unsigned n_neighbors = 4;
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[4][2];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[4][2];
 
-	/// Returns the i-th edge of the element.
-	typedef LinearEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef LinearEdgeReturn EdgeReturn;
 
-	/**
-	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::Point3d object
-	 * @param eps tolerance for numerical algorithm used or computing the property
-	 * @return true if the point is not outside the element, false otherwise
-	 */
-	static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
+    /**
+     * Checks if a point is inside the element.
+     * @param pnt a 3D MathLib::Point3d object
+     * @param eps tolerance for numerical algorithm used or computing the property
+     * @return true if the point is not outside the element, false otherwise
+     */
+    static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
 
-	/**
-	 * Tests if the element is geometrically valid.
-	 */
-	static ElementErrorCode validate(const Element* e);
+    /**
+     * Tests if the element is geometrically valid.
+     */
+    static ElementErrorCode validate(const Element* e);
 
-	/// Returns the ID of a face given an array of nodes.
-	static unsigned identifyFace(Node const* const*, Node* nodes[3]);
+    /// Returns the ID of a face given an array of nodes.
+    static unsigned identifyFace(Node const* const*, Node* nodes[3]);
 
-	/// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
-	static double computeVolume(Node const* const* _nodes);
+    /// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
+    static double computeVolume(Node const* const* _nodes);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/QuadRule8.cpp b/MeshLib/Elements/QuadRule8.cpp
index 2c5e15314b3..ae20908d2ba 100644
--- a/MeshLib/Elements/QuadRule8.cpp
+++ b/MeshLib/Elements/QuadRule8.cpp
@@ -13,10 +13,10 @@ namespace MeshLib {
 
 const unsigned QuadRule8::edge_nodes[4][3] =
 {
-		{0, 1, 4}, // Edge 0
-		{1, 2, 5}, // Edge 1
-		{2, 3, 6}, // Edge 2
-		{0, 3, 7}  // Edge 3
+        {0, 1, 4}, // Edge 0
+        {1, 2, 5}, // Edge 1
+        {2, 3, 6}, // Edge 2
+        {0, 3, 7}  // Edge 3
 };
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/QuadRule8.h b/MeshLib/Elements/QuadRule8.h
index 115da65e946..33ed5f083af 100644
--- a/MeshLib/Elements/QuadRule8.h
+++ b/MeshLib/Elements/QuadRule8.h
@@ -36,17 +36,17 @@ namespace MeshLib
 class QuadRule8 : public QuadRule4
 {
 public:
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 8u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 8u;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::QUAD8;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::QUAD8;
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[4][3];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[4][3];
 
-	/// Returns the i-th edge of the element.
-	typedef QuadraticEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef QuadraticEdgeReturn EdgeReturn;
 
 }; /* class */
 
diff --git a/MeshLib/Elements/QuadRule9.h b/MeshLib/Elements/QuadRule9.h
index 3359c0d5e04..64d2367ddde 100644
--- a/MeshLib/Elements/QuadRule9.h
+++ b/MeshLib/Elements/QuadRule9.h
@@ -35,11 +35,11 @@ namespace MeshLib
 class QuadRule9 : public QuadRule8
 {
 public:
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 9u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 9u;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::QUAD9;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::QUAD9;
 }; /* class */
 
 } /* namespace */
diff --git a/MeshLib/Elements/TemplateElement-impl.h b/MeshLib/Elements/TemplateElement-impl.h
index a0d3e4397d4..2121c70eb5b 100644
--- a/MeshLib/Elements/TemplateElement-impl.h
+++ b/MeshLib/Elements/TemplateElement-impl.h
@@ -16,34 +16,34 @@ template <class ELEMENT_RULE>
 TemplateElement<ELEMENT_RULE>::TemplateElement(Node* nodes[n_all_nodes], std::size_t id)
 : Element(id)
 {
-	this->_nodes = nodes;
-	this->_neighbors = new Element*[getNNeighbors()];
-	std::fill(this->_neighbors, this->_neighbors + getNNeighbors(), nullptr);
-	this->_content = ELEMENT_RULE::computeVolume(this->_nodes);
+    this->_nodes = nodes;
+    this->_neighbors = new Element*[getNNeighbors()];
+    std::fill(this->_neighbors, this->_neighbors + getNNeighbors(), nullptr);
+    this->_content = ELEMENT_RULE::computeVolume(this->_nodes);
 }
 
 template <class ELEMENT_RULE>
 TemplateElement<ELEMENT_RULE>::TemplateElement(std::array<Node*, n_all_nodes> const& nodes, std::size_t id)
 : Element(id)
 {
-	this->_nodes = new Node*[n_all_nodes];
-	std::copy(nodes.begin(), nodes.end(), this->_nodes);
-	this->_neighbors = new Element*[getNNeighbors()];
-	std::fill(this->_neighbors, this->_neighbors + getNNeighbors(), nullptr);
-	this->_content = ELEMENT_RULE::computeVolume(this->_nodes);
+    this->_nodes = new Node*[n_all_nodes];
+    std::copy(nodes.begin(), nodes.end(), this->_nodes);
+    this->_neighbors = new Element*[getNNeighbors()];
+    std::fill(this->_neighbors, this->_neighbors + getNNeighbors(), nullptr);
+    this->_content = ELEMENT_RULE::computeVolume(this->_nodes);
 }
 
 template <class ELEMENT_RULE>
 TemplateElement<ELEMENT_RULE>::TemplateElement(const TemplateElement &e)
 : Element(e.getID())
 {
-	this->_nodes = new Node*[n_all_nodes];
-	for (unsigned i=0; i<n_all_nodes; i++)
-		this->_nodes[i] = e._nodes[i];
-	this->_neighbors = new Element*[getNNeighbors()];
-	for (unsigned i=0; i<getNNeighbors(); i++)
-		this->_neighbors[i] = e._neighbors[i];
-	this->_content = e.getContent();
+    this->_nodes = new Node*[n_all_nodes];
+    for (unsigned i=0; i<n_all_nodes; i++)
+        this->_nodes[i] = e._nodes[i];
+    this->_neighbors = new Element*[getNNeighbors()];
+    for (unsigned i=0; i<getNNeighbors(); i++)
+        this->_neighbors[i] = e._neighbors[i];
+    this->_content = e.getContent();
 }
 
 
@@ -54,16 +54,16 @@ template<unsigned N>
 bool isEdge(unsigned const (&edge_nodes)[N], unsigned idx1, unsigned idx2)
 {
 
-	if (edge_nodes[0]==idx1 && edge_nodes[1]==idx2) return true;
-	if (edge_nodes[1]==idx1 && edge_nodes[0]==idx2) return true;
+    if (edge_nodes[0]==idx1 && edge_nodes[1]==idx2) return true;
+    if (edge_nodes[1]==idx1 && edge_nodes[0]==idx2) return true;
 
-	return false;
+    return false;
 }
 
 inline bool
 isEdge(unsigned const (&/*edge_nodes*/)[1], unsigned /*idx1*/, unsigned /*idx2*/)
 {
-	return false;
+    return false;
 }
 
 } // namespace detail
@@ -72,11 +72,11 @@ isEdge(unsigned const (&/*edge_nodes*/)[1], unsigned /*idx1*/, unsigned /*idx2*/
 template <class ELEMENT_RULE>
 bool TemplateElement<ELEMENT_RULE>::isEdge(unsigned idx1, unsigned idx2) const
 {
-	for (unsigned i(0); i<getNEdges(); i++)
-	{
-		if (detail::isEdge(ELEMENT_RULE::edge_nodes[i], idx1, idx2)) return true;
-	}
-	return false;
+    for (unsigned i(0); i<getNEdges(); i++)
+    {
+        if (detail::isEdge(ELEMENT_RULE::edge_nodes[i], idx1, idx2)) return true;
+    }
+    return false;
 }
 
 
diff --git a/MeshLib/Elements/TemplateElement.h b/MeshLib/Elements/TemplateElement.h
index ea08aef8d9d..521cbb4212e 100644
--- a/MeshLib/Elements/TemplateElement.h
+++ b/MeshLib/Elements/TemplateElement.h
@@ -32,124 +32,124 @@ template <class ELEMENT_RULE>
 class TemplateElement : public Element
 {
 public:
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = ELEMENT_RULE::n_all_nodes;
-
-	/// Constant: The number of base nodes for this element
-	static const unsigned n_base_nodes = ELEMENT_RULE::n_base_nodes;
-
-	/// Constant: The dimension of this element
-	static const unsigned dimension = ELEMENT_RULE::dimension;
-
-	/**
-	 * Constructor with an array of mesh nodes.
-	 *
-	 * @param nodes  an array of pointers of mesh nodes which form this element
-	 * @param id     element id
-	 */
-	TemplateElement(Node* nodes[n_all_nodes], std::size_t id = std::numeric_limits<std::size_t>::max());
-
-	/**
-	 * Constructor with an array of mesh nodes
-	 *
-	 * @param nodes  an array of pointers of mesh nodes which form this element
-	 * @param id     element id
-	 */
-	TemplateElement(std::array<Node*, n_all_nodes> const& nodes, std::size_t id = std::numeric_limits<std::size_t>::max());
-
-	/// Copy constructor
-	TemplateElement(const TemplateElement &e);
-
-	/// Destructor
-	virtual ~TemplateElement() {}
-
-	/// Returns a copy of this object.
-	virtual Element* clone() const
-	{
-		return new TemplateElement(*this);
-	}
-
-	/// Get dimension of the mesh element.
-	unsigned getDimension() const { return dimension; }
-
-	/// Returns the edge i of the element.
-	const Element* getEdge(unsigned i) const { return ELEMENT_RULE::EdgeReturn::getEdge(this, i); }
-
-	/// Returns the face i of the element.
-	const Element* getFace(unsigned i) const { return ELEMENT_RULE::getFace(this, i); }
-
-	/// Get the number of edges for this element.
-	unsigned getNEdges() const { return ELEMENT_RULE::n_edges; }
-
-	/// Get the number of nodes for face i.
-	unsigned getNFaceNodes(unsigned i) const { return ELEMENT_RULE::getNFaceNodes(i); }
-
-	/// Get the number of faces for this element.
-	unsigned getNFaces() const { return ELEMENT_RULE::n_faces; }
-
-	/// Get the number of neighbors for this element.
-	unsigned getNNeighbors() const { return ELEMENT_RULE::n_neighbors; }
-
-	/// Get the number of linear nodes for this element.
-	virtual unsigned getNBaseNodes() const { return n_base_nodes; }
-
-	/// Get the number of all nodes for this element.
-	virtual unsigned getNNodes() const { return n_all_nodes; }
-
-	/// Get the type of this element.
-	virtual MeshElemType getGeomType() const { return ELEMENT_RULE::mesh_elem_type; }
-
-	/// Get the FEM type of this element.
-	virtual CellType getCellType() const { return ELEMENT_RULE::cell_type; }
-
-	/// Returns true if these two indices form an edge and false otherwise
-	bool isEdge(unsigned idx1, unsigned idx2) const;
-
-	/**
-	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::Point3d object
-	 * @param eps tolerance for numerical algorithm used or computing the property
-	 * @return true if the point is not outside the element, false otherwise
-	 */
-	bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const
-	{
-		return ELEMENT_RULE::isPntInElement(this->_nodes, pnt, eps);
-	}
-
-	/**
-	 * Tests if the element is geometrically valid.
-	 */
-	virtual ElementErrorCode validate() const
-	{
-		return ELEMENT_RULE::validate(this);
-	}
-
-	/// Returns the ID of a face given an array of nodes.
-	unsigned identifyFace(Node* nodes[3]) const
-	{
-		return ELEMENT_RULE::identifyFace(this->_nodes, nodes);
-	}
-
-	/// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
-	virtual double computeVolume() {return ELEMENT_RULE::computeVolume(this->_nodes);}
-
-	/// Return a specific edge node.
-	virtual inline Node* getEdgeNode(unsigned edge_id, unsigned node_id) const
-	{
-		if (getNEdges()>0)
-			return const_cast<Node*>(this->_nodes[ELEMENT_RULE::edge_nodes[edge_id][node_id]]);
-		else
-			return nullptr;
-	}
-
-	/**
-	* Checks if the node order of an element is correct by testing surface normals.
-	* For 1D elements this always returns true.
-	*/
-	virtual bool testElementNodeOrder() const
-	{
-		return ELEMENT_RULE::testElementNodeOrder(this);
-	}
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = ELEMENT_RULE::n_all_nodes;
+
+    /// Constant: The number of base nodes for this element
+    static const unsigned n_base_nodes = ELEMENT_RULE::n_base_nodes;
+
+    /// Constant: The dimension of this element
+    static const unsigned dimension = ELEMENT_RULE::dimension;
+
+    /**
+     * Constructor with an array of mesh nodes.
+     *
+     * @param nodes  an array of pointers of mesh nodes which form this element
+     * @param id     element id
+     */
+    TemplateElement(Node* nodes[n_all_nodes], std::size_t id = std::numeric_limits<std::size_t>::max());
+
+    /**
+     * Constructor with an array of mesh nodes
+     *
+     * @param nodes  an array of pointers of mesh nodes which form this element
+     * @param id     element id
+     */
+    TemplateElement(std::array<Node*, n_all_nodes> const& nodes, std::size_t id = std::numeric_limits<std::size_t>::max());
+
+    /// Copy constructor
+    TemplateElement(const TemplateElement &e);
+
+    /// Destructor
+    virtual ~TemplateElement() {}
+
+    /// Returns a copy of this object.
+    virtual Element* clone() const
+    {
+        return new TemplateElement(*this);
+    }
+
+    /// Get dimension of the mesh element.
+    unsigned getDimension() const { return dimension; }
+
+    /// Returns the edge i of the element.
+    const Element* getEdge(unsigned i) const { return ELEMENT_RULE::EdgeReturn::getEdge(this, i); }
+
+    /// Returns the face i of the element.
+    const Element* getFace(unsigned i) const { return ELEMENT_RULE::getFace(this, i); }
+
+    /// Get the number of edges for this element.
+    unsigned getNEdges() const { return ELEMENT_RULE::n_edges; }
+
+    /// Get the number of nodes for face i.
+    unsigned getNFaceNodes(unsigned i) const { return ELEMENT_RULE::getNFaceNodes(i); }
+
+    /// Get the number of faces for this element.
+    unsigned getNFaces() const { return ELEMENT_RULE::n_faces; }
+
+    /// Get the number of neighbors for this element.
+    unsigned getNNeighbors() const { return ELEMENT_RULE::n_neighbors; }
+
+    /// Get the number of linear nodes for this element.
+    virtual unsigned getNBaseNodes() const { return n_base_nodes; }
+
+    /// Get the number of all nodes for this element.
+    virtual unsigned getNNodes() const { return n_all_nodes; }
+
+    /// Get the type of this element.
+    virtual MeshElemType getGeomType() const { return ELEMENT_RULE::mesh_elem_type; }
+
+    /// Get the FEM type of this element.
+    virtual CellType getCellType() const { return ELEMENT_RULE::cell_type; }
+
+    /// Returns true if these two indices form an edge and false otherwise
+    bool isEdge(unsigned idx1, unsigned idx2) const;
+
+    /**
+     * Checks if a point is inside the element.
+     * @param pnt a 3D MathLib::Point3d object
+     * @param eps tolerance for numerical algorithm used or computing the property
+     * @return true if the point is not outside the element, false otherwise
+     */
+    bool isPntInElement(MathLib::Point3d const& pnt, double eps = std::numeric_limits<double>::epsilon()) const
+    {
+        return ELEMENT_RULE::isPntInElement(this->_nodes, pnt, eps);
+    }
+
+    /**
+     * Tests if the element is geometrically valid.
+     */
+    virtual ElementErrorCode validate() const
+    {
+        return ELEMENT_RULE::validate(this);
+    }
+
+    /// Returns the ID of a face given an array of nodes.
+    unsigned identifyFace(Node* nodes[3]) const
+    {
+        return ELEMENT_RULE::identifyFace(this->_nodes, nodes);
+    }
+
+    /// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
+    virtual double computeVolume() {return ELEMENT_RULE::computeVolume(this->_nodes);}
+
+    /// Return a specific edge node.
+    virtual inline Node* getEdgeNode(unsigned edge_id, unsigned node_id) const
+    {
+        if (getNEdges()>0)
+            return const_cast<Node*>(this->_nodes[ELEMENT_RULE::edge_nodes[edge_id][node_id]]);
+        else
+            return nullptr;
+    }
+
+    /**
+    * Checks if the node order of an element is correct by testing surface normals.
+    * For 1D elements this always returns true.
+    */
+    virtual bool testElementNodeOrder() const
+    {
+        return ELEMENT_RULE::testElementNodeOrder(this);
+    }
 
 };
 
diff --git a/MeshLib/Elements/TetRule10.cpp b/MeshLib/Elements/TetRule10.cpp
index 2fb5fee6244..fa4c455e191 100644
--- a/MeshLib/Elements/TetRule10.cpp
+++ b/MeshLib/Elements/TetRule10.cpp
@@ -21,33 +21,33 @@ namespace MeshLib
 
 const unsigned TetRule10::face_nodes[4][6] =
 {
-	{0, 2, 1, 6, 5, 4}, // Face 0
-	{0, 1, 3, 4, 8, 7}, // Face 1
-	{1, 2, 3, 5, 9, 8}, // Face 2
-	{2, 0, 3, 6, 7, 9}  // Face 3
+    {0, 2, 1, 6, 5, 4}, // Face 0
+    {0, 1, 3, 4, 8, 7}, // Face 1
+    {1, 2, 3, 5, 9, 8}, // Face 2
+    {2, 0, 3, 6, 7, 9}  // Face 3
 };
 
 const unsigned TetRule10::edge_nodes[6][3] =
 {
-	{0, 1, 4}, // Edge 0
-	{1, 2, 5}, // Edge 1
-	{0, 2, 6}, // Edge 2
-	{0, 3, 7}, // Edge 3
-	{1, 3, 8}, // Edge 4
-	{2, 3, 9}  // Edge 5
+    {0, 1, 4}, // Edge 0
+    {1, 2, 5}, // Edge 1
+    {0, 2, 6}, // Edge 2
+    {0, 3, 7}, // Edge 3
+    {1, 3, 8}, // Edge 4
+    {2, 3, 9}  // Edge 5
 };
 
 const Element* TetRule10::getFace(const Element* e, unsigned i)
 {
-	if (i<n_faces)
-	{
-		std::array<Node*,6> nodes;
-		for (unsigned j=0; j<6; j++)
-			nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
-		return new Tri6(nodes);
-	}
-	ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
-	return nullptr;
+    if (i<n_faces)
+    {
+        std::array<Node*,6> nodes;
+        for (unsigned j=0; j<6; j++)
+            nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
+        return new Tri6(nodes);
+    }
+    ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
+    return nullptr;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/TetRule10.h b/MeshLib/Elements/TetRule10.h
index ee8fa91f6a4..3ca54a9cd60 100644
--- a/MeshLib/Elements/TetRule10.h
+++ b/MeshLib/Elements/TetRule10.h
@@ -41,26 +41,26 @@ namespace MeshLib
 class TetRule10 : public TetRule4
 {
 public:
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 10u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 10u;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::TET10;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::TET10;
 
-	/// Constant: Local node index table for faces
-	static const unsigned face_nodes[4][6];
+    /// Constant: Local node index table for faces
+    static const unsigned face_nodes[4][6];
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[6][3];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[6][3];
 
-	/// Returns the i-th edge of the element.
-	typedef QuadraticEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef QuadraticEdgeReturn EdgeReturn;
 
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned /*i*/) { return 6; }
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned /*i*/) { return 6; }
 
-	/// Returns the i-th face of the element.
-	static const Element* getFace(const Element* e, unsigned i);
+    /// Returns the i-th face of the element.
+    static const Element* getFace(const Element* e, unsigned i);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/TetRule4.cpp b/MeshLib/Elements/TetRule4.cpp
index 8f681b46935..1d9ca6e4546 100644
--- a/MeshLib/Elements/TetRule4.cpp
+++ b/MeshLib/Elements/TetRule4.cpp
@@ -23,66 +23,66 @@ namespace MeshLib {
 
 const unsigned TetRule4::face_nodes[4][3] =
 {
-	{0, 2, 1}, // Face 0
-	{0, 1, 3}, // Face 1
-	{1, 2, 3}, // Face 2
-	{2, 0, 3}  // Face 3
+    {0, 2, 1}, // Face 0
+    {0, 1, 3}, // Face 1
+    {1, 2, 3}, // Face 2
+    {2, 0, 3}  // Face 3
 };
 
 const unsigned TetRule4::edge_nodes[6][2] =
 {
-	{0, 1}, // Edge 0
-	{1, 2}, // Edge 1
-	{0, 2}, // Edge 2
-	{0, 3}, // Edge 3
-	{1, 3}, // Edge 4
-	{2, 3}  // Edge 5
+    {0, 1}, // Edge 0
+    {1, 2}, // Edge 1
+    {0, 2}, // Edge 2
+    {0, 3}, // Edge 3
+    {1, 3}, // Edge 4
+    {2, 3}  // Edge 5
 };
 
 const Element* TetRule4::getFace(const Element* e, unsigned i)
 {
-	if (i<n_faces)
-	{
-		std::array<Node*,3> nodes;
-		for (unsigned j=0; j<3; j++)
-			nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
-		return new Tri(nodes);
-	}
-	ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
-	return nullptr;
+    if (i<n_faces)
+    {
+        std::array<Node*,3> nodes;
+        for (unsigned j=0; j<3; j++)
+            nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
+        return new Tri(nodes);
+    }
+    ERR("Error in MeshLib::Element::getFace() - Index %d does not exist.", i);
+    return nullptr;
 }
 
 double TetRule4::computeVolume(Node const* const* _nodes)
 {
-	return GeoLib::calcTetrahedronVolume(*_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3]);
+    return GeoLib::calcTetrahedronVolume(*_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3]);
 }
 
 bool TetRule4::isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps)
 {
-	return GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3], eps);
+    return GeoLib::isPointInTetrahedron(pnt, *_nodes[0], *_nodes[1], *_nodes[2], *_nodes[3], eps);
 }
 
 unsigned TetRule4::identifyFace(Node const* const* _nodes, Node* nodes[3])
 {
-	for (unsigned i=0; i<4; i++)
-	{
-		unsigned flag(0);
-		for (unsigned j=0; j<3; j++)
-			for (unsigned k=0; k<3; k++)
-				if (_nodes[face_nodes[i][j]] == nodes[k])
-					flag++;
-		if (flag==3)
-			return i;
-	}
-	return std::numeric_limits<unsigned>::max();
+    for (unsigned i=0; i<4; i++)
+    {
+        unsigned flag(0);
+        for (unsigned j=0; j<3; j++)
+            for (unsigned k=0; k<3; k++)
+                if (_nodes[face_nodes[i][j]] == nodes[k])
+                    flag++;
+        if (flag==3)
+            return i;
+    }
+    return std::numeric_limits<unsigned>::max();
 }
 
 ElementErrorCode TetRule4::validate(const Element* e)
 {
-	ElementErrorCode error_code;
-	error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
-	error_code[ElementErrorFlag::NodeOrder]  = !e->testElementNodeOrder();
-	return error_code;
+    ElementErrorCode error_code;
+    error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
+    error_code[ElementErrorFlag::NodeOrder]  = !e->testElementNodeOrder();
+    return error_code;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/TetRule4.h b/MeshLib/Elements/TetRule4.h
index 7ec3c764439..c5d64099949 100644
--- a/MeshLib/Elements/TetRule4.h
+++ b/MeshLib/Elements/TetRule4.h
@@ -41,60 +41,60 @@ namespace MeshLib
 class TetRule4 : public CellRule
 {
 public:
-	/// Constant: The number of base nodes for this element
-	static const unsigned n_base_nodes = 4u;
+    /// Constant: The number of base nodes for this element
+    static const unsigned n_base_nodes = 4u;
 
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 4u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 4u;
 
-	/// Constant: The geometric type of the element
-	static const MeshElemType mesh_elem_type = MeshElemType::TETRAHEDRON;
+    /// Constant: The geometric type of the element
+    static const MeshElemType mesh_elem_type = MeshElemType::TETRAHEDRON;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::TET4;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::TET4;
 
-	/// Constant: The number of faces
-	static const unsigned n_faces = 4;
+    /// Constant: The number of faces
+    static const unsigned n_faces = 4;
 
-	/// Constant: The number of edges
-	static const unsigned n_edges = 6;
+    /// Constant: The number of edges
+    static const unsigned n_edges = 6;
 
-	/// Constant: The number of neighbors
-	static const unsigned n_neighbors = 4;
+    /// Constant: The number of neighbors
+    static const unsigned n_neighbors = 4;
 
-	/// Constant: Local node index table for faces
-	static const unsigned face_nodes[4][3];
+    /// Constant: Local node index table for faces
+    static const unsigned face_nodes[4][3];
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[6][2];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[6][2];
 
-	/// Returns the i-th edge of the element.
-	typedef LinearEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef LinearEdgeReturn EdgeReturn;
 
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned /*i*/) { return 3; }
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned /*i*/) { return 3; }
 
-	/// Returns the i-th face of the element.
-	static const Element* getFace(const Element* e, unsigned i);
+    /// Returns the i-th face of the element.
+    static const Element* getFace(const Element* e, unsigned i);
 
-	/**
-	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::Point3d object
-	 * @param eps tolerance for numerical algorithm used or computing the property
-	 * @return true if the point is not outside the element, false otherwise
-	 */
-	static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
+    /**
+     * Checks if a point is inside the element.
+     * @param pnt a 3D MathLib::Point3d object
+     * @param eps tolerance for numerical algorithm used or computing the property
+     * @return true if the point is not outside the element, false otherwise
+     */
+    static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
 
-	/**
-	 * Tests if the element is geometrically valid.
-	 */
-	static ElementErrorCode validate(const Element* e);
+    /**
+     * Tests if the element is geometrically valid.
+     */
+    static ElementErrorCode validate(const Element* e);
 
-	/// Returns the ID of a face given an array of nodes.
-	static unsigned identifyFace(Node const* const*, Node* nodes[3]);
+    /// Returns the ID of a face given an array of nodes.
+    static unsigned identifyFace(Node const* const*, Node* nodes[3]);
 
-	/// Calculates the volume of the element
-	static double computeVolume(Node const* const* _nodes);
+    /// Calculates the volume of the element
+    static double computeVolume(Node const* const* _nodes);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/TriRule3.cpp b/MeshLib/Elements/TriRule3.cpp
index f248bb07bd3..2da9a0877c0 100644
--- a/MeshLib/Elements/TriRule3.cpp
+++ b/MeshLib/Elements/TriRule3.cpp
@@ -19,42 +19,42 @@ namespace MeshLib {
 
 const unsigned TriRule3::edge_nodes[3][2] =
 {
-		{0, 1}, // Edge 0
-		{1, 2}, // Edge 1
-		{2, 0}, // Edge 2
+        {0, 1}, // Edge 0
+        {1, 2}, // Edge 1
+        {2, 0}, // Edge 2
 };
 
 double TriRule3::computeVolume(Node const* const* _nodes)
 {
-	return GeoLib::calcTriangleArea(*_nodes[0], *_nodes[1], *_nodes[2]);
+    return GeoLib::calcTriangleArea(*_nodes[0], *_nodes[1], *_nodes[2]);
 }
 
 bool TriRule3::isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps)
 {
-	return GeoLib::isPointInTriangle(pnt, *_nodes[0], *_nodes[1], *_nodes[2], eps);
+    return GeoLib::isPointInTriangle(pnt, *_nodes[0], *_nodes[1], *_nodes[2], eps);
 }
 
 unsigned TriRule3::identifyFace(Node const* const* _nodes, Node* nodes[3])
 {
-	for (unsigned i=0; i<3; i++)
-	{
-		unsigned flag(0);
-		for (unsigned j=0; j<2; j++)
-			for (unsigned k=0; k<2; k++)
-				if (_nodes[edge_nodes[i][j]] == nodes[k])
-					flag++;
-		if (flag==2)
-			return i;
-	}
-	return std::numeric_limits<unsigned>::max();
+    for (unsigned i=0; i<3; i++)
+    {
+        unsigned flag(0);
+        for (unsigned j=0; j<2; j++)
+            for (unsigned k=0; k<2; k++)
+                if (_nodes[edge_nodes[i][j]] == nodes[k])
+                    flag++;
+        if (flag==2)
+            return i;
+    }
+    return std::numeric_limits<unsigned>::max();
 }
 
 ElementErrorCode TriRule3::validate(const Element* e)
 {
-	ElementErrorCode error_code;
-	error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
-	error_code[ElementErrorFlag::NodeOrder]  = !e->testElementNodeOrder();
-	return error_code;
+    ElementErrorCode error_code;
+    error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
+    error_code[ElementErrorFlag::NodeOrder]  = !e->testElementNodeOrder();
+    return error_code;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/TriRule3.h b/MeshLib/Elements/TriRule3.h
index b02f4be6f42..6f08356c0c5 100644
--- a/MeshLib/Elements/TriRule3.h
+++ b/MeshLib/Elements/TriRule3.h
@@ -38,48 +38,48 @@ namespace MeshLib
 class TriRule3 : public FaceRule
 {
 public:
-	/// Constant: The number of base nodes for this element
-	static const unsigned n_base_nodes = 3u;
+    /// Constant: The number of base nodes for this element
+    static const unsigned n_base_nodes = 3u;
 
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 3u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 3u;
 
-	/// Constant: The geometric type of the element
-	static const MeshElemType mesh_elem_type = MeshElemType::TRIANGLE;
+    /// Constant: The geometric type of the element
+    static const MeshElemType mesh_elem_type = MeshElemType::TRIANGLE;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::TRI3;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::TRI3;
 
-	/// Constant: The number of edges
-	static const unsigned n_edges = 3;
+    /// Constant: The number of edges
+    static const unsigned n_edges = 3;
 
-	/// Constant: The number of neighbors
-	static const unsigned n_neighbors = 3;
+    /// Constant: The number of neighbors
+    static const unsigned n_neighbors = 3;
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[3][2];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[3][2];
 
-	/// Returns the i-th edge of the element.
-	typedef LinearEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef LinearEdgeReturn EdgeReturn;
 
-	/**
-	 * Checks if a point is inside the element.
-	 * @param pnt a 3D MathLib::Point3d object
-	 * @param eps tolerance for numerical algorithm used or computing the property
-	 * @return true if the point is not outside the element, false otherwise
-	 */
-	static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
+    /**
+     * Checks if a point is inside the element.
+     * @param pnt a 3D MathLib::Point3d object
+     * @param eps tolerance for numerical algorithm used or computing the property
+     * @return true if the point is not outside the element, false otherwise
+     */
+    static bool isPntInElement(Node const* const* _nodes, MathLib::Point3d const& pnt, double eps);
 
-	/**
-	 * Tests if the element is geometrically valid.
-	 */
-	static ElementErrorCode validate(const Element* e);
+    /**
+     * Tests if the element is geometrically valid.
+     */
+    static ElementErrorCode validate(const Element* e);
 
-	/// Returns the ID of a face given an array of nodes.
-	static unsigned identifyFace(Node const* const*, Node* nodes[3]);
+    /// Returns the ID of a face given an array of nodes.
+    static unsigned identifyFace(Node const* const*, Node* nodes[3]);
 
-	/// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
-	static double computeVolume(Node const* const* _nodes);
+    /// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.
+    static double computeVolume(Node const* const* _nodes);
 
 }; /* class */
 
diff --git a/MeshLib/Elements/TriRule6.cpp b/MeshLib/Elements/TriRule6.cpp
index e12174dbc79..597b0a96dc1 100644
--- a/MeshLib/Elements/TriRule6.cpp
+++ b/MeshLib/Elements/TriRule6.cpp
@@ -13,9 +13,9 @@ namespace MeshLib {
 
 const unsigned TriRule6::edge_nodes[3][3] =
 {
-		{0, 1, 3}, // Edge 0
-		{1, 2, 4}, // Edge 1
-		{2, 0, 5}, // Edge 2
+        {0, 1, 3}, // Edge 0
+        {1, 2, 4}, // Edge 1
+        {2, 0, 5}, // Edge 2
 };
 
 } // end namespace MeshLib
diff --git a/MeshLib/Elements/TriRule6.h b/MeshLib/Elements/TriRule6.h
index 8d878f4872f..c41b79c9361 100644
--- a/MeshLib/Elements/TriRule6.h
+++ b/MeshLib/Elements/TriRule6.h
@@ -39,17 +39,17 @@ namespace MeshLib
 class TriRule6 : public TriRule3
 {
 public:
-	/// Constant: The number of all nodes for this element
-	static const unsigned n_all_nodes = 6u;
+    /// Constant: The number of all nodes for this element
+    static const unsigned n_all_nodes = 6u;
 
-	/// Constant: The FEM type of the element
-	static const CellType cell_type = CellType::TRI6;
+    /// Constant: The FEM type of the element
+    static const CellType cell_type = CellType::TRI6;
 
-	/// Constant: Local node index table for edge
-	static const unsigned edge_nodes[3][3];
+    /// Constant: Local node index table for edge
+    static const unsigned edge_nodes[3][3];
 
-	/// Returns the i-th edge of the element.
-	typedef QuadraticEdgeReturn EdgeReturn;
+    /// Returns the i-th edge of the element.
+    typedef QuadraticEdgeReturn EdgeReturn;
 
 }; /* class */
 
diff --git a/MeshLib/Elements/VertexRule.h b/MeshLib/Elements/VertexRule.h
index f70c96f1cad..e2273bab166 100644
--- a/MeshLib/Elements/VertexRule.h
+++ b/MeshLib/Elements/VertexRule.h
@@ -18,30 +18,30 @@ class Element;
 class VertexRule
 {
 public:
-	/// Constant: Dimension of this mesh element
-	static const unsigned dimension = 0u;
-
-	/// Constant: The number of faces
-	static const unsigned n_faces = 0;
-
-	/// Constant: The number of edges
-	static const unsigned n_edges = 0;
-
-	/// Get the number of nodes for face i.
-	static unsigned getNFaceNodes(unsigned /*i*/)
-	{
-		return 0;
-	}
-
-	/// Returns the i-th face of the element.
-	static const Element* getFace(const Element* /*e*/, unsigned /*i*/)
-	{
-		return nullptr;
-	}
-
-	/// Checks if the node order of an element is correct by testing surface
-	/// normals.  For 0D elements this always returns true.
-	static bool testElementNodeOrder(const Element* /*e*/) { return true; }
+    /// Constant: Dimension of this mesh element
+    static const unsigned dimension = 0u;
+
+    /// Constant: The number of faces
+    static const unsigned n_faces = 0;
+
+    /// Constant: The number of edges
+    static const unsigned n_edges = 0;
+
+    /// Get the number of nodes for face i.
+    static unsigned getNFaceNodes(unsigned /*i*/)
+    {
+        return 0;
+    }
+
+    /// Returns the i-th face of the element.
+    static const Element* getFace(const Element* /*e*/, unsigned /*i*/)
+    {
+        return nullptr;
+    }
+
+    /// Checks if the node order of an element is correct by testing surface
+    /// normals.  For 0D elements this always returns true.
+    static bool testElementNodeOrder(const Element* /*e*/) { return true; }
 
 };
 
diff --git a/MeshLib/IO/Legacy/MeshIO.cpp b/MeshLib/IO/Legacy/MeshIO.cpp
index 474dd143894..56af278ffc9 100644
--- a/MeshLib/IO/Legacy/MeshIO.cpp
+++ b/MeshLib/IO/Legacy/MeshIO.cpp
@@ -39,299 +39,299 @@ namespace IO
 namespace Legacy {
 
 MeshIO::MeshIO()
-	: _mesh(NULL)
+    : _mesh(NULL)
 {
 }
 
 MeshLib::Mesh* MeshIO::loadMeshFromFile(const std::string& file_name)
 {
-	INFO("Reading OGS legacy mesh ... ");
-
-	std::ifstream in (file_name.c_str(),std::ios::in);
-	if (!in.is_open())
-	{
-		WARN("MeshIO::loadMeshFromFile() - Could not open file %s.", file_name.c_str());
-		return nullptr;
-	}
-
-	std::string line_string ("");
-	getline(in, line_string);
-
-	std::vector<MeshLib::Node*> nodes;
-	std::vector<MeshLib::Element*> elements;
-	std::vector<std::size_t> materials;
-
-	if(line_string.find("#FEM_MSH") != std::string::npos) // OGS mesh file
-	{
-		while (!in.eof())
-		{
-			getline(in, line_string);
-
-			// check keywords
-			if (line_string.find("#STOP") != std::string::npos)
-				break;
-			else if (line_string.find("$NODES") != std::string::npos)
-			{
-				double x, y, z, double_dummy;
-				unsigned idx;
-				getline(in, line_string);
-				BaseLib::trim(line_string);
-				unsigned nNodes = atoi(line_string.c_str());
-				std::string s;
-				for (unsigned i = 0; i < nNodes; ++i)
-				{
-					getline(in, line_string);
-					std::stringstream iss(line_string);
-					iss >> idx >> x >> y >> z;
-					MeshLib::Node* node(new MeshLib::Node(x, y, z, idx));
-					nodes.push_back(node);
-					iss >> s;
-					if (s.find("$AREA") != std::string::npos)
-						iss >> double_dummy;
-				}
-			}
-			else if (line_string.find("$ELEMENTS") != std::string::npos)
-			{
-				getline(in, line_string);
-				BaseLib::trim(line_string);
-				unsigned nElements = atoi(line_string.c_str());
-				for (unsigned i = 0; i < nElements; ++i)
-				{
-					getline(in, line_string);
-					std::stringstream ss(line_string);
-					materials.push_back(readMaterialID(ss));
-					MeshLib::Element *elem(readElement(ss,nodes));
-					if (elem == nullptr) {
-						ERR("Reading mesh element %d from file \"%s\" failed.",
-							i, file_name.c_str());
-						// clean up the elements vector
-						std::for_each(elements.begin(), elements.end(),
-							std::default_delete<MeshLib::Element>());
-						// clean up the nodes vector
-						std::for_each(nodes.begin(), nodes.end(),
-							std::default_delete<MeshLib::Node>());
-						return nullptr;
-					}
-					elements.push_back(elem);
-				}
-			}
-		}
-
-		if (elements.empty())
-		{
-			ERR ("MeshIO::loadMeshFromFile() - File did not contain element information.");
-			for (auto it = nodes.begin(); it!=nodes.end(); ++it)
-				delete *it;
-			return nullptr;
-		}
-
-		MeshLib::Mesh* mesh (new MeshLib::Mesh(BaseLib::extractBaseNameWithoutExtension(
-		                                               file_name), nodes, elements));
-
-		boost::optional<MeshLib::PropertyVector<int> &> opt_material_ids(
-			mesh->getProperties().createNewPropertyVector<int>(
-				"MaterialIDs", MeshLib::MeshItemType::Cell, 1)
-		);
-		if (!opt_material_ids) {
-			WARN("Could not create PropertyVector for MaterialIDs in Mesh.");
-		} else {
-			MeshLib::PropertyVector<int> & material_ids(opt_material_ids.get());
-			material_ids.insert(material_ids.end(), materials.cbegin(),
-				materials.cend());
-		}
-		INFO("\t... finished.");
-		INFO("Nr. Nodes: %d.", nodes.size());
-		INFO("Nr. Elements: %d.", elements.size());
-
-		in.close();
-		return mesh;
-	}
-	else
-	{
-		in.close();
-		return nullptr;
-	}
+    INFO("Reading OGS legacy mesh ... ");
+
+    std::ifstream in (file_name.c_str(),std::ios::in);
+    if (!in.is_open())
+    {
+        WARN("MeshIO::loadMeshFromFile() - Could not open file %s.", file_name.c_str());
+        return nullptr;
+    }
+
+    std::string line_string ("");
+    getline(in, line_string);
+
+    std::vector<MeshLib::Node*> nodes;
+    std::vector<MeshLib::Element*> elements;
+    std::vector<std::size_t> materials;
+
+    if(line_string.find("#FEM_MSH") != std::string::npos) // OGS mesh file
+    {
+        while (!in.eof())
+        {
+            getline(in, line_string);
+
+            // check keywords
+            if (line_string.find("#STOP") != std::string::npos)
+                break;
+            else if (line_string.find("$NODES") != std::string::npos)
+            {
+                double x, y, z, double_dummy;
+                unsigned idx;
+                getline(in, line_string);
+                BaseLib::trim(line_string);
+                unsigned nNodes = atoi(line_string.c_str());
+                std::string s;
+                for (unsigned i = 0; i < nNodes; ++i)
+                {
+                    getline(in, line_string);
+                    std::stringstream iss(line_string);
+                    iss >> idx >> x >> y >> z;
+                    MeshLib::Node* node(new MeshLib::Node(x, y, z, idx));
+                    nodes.push_back(node);
+                    iss >> s;
+                    if (s.find("$AREA") != std::string::npos)
+                        iss >> double_dummy;
+                }
+            }
+            else if (line_string.find("$ELEMENTS") != std::string::npos)
+            {
+                getline(in, line_string);
+                BaseLib::trim(line_string);
+                unsigned nElements = atoi(line_string.c_str());
+                for (unsigned i = 0; i < nElements; ++i)
+                {
+                    getline(in, line_string);
+                    std::stringstream ss(line_string);
+                    materials.push_back(readMaterialID(ss));
+                    MeshLib::Element *elem(readElement(ss,nodes));
+                    if (elem == nullptr) {
+                        ERR("Reading mesh element %d from file \"%s\" failed.",
+                            i, file_name.c_str());
+                        // clean up the elements vector
+                        std::for_each(elements.begin(), elements.end(),
+                            std::default_delete<MeshLib::Element>());
+                        // clean up the nodes vector
+                        std::for_each(nodes.begin(), nodes.end(),
+                            std::default_delete<MeshLib::Node>());
+                        return nullptr;
+                    }
+                    elements.push_back(elem);
+                }
+            }
+        }
+
+        if (elements.empty())
+        {
+            ERR ("MeshIO::loadMeshFromFile() - File did not contain element information.");
+            for (auto it = nodes.begin(); it!=nodes.end(); ++it)
+                delete *it;
+            return nullptr;
+        }
+
+        MeshLib::Mesh* mesh (new MeshLib::Mesh(BaseLib::extractBaseNameWithoutExtension(
+                                                       file_name), nodes, elements));
+
+        boost::optional<MeshLib::PropertyVector<int> &> opt_material_ids(
+            mesh->getProperties().createNewPropertyVector<int>(
+                "MaterialIDs", MeshLib::MeshItemType::Cell, 1)
+        );
+        if (!opt_material_ids) {
+            WARN("Could not create PropertyVector for MaterialIDs in Mesh.");
+        } else {
+            MeshLib::PropertyVector<int> & material_ids(opt_material_ids.get());
+            material_ids.insert(material_ids.end(), materials.cbegin(),
+                materials.cend());
+        }
+        INFO("\t... finished.");
+        INFO("Nr. Nodes: %d.", nodes.size());
+        INFO("Nr. Elements: %d.", elements.size());
+
+        in.close();
+        return mesh;
+    }
+    else
+    {
+        in.close();
+        return nullptr;
+    }
 }
 
 std::size_t MeshIO::readMaterialID(std::istream & in) const
 {
-	unsigned index, material_id;
-	if (!(in >> index >> material_id))
-		return std::numeric_limits<std::size_t>::max();
-	return material_id;
+    unsigned index, material_id;
+    if (!(in >> index >> material_id))
+        return std::numeric_limits<std::size_t>::max();
+    return material_id;
 }
 
 MeshLib::Element* MeshIO::readElement(std::istream& in,
-	const std::vector<MeshLib::Node*> &nodes) const
+    const std::vector<MeshLib::Node*> &nodes) const
 {
-	std::string elem_type_str("");
-	MeshLib::MeshElemType elem_type (MeshLib::MeshElemType::INVALID);
-
-	do {
-		if (!(in >> elem_type_str))
-			return nullptr;
-		elem_type = MeshLib::String2MeshElemType(elem_type_str);
-	} while (elem_type == MeshLib::MeshElemType::INVALID);
-
-	unsigned* idx = new unsigned[8];
-	MeshLib::Element* elem;
-
-	switch(elem_type)
-	{
-	case MeshLib::MeshElemType::LINE: {
-		for (int i = 0; i < 2; ++i)
-			if (!(in >> idx[i]))
-				return nullptr;
-		// edge_nodes array will be deleted from Line object
-		MeshLib::Node** edge_nodes = new MeshLib::Node*[2];
-		for (unsigned k(0); k < 2; ++k)
-			edge_nodes[k] = nodes[idx[k]];
-		elem = new MeshLib::Line(edge_nodes);
-		break;
-	}
-	case MeshLib::MeshElemType::TRIANGLE: {
-		for (int i = 0; i < 3; ++i)
-			if (!(in >> idx[i]))
-				return nullptr;
-		MeshLib::Node** tri_nodes = new MeshLib::Node*[3];
-		for (unsigned k(0); k < 3; ++k)
-			tri_nodes[k] = nodes[idx[k]];
-		elem = new MeshLib::Tri(tri_nodes);
-		break;
-	}
-	case MeshLib::MeshElemType::QUAD: {
-		for (int i = 0; i < 4; ++i)
-			if (!(in >> idx[i]))
-				return nullptr;
-		MeshLib::Node** quad_nodes = new MeshLib::Node*[4];
-		for (unsigned k(0); k < 4; ++k)
-			quad_nodes[k] = nodes[idx[k]];
-		elem = new MeshLib::Quad(quad_nodes);
-		break;
-	}
-	case MeshLib::MeshElemType::TETRAHEDRON: {
-		for (int i = 0; i < 4; ++i)
-			if (!(in >> idx[i]))
-				return nullptr;
-		MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
-		for (unsigned k(0); k < 4; ++k)
-			tet_nodes[k] = nodes[idx[k]];
-		elem = new MeshLib::Tet(tet_nodes);
-		break;
-	}
-	case MeshLib::MeshElemType::HEXAHEDRON: {
-		for (int i = 0; i < 8; ++i)
-			if (!(in >> idx[i]))
-				return nullptr;
-		MeshLib::Node** hex_nodes = new MeshLib::Node*[8];
-		for (unsigned k(0); k < 8; ++k)
-			hex_nodes[k] = nodes[idx[k]];
-		elem = new MeshLib::Hex(hex_nodes);
-		break;
-	}
-	case MeshLib::MeshElemType::PYRAMID: {
-		for (int i = 0; i < 5; ++i)
-			if (!(in >> idx[i]))
-				return nullptr;
-		MeshLib::Node** pyramid_nodes = new MeshLib::Node*[5];
-		for (unsigned k(0); k < 5; ++k)
-			pyramid_nodes[k] = nodes[idx[k]];
-		elem = new MeshLib::Pyramid(pyramid_nodes);
-		break;
-	}
-	case MeshLib::MeshElemType::PRISM: {
-		for (int i = 0; i < 6; ++i)
-			if (!(in >> idx[i]))
-				return nullptr;
-		MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
-		for (unsigned k(0); k < 6; ++k)
-			prism_nodes[k] = nodes[idx[k]];
-		elem = new MeshLib::Prism(prism_nodes);
-		break;
-	}
-	default:
-		elem = NULL;
-		break;
-	}
-
-	delete [] idx;
-
-	return elem;
+    std::string elem_type_str("");
+    MeshLib::MeshElemType elem_type (MeshLib::MeshElemType::INVALID);
+
+    do {
+        if (!(in >> elem_type_str))
+            return nullptr;
+        elem_type = MeshLib::String2MeshElemType(elem_type_str);
+    } while (elem_type == MeshLib::MeshElemType::INVALID);
+
+    unsigned* idx = new unsigned[8];
+    MeshLib::Element* elem;
+
+    switch(elem_type)
+    {
+    case MeshLib::MeshElemType::LINE: {
+        for (int i = 0; i < 2; ++i)
+            if (!(in >> idx[i]))
+                return nullptr;
+        // edge_nodes array will be deleted from Line object
+        MeshLib::Node** edge_nodes = new MeshLib::Node*[2];
+        for (unsigned k(0); k < 2; ++k)
+            edge_nodes[k] = nodes[idx[k]];
+        elem = new MeshLib::Line(edge_nodes);
+        break;
+    }
+    case MeshLib::MeshElemType::TRIANGLE: {
+        for (int i = 0; i < 3; ++i)
+            if (!(in >> idx[i]))
+                return nullptr;
+        MeshLib::Node** tri_nodes = new MeshLib::Node*[3];
+        for (unsigned k(0); k < 3; ++k)
+            tri_nodes[k] = nodes[idx[k]];
+        elem = new MeshLib::Tri(tri_nodes);
+        break;
+    }
+    case MeshLib::MeshElemType::QUAD: {
+        for (int i = 0; i < 4; ++i)
+            if (!(in >> idx[i]))
+                return nullptr;
+        MeshLib::Node** quad_nodes = new MeshLib::Node*[4];
+        for (unsigned k(0); k < 4; ++k)
+            quad_nodes[k] = nodes[idx[k]];
+        elem = new MeshLib::Quad(quad_nodes);
+        break;
+    }
+    case MeshLib::MeshElemType::TETRAHEDRON: {
+        for (int i = 0; i < 4; ++i)
+            if (!(in >> idx[i]))
+                return nullptr;
+        MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
+        for (unsigned k(0); k < 4; ++k)
+            tet_nodes[k] = nodes[idx[k]];
+        elem = new MeshLib::Tet(tet_nodes);
+        break;
+    }
+    case MeshLib::MeshElemType::HEXAHEDRON: {
+        for (int i = 0; i < 8; ++i)
+            if (!(in >> idx[i]))
+                return nullptr;
+        MeshLib::Node** hex_nodes = new MeshLib::Node*[8];
+        for (unsigned k(0); k < 8; ++k)
+            hex_nodes[k] = nodes[idx[k]];
+        elem = new MeshLib::Hex(hex_nodes);
+        break;
+    }
+    case MeshLib::MeshElemType::PYRAMID: {
+        for (int i = 0; i < 5; ++i)
+            if (!(in >> idx[i]))
+                return nullptr;
+        MeshLib::Node** pyramid_nodes = new MeshLib::Node*[5];
+        for (unsigned k(0); k < 5; ++k)
+            pyramid_nodes[k] = nodes[idx[k]];
+        elem = new MeshLib::Pyramid(pyramid_nodes);
+        break;
+    }
+    case MeshLib::MeshElemType::PRISM: {
+        for (int i = 0; i < 6; ++i)
+            if (!(in >> idx[i]))
+                return nullptr;
+        MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
+        for (unsigned k(0); k < 6; ++k)
+            prism_nodes[k] = nodes[idx[k]];
+        elem = new MeshLib::Prism(prism_nodes);
+        break;
+    }
+    default:
+        elem = NULL;
+        break;
+    }
+
+    delete [] idx;
+
+    return elem;
 }
 
 bool MeshIO::write()
 {
-	if(!_mesh) {
-		WARN("MeshIO::write(): Cannot write: no mesh object specified.");
-		return false;
-	}
-
-	_out << "#FEM_MSH\n"
-		<< "$PCS_TYPE\n"
-		<< "  NO_PCS\n"
-		<< "$NODES\n"
-		<< "  ";
-	const std::size_t n_nodes(_mesh->getNNodes());
-	_out << n_nodes << "\n";
-	for (std::size_t i(0); i < n_nodes; ++i) {
-		_out << i << " " << *(_mesh->getNode(i)) << "\n";
-	}
-
-	_out << "$ELEMENTS\n"
-		<< "  ";
-
-	boost::optional<MeshLib::PropertyVector<int> const&>
-		materials(_mesh->getProperties().getPropertyVector<int>("MaterialIDs"));
-	writeElements(_mesh->getElements(), materials, _out);
-
-	_out << "#STOP\n";
-
-	return true;
+    if(!_mesh) {
+        WARN("MeshIO::write(): Cannot write: no mesh object specified.");
+        return false;
+    }
+
+    _out << "#FEM_MSH\n"
+        << "$PCS_TYPE\n"
+        << "  NO_PCS\n"
+        << "$NODES\n"
+        << "  ";
+    const std::size_t n_nodes(_mesh->getNNodes());
+    _out << n_nodes << "\n";
+    for (std::size_t i(0); i < n_nodes; ++i) {
+        _out << i << " " << *(_mesh->getNode(i)) << "\n";
+    }
+
+    _out << "$ELEMENTS\n"
+        << "  ";
+
+    boost::optional<MeshLib::PropertyVector<int> const&>
+        materials(_mesh->getProperties().getPropertyVector<int>("MaterialIDs"));
+    writeElements(_mesh->getElements(), materials, _out);
+
+    _out << "#STOP\n";
+
+    return true;
 }
 
 void MeshIO::setMesh(const MeshLib::Mesh* mesh)
 {
-	_mesh = mesh;
+    _mesh = mesh;
 }
 
 void MeshIO::writeElements(std::vector<MeshLib::Element*> const& ele_vec,
-	boost::optional<MeshLib::PropertyVector<int> const&> material_ids,
-	std::ostream &out) const
+    boost::optional<MeshLib::PropertyVector<int> const&> material_ids,
+    std::ostream &out) const
 {
-	const std::size_t ele_vector_size (ele_vec.size());
-
-	out << ele_vector_size << "\n";
-	for (std::size_t i(0); i < ele_vector_size; ++i) {
-		out << i << " ";
-		if (! material_ids)
-			out << "0 ";
-		else
-			out << (*material_ids)[i] << " ";
-		out << this->ElemType2StringOutput(ele_vec[i]->getGeomType()) << " ";
-		unsigned nElemNodes (ele_vec[i]->getNBaseNodes());
-		for(std::size_t j = 0; j < nElemNodes; ++j)
-			out << ele_vec[i]->getNode(j)->getID() << " ";
-		out << "\n";
-	}
+    const std::size_t ele_vector_size (ele_vec.size());
+
+    out << ele_vector_size << "\n";
+    for (std::size_t i(0); i < ele_vector_size; ++i) {
+        out << i << " ";
+        if (! material_ids)
+            out << "0 ";
+        else
+            out << (*material_ids)[i] << " ";
+        out << this->ElemType2StringOutput(ele_vec[i]->getGeomType()) << " ";
+        unsigned nElemNodes (ele_vec[i]->getNBaseNodes());
+        for(std::size_t j = 0; j < nElemNodes; ++j)
+            out << ele_vec[i]->getNode(j)->getID() << " ";
+        out << "\n";
+    }
 }
 
 std::string MeshIO::ElemType2StringOutput(const MeshLib::MeshElemType t) const
 {
-	if (t == MeshLib::MeshElemType::LINE)
-		return "line";
-	if (t == MeshLib::MeshElemType::QUAD)
-		return "quad";
-	if (t == MeshLib::MeshElemType::HEXAHEDRON)
-		return "hex";
-	if (t == MeshLib::MeshElemType::TRIANGLE)
-		return "tri";
-	if (t == MeshLib::MeshElemType::TETRAHEDRON)
-		return "tet";
-	if (t == MeshLib::MeshElemType::PRISM)
-		return "pris";
-	if (t == MeshLib::MeshElemType::PYRAMID)
-		return "pyra";
-	return "none";
+    if (t == MeshLib::MeshElemType::LINE)
+        return "line";
+    if (t == MeshLib::MeshElemType::QUAD)
+        return "quad";
+    if (t == MeshLib::MeshElemType::HEXAHEDRON)
+        return "hex";
+    if (t == MeshLib::MeshElemType::TRIANGLE)
+        return "tri";
+    if (t == MeshLib::MeshElemType::TETRAHEDRON)
+        return "tet";
+    if (t == MeshLib::MeshElemType::PRISM)
+        return "pris";
+    if (t == MeshLib::MeshElemType::PYRAMID)
+        return "pyra";
+    return "none";
 }
 
 } // end namespace Legacy
diff --git a/MeshLib/IO/Legacy/MeshIO.h b/MeshLib/IO/Legacy/MeshIO.h
index 69369c9066f..8ee1970b949 100644
--- a/MeshLib/IO/Legacy/MeshIO.h
+++ b/MeshLib/IO/Legacy/MeshIO.h
@@ -39,30 +39,30 @@ namespace Legacy
 class MeshIO : public BaseLib::IO::Writer
 {
 public:
-	/// Constructor.
-	MeshIO();
+    /// Constructor.
+    MeshIO();
 
-	virtual ~MeshIO() {}
+    virtual ~MeshIO() {}
 
-	/// Read mesh from file.
-	MeshLib::Mesh* loadMeshFromFile(const std::string& fileName);
+    /// Read mesh from file.
+    MeshLib::Mesh* loadMeshFromFile(const std::string& fileName);
 
-	/// Set mesh for writing.
-	void setMesh(const MeshLib::Mesh*  mesh);
+    /// Set mesh for writing.
+    void setMesh(const MeshLib::Mesh*  mesh);
 
 protected:
-	/// Write mesh to stream.
-	bool write();
+    /// Write mesh to stream.
+    bool write();
 
 private:
-	void writeElements(std::vector<MeshLib::Element*> const& ele_vec,
-		boost::optional<MeshLib::PropertyVector<int> const&> material_ids,
-		std::ostream &out) const;
-	std::size_t readMaterialID(std::istream & in) const;
-	MeshLib::Element* readElement(std::istream& line, const std::vector<MeshLib::Node*> &nodes) const;
-	std::string ElemType2StringOutput(const MeshLib::MeshElemType t) const;
+    void writeElements(std::vector<MeshLib::Element*> const& ele_vec,
+        boost::optional<MeshLib::PropertyVector<int> const&> material_ids,
+        std::ostream &out) const;
+    std::size_t readMaterialID(std::istream & in) const;
+    MeshLib::Element* readElement(std::istream& line, const std::vector<MeshLib::Node*> &nodes) const;
+    std::string ElemType2StringOutput(const MeshLib::MeshElemType t) const;
 
-	const MeshLib::Mesh* _mesh;
+    const MeshLib::Mesh* _mesh;
 
 };  /* class */
 
diff --git a/MeshLib/IO/VtkIO/VtuInterface-impl.h b/MeshLib/IO/VtkIO/VtuInterface-impl.h
index f87f71f9437..72a76eb8a0d 100644
--- a/MeshLib/IO/VtkIO/VtuInterface-impl.h
+++ b/MeshLib/IO/VtkIO/VtuInterface-impl.h
@@ -34,48 +34,48 @@ namespace IO
 template<typename UnstructuredGridWriter>
 bool VtuInterface::writeVTU(std::string const &file_name, const int num_partitions)
 {
-	if(!_mesh)
-	{
-		ERR("VtuInterface::write(): No mesh specified.");
-		return false;
-	}
+    if(!_mesh)
+    {
+        ERR("VtuInterface::write(): No mesh specified.");
+        return false;
+    }
 
-	// See http://www.paraview.org/Bug/view.php?id=13382
-	if(_data_mode == vtkXMLWriter::Appended)
-		WARN("Appended data mode is currently not supported, written file is not valid!");
+    // See http://www.paraview.org/Bug/view.php?id=13382
+    if(_data_mode == vtkXMLWriter::Appended)
+        WARN("Appended data mode is currently not supported, written file is not valid!");
 
-	vtkNew<InSituLib::VtkMappedMeshSource> vtkSource;
-	vtkSource->SetMesh(_mesh);
+    vtkNew<InSituLib::VtkMappedMeshSource> vtkSource;
+    vtkSource->SetMesh(_mesh);
 
-	vtkSmartPointer<UnstructuredGridWriter> vtuWriter =
-		vtkSmartPointer<UnstructuredGridWriter>::New();
+    vtkSmartPointer<UnstructuredGridWriter> vtuWriter =
+        vtkSmartPointer<UnstructuredGridWriter>::New();
 
-	vtuWriter->SetInputConnection(vtkSource->GetOutputPort());
+    vtuWriter->SetInputConnection(vtkSource->GetOutputPort());
 
-	if(_use_compressor && num_partitions == 0)
-		vtuWriter->SetCompressorTypeToZLib();
+    if(_use_compressor && num_partitions == 0)
+        vtuWriter->SetCompressorTypeToZLib();
 
-	vtuWriter->SetDataMode(_data_mode);
-	if (_data_mode == vtkXMLWriter::Appended)
-		vtuWriter->SetEncodeAppendedData(1);
-	if (_data_mode == vtkXMLWriter::Ascii)
-	{
-		// Mapped data structures for OGS to VTK mesh conversion are not fully
-		// implemented and doing so is not trivial. Therefore for ascii output
-		// the mapped unstructured grid is copied to a regular VTK grid.
-		// See http://www.vtk.org/pipermail/vtkusers/2014-October/089400.html
-		vtkSource->Update();
-		vtkSmartPointer<vtkUnstructuredGrid> tempGrid =
-			vtkSmartPointer<vtkUnstructuredGrid>::New();
-		tempGrid->DeepCopy(vtkSource->GetOutput());
-		vtuWriter->SetInputDataObject(tempGrid);
-	}
+    vtuWriter->SetDataMode(_data_mode);
+    if (_data_mode == vtkXMLWriter::Appended)
+        vtuWriter->SetEncodeAppendedData(1);
+    if (_data_mode == vtkXMLWriter::Ascii)
+    {
+        // Mapped data structures for OGS to VTK mesh conversion are not fully
+        // implemented and doing so is not trivial. Therefore for ascii output
+        // the mapped unstructured grid is copied to a regular VTK grid.
+        // See http://www.vtk.org/pipermail/vtkusers/2014-October/089400.html
+        vtkSource->Update();
+        vtkSmartPointer<vtkUnstructuredGrid> tempGrid =
+            vtkSmartPointer<vtkUnstructuredGrid>::New();
+        tempGrid->DeepCopy(vtkSource->GetOutput());
+        vtuWriter->SetInputDataObject(tempGrid);
+    }
 
-	vtuWriter->SetFileName(file_name.c_str());
-	if (num_partitions > 0)
-		vtuWriter->SetNumberOfPieces(num_partitions);
+    vtuWriter->SetFileName(file_name.c_str());
+    if (num_partitions > 0)
+        vtuWriter->SetNumberOfPieces(num_partitions);
 
-	return (vtuWriter->Write() > 0);
+    return (vtuWriter->Write() > 0);
 }
 
 } // end namespace IO
diff --git a/MeshLib/IO/VtkIO/VtuInterface.cpp b/MeshLib/IO/VtkIO/VtuInterface.cpp
index 014e58215eb..eeb68c27bc9 100644
--- a/MeshLib/IO/VtkIO/VtuInterface.cpp
+++ b/MeshLib/IO/VtkIO/VtuInterface.cpp
@@ -41,12 +41,12 @@ namespace IO
 {
 
 VtuInterface::VtuInterface(const MeshLib::Mesh* mesh, int dataMode, bool compress) :
-	_mesh(mesh), _data_mode(dataMode), _use_compressor(compress)
+    _mesh(mesh), _data_mode(dataMode), _use_compressor(compress)
 {
-	if(_data_mode == vtkXMLWriter::Appended)
-		ERR("Appended data mode is currently not supported!");
-	if(_data_mode == vtkXMLWriter::Ascii && compress)
-		WARN("Ascii data cannot be compressed, ignoring compression flag.")
+    if(_data_mode == vtkXMLWriter::Appended)
+        ERR("Appended data mode is currently not supported!");
+    if(_data_mode == vtkXMLWriter::Ascii && compress)
+        WARN("Ascii data cannot be compressed, ignoring compression flag.")
 }
 
 VtuInterface::~VtuInterface()
@@ -54,53 +54,53 @@ VtuInterface::~VtuInterface()
 
 MeshLib::Mesh* VtuInterface::readVTUFile(std::string const &file_name)
 {
-	if (!BaseLib::IsFileExisting(file_name)) {
-		ERR("File \"%s\" does not exist.", file_name.c_str());
-		return nullptr;
-	}
-
-	vtkSmartPointer<vtkXMLUnstructuredGridReader> reader =
-		vtkSmartPointer<vtkXMLUnstructuredGridReader>::New();
-	reader->SetFileName(file_name.c_str());
-	reader->Update();
-
-	vtkUnstructuredGrid* vtkGrid = reader->GetOutput();
-	if (vtkGrid->GetNumberOfPoints() == 0)
-		return nullptr;
-
-	std::string const mesh_name (BaseLib::extractBaseNameWithoutExtension(file_name));
-	return MeshLib::VtkMeshConverter::convertUnstructuredGrid(vtkGrid, mesh_name);
+    if (!BaseLib::IsFileExisting(file_name)) {
+        ERR("File \"%s\" does not exist.", file_name.c_str());
+        return nullptr;
+    }
+
+    vtkSmartPointer<vtkXMLUnstructuredGridReader> reader =
+        vtkSmartPointer<vtkXMLUnstructuredGridReader>::New();
+    reader->SetFileName(file_name.c_str());
+    reader->Update();
+
+    vtkUnstructuredGrid* vtkGrid = reader->GetOutput();
+    if (vtkGrid->GetNumberOfPoints() == 0)
+        return nullptr;
+
+    std::string const mesh_name (BaseLib::extractBaseNameWithoutExtension(file_name));
+    return MeshLib::VtkMeshConverter::convertUnstructuredGrid(vtkGrid, mesh_name);
 }
 
 bool VtuInterface::writeToFile(std::string const &file_name)
 {
 #ifdef USE_PETSC
-	// Also for other approach with DDC.
-	// In such case, a MPI_Comm argument is need to this member,
-	// and PETSC_COMM_WORLD should be replaced with the argument.
-	int mpi_rank;
-	MPI_Comm_rank(PETSC_COMM_WORLD, &mpi_rank);
-	const std::string file_name_base = boost::erase_last_copy(file_name, ".vtu");
-
-	const std::string file_name_rank = file_name_base + "_"
-	                                   + std::to_string(mpi_rank) + ".vtu";
-	const bool vtu_status_i = writeVTU<vtkXMLUnstructuredGridWriter>(file_name_rank);
-	bool vtu_status = false;
-	MPI_Allreduce(&vtu_status_i, &vtu_status, 1, MPI_C_BOOL, MPI_LAND, PETSC_COMM_WORLD);
-
-	int mpi_size;
-	MPI_Comm_size(PETSC_COMM_WORLD, &mpi_size);
-	bool pvtu_status = false;
-	if (mpi_rank == 0)
-	{
-		pvtu_status = writeVTU<vtkXMLPUnstructuredGridWriter>(file_name_base + ".pvtu", mpi_size);
-	}
-	MPI_Bcast(&pvtu_status, 1, MPI_C_BOOL, 0, PETSC_COMM_WORLD);
-
-	return vtu_status && pvtu_status;
+    // Also for other approach with DDC.
+    // In such case, a MPI_Comm argument is need to this member,
+    // and PETSC_COMM_WORLD should be replaced with the argument.
+    int mpi_rank;
+    MPI_Comm_rank(PETSC_COMM_WORLD, &mpi_rank);
+    const std::string file_name_base = boost::erase_last_copy(file_name, ".vtu");
+
+    const std::string file_name_rank = file_name_base + "_"
+                                       + std::to_string(mpi_rank) + ".vtu";
+    const bool vtu_status_i = writeVTU<vtkXMLUnstructuredGridWriter>(file_name_rank);
+    bool vtu_status = false;
+    MPI_Allreduce(&vtu_status_i, &vtu_status, 1, MPI_C_BOOL, MPI_LAND, PETSC_COMM_WORLD);
+
+    int mpi_size;
+    MPI_Comm_size(PETSC_COMM_WORLD, &mpi_size);
+    bool pvtu_status = false;
+    if (mpi_rank == 0)
+    {
+        pvtu_status = writeVTU<vtkXMLPUnstructuredGridWriter>(file_name_base + ".pvtu", mpi_size);
+    }
+    MPI_Bcast(&pvtu_status, 1, MPI_C_BOOL, 0, PETSC_COMM_WORLD);
+
+    return vtu_status && pvtu_status;
 
 #else
-	return writeVTU<vtkXMLUnstructuredGridWriter>(file_name);
+    return writeVTU<vtkXMLUnstructuredGridWriter>(file_name);
 #endif
 }
 } // end namespace IO
diff --git a/MeshLib/IO/VtkIO/VtuInterface.h b/MeshLib/IO/VtkIO/VtuInterface.h
index 6408d0034af..8b28b745832 100644
--- a/MeshLib/IO/VtkIO/VtuInterface.h
+++ b/MeshLib/IO/VtkIO/VtuInterface.h
@@ -32,28 +32,28 @@ namespace IO
 class VtuInterface
 {
 public:
-	/// Provide the mesh to write and set if compression should be used.
-	VtuInterface(const MeshLib::Mesh* mesh, int dataMode = vtkXMLWriter::Binary, bool compressed = false);
-	~VtuInterface();
+    /// Provide the mesh to write and set if compression should be used.
+    VtuInterface(const MeshLib::Mesh* mesh, int dataMode = vtkXMLWriter::Binary, bool compressed = false);
+    ~VtuInterface();
 
-	/// Read an unstructured grid from a VTU file
-	/// \return The converted mesh or a nullptr if reading failed
-	static MeshLib::Mesh* readVTUFile(std::string const &file_name);
+    /// Read an unstructured grid from a VTU file
+    /// \return The converted mesh or a nullptr if reading failed
+    static MeshLib::Mesh* readVTUFile(std::string const &file_name);
 
-	/// Writes the given mesh to file.
-	/// \return True on success, false on error
-	bool writeToFile(std::string const &file_name);
+    /// Writes the given mesh to file.
+    /// \return True on success, false on error
+    bool writeToFile(std::string const &file_name);
 
-	/// Writes the given mesh to vtu file.
-	/// \param file_name      File name.
-	/// \param num_partitions Number of partiions to be merged.
-	/// \return True on success, false on error
-	template<typename UnstructuredGridWriter> bool writeVTU(std::string const &file_name, const int num_partitions = 1);
+    /// Writes the given mesh to vtu file.
+    /// \param file_name      File name.
+    /// \param num_partitions Number of partiions to be merged.
+    /// \return True on success, false on error
+    template<typename UnstructuredGridWriter> bool writeVTU(std::string const &file_name, const int num_partitions = 1);
 
 private:
-	const MeshLib::Mesh* _mesh;
-	int _data_mode;
-	bool _use_compressor;
+    const MeshLib::Mesh* _mesh;
+    int _data_mode;
+    bool _use_compressor;
 };
 
 } // end namespace IO
diff --git a/MeshLib/IO/readMeshFromFile.cpp b/MeshLib/IO/readMeshFromFile.cpp
index 0c84f973d8b..f76cb53320e 100644
--- a/MeshLib/IO/readMeshFromFile.cpp
+++ b/MeshLib/IO/readMeshFromFile.cpp
@@ -45,21 +45,21 @@ namespace IO
 MeshLib::Mesh* readMeshFromFile(const std::string &file_name)
 {
 #ifdef USE_PETSC
-	MeshLib::IO::NodePartitionedMeshReader read_pmesh(PETSC_COMM_WORLD);
-	const std::string file_name_base = BaseLib::dropFileExtension(file_name);
-	return read_pmesh.read(file_name_base);
+    MeshLib::IO::NodePartitionedMeshReader read_pmesh(PETSC_COMM_WORLD);
+    const std::string file_name_base = BaseLib::dropFileExtension(file_name);
+    return read_pmesh.read(file_name_base);
 #else
-	if (BaseLib::hasFileExtension("msh", file_name))
-	{
-		MeshLib::IO::Legacy::MeshIO meshIO;
-		return meshIO.loadMeshFromFile(file_name);
-	}
+    if (BaseLib::hasFileExtension("msh", file_name))
+    {
+        MeshLib::IO::Legacy::MeshIO meshIO;
+        return meshIO.loadMeshFromFile(file_name);
+    }
 
-	if (BaseLib::hasFileExtension("vtu", file_name))
-		return MeshLib::IO::VtuInterface::readVTUFile(file_name);
+    if (BaseLib::hasFileExtension("vtu", file_name))
+        return MeshLib::IO::VtuInterface::readVTUFile(file_name);
 
-	ERR("readMeshFromFile(): Unknown mesh file format in file %s.", file_name.c_str());
-	return nullptr;
+    ERR("readMeshFromFile(): Unknown mesh file format in file %s.", file_name.c_str());
+    return nullptr;
 #endif
 }
 } // end namespace IO
diff --git a/MeshLib/IO/writeMeshToFile.cpp b/MeshLib/IO/writeMeshToFile.cpp
index e15e9cb6ae2..df6d557b25d 100644
--- a/MeshLib/IO/writeMeshToFile.cpp
+++ b/MeshLib/IO/writeMeshToFile.cpp
@@ -24,17 +24,17 @@ namespace IO
 {
 void writeMeshToFile(const MeshLib::Mesh &mesh, const std::string &file_name)
 {
-	if (BaseLib::hasFileExtension("msh", file_name))
-	{
-		MeshLib::IO::Legacy::MeshIO meshIO;
-		meshIO.setMesh(&mesh);
-		meshIO.writeToFile(file_name);
-	} else if (BaseLib::hasFileExtension("vtu", file_name)) {
-		MeshLib::IO::VtuInterface writer(&mesh);
-		writer.writeToFile(file_name);
-	} else {
-		ERR("writeMeshToFile(): Unknown mesh file format in file %s.", file_name.c_str());
-	}
+    if (BaseLib::hasFileExtension("msh", file_name))
+    {
+        MeshLib::IO::Legacy::MeshIO meshIO;
+        meshIO.setMesh(&mesh);
+        meshIO.writeToFile(file_name);
+    } else if (BaseLib::hasFileExtension("vtu", file_name)) {
+        MeshLib::IO::VtuInterface writer(&mesh);
+        writer.writeToFile(file_name);
+    } else {
+        ERR("writeMeshToFile(): Unknown mesh file format in file %s.", file_name.c_str());
+    }
 }
 
 } // end namespace IO
diff --git a/MeshLib/Mesh.cpp b/MeshLib/Mesh.cpp
index 909a08c77c8..5aecd5595bb 100644
--- a/MeshLib/Mesh.cpp
+++ b/MeshLib/Mesh.cpp
@@ -32,243 +32,243 @@ Mesh::Mesh(const std::string &name,
            const std::vector<Element*> &elements,
            Properties const& properties,
            const std::size_t n_base_nodes)
-	: _id(_counter_value-1), _mesh_dimension(0),
-	  _edge_length(std::numeric_limits<double>::max(), 0),
-	  _node_distance(std::numeric_limits<double>::max(), 0),
-	  _name(name), _nodes(nodes), _elements(elements),
-	  _n_base_nodes(n_base_nodes==0 ? nodes.size() : n_base_nodes),
-	  _properties(properties)
+    : _id(_counter_value-1), _mesh_dimension(0),
+      _edge_length(std::numeric_limits<double>::max(), 0),
+      _node_distance(std::numeric_limits<double>::max(), 0),
+      _name(name), _nodes(nodes), _elements(elements),
+      _n_base_nodes(n_base_nodes==0 ? nodes.size() : n_base_nodes),
+      _properties(properties)
 {
-	assert(n_base_nodes <= nodes.size());
-	this->resetNodeIDs();
-	this->resetElementIDs();
-	this->setDimension();
-	this->setElementsConnectedToNodes();
-	//this->setNodesConnectedByEdges();
-	this->setNodesConnectedByElements();
-	this->setElementNeighbors();
-
-	this->calcEdgeLengthRange();
-	this->calcNodeDistanceRange();
+    assert(n_base_nodes <= nodes.size());
+    this->resetNodeIDs();
+    this->resetElementIDs();
+    this->setDimension();
+    this->setElementsConnectedToNodes();
+    //this->setNodesConnectedByEdges();
+    this->setNodesConnectedByElements();
+    this->setElementNeighbors();
+
+    this->calcEdgeLengthRange();
+    this->calcNodeDistanceRange();
 }
 
 Mesh::Mesh(const Mesh &mesh)
-	: _id(_counter_value-1), _mesh_dimension(mesh.getDimension()),
-	  _edge_length(mesh._edge_length.first, mesh._edge_length.second),
-	  _node_distance(mesh._node_distance.first, mesh._node_distance.second),
-	  _name(mesh.getName()), _nodes(mesh.getNNodes()), _elements(mesh.getNElements()),
-	  _n_base_nodes(mesh.getNBaseNodes()),
-	  _properties(mesh._properties)
+    : _id(_counter_value-1), _mesh_dimension(mesh.getDimension()),
+      _edge_length(mesh._edge_length.first, mesh._edge_length.second),
+      _node_distance(mesh._node_distance.first, mesh._node_distance.second),
+      _name(mesh.getName()), _nodes(mesh.getNNodes()), _elements(mesh.getNElements()),
+      _n_base_nodes(mesh.getNBaseNodes()),
+      _properties(mesh._properties)
 {
-	const std::vector<Node*> nodes (mesh.getNodes());
-	const std::size_t nNodes (nodes.size());
-	for (unsigned i=0; i<nNodes; ++i)
-		_nodes[i] = new Node(*nodes[i]);
-
-	const std::vector<Element*> elements (mesh.getElements());
-	const std::size_t nElements (elements.size());
-	for (unsigned i=0; i<nElements; ++i)
-	{
-		const std::size_t nElemNodes = elements[i]->getNBaseNodes();
-		_elements[i] = elements[i]->clone();
-		for (unsigned j=0; j<nElemNodes; ++j)
-			_elements[i]->_nodes[j] = _nodes[elements[i]->getNode(j)->getID()];
-	}
-
-	if (_mesh_dimension==0) this->setDimension();
-	this->setElementsConnectedToNodes();
-	//this->setNodesConnectedByEdges();
-	//this->setNodesConnectedByElements();
-	this->setElementNeighbors();
+    const std::vector<Node*> nodes (mesh.getNodes());
+    const std::size_t nNodes (nodes.size());
+    for (unsigned i=0; i<nNodes; ++i)
+        _nodes[i] = new Node(*nodes[i]);
+
+    const std::vector<Element*> elements (mesh.getElements());
+    const std::size_t nElements (elements.size());
+    for (unsigned i=0; i<nElements; ++i)
+    {
+        const std::size_t nElemNodes = elements[i]->getNBaseNodes();
+        _elements[i] = elements[i]->clone();
+        for (unsigned j=0; j<nElemNodes; ++j)
+            _elements[i]->_nodes[j] = _nodes[elements[i]->getNode(j)->getID()];
+    }
+
+    if (_mesh_dimension==0) this->setDimension();
+    this->setElementsConnectedToNodes();
+    //this->setNodesConnectedByEdges();
+    //this->setNodesConnectedByElements();
+    this->setElementNeighbors();
 }
 
 Mesh::~Mesh()
 {
-	const std::size_t nElements (_elements.size());
-	for (std::size_t i=0; i<nElements; ++i)
-		delete _elements[i];
+    const std::size_t nElements (_elements.size());
+    for (std::size_t i=0; i<nElements; ++i)
+        delete _elements[i];
 
-	const std::size_t nNodes (_nodes.size());
-	for (std::size_t i=0; i<nNodes; ++i)
-		delete _nodes[i];
+    const std::size_t nNodes (_nodes.size());
+    for (std::size_t i=0; i<nNodes; ++i)
+        delete _nodes[i];
 }
 
 void Mesh::addNode(Node* node)
 {
-	_nodes.push_back(node);
+    _nodes.push_back(node);
 }
 
 void Mesh::addElement(Element* elem)
 {
-	_elements.push_back(elem);
+    _elements.push_back(elem);
 
-	// add element information to nodes
-	unsigned nNodes (elem->getNBaseNodes());
-	for (unsigned i=0; i<nNodes; ++i)
-		elem->_nodes[i]->addElement(elem);
+    // add element information to nodes
+    unsigned nNodes (elem->getNBaseNodes());
+    for (unsigned i=0; i<nNodes; ++i)
+        elem->_nodes[i]->addElement(elem);
 }
 
 void Mesh::resetNodeIDs()
 {
-	const std::size_t nNodes (this->_nodes.size());
-	for (unsigned i=0; i<nNodes; ++i)
-		_nodes[i]->setID(i);
+    const std::size_t nNodes (this->_nodes.size());
+    for (unsigned i=0; i<nNodes; ++i)
+        _nodes[i]->setID(i);
 }
 
 void Mesh::resetElementIDs()
 {
-	const std::size_t nElements (this->_elements.size());
-	for (unsigned i=0; i<nElements; ++i)
-		_elements[i]->setID(i);
+    const std::size_t nElements (this->_elements.size());
+    for (unsigned i=0; i<nElements; ++i)
+        _elements[i]->setID(i);
 }
 
 void Mesh::setDimension()
 {
-	const std::size_t nElements (_elements.size());
-	for (unsigned i=0; i<nElements; ++i)
-		if (_elements[i]->getDimension() > _mesh_dimension)
-			_mesh_dimension = _elements[i]->getDimension();
+    const std::size_t nElements (_elements.size());
+    for (unsigned i=0; i<nElements; ++i)
+        if (_elements[i]->getDimension() > _mesh_dimension)
+            _mesh_dimension = _elements[i]->getDimension();
 }
 
 void Mesh::setElementsConnectedToNodes()
 {
-	for (auto e = _elements.begin(); e != _elements.end(); ++e)
-	{
-		const unsigned nNodes ((*e)->getNBaseNodes());
-		for (unsigned j=0; j<nNodes; ++j)
-			(*e)->_nodes[j]->addElement(*e);
-	}
+    for (auto e = _elements.begin(); e != _elements.end(); ++e)
+    {
+        const unsigned nNodes ((*e)->getNBaseNodes());
+        for (unsigned j=0; j<nNodes; ++j)
+            (*e)->_nodes[j]->addElement(*e);
+    }
 }
 
 void Mesh::resetElementsConnectedToNodes()
 {
-	for (auto node = _nodes.begin(); node != _nodes.end(); ++node)
-		if (*node)
-			(*node)->clearElements();
-	this->setElementsConnectedToNodes();
+    for (auto node = _nodes.begin(); node != _nodes.end(); ++node)
+        if (*node)
+            (*node)->clearElements();
+    this->setElementsConnectedToNodes();
 }
 
 void Mesh::calcEdgeLengthRange()
 {
-	this->_edge_length.first  = std::numeric_limits<double>::max();
-	this->_edge_length.second = 0;
-	double min_length(0);
-	double max_length(0);
-	const std::size_t nElems (this->getNElements());
-	for (std::size_t i=0; i<nElems; ++i)
-	{
-		_elements[i]->computeSqrEdgeLengthRange(min_length, max_length);
-		this->_edge_length.first  = std::min(this->_edge_length.first,  min_length);
-		this->_edge_length.second = std::max(this->_edge_length.second, max_length);
-	}
-	this->_edge_length.first  = sqrt(this->_edge_length.first);
-	this->_edge_length.second = sqrt(this->_edge_length.second);
+    this->_edge_length.first  = std::numeric_limits<double>::max();
+    this->_edge_length.second = 0;
+    double min_length(0);
+    double max_length(0);
+    const std::size_t nElems (this->getNElements());
+    for (std::size_t i=0; i<nElems; ++i)
+    {
+        _elements[i]->computeSqrEdgeLengthRange(min_length, max_length);
+        this->_edge_length.first  = std::min(this->_edge_length.first,  min_length);
+        this->_edge_length.second = std::max(this->_edge_length.second, max_length);
+    }
+    this->_edge_length.first  = sqrt(this->_edge_length.first);
+    this->_edge_length.second = sqrt(this->_edge_length.second);
 }
 
 void Mesh::calcNodeDistanceRange()
 {
-	this->_node_distance.first  = std::numeric_limits<double>::max();
-	this->_node_distance.second = 0;
-	double min_length(0);
-	double max_length(0);
-	const std::size_t nElems (this->getNElements());
-	for (std::size_t i=0; i<nElems; ++i)
-	{
-		_elements[i]->computeSqrNodeDistanceRange(min_length, max_length);
-		this->_node_distance.first  = std::min(this->_node_distance.first,  min_length);
-		this->_node_distance.second = std::max(this->_node_distance.second, max_length);
-	}
-	this->_node_distance.first  = sqrt(this->_node_distance.first);
-	this->_node_distance.second = sqrt(this->_node_distance.second);
+    this->_node_distance.first  = std::numeric_limits<double>::max();
+    this->_node_distance.second = 0;
+    double min_length(0);
+    double max_length(0);
+    const std::size_t nElems (this->getNElements());
+    for (std::size_t i=0; i<nElems; ++i)
+    {
+        _elements[i]->computeSqrNodeDistanceRange(min_length, max_length);
+        this->_node_distance.first  = std::min(this->_node_distance.first,  min_length);
+        this->_node_distance.second = std::max(this->_node_distance.second, max_length);
+    }
+    this->_node_distance.first  = sqrt(this->_node_distance.first);
+    this->_node_distance.second = sqrt(this->_node_distance.second);
 }
 
 void Mesh::setElementNeighbors()
 {
-	std::vector<Element*> neighbors;
-	for (auto it = _elements.begin(); it != _elements.end(); ++it)
-	{
-		// create vector with all elements connected to current element (includes lots of doubles!)
-		Element *const element = *it;
-
-		const std::size_t nNodes (element->getNBaseNodes());
-		for (unsigned n(0); n<nNodes; ++n)
-		{
-			std::vector<Element*> const& conn_elems ((element->getNode(n)->getElements()));
-			neighbors.insert(neighbors.end(), conn_elems.begin(), conn_elems.end());
-		}
-		std::sort(neighbors.begin(), neighbors.end());
-		auto const neighbors_new_end = std::unique(neighbors.begin(), neighbors.end());
-
-		for (auto neighbor = neighbors.begin(); neighbor != neighbors_new_end; ++neighbor)
-		{
-			boost::optional<unsigned> const opposite_face_id = element->addNeighbor(*neighbor);
-			if (opposite_face_id)
-			{
-				(*neighbor)->setNeighbor(element, *opposite_face_id);
-			}
-		}
-		neighbors.clear();
-	}
+    std::vector<Element*> neighbors;
+    for (auto it = _elements.begin(); it != _elements.end(); ++it)
+    {
+        // create vector with all elements connected to current element (includes lots of doubles!)
+        Element *const element = *it;
+
+        const std::size_t nNodes (element->getNBaseNodes());
+        for (unsigned n(0); n<nNodes; ++n)
+        {
+            std::vector<Element*> const& conn_elems ((element->getNode(n)->getElements()));
+            neighbors.insert(neighbors.end(), conn_elems.begin(), conn_elems.end());
+        }
+        std::sort(neighbors.begin(), neighbors.end());
+        auto const neighbors_new_end = std::unique(neighbors.begin(), neighbors.end());
+
+        for (auto neighbor = neighbors.begin(); neighbor != neighbors_new_end; ++neighbor)
+        {
+            boost::optional<unsigned> const opposite_face_id = element->addNeighbor(*neighbor);
+            if (opposite_face_id)
+            {
+                (*neighbor)->setNeighbor(element, *opposite_face_id);
+            }
+        }
+        neighbors.clear();
+    }
 }
 
 void Mesh::setNodesConnectedByEdges()
 {
-	const std::size_t nNodes (this->_nodes.size());
-	for (unsigned i=0; i<nNodes; ++i)
-	{
-		MeshLib::Node* node (_nodes[i]);
-		std::vector<MeshLib::Node*> conn_set;
-		const std::vector<MeshLib::Element*> &conn_elems (node->getElements());
-		const std::size_t nConnElems (conn_elems.size());
-		for (unsigned j=0; j<nConnElems; ++j)
-		{
-			const unsigned idx (conn_elems[j]->getNodeIDinElement(node));
-			const unsigned nElemNodes (conn_elems[j]->getNBaseNodes());
-			for (unsigned k(0); k<nElemNodes; ++k)
-			{
-				bool is_in_vector (false);
-				const std::size_t nConnNodes (conn_set.size());
-				for (unsigned l(0); l<nConnNodes; ++l)
-					if (conn_elems[j]->getNode(k) == conn_set[l])
-						is_in_vector = true;
-				if (is_in_vector) continue;
-				if (conn_elems[j]->isEdge(idx, k)) //TODO doesn't work with higher order nodes
-					conn_set.push_back(_nodes[conn_elems[j]->getNode(k)->getID()]);
-			}
-		}
-		node->setConnectedNodes(conn_set);
-	}
+    const std::size_t nNodes (this->_nodes.size());
+    for (unsigned i=0; i<nNodes; ++i)
+    {
+        MeshLib::Node* node (_nodes[i]);
+        std::vector<MeshLib::Node*> conn_set;
+        const std::vector<MeshLib::Element*> &conn_elems (node->getElements());
+        const std::size_t nConnElems (conn_elems.size());
+        for (unsigned j=0; j<nConnElems; ++j)
+        {
+            const unsigned idx (conn_elems[j]->getNodeIDinElement(node));
+            const unsigned nElemNodes (conn_elems[j]->getNBaseNodes());
+            for (unsigned k(0); k<nElemNodes; ++k)
+            {
+                bool is_in_vector (false);
+                const std::size_t nConnNodes (conn_set.size());
+                for (unsigned l(0); l<nConnNodes; ++l)
+                    if (conn_elems[j]->getNode(k) == conn_set[l])
+                        is_in_vector = true;
+                if (is_in_vector) continue;
+                if (conn_elems[j]->isEdge(idx, k)) //TODO doesn't work with higher order nodes
+                    conn_set.push_back(_nodes[conn_elems[j]->getNode(k)->getID()]);
+            }
+        }
+        node->setConnectedNodes(conn_set);
+    }
 }
 
 void Mesh::setNodesConnectedByElements()
 {
-	// Allocate temporary space for adjacent nodes.
-	std::vector<Node*> adjacent_nodes;
-	for (Node* const node : _nodes)
-	{
-		adjacent_nodes.clear();
-
-		// Get all elements, to which this node is connected.
-		std::vector<Element*> const& conn_elems = node->getElements();
-
-		// And collect all elements' nodes.
-		for (Element const* const element : conn_elems)
-		{
-			Node* const* const single_elem_nodes = element->getNodes();
-			std::size_t const nnodes = element->getNBaseNodes();
-			for (std::size_t n = 0; n < nnodes; n++)
-				adjacent_nodes.push_back(single_elem_nodes[n]);
-		}
-
-		// Make nodes unique and sorted by their ids.
-		// This relies on the node's id being equivalent to it's address.
-		std::sort(adjacent_nodes.begin(), adjacent_nodes.end(),
-			[](Node* a, Node* b) { return a->getID() < b->getID(); });
-		auto const last = std::unique(adjacent_nodes.begin(), adjacent_nodes.end());
-		adjacent_nodes.erase(last, adjacent_nodes.end());
-
-		node->setConnectedNodes(adjacent_nodes);
-	}
+    // Allocate temporary space for adjacent nodes.
+    std::vector<Node*> adjacent_nodes;
+    for (Node* const node : _nodes)
+    {
+        adjacent_nodes.clear();
+
+        // Get all elements, to which this node is connected.
+        std::vector<Element*> const& conn_elems = node->getElements();
+
+        // And collect all elements' nodes.
+        for (Element const* const element : conn_elems)
+        {
+            Node* const* const single_elem_nodes = element->getNodes();
+            std::size_t const nnodes = element->getNBaseNodes();
+            for (std::size_t n = 0; n < nnodes; n++)
+                adjacent_nodes.push_back(single_elem_nodes[n]);
+        }
+
+        // Make nodes unique and sorted by their ids.
+        // This relies on the node's id being equivalent to it's address.
+        std::sort(adjacent_nodes.begin(), adjacent_nodes.end(),
+            [](Node* a, Node* b) { return a->getID() < b->getID(); });
+        auto const last = std::unique(adjacent_nodes.begin(), adjacent_nodes.end());
+        adjacent_nodes.erase(last, adjacent_nodes.end());
+
+        node->setConnectedNodes(adjacent_nodes);
+    }
 }
 
 
diff --git a/MeshLib/Mesh.h b/MeshLib/Mesh.h
index c0f8e125d38..ed182aa6251 100644
--- a/MeshLib/Mesh.h
+++ b/MeshLib/Mesh.h
@@ -26,145 +26,145 @@
 
 namespace MeshLib
 {
-	class Node;
-	class Element;
+    class Node;
+    class Element;
 
 /**
  * A basic mesh.
  */
 class Mesh : BaseLib::Counter<Mesh>
 {
-	/* friend functions: */
-	friend void removeMeshNodes(MeshLib::Mesh &mesh, const std::vector<std::size_t> &nodes);
+    /* friend functions: */
+    friend void removeMeshNodes(MeshLib::Mesh &mesh, const std::vector<std::size_t> &nodes);
 
 public:
-	/// Constructor using a mesh name and an array of nodes and elements
-	/// @param name          Mesh name.
-	/// @param nodes         A vector of mesh nodes. In case nonlinear nodes are involved, one should
-	///                      put them after line ones in the vector and set "n_base_nodes" argument.
-	/// @param elements      An array of mesh elements.
-	/// @param n_base_nodes  The number of base nodes. This is an optional parameter for nonlinear case.
-	///                      If the parameter is set to zero, we consider there are no nonlinear nodes.
-	Mesh(const std::string &name,
-	     const std::vector<Node*> &nodes,
-	     const std::vector<Element*> &elements,
-	     Properties const& properties = Properties(),
-	     const std::size_t n_base_nodes = 0);
+    /// Constructor using a mesh name and an array of nodes and elements
+    /// @param name          Mesh name.
+    /// @param nodes         A vector of mesh nodes. In case nonlinear nodes are involved, one should
+    ///                      put them after line ones in the vector and set "n_base_nodes" argument.
+    /// @param elements      An array of mesh elements.
+    /// @param n_base_nodes  The number of base nodes. This is an optional parameter for nonlinear case.
+    ///                      If the parameter is set to zero, we consider there are no nonlinear nodes.
+    Mesh(const std::string &name,
+         const std::vector<Node*> &nodes,
+         const std::vector<Element*> &elements,
+         Properties const& properties = Properties(),
+         const std::size_t n_base_nodes = 0);
 
-	/// Copy constructor
-	Mesh(const Mesh &mesh);
+    /// Copy constructor
+    Mesh(const Mesh &mesh);
 
-	/// Destructor
-	virtual ~Mesh();
+    /// Destructor
+    virtual ~Mesh();
 
-	/// Add a node to the mesh.
-	void addNode(Node* node);
+    /// Add a node to the mesh.
+    void addNode(Node* node);
 
-	/// Add an element to the mesh.
-	void addElement(Element* elem);
+    /// Add an element to the mesh.
+    void addElement(Element* elem);
 
-	/// Returns the dimension of the mesh (determined by the maximum dimension over all elements).
-	unsigned getDimension() const { return _mesh_dimension; }
+    /// Returns the dimension of the mesh (determined by the maximum dimension over all elements).
+    unsigned getDimension() const { return _mesh_dimension; }
 
-	/// Get the node with the given index.
-	const Node* getNode(unsigned idx) const { return _nodes[idx]; }
+    /// Get the node with the given index.
+    const Node* getNode(unsigned idx) const { return _nodes[idx]; }
 
-	/// Get the element with the given index.
-	const Element* getElement(unsigned idx) const { return _elements[idx]; }
+    /// Get the element with the given index.
+    const Element* getElement(unsigned idx) const { return _elements[idx]; }
 
-	/// Get the minimum edge length over all elements of the mesh.
-	double getMinEdgeLength() const { return _edge_length.first; }
+    /// Get the minimum edge length over all elements of the mesh.
+    double getMinEdgeLength() const { return _edge_length.first; }
 
-	/// Get the maximum edge length over all elements of the mesh.
-	double getMaxEdgeLength() const { return _edge_length.second; }
+    /// Get the maximum edge length over all elements of the mesh.
+    double getMaxEdgeLength() const { return _edge_length.second; }
 
-	/// Get the minimum node distance in the mesh.
+    /// Get the minimum node distance in the mesh.
     /// The value is calculated from element-wise minimum node distances.
-	double getMinNodeDistance() const { return _node_distance.first; }
+    double getMinNodeDistance() const { return _node_distance.first; }
 
-	/// Get the maximum node distance over all elements of the mesh.
+    /// Get the maximum node distance over all elements of the mesh.
     /// The value is calculated from element-wise maximum node distances.
-	double getMaxNodeDistance() const { return _node_distance.second; }
+    double getMaxNodeDistance() const { return _node_distance.second; }
 
-	/// Get the number of elements
-	std::size_t getNElements() const { return _elements.size(); }
+    /// Get the number of elements
+    std::size_t getNElements() const { return _elements.size(); }
 
-	/// Get the number of nodes
-	std::size_t getNNodes() const { return _nodes.size(); }
+    /// Get the number of nodes
+    std::size_t getNNodes() const { return _nodes.size(); }
 
-	/// Get name of the mesh.
-	const std::string getName() const { return _name; }
+    /// Get name of the mesh.
+    const std::string getName() const { return _name; }
 
-	/// Get the nodes-vector for the mesh.
-	std::vector<Node*> const& getNodes() const { return _nodes; }
+    /// Get the nodes-vector for the mesh.
+    std::vector<Node*> const& getNodes() const { return _nodes; }
 
-	/// Get the element-vector for the mesh.
-	std::vector<Element*> const& getElements() const { return _elements; }
+    /// Get the element-vector for the mesh.
+    std::vector<Element*> const& getElements() const { return _elements; }
 
-	/// Resets the IDs of all mesh-elements to their position in the element vector
-	void resetElementIDs();
+    /// Resets the IDs of all mesh-elements to their position in the element vector
+    void resetElementIDs();
 
-	/// Resets the IDs of all mesh-nodes to their position in the node vector
-	void resetNodeIDs();
+    /// Resets the IDs of all mesh-nodes to their position in the node vector
+    void resetNodeIDs();
 
-	/// Changes the name of the mesh.
-	void setName(const std::string &name) { this->_name = name; }
+    /// Changes the name of the mesh.
+    void setName(const std::string &name) { this->_name = name; }
 
-	/// Get id of the mesh
-	std::size_t getID() const {return _id; }
+    /// Get id of the mesh
+    std::size_t getID() const {return _id; }
 
-	/// Get the number of base nodes
-	std::size_t getNBaseNodes() const { return _n_base_nodes; }
+    /// Get the number of base nodes
+    std::size_t getNBaseNodes() const { return _n_base_nodes; }
 
-	/// Return true if the given node is a basic one (i.e. linear order node)
-	bool isBaseNode(std::size_t node_idx) const {return node_idx < _n_base_nodes; }
+    /// Return true if the given node is a basic one (i.e. linear order node)
+    bool isBaseNode(std::size_t node_idx) const {return node_idx < _n_base_nodes; }
 
-	/// Return true if the mesh has any nonlinear nodes
-	bool isNonlinear() const { return (getNNodes() != getNBaseNodes()); }
+    /// Return true if the mesh has any nonlinear nodes
+    bool isNonlinear() const { return (getNNodes() != getNBaseNodes()); }
 
-	MeshLib::Properties & getProperties() { return _properties; }
-	MeshLib::Properties const& getProperties() const { return _properties; }
+    MeshLib::Properties & getProperties() { return _properties; }
+    MeshLib::Properties const& getProperties() const { return _properties; }
 
 protected:
-	/// Set the minimum and maximum length over the edges of the mesh.
-	void calcEdgeLengthRange();
-	/// Set the minimum and maximum node distances within elements.
-	void calcNodeDistanceRange();
-
-	/**
-	 * Resets the connected elements for the node vector, i.e. removes the old information and
-	 * calls setElementsConnectedToNodes to set the new information.
-	 * \attention This needs to be called if node neighbourhoods are reset.
-	 */
-	void resetElementsConnectedToNodes();
-
-	/// Sets the dimension of the mesh.
-	void setDimension();
-
-	/// Fills in the neighbor-information for nodes (i.e. which element each node belongs to).
-	void setElementsConnectedToNodes();
-
-	/// Fills in the neighbor-information for elements.
-	/// Note: Using this implementation, an element e can only have neighbors that have the same dimensionality as e.
-	void setElementNeighbors();
-
-	void setNodesConnectedByEdges();
-
-	/// Computes the element-connectivity of nodes. Two nodes i and j are
-	/// connected if they are shared by an element.
-	void setNodesConnectedByElements();
-
-	std::size_t const _id;
-	unsigned _mesh_dimension;
-	/// The minimal and maximal edge length over all elements in the mesh
-	std::pair<double, double> _edge_length;
-	/// The minimal and maximal distance of nodes within an element over all elements in the mesh
-	std::pair<double, double> _node_distance;
-	std::string _name;
-	std::vector<Node*> _nodes;
-	std::vector<Element*> _elements;
-	std::size_t _n_base_nodes;
-	Properties _properties;
+    /// Set the minimum and maximum length over the edges of the mesh.
+    void calcEdgeLengthRange();
+    /// Set the minimum and maximum node distances within elements.
+    void calcNodeDistanceRange();
+
+    /**
+     * Resets the connected elements for the node vector, i.e. removes the old information and
+     * calls setElementsConnectedToNodes to set the new information.
+     * \attention This needs to be called if node neighbourhoods are reset.
+     */
+    void resetElementsConnectedToNodes();
+
+    /// Sets the dimension of the mesh.
+    void setDimension();
+
+    /// Fills in the neighbor-information for nodes (i.e. which element each node belongs to).
+    void setElementsConnectedToNodes();
+
+    /// Fills in the neighbor-information for elements.
+    /// Note: Using this implementation, an element e can only have neighbors that have the same dimensionality as e.
+    void setElementNeighbors();
+
+    void setNodesConnectedByEdges();
+
+    /// Computes the element-connectivity of nodes. Two nodes i and j are
+    /// connected if they are shared by an element.
+    void setNodesConnectedByElements();
+
+    std::size_t const _id;
+    unsigned _mesh_dimension;
+    /// The minimal and maximal edge length over all elements in the mesh
+    std::pair<double, double> _edge_length;
+    /// The minimal and maximal distance of nodes within an element over all elements in the mesh
+    std::pair<double, double> _node_distance;
+    std::string _name;
+    std::vector<Node*> _nodes;
+    std::vector<Element*> _elements;
+    std::size_t _n_base_nodes;
+    Properties _properties;
 }; /* class */
 
 } /* namespace */
diff --git a/MeshLib/MeshEditing/AddLayerToMesh.cpp b/MeshLib/MeshEditing/AddLayerToMesh.cpp
index bc33dcd1aa8..8cd5a58f6d1 100644
--- a/MeshLib/MeshEditing/AddLayerToMesh.cpp
+++ b/MeshLib/MeshEditing/AddLayerToMesh.cpp
@@ -45,149 +45,149 @@ namespace MeshLib
  * hexahedron)
 */
 MeshLib::Element* extrudeElement(std::vector<MeshLib::Node*> const& subsfc_nodes,
-	MeshLib::Element const& sfc_elem,
-	MeshLib::PropertyVector<std::size_t> const& sfc_to_subsfc_id_map,
-	std::map<std::size_t, std::size_t> const& subsfc_sfc_id_map)
+    MeshLib::Element const& sfc_elem,
+    MeshLib::PropertyVector<std::size_t> const& sfc_to_subsfc_id_map,
+    std::map<std::size_t, std::size_t> const& subsfc_sfc_id_map)
 {
-	if (sfc_elem.getDimension() > 2)
-		return nullptr;
-
-	const unsigned nElemNodes(sfc_elem.getNBaseNodes());
-	MeshLib::Node** new_nodes = new MeshLib::Node*[2*nElemNodes];
-
-	for (unsigned j=0; j<nElemNodes; ++j)
-	{
-		std::size_t const subsfc_id(
-		    sfc_to_subsfc_id_map[sfc_elem.getNode(j)->getID()]);
-		new_nodes[j] = subsfc_nodes[subsfc_id];
-		std::size_t new_idx = (nElemNodes==2) ? (3-j) : (nElemNodes+j);
-		new_nodes[new_idx] = subsfc_nodes[subsfc_sfc_id_map.at(subsfc_id)];
-	}
-
-	if (sfc_elem.getGeomType() == MeshLib::MeshElemType::LINE)
-		return new MeshLib::Quad(new_nodes);
-	if (sfc_elem.getGeomType() == MeshLib::MeshElemType::TRIANGLE)
-		return new MeshLib::Prism(new_nodes);
-	if (sfc_elem.getGeomType() == MeshLib::MeshElemType::QUAD)
-		return new MeshLib::Hex(new_nodes);
-
-	return nullptr;
+    if (sfc_elem.getDimension() > 2)
+        return nullptr;
+
+    const unsigned nElemNodes(sfc_elem.getNBaseNodes());
+    MeshLib::Node** new_nodes = new MeshLib::Node*[2*nElemNodes];
+
+    for (unsigned j=0; j<nElemNodes; ++j)
+    {
+        std::size_t const subsfc_id(
+            sfc_to_subsfc_id_map[sfc_elem.getNode(j)->getID()]);
+        new_nodes[j] = subsfc_nodes[subsfc_id];
+        std::size_t new_idx = (nElemNodes==2) ? (3-j) : (nElemNodes+j);
+        new_nodes[new_idx] = subsfc_nodes[subsfc_sfc_id_map.at(subsfc_id)];
+    }
+
+    if (sfc_elem.getGeomType() == MeshLib::MeshElemType::LINE)
+        return new MeshLib::Quad(new_nodes);
+    if (sfc_elem.getGeomType() == MeshLib::MeshElemType::TRIANGLE)
+        return new MeshLib::Prism(new_nodes);
+    if (sfc_elem.getGeomType() == MeshLib::MeshElemType::QUAD)
+        return new MeshLib::Hex(new_nodes);
+
+    return nullptr;
 }
 
 MeshLib::Mesh* addTopLayerToMesh(MeshLib::Mesh const& mesh,
-	double thickness,
-	std::string const& name)
+    double thickness,
+    std::string const& name)
 {
-	return addLayerToMesh(mesh, thickness, name, true);
+    return addLayerToMesh(mesh, thickness, name, true);
 }
 
 MeshLib::Mesh* addBottomLayerToMesh(MeshLib::Mesh const& mesh,
-	double thickness,
-	std::string const& name)
+    double thickness,
+    std::string const& name)
 {
-	return addLayerToMesh(mesh, thickness, name, false);
+    return addLayerToMesh(mesh, thickness, name, false);
 }
 
 MeshLib::Mesh* addLayerToMesh(MeshLib::Mesh const& mesh, double thickness,
-	std::string const& name,
-	bool on_top)
+    std::string const& name,
+    bool on_top)
 {
-	INFO("Extracting top surface of mesh \"%s\" ... ", mesh.getName().c_str());
-	int const flag = (on_top) ? -1 : 1;
-	const MathLib::Vector3 dir(0, 0, flag);
-	double const angle(90);
-	std::unique_ptr<MeshLib::Mesh> sfc_mesh (nullptr);
-
-	std::string const prop_name("OriginalSubsurfaceNodeIDs");
-
-	if (mesh.getDimension() == 3)
-		sfc_mesh.reset(MeshLib::MeshSurfaceExtraction::getMeshSurface(
-		    mesh, dir, angle, prop_name));
-	else {
-		sfc_mesh = (on_top) ? std::unique_ptr<MeshLib::Mesh>(new MeshLib::Mesh(mesh)) :
-		                      std::unique_ptr<MeshLib::Mesh>(MeshLib::createFlippedMesh(mesh));
-		// add property storing node ids
-		boost::optional<MeshLib::PropertyVector<std::size_t>&> pv(
-		    sfc_mesh->getProperties().createNewPropertyVector<std::size_t>(
-		        prop_name, MeshLib::MeshItemType::Node, 1));
-		if (pv) {
-			pv->resize(sfc_mesh->getNNodes());
-			std::iota(pv->begin(), pv->end(), 0);
-		} else {
-			ERR("Could not create and initialize property.");
-			return nullptr;
-		}
-	}
-	INFO("done.");
-
-	// *** add new surface nodes
-	std::vector<MeshLib::Node*> subsfc_nodes =
-	    MeshLib::copyNodeVector(mesh.getNodes());
-	std::vector<MeshLib::Element*> subsfc_elements =
-		MeshLib::copyElementVector(mesh.getElements(), subsfc_nodes);
-
-	std::size_t const n_subsfc_nodes(subsfc_nodes.size());
-
-	std::vector<MeshLib::Node*> const& sfc_nodes(sfc_mesh->getNodes());
-	std::size_t const n_sfc_nodes(sfc_nodes.size());
-
-	// fetch subsurface node ids PropertyVector
-	boost::optional<MeshLib::PropertyVector<std::size_t> const&> opt_node_id_pv(
-	    sfc_mesh->getProperties().getPropertyVector<std::size_t>(prop_name));
-	if (!opt_node_id_pv) {
-		ERR(
-		    "Need subsurface node ids, but the property \"%s\" is not "
-		    "available.",
-		    prop_name.c_str());
-		return nullptr;
-	}
-
-	MeshLib::PropertyVector<std::size_t> const& node_id_pv(*opt_node_id_pv);
-	// *** copy sfc nodes to subsfc mesh node
-	std::map<std::size_t, std::size_t> subsfc_sfc_id_map;
-	for (std::size_t k(0); k<n_sfc_nodes; ++k) {
-		std::size_t const subsfc_id(node_id_pv[k]);
-		std::size_t const sfc_id(k+n_subsfc_nodes);
-		subsfc_sfc_id_map.insert(std::make_pair(subsfc_id, sfc_id));
-		MeshLib::Node const& node(*sfc_nodes[k]);
-		subsfc_nodes.push_back(new MeshLib::Node(
-		    node[0], node[1], node[2] - (flag * thickness), sfc_id));
-	}
-
-	// *** insert new layer elements into subsfc_mesh
-	std::vector<MeshLib::Element*> const& sfc_elements(sfc_mesh->getElements());
-	std::size_t const n_sfc_elements(sfc_elements.size());
-	for (std::size_t k(0); k<n_sfc_elements; ++k)
-		subsfc_elements.push_back(extrudeElement(subsfc_nodes, *sfc_elements[k],
-		                                         node_id_pv,
-		                                         subsfc_sfc_id_map));
-
-	auto new_mesh = new MeshLib::Mesh(name, subsfc_nodes, subsfc_elements);
-
-	boost::optional<MeshLib::PropertyVector<int> const&> opt_materials(
-		mesh.getProperties().getPropertyVector<int>("MaterialIDs")
-	);
-
-	if (opt_materials) {
-		boost::optional<PropertyVector<int> &> new_materials(
-		new_mesh->getProperties().createNewPropertyVector<int>("MaterialIDs",
-			MeshLib::MeshItemType::Cell, 1));
-		if (!new_materials) {
-			ERR("Can not set material properties for new layer");
-		} else {
-			new_materials->reserve(subsfc_elements.size());
-			int new_layer_id (*(std::max_element(opt_materials->cbegin(), opt_materials->cend()))+1);
-			std::copy(opt_materials->cbegin(), opt_materials->cend(), std::back_inserter(*new_materials));
-			auto const n_new_props(subsfc_elements.size()-mesh.getNElements());
-			std::fill_n(std::back_inserter(*new_materials), n_new_props, new_layer_id);
-		}
-	} else {
-		ERR(
-		    "Could not copy the property \"MaterialIDs\" since the original "
-		    "mesh does not contain such a property.");
-	}
-
-	return new_mesh;
+    INFO("Extracting top surface of mesh \"%s\" ... ", mesh.getName().c_str());
+    int const flag = (on_top) ? -1 : 1;
+    const MathLib::Vector3 dir(0, 0, flag);
+    double const angle(90);
+    std::unique_ptr<MeshLib::Mesh> sfc_mesh (nullptr);
+
+    std::string const prop_name("OriginalSubsurfaceNodeIDs");
+
+    if (mesh.getDimension() == 3)
+        sfc_mesh.reset(MeshLib::MeshSurfaceExtraction::getMeshSurface(
+            mesh, dir, angle, prop_name));
+    else {
+        sfc_mesh = (on_top) ? std::unique_ptr<MeshLib::Mesh>(new MeshLib::Mesh(mesh)) :
+                              std::unique_ptr<MeshLib::Mesh>(MeshLib::createFlippedMesh(mesh));
+        // add property storing node ids
+        boost::optional<MeshLib::PropertyVector<std::size_t>&> pv(
+            sfc_mesh->getProperties().createNewPropertyVector<std::size_t>(
+                prop_name, MeshLib::MeshItemType::Node, 1));
+        if (pv) {
+            pv->resize(sfc_mesh->getNNodes());
+            std::iota(pv->begin(), pv->end(), 0);
+        } else {
+            ERR("Could not create and initialize property.");
+            return nullptr;
+        }
+    }
+    INFO("done.");
+
+    // *** add new surface nodes
+    std::vector<MeshLib::Node*> subsfc_nodes =
+        MeshLib::copyNodeVector(mesh.getNodes());
+    std::vector<MeshLib::Element*> subsfc_elements =
+        MeshLib::copyElementVector(mesh.getElements(), subsfc_nodes);
+
+    std::size_t const n_subsfc_nodes(subsfc_nodes.size());
+
+    std::vector<MeshLib::Node*> const& sfc_nodes(sfc_mesh->getNodes());
+    std::size_t const n_sfc_nodes(sfc_nodes.size());
+
+    // fetch subsurface node ids PropertyVector
+    boost::optional<MeshLib::PropertyVector<std::size_t> const&> opt_node_id_pv(
+        sfc_mesh->getProperties().getPropertyVector<std::size_t>(prop_name));
+    if (!opt_node_id_pv) {
+        ERR(
+            "Need subsurface node ids, but the property \"%s\" is not "
+            "available.",
+            prop_name.c_str());
+        return nullptr;
+    }
+
+    MeshLib::PropertyVector<std::size_t> const& node_id_pv(*opt_node_id_pv);
+    // *** copy sfc nodes to subsfc mesh node
+    std::map<std::size_t, std::size_t> subsfc_sfc_id_map;
+    for (std::size_t k(0); k<n_sfc_nodes; ++k) {
+        std::size_t const subsfc_id(node_id_pv[k]);
+        std::size_t const sfc_id(k+n_subsfc_nodes);
+        subsfc_sfc_id_map.insert(std::make_pair(subsfc_id, sfc_id));
+        MeshLib::Node const& node(*sfc_nodes[k]);
+        subsfc_nodes.push_back(new MeshLib::Node(
+            node[0], node[1], node[2] - (flag * thickness), sfc_id));
+    }
+
+    // *** insert new layer elements into subsfc_mesh
+    std::vector<MeshLib::Element*> const& sfc_elements(sfc_mesh->getElements());
+    std::size_t const n_sfc_elements(sfc_elements.size());
+    for (std::size_t k(0); k<n_sfc_elements; ++k)
+        subsfc_elements.push_back(extrudeElement(subsfc_nodes, *sfc_elements[k],
+                                                 node_id_pv,
+                                                 subsfc_sfc_id_map));
+
+    auto new_mesh = new MeshLib::Mesh(name, subsfc_nodes, subsfc_elements);
+
+    boost::optional<MeshLib::PropertyVector<int> const&> opt_materials(
+        mesh.getProperties().getPropertyVector<int>("MaterialIDs")
+    );
+
+    if (opt_materials) {
+        boost::optional<PropertyVector<int> &> new_materials(
+        new_mesh->getProperties().createNewPropertyVector<int>("MaterialIDs",
+            MeshLib::MeshItemType::Cell, 1));
+        if (!new_materials) {
+            ERR("Can not set material properties for new layer");
+        } else {
+            new_materials->reserve(subsfc_elements.size());
+            int new_layer_id (*(std::max_element(opt_materials->cbegin(), opt_materials->cend()))+1);
+            std::copy(opt_materials->cbegin(), opt_materials->cend(), std::back_inserter(*new_materials));
+            auto const n_new_props(subsfc_elements.size()-mesh.getNElements());
+            std::fill_n(std::back_inserter(*new_materials), n_new_props, new_layer_id);
+        }
+    } else {
+        ERR(
+            "Could not copy the property \"MaterialIDs\" since the original "
+            "mesh does not contain such a property.");
+    }
+
+    return new_mesh;
 }
 
 } // namespace MeshLib
diff --git a/MeshLib/MeshEditing/AddLayerToMesh.h b/MeshLib/MeshEditing/AddLayerToMesh.h
index 81f0c0b8d95..b33bfa623c6 100644
--- a/MeshLib/MeshEditing/AddLayerToMesh.h
+++ b/MeshLib/MeshEditing/AddLayerToMesh.h
@@ -27,20 +27,20 @@ class Element;
 
 /// Adds a layer on top of the mesh
 MeshLib::Mesh* addTopLayerToMesh(MeshLib::Mesh const& mesh,
-	double thickness,
-	std::string const& name);
+    double thickness,
+    std::string const& name);
 
 /// Adds a layer at the bottom of the mesh
 MeshLib::Mesh* addBottomLayerToMesh(MeshLib::Mesh const& mesh,
-	double thickness,
-	std::string const& name);
+    double thickness,
+    std::string const& name);
 
 /// Adds a layer to the mesh. If on_top is true, the layer is added on top,
 /// if it is false, the layer is added at the bottom.
 MeshLib::Mesh* addLayerToMesh(MeshLib::Mesh const& mesh,
-	double thickness,
-	std::string const& name,
-	bool on_top);
+    double thickness,
+    std::string const& name,
+    bool on_top);
 
 } // end namespace MeshLib
 
diff --git a/MeshLib/MeshEditing/DuplicateMeshComponents.cpp b/MeshLib/MeshEditing/DuplicateMeshComponents.cpp
index 1f6db1df34c..7707e5afada 100644
--- a/MeshLib/MeshEditing/DuplicateMeshComponents.cpp
+++ b/MeshLib/MeshEditing/DuplicateMeshComponents.cpp
@@ -22,52 +22,52 @@ namespace MeshLib
 
 std::vector<MeshLib::Node*> copyNodeVector(const std::vector<MeshLib::Node*> &nodes)
 {
-	const std::size_t nNodes(nodes.size());
-	std::vector<MeshLib::Node*> new_nodes;
-	new_nodes.reserve(nNodes);
-	for (std::size_t k = 0; k < nNodes; ++k)
-		new_nodes.push_back(new MeshLib::Node(nodes[k]->getCoords(), new_nodes.size()));
-	return new_nodes;
+    const std::size_t nNodes(nodes.size());
+    std::vector<MeshLib::Node*> new_nodes;
+    new_nodes.reserve(nNodes);
+    for (std::size_t k = 0; k < nNodes; ++k)
+        new_nodes.push_back(new MeshLib::Node(nodes[k]->getCoords(), new_nodes.size()));
+    return new_nodes;
 }
 
 std::vector<MeshLib::Element*> copyElementVector(const std::vector<MeshLib::Element*> &elements, const std::vector<MeshLib::Node*> &nodes)
 {
-	const std::size_t nElements(elements.size());
-	std::vector<MeshLib::Element*> new_elements;
-	new_elements.reserve(nElements);
-	for (std::size_t k = 0; k < nElements; ++k)
-		new_elements.push_back(copyElement(elements[k], nodes));
-	return new_elements;
+    const std::size_t nElements(elements.size());
+    std::vector<MeshLib::Element*> new_elements;
+    new_elements.reserve(nElements);
+    for (std::size_t k = 0; k < nElements; ++k)
+        new_elements.push_back(copyElement(elements[k], nodes));
+    return new_elements;
 }
 
 MeshLib::Element* copyElement(MeshLib::Element const*const element, const std::vector<MeshLib::Node*> &nodes)
 {
-	if (element->getGeomType() == MeshElemType::LINE)
-		return copyElement<MeshLib::Line>(element, nodes);
-	else if (element->getGeomType() == MeshElemType::TRIANGLE)
-		return copyElement<MeshLib::Tri>(element, nodes);
-	else if (element->getGeomType() == MeshElemType::QUAD)
-		return copyElement<MeshLib::Quad>(element, nodes);
-	else if (element->getGeomType() == MeshElemType::TETRAHEDRON)
-		return copyElement<MeshLib::Tet>(element, nodes);
-	else if (element->getGeomType() == MeshElemType::HEXAHEDRON)
-		return copyElement<MeshLib::Hex>(element, nodes);
-	else if (element->getGeomType() == MeshElemType::PYRAMID)
-		return copyElement<MeshLib::Pyramid>(element, nodes);
-	else if (element->getGeomType() == MeshElemType::PRISM)
-		return copyElement<MeshLib::Prism>(element, nodes);
+    if (element->getGeomType() == MeshElemType::LINE)
+        return copyElement<MeshLib::Line>(element, nodes);
+    else if (element->getGeomType() == MeshElemType::TRIANGLE)
+        return copyElement<MeshLib::Tri>(element, nodes);
+    else if (element->getGeomType() == MeshElemType::QUAD)
+        return copyElement<MeshLib::Quad>(element, nodes);
+    else if (element->getGeomType() == MeshElemType::TETRAHEDRON)
+        return copyElement<MeshLib::Tet>(element, nodes);
+    else if (element->getGeomType() == MeshElemType::HEXAHEDRON)
+        return copyElement<MeshLib::Hex>(element, nodes);
+    else if (element->getGeomType() == MeshElemType::PYRAMID)
+        return copyElement<MeshLib::Pyramid>(element, nodes);
+    else if (element->getGeomType() == MeshElemType::PRISM)
+        return copyElement<MeshLib::Prism>(element, nodes);
 
-	ERR ("Error: Unknown element type.");
-	return nullptr;
+    ERR ("Error: Unknown element type.");
+    return nullptr;
 }
 
 template <typename E>
 MeshLib::Element* copyElement(MeshLib::Element const*const element, const std::vector<MeshLib::Node*> &nodes)
 {
-	MeshLib::Node** new_nodes = new MeshLib::Node*[element->getNBaseNodes()];
-	for (unsigned i=0; i<element->getNBaseNodes(); ++i)
-		new_nodes[i] = nodes[element->getNode(i)->getID()];
-	return new E(new_nodes);
+    MeshLib::Node** new_nodes = new MeshLib::Node*[element->getNBaseNodes()];
+    for (unsigned i=0; i<element->getNBaseNodes(); ++i)
+        new_nodes[i] = nodes[element->getNode(i)->getID()];
+    return new E(new_nodes);
 }
 
 } // namespace MeshLib
diff --git a/MeshLib/MeshEditing/DuplicateMeshComponents.h b/MeshLib/MeshEditing/DuplicateMeshComponents.h
index 0d1fea8ef53..f0844abc692 100644
--- a/MeshLib/MeshEditing/DuplicateMeshComponents.h
+++ b/MeshLib/MeshEditing/DuplicateMeshComponents.h
@@ -20,27 +20,27 @@
 namespace MeshLib
 {
 
-	class Mesh;
-	class Node;
-	class Element;
-
-	/// Creates a deep copy of a Node vector
-	std::vector<MeshLib::Node*> copyNodeVector(const std::vector<MeshLib::Node*> &nodes);
-
-	/** Creates a deep copy of an element vector using the given Node vector.
-	 * @param elements The element vector that should be duplicated.
-	 * @param nodes    The new node vector used for the duplicated element vector. This should be consistent with the original node vector.
-	 * @return A deep copy of the elements vector using the new nodes vector.
-	 */
-	std::vector<MeshLib::Element*> copyElementVector(const std::vector<MeshLib::Element*> &elements, const std::vector<MeshLib::Node*> &nodes);
-
-	/// Copies an element without change, using the nodes vector from the result mesh.
-	MeshLib::Element* copyElement(MeshLib::Element const*const element,
+    class Mesh;
+    class Node;
+    class Element;
+
+    /// Creates a deep copy of a Node vector
+    std::vector<MeshLib::Node*> copyNodeVector(const std::vector<MeshLib::Node*> &nodes);
+
+    /** Creates a deep copy of an element vector using the given Node vector.
+     * @param elements The element vector that should be duplicated.
+     * @param nodes    The new node vector used for the duplicated element vector. This should be consistent with the original node vector.
+     * @return A deep copy of the elements vector using the new nodes vector.
+     */
+    std::vector<MeshLib::Element*> copyElementVector(const std::vector<MeshLib::Element*> &elements, const std::vector<MeshLib::Node*> &nodes);
+
+    /// Copies an element without change, using the nodes vector from the result mesh.
+    MeshLib::Element* copyElement(MeshLib::Element const*const element,
                                   const std::vector<MeshLib::Node*> &nodes);
 
-	/// Copies an element without change, using the nodes vector from the result mesh.
-	template <typename E>
-	MeshLib::Element* copyElement(MeshLib::Element const*const element, const std::vector<MeshLib::Node*> &nodes);
+    /// Copies an element without change, using the nodes vector from the result mesh.
+    template <typename E>
+    MeshLib::Element* copyElement(MeshLib::Element const*const element, const std::vector<MeshLib::Node*> &nodes);
 
 } // end namespace MeshLib
 
diff --git a/MeshLib/MeshEditing/ElementValueModification.cpp b/MeshLib/MeshEditing/ElementValueModification.cpp
index 718bf4304ae..4e52c4b97dd 100644
--- a/MeshLib/MeshEditing/ElementValueModification.cpp
+++ b/MeshLib/MeshEditing/ElementValueModification.cpp
@@ -24,102 +24,102 @@
 namespace MeshLib {
 
 bool ElementValueModification::replace(MeshLib::Mesh &mesh,
-	std::string const& property_name, int const old_value, int const new_value,
-	bool replace_if_exists)
+    std::string const& property_name, int const old_value, int const new_value,
+    bool replace_if_exists)
 {
-	boost::optional<MeshLib::PropertyVector<int> &> optional_property_value_vec(
-		mesh.getProperties().getPropertyVector<int>(property_name)
-	);
-
-	if (!optional_property_value_vec) {
-		return false;
-	}
-
-	MeshLib::PropertyVector<int> & property_value_vec(
-		optional_property_value_vec.get()
-	);
-	const std::size_t n_property_tuples(property_value_vec.getNumberOfTuples());
-
-	if (!replace_if_exists) {
-		for (std::size_t i=0; i<n_property_tuples; ++i) {
-			if (property_value_vec[i] == new_value) {
-				WARN ("ElementValueModification::replaceElementValue() "
-					"- Replacement value \"%d\" is already taken, "
-					"no changes have been made.", new_value);
-				return false;
-			}
-		}
-	}
-
-	for (std::size_t i=0; i<n_property_tuples; ++i) {
-		if (property_value_vec[i] == old_value)
-			property_value_vec[i] = new_value;
-	}
-
-	return true;
+    boost::optional<MeshLib::PropertyVector<int> &> optional_property_value_vec(
+        mesh.getProperties().getPropertyVector<int>(property_name)
+    );
+
+    if (!optional_property_value_vec) {
+        return false;
+    }
+
+    MeshLib::PropertyVector<int> & property_value_vec(
+        optional_property_value_vec.get()
+    );
+    const std::size_t n_property_tuples(property_value_vec.getNumberOfTuples());
+
+    if (!replace_if_exists) {
+        for (std::size_t i=0; i<n_property_tuples; ++i) {
+            if (property_value_vec[i] == new_value) {
+                WARN ("ElementValueModification::replaceElementValue() "
+                    "- Replacement value \"%d\" is already taken, "
+                    "no changes have been made.", new_value);
+                return false;
+            }
+        }
+    }
+
+    for (std::size_t i=0; i<n_property_tuples; ++i) {
+        if (property_value_vec[i] == old_value)
+            property_value_vec[i] = new_value;
+    }
+
+    return true;
 }
 
 bool ElementValueModification::replace(MeshLib::Mesh &mesh,
-	int const old_value, int const new_value, bool replace_if_exists)
+    int const old_value, int const new_value, bool replace_if_exists)
 {
-	return replace(mesh, "MaterialIDs", old_value, new_value, replace_if_exists);
+    return replace(mesh, "MaterialIDs", old_value, new_value, replace_if_exists);
 }
 
 std::size_t ElementValueModification::condense(MeshLib::Mesh &mesh)
 {
-	boost::optional<MeshLib::PropertyVector<int> &>
-		optional_property_value_vec(
-			mesh.getProperties().getPropertyVector<int>("MaterialIDs")
-		);
-
-	if (!optional_property_value_vec) {
-		return 0;
-	}
-
-	MeshLib::PropertyVector<int> & property_value_vector(
-		optional_property_value_vec.get()
-	);
-	std::vector<int> value_mapping(
-		getSortedPropertyValues(property_value_vector)
-	);
-
-	std::vector<int> reverse_mapping(value_mapping.back()+1, 0);
-	std::size_t const nValues (value_mapping.size());
-	for (std::size_t i=0; i<nValues; ++i)
-		reverse_mapping[value_mapping[i]] = i;
-
-	std::size_t const n_property_values(property_value_vector.size());
-	for (std::size_t i=0; i<n_property_values; ++i)
-		property_value_vector[i] = reverse_mapping[property_value_vector[i]];
-
-	return nValues;
+    boost::optional<MeshLib::PropertyVector<int> &>
+        optional_property_value_vec(
+            mesh.getProperties().getPropertyVector<int>("MaterialIDs")
+        );
+
+    if (!optional_property_value_vec) {
+        return 0;
+    }
+
+    MeshLib::PropertyVector<int> & property_value_vector(
+        optional_property_value_vec.get()
+    );
+    std::vector<int> value_mapping(
+        getSortedPropertyValues(property_value_vector)
+    );
+
+    std::vector<int> reverse_mapping(value_mapping.back()+1, 0);
+    std::size_t const nValues (value_mapping.size());
+    for (std::size_t i=0; i<nValues; ++i)
+        reverse_mapping[value_mapping[i]] = i;
+
+    std::size_t const n_property_values(property_value_vector.size());
+    for (std::size_t i=0; i<n_property_values; ++i)
+        property_value_vector[i] = reverse_mapping[property_value_vector[i]];
+
+    return nValues;
 }
 
 std::size_t ElementValueModification::setByElementType(MeshLib::Mesh &mesh, MeshElemType ele_type, int const new_value)
 {
-	boost::optional<MeshLib::PropertyVector<int> &>
-		optional_property_value_vec(
-			mesh.getProperties().getPropertyVector<int>("MaterialIDs")
-		);
-
-	if (!optional_property_value_vec) {
-		return 0;
-	}
-
-	MeshLib::PropertyVector<int> & property_value_vector(
-		optional_property_value_vec.get()
-	);
-
-	std::vector<MeshLib::Element*> const& elements(mesh.getElements());
-	std::size_t cnt(0);
-	for (std::size_t k(0); k<elements.size(); k++) {
-		if (elements[k]->getGeomType()!=ele_type)
-			continue;
-		property_value_vector[k] = new_value;
-		cnt++;
-	}
-
-	return cnt;
+    boost::optional<MeshLib::PropertyVector<int> &>
+        optional_property_value_vec(
+            mesh.getProperties().getPropertyVector<int>("MaterialIDs")
+        );
+
+    if (!optional_property_value_vec) {
+        return 0;
+    }
+
+    MeshLib::PropertyVector<int> & property_value_vector(
+        optional_property_value_vec.get()
+    );
+
+    std::vector<MeshLib::Element*> const& elements(mesh.getElements());
+    std::size_t cnt(0);
+    for (std::size_t k(0); k<elements.size(); k++) {
+        if (elements[k]->getGeomType()!=ele_type)
+            continue;
+        property_value_vector[k] = new_value;
+        cnt++;
+    }
+
+    return cnt;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshEditing/ElementValueModification.h b/MeshLib/MeshEditing/ElementValueModification.h
index d349a1dd78a..f0af8e8b138 100644
--- a/MeshLib/MeshEditing/ElementValueModification.h
+++ b/MeshLib/MeshEditing/ElementValueModification.h
@@ -33,47 +33,47 @@ class Mesh;
 class ElementValueModification
 {
 public:
-	/// Reduces the values assigned the elements of mesh to the smallest possible range.
-	/// Returns the number of different values.
-	static std::size_t condense(MeshLib::Mesh &mesh);
+    /// Reduces the values assigned the elements of mesh to the smallest possible range.
+    /// Returns the number of different values.
+    static std::size_t condense(MeshLib::Mesh &mesh);
 
-	/// Replaces for all elements of mesh with the value old_value with new_value if possible.
-	/// Returns true if successful or false if the value is already taken.
-	static bool replace(MeshLib::Mesh &mesh, int const old_value, int const new_value, bool replace_if_exists = false);
+    /// Replaces for all elements of mesh with the value old_value with new_value if possible.
+    /// Returns true if successful or false if the value is already taken.
+    static bool replace(MeshLib::Mesh &mesh, int const old_value, int const new_value, bool replace_if_exists = false);
 
-	static bool replace(MeshLib::Mesh &mesh, std::string const& property_name,
-		int const old_value, int const new_value, bool replace_if_exists = false);
+    static bool replace(MeshLib::Mesh &mesh, std::string const& property_name,
+        int const old_value, int const new_value, bool replace_if_exists = false);
 
-	/// Sets new value for all elements having the given element type
-	/// Returns the number of elements having the given element type
-	static std::size_t setByElementType(MeshLib::Mesh &mesh, MeshElemType ele_type, int const new_value);
+    /// Sets new value for all elements having the given element type
+    /// Returns the number of elements having the given element type
+    static std::size_t setByElementType(MeshLib::Mesh &mesh, MeshElemType ele_type, int const new_value);
 
 private:
-	/// Returns sorted values of properties within the PropertyVector
-	/// These values are stored in a vector.
-	template <typename T>
-	static std::vector<T> getSortedPropertyValues(
-		MeshLib::PropertyVector<T> const& property_vector)
-	{
-		std::vector<T> value_mapping;
-		const std::size_t n_property_values(property_vector.size());
-		for (std::size_t i=0; i<n_property_values; ++i) {
-			bool exists(false);
-			T const& value (property_vector[i]);
-			std::size_t const size(value_mapping.size());
-			for (std::size_t j=0; j<size; ++j) {
-				if (value == value_mapping[j]) {
-					exists = true;
-					break;
-				}
-			}
-			if (!exists)
-				value_mapping.push_back(value);
-		}
+    /// Returns sorted values of properties within the PropertyVector
+    /// These values are stored in a vector.
+    template <typename T>
+    static std::vector<T> getSortedPropertyValues(
+        MeshLib::PropertyVector<T> const& property_vector)
+    {
+        std::vector<T> value_mapping;
+        const std::size_t n_property_values(property_vector.size());
+        for (std::size_t i=0; i<n_property_values; ++i) {
+            bool exists(false);
+            T const& value (property_vector[i]);
+            std::size_t const size(value_mapping.size());
+            for (std::size_t j=0; j<size; ++j) {
+                if (value == value_mapping[j]) {
+                    exists = true;
+                    break;
+                }
+            }
+            if (!exists)
+                value_mapping.push_back(value);
+        }
 
-		std::sort(value_mapping.begin(), value_mapping.end());
-		return value_mapping;
-	}
+        std::sort(value_mapping.begin(), value_mapping.end());
+        return value_mapping;
+    }
 
 };
 
diff --git a/MeshLib/MeshEditing/FlipElements.cpp b/MeshLib/MeshEditing/FlipElements.cpp
index d09c210e05b..b2931d757df 100644
--- a/MeshLib/MeshEditing/FlipElements.cpp
+++ b/MeshLib/MeshEditing/FlipElements.cpp
@@ -21,43 +21,43 @@ namespace MeshLib
 
 std::unique_ptr<MeshLib::Element> createFlippedElement(MeshLib::Element const& elem, std::vector<MeshLib::Node*> const& nodes)
 {
-	if (elem.getDimension()>2)
-		return nullptr;
+    if (elem.getDimension()>2)
+        return nullptr;
 
-	unsigned const n_nodes (elem.getNNodes());
-	MeshLib::Node** elem_nodes = new MeshLib::Node*[n_nodes];
-	for (unsigned i=0; i<n_nodes; ++i)
-		elem_nodes[i] = nodes[elem.getNode(i)->getID()];
-	std::swap(elem_nodes[0], elem_nodes[1]);
+    unsigned const n_nodes (elem.getNNodes());
+    MeshLib::Node** elem_nodes = new MeshLib::Node*[n_nodes];
+    for (unsigned i=0; i<n_nodes; ++i)
+        elem_nodes[i] = nodes[elem.getNode(i)->getID()];
+    std::swap(elem_nodes[0], elem_nodes[1]);
 
-	if (elem.getGeomType() == MeshElemType::LINE)
-		return std::unique_ptr<MeshLib::Line>(new MeshLib::Line(elem_nodes, elem.getID()));
-	else if (elem.getGeomType() == MeshElemType::TRIANGLE)
-		return std::unique_ptr<MeshLib::Tri>(new MeshLib::Tri(elem_nodes, elem.getID()));
-	else if (elem.getGeomType() == MeshElemType::QUAD)
-	{
-		std::swap(elem_nodes[2], elem_nodes[3]);
-		return std::unique_ptr<MeshLib::Quad>(new MeshLib::Quad(elem_nodes, elem.getID()));
-	}
-	return nullptr;
+    if (elem.getGeomType() == MeshElemType::LINE)
+        return std::unique_ptr<MeshLib::Line>(new MeshLib::Line(elem_nodes, elem.getID()));
+    else if (elem.getGeomType() == MeshElemType::TRIANGLE)
+        return std::unique_ptr<MeshLib::Tri>(new MeshLib::Tri(elem_nodes, elem.getID()));
+    else if (elem.getGeomType() == MeshElemType::QUAD)
+    {
+        std::swap(elem_nodes[2], elem_nodes[3]);
+        return std::unique_ptr<MeshLib::Quad>(new MeshLib::Quad(elem_nodes, elem.getID()));
+    }
+    return nullptr;
 }
 
 std::unique_ptr<MeshLib::Mesh> createFlippedMesh(MeshLib::Mesh const& mesh)
 {
-	if (mesh.getDimension() > 2)
-		return nullptr;
+    if (mesh.getDimension() > 2)
+        return nullptr;
 
-	std::vector<MeshLib::Node*> new_nodes (MeshLib::copyNodeVector(mesh.getNodes()));
-	std::vector<MeshLib::Element*> const& elems (mesh.getElements());
-	std::vector<MeshLib::Element*> new_elems;
-	std::size_t n_elems (mesh.getNElements());
-	new_elems.reserve(n_elems);
+    std::vector<MeshLib::Node*> new_nodes (MeshLib::copyNodeVector(mesh.getNodes()));
+    std::vector<MeshLib::Element*> const& elems (mesh.getElements());
+    std::vector<MeshLib::Element*> new_elems;
+    std::size_t n_elems (mesh.getNElements());
+    new_elems.reserve(n_elems);
 
-	for (std::size_t i=0; i<n_elems; ++i)
-		new_elems.push_back(createFlippedElement(*elems[i], new_nodes).release());
+    for (std::size_t i=0; i<n_elems; ++i)
+        new_elems.push_back(createFlippedElement(*elems[i], new_nodes).release());
 
-	MeshLib::Properties new_props (mesh.getProperties());
-	return std::unique_ptr<MeshLib::Mesh>(new MeshLib::Mesh("FlippedElementMesh", new_nodes, new_elems, new_props));
+    MeshLib::Properties new_props (mesh.getProperties());
+    return std::unique_ptr<MeshLib::Mesh>(new MeshLib::Mesh("FlippedElementMesh", new_nodes, new_elems, new_props));
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp
index 87efa916a55..7306eeeee44 100644
--- a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp
+++ b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp
@@ -30,7 +30,7 @@
 namespace MeshLib {
 
 Mesh2MeshPropertyInterpolation::Mesh2MeshPropertyInterpolation(Mesh const*const src_mesh, std::vector<double> const*const src_properties) :
-	_src_mesh(src_mesh), _src_properties(src_properties)
+    _src_mesh(src_mesh), _src_properties(src_properties)
 {}
 
 Mesh2MeshPropertyInterpolation::~Mesh2MeshPropertyInterpolation()
@@ -38,132 +38,132 @@ Mesh2MeshPropertyInterpolation::~Mesh2MeshPropertyInterpolation()
 
 bool Mesh2MeshPropertyInterpolation::setPropertiesForMesh(Mesh *dest_mesh, std::vector<double>& dest_properties) const
 {
-	if (_src_mesh->getDimension() != dest_mesh->getDimension()) {
-		ERR ("MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh() dimension of source (dim = %d) and destination (dim = %d) mesh does not match.", _src_mesh->getDimension(), dest_mesh->getDimension());
-		return false;
-	}
-
-	if (_src_mesh->getDimension() != 2) {
-		WARN ("MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh() implemented only for 2D case at the moment.");
-		return false;
-	}
-
-	GeoLib::AABB src_aabb(_src_mesh->getNodes().begin(), _src_mesh->getNodes().end());
-	GeoLib::AABB dest_aabb(dest_mesh->getNodes().begin(), dest_mesh->getNodes().end());
-	if (!src_aabb.containsAABB(dest_aabb)) {
-		ERR("MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh() source mesh to small.");
-		ERR("src_aabb: %f, %f, %f | %f, %f, %f", src_aabb.getMinPoint()[0], src_aabb.getMinPoint()[1], src_aabb.getMinPoint()[2], src_aabb.getMaxPoint()[0], src_aabb.getMaxPoint()[1], src_aabb.getMaxPoint()[2]);
-		ERR("dest_aabb: %f, %f, %f | %f, %f, %f", dest_aabb.getMinPoint()[0], dest_aabb.getMinPoint()[1], dest_aabb.getMinPoint()[2], dest_aabb.getMaxPoint()[0], dest_aabb.getMaxPoint()[1], dest_aabb.getMaxPoint()[2]);
-		return false;
-	}
-
-	interpolatePropertiesForMesh(dest_mesh, dest_properties);
-
-	return true;
+    if (_src_mesh->getDimension() != dest_mesh->getDimension()) {
+        ERR ("MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh() dimension of source (dim = %d) and destination (dim = %d) mesh does not match.", _src_mesh->getDimension(), dest_mesh->getDimension());
+        return false;
+    }
+
+    if (_src_mesh->getDimension() != 2) {
+        WARN ("MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh() implemented only for 2D case at the moment.");
+        return false;
+    }
+
+    GeoLib::AABB src_aabb(_src_mesh->getNodes().begin(), _src_mesh->getNodes().end());
+    GeoLib::AABB dest_aabb(dest_mesh->getNodes().begin(), dest_mesh->getNodes().end());
+    if (!src_aabb.containsAABB(dest_aabb)) {
+        ERR("MeshLib::Mesh2MeshPropertyInterpolation::setPropertiesForMesh() source mesh to small.");
+        ERR("src_aabb: %f, %f, %f | %f, %f, %f", src_aabb.getMinPoint()[0], src_aabb.getMinPoint()[1], src_aabb.getMinPoint()[2], src_aabb.getMaxPoint()[0], src_aabb.getMaxPoint()[1], src_aabb.getMaxPoint()[2]);
+        ERR("dest_aabb: %f, %f, %f | %f, %f, %f", dest_aabb.getMinPoint()[0], dest_aabb.getMinPoint()[1], dest_aabb.getMinPoint()[2], dest_aabb.getMaxPoint()[0], dest_aabb.getMaxPoint()[1], dest_aabb.getMaxPoint()[2]);
+        return false;
+    }
+
+    interpolatePropertiesForMesh(dest_mesh, dest_properties);
+
+    return true;
 }
 
 void Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(Mesh *dest_mesh, std::vector<double>& dest_properties) const
 {
-	// carry over property information from source elements to source nodes
-	std::vector<double> interpolated_src_node_properties(_src_mesh->getNNodes());
-	interpolateElementPropertiesToNodeProperties(interpolated_src_node_properties);
-
-	// looping over the destination elements and calculate properties
-	// from interpolated_src_node_properties
-	std::vector<MeshLib::Node*> const& src_nodes(_src_mesh->getNodes());
-
-	GeoLib::Grid<MeshLib::Node> src_grid(src_nodes.begin(), src_nodes.end(), 64);
-
-	auto materialIds = dest_mesh->getProperties().getPropertyVector<int>("MaterialIDs");
-	if (!materialIds)
-		materialIds = dest_mesh->getProperties().createNewPropertyVector<int>(
-			"MaterialIDs", MeshLib::MeshItemType::Cell, 1);
-	if (!materialIds)
-	{
-		ERR("Could not create PropertyVector for MaterialIDs in Mesh.");
-		return;
-	}
-
-	std::vector<MeshLib::Element*> const& dest_elements(dest_mesh->getElements());
-	const std::size_t n_dest_elements(dest_elements.size());
-	for (std::size_t k(0); k<n_dest_elements; k++)
-	{
-		// compute axis aligned bounding box around the current element
-		const GeoLib::AABB elem_aabb(dest_elements[k]->getNodes(), dest_elements[k]->getNodes()+dest_elements[k]->getNBaseNodes());
-
-		// request "interesting" nodes from grid
-		std::vector<std::vector<MeshLib::Node*> const*> nodes;
-		src_grid.getPntVecsOfGridCellsIntersectingCuboid(elem_aabb.getMinPoint(), elem_aabb.getMaxPoint(), nodes);
-
-		std::size_t cnt(0);
-		dest_properties[k] = 0.0;
-
-		for (std::size_t i(0); i<nodes.size(); ++i) {
-			std::vector<MeshLib::Node*> const* i_th_vec(nodes[i]);
-			const std::size_t n_nodes_in_vec(i_th_vec->size());
-			for (std::size_t j(0); j<n_nodes_in_vec; j++) {
-				MeshLib::Node const*const j_th_node((*i_th_vec)[j]);
-				if (elem_aabb.containsPoint(*j_th_node)) {
-					if (dest_elements[k]->isPntInElement(*j_th_node, 30)) {
-						dest_properties[k] += interpolated_src_node_properties[(*i_th_vec)[j]->getID()];
-						cnt++;
-					}
-				}
-			}
-		}
-
-		dest_properties[k] /= cnt;
-		materialIds->push_back(k);
-
-		if (cnt == 0) {
-			std::string base_name("DebugData/Element-");
-			base_name += std::to_string(k);
-
-			std::string aabb_fname(base_name + "-aabb.gli");
-			std::ofstream out_aabb(aabb_fname.c_str());
-			out_aabb << "#POINTS" << "\n";
-			out_aabb << "0 " << elem_aabb.getMinPoint() << "\n";
-			out_aabb << "1 " << elem_aabb.getMaxPoint() << "\n";
-			out_aabb << "#STOP" << "\n";
-			out_aabb.close();
-
-
-			std::string source_fname(base_name + "-SourceNodes.gli");
-			std::ofstream out_src(source_fname.c_str());
-			out_src << "#POINTS" << "\n";
-			std::size_t nodes_cnt(0);
-			for (std::size_t i(0); i<nodes.size(); ++i) {
-				std::vector<MeshLib::Node*> const* i_th_vec(nodes[i]);
-				const std::size_t n_nodes_in_vec(i_th_vec->size());
-				for (std::size_t j(0); j<n_nodes_in_vec; j++) {
-					MeshLib::Node const*const j_th_node((*i_th_vec)[j]);
-					out_src << nodes_cnt << " " << *(dynamic_cast<GeoLib::Point const*>(j_th_node)) << "\n";
-					nodes_cnt++;
-				}
-			}
-			out_src << "#STOP" << "\n";
-			out_src.close();
-			std::cerr << "no source nodes in dest element " << k << "\n";
-		}
-	}
+    // carry over property information from source elements to source nodes
+    std::vector<double> interpolated_src_node_properties(_src_mesh->getNNodes());
+    interpolateElementPropertiesToNodeProperties(interpolated_src_node_properties);
+
+    // looping over the destination elements and calculate properties
+    // from interpolated_src_node_properties
+    std::vector<MeshLib::Node*> const& src_nodes(_src_mesh->getNodes());
+
+    GeoLib::Grid<MeshLib::Node> src_grid(src_nodes.begin(), src_nodes.end(), 64);
+
+    auto materialIds = dest_mesh->getProperties().getPropertyVector<int>("MaterialIDs");
+    if (!materialIds)
+        materialIds = dest_mesh->getProperties().createNewPropertyVector<int>(
+            "MaterialIDs", MeshLib::MeshItemType::Cell, 1);
+    if (!materialIds)
+    {
+        ERR("Could not create PropertyVector for MaterialIDs in Mesh.");
+        return;
+    }
+
+    std::vector<MeshLib::Element*> const& dest_elements(dest_mesh->getElements());
+    const std::size_t n_dest_elements(dest_elements.size());
+    for (std::size_t k(0); k<n_dest_elements; k++)
+    {
+        // compute axis aligned bounding box around the current element
+        const GeoLib::AABB elem_aabb(dest_elements[k]->getNodes(), dest_elements[k]->getNodes()+dest_elements[k]->getNBaseNodes());
+
+        // request "interesting" nodes from grid
+        std::vector<std::vector<MeshLib::Node*> const*> nodes;
+        src_grid.getPntVecsOfGridCellsIntersectingCuboid(elem_aabb.getMinPoint(), elem_aabb.getMaxPoint(), nodes);
+
+        std::size_t cnt(0);
+        dest_properties[k] = 0.0;
+
+        for (std::size_t i(0); i<nodes.size(); ++i) {
+            std::vector<MeshLib::Node*> const* i_th_vec(nodes[i]);
+            const std::size_t n_nodes_in_vec(i_th_vec->size());
+            for (std::size_t j(0); j<n_nodes_in_vec; j++) {
+                MeshLib::Node const*const j_th_node((*i_th_vec)[j]);
+                if (elem_aabb.containsPoint(*j_th_node)) {
+                    if (dest_elements[k]->isPntInElement(*j_th_node, 30)) {
+                        dest_properties[k] += interpolated_src_node_properties[(*i_th_vec)[j]->getID()];
+                        cnt++;
+                    }
+                }
+            }
+        }
+
+        dest_properties[k] /= cnt;
+        materialIds->push_back(k);
+
+        if (cnt == 0) {
+            std::string base_name("DebugData/Element-");
+            base_name += std::to_string(k);
+
+            std::string aabb_fname(base_name + "-aabb.gli");
+            std::ofstream out_aabb(aabb_fname.c_str());
+            out_aabb << "#POINTS" << "\n";
+            out_aabb << "0 " << elem_aabb.getMinPoint() << "\n";
+            out_aabb << "1 " << elem_aabb.getMaxPoint() << "\n";
+            out_aabb << "#STOP" << "\n";
+            out_aabb.close();
+
+
+            std::string source_fname(base_name + "-SourceNodes.gli");
+            std::ofstream out_src(source_fname.c_str());
+            out_src << "#POINTS" << "\n";
+            std::size_t nodes_cnt(0);
+            for (std::size_t i(0); i<nodes.size(); ++i) {
+                std::vector<MeshLib::Node*> const* i_th_vec(nodes[i]);
+                const std::size_t n_nodes_in_vec(i_th_vec->size());
+                for (std::size_t j(0); j<n_nodes_in_vec; j++) {
+                    MeshLib::Node const*const j_th_node((*i_th_vec)[j]);
+                    out_src << nodes_cnt << " " << *(dynamic_cast<GeoLib::Point const*>(j_th_node)) << "\n";
+                    nodes_cnt++;
+                }
+            }
+            out_src << "#STOP" << "\n";
+            out_src.close();
+            std::cerr << "no source nodes in dest element " << k << "\n";
+        }
+    }
 }
 
 void Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodeProperties(std::vector<double> &interpolated_node_properties) const
 {
-	auto materialIds = _src_mesh->getProperties().getPropertyVector<int>("MaterialIDs");
-	if (!materialIds)
-		return;
-
-	std::vector<MeshLib::Node*> const& src_nodes(_src_mesh->getNodes());
-	const std::size_t n_src_nodes(src_nodes.size());
-	for (std::size_t k(0); k<n_src_nodes; k++) {
-		const std::size_t n_con_elems (src_nodes[k]->getNElements());
-		interpolated_node_properties[k] = (*_src_properties)[(*materialIds)[src_nodes[k]->getElement(0)->getID()]];
-		for (std::size_t j(1); j<n_con_elems; j++) {
-			interpolated_node_properties[k] += (*_src_properties)[(*materialIds)[src_nodes[k]->getElement(j)->getID()]];
-		}
-		interpolated_node_properties[k] /= n_con_elems;
-	}
+    auto materialIds = _src_mesh->getProperties().getPropertyVector<int>("MaterialIDs");
+    if (!materialIds)
+        return;
+
+    std::vector<MeshLib::Node*> const& src_nodes(_src_mesh->getNodes());
+    const std::size_t n_src_nodes(src_nodes.size());
+    for (std::size_t k(0); k<n_src_nodes; k++) {
+        const std::size_t n_con_elems (src_nodes[k]->getNElements());
+        interpolated_node_properties[k] = (*_src_properties)[(*materialIds)[src_nodes[k]->getElement(0)->getID()]];
+        for (std::size_t j(1); j<n_con_elems; j++) {
+            interpolated_node_properties[k] += (*_src_properties)[(*materialIds)[src_nodes[k]->getElement(j)->getID()]];
+        }
+        interpolated_node_properties[k] /= n_con_elems;
+    }
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h
index bde572076fa..cdaf987fc82 100644
--- a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h
+++ b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.h
@@ -26,46 +26,46 @@ class Mesh;
  */
 class Mesh2MeshPropertyInterpolation {
 public:
-	/**
-	 * Constructor taking the source or input mesh and properties.
-	 * @param source_mesh the mesh the given property information is
-	 * assigned to.
-	 * @param source_properties a vector containing property information
-	 * assigned to the mesh. The number of entries in the property vector
-	 * must be at least the number of different properties stored in mesh.
-	 * For instance if mesh has \f$n\f$ (pairwise) different property
-	 * indices the vector of properties must have \f$\ge n\f$ entries.
-	 */
-	Mesh2MeshPropertyInterpolation(Mesh const*const source_mesh, std::vector<double> const*const source_properties);
-	virtual ~Mesh2MeshPropertyInterpolation();
+    /**
+     * Constructor taking the source or input mesh and properties.
+     * @param source_mesh the mesh the given property information is
+     * assigned to.
+     * @param source_properties a vector containing property information
+     * assigned to the mesh. The number of entries in the property vector
+     * must be at least the number of different properties stored in mesh.
+     * For instance if mesh has \f$n\f$ (pairwise) different property
+     * indices the vector of properties must have \f$\ge n\f$ entries.
+     */
+    Mesh2MeshPropertyInterpolation(Mesh const*const source_mesh, std::vector<double> const*const source_properties);
+    virtual ~Mesh2MeshPropertyInterpolation();
 
-	/**
-	 * Calculates entries for the property vector and sets appropriate indices in the
-	 * mesh elements.
-	 * @param mesh the mesh the property information will be calculated and set via
-	 * weighted interpolation
-	 * @param properties at input a vector of length equal to the number of elements,
-	 * 	at output interpolated property values
-	 * @return true if the operation was successful, false on error
-	 */
-	bool setPropertiesForMesh(Mesh *mesh, std::vector<double>& properties) const;
+    /**
+     * Calculates entries for the property vector and sets appropriate indices in the
+     * mesh elements.
+     * @param mesh the mesh the property information will be calculated and set via
+     * weighted interpolation
+     * @param properties at input a vector of length equal to the number of elements,
+     *     at output interpolated property values
+     * @return true if the operation was successful, false on error
+     */
+    bool setPropertiesForMesh(Mesh *mesh, std::vector<double>& properties) const;
 
 private:
-	/**
-	 *
-	 * @param dest_mesh
-	 * @param dest_properties
-	 */
-	void interpolatePropertiesForMesh(Mesh *dest_mesh, std::vector<double>& dest_properties) const;
-	/**
-	 * Method interpolates the element wise given properties to the nodes of the element
-	 * @param interpolated_node_properties the vector must have the same number of entries as
-	 * the source mesh has number of nodes, the content of the particular entries will be overwritten
-	 */
-	void interpolateElementPropertiesToNodeProperties(std::vector<double> &interpolated_node_properties) const;
+    /**
+     *
+     * @param dest_mesh
+     * @param dest_properties
+     */
+    void interpolatePropertiesForMesh(Mesh *dest_mesh, std::vector<double>& dest_properties) const;
+    /**
+     * Method interpolates the element wise given properties to the nodes of the element
+     * @param interpolated_node_properties the vector must have the same number of entries as
+     * the source mesh has number of nodes, the content of the particular entries will be overwritten
+     */
+    void interpolateElementPropertiesToNodeProperties(std::vector<double> &interpolated_node_properties) const;
 
-	Mesh const*const _src_mesh;
-	std::vector<double> const*const _src_properties;
+    Mesh const*const _src_mesh;
+    std::vector<double> const*const _src_properties;
 };
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshEditing/MeshRevision.cpp b/MeshLib/MeshEditing/MeshRevision.cpp
index 9a6ee7b16bb..c7dfd3a9a33 100644
--- a/MeshLib/MeshEditing/MeshRevision.cpp
+++ b/MeshLib/MeshEditing/MeshRevision.cpp
@@ -32,840 +32,840 @@ namespace MeshLib {
 const std::array<unsigned, 8> MeshRevision::_hex_diametral_nodes = {{ 6, 7, 4, 5, 2, 3, 0, 1 }};
 
 MeshRevision::MeshRevision(MeshLib::Mesh &mesh) :
-	_mesh(mesh)
+    _mesh(mesh)
 {}
 
 
 MeshLib::Mesh* MeshRevision::collapseNodes(const std::string &new_mesh_name, double eps)
 {
-	std::vector<MeshLib::Node*> new_nodes (this->constructNewNodesArray(this->collapseNodeIndices(eps)));
-	std::vector<MeshLib::Element*> new_elements (MeshLib::copyElementVector(_mesh.getElements(), new_nodes));
-	this->resetNodeIDs();
-	return new MeshLib::Mesh(new_mesh_name, new_nodes, new_elements, _mesh.getProperties());
+    std::vector<MeshLib::Node*> new_nodes (this->constructNewNodesArray(this->collapseNodeIndices(eps)));
+    std::vector<MeshLib::Element*> new_elements (MeshLib::copyElementVector(_mesh.getElements(), new_nodes));
+    this->resetNodeIDs();
+    return new MeshLib::Mesh(new_mesh_name, new_nodes, new_elements, _mesh.getProperties());
 }
 
 unsigned MeshRevision::getNCollapsableNodes(double eps) const
 {
-	std::vector<std::size_t> id_map(this->collapseNodeIndices(eps));
-	std::size_t nNodes(id_map.size());
-	unsigned count(0);
-	for (std::size_t i = 0; i < nNodes; ++i)
-		if (i != id_map[i])
-			count++;
-	return count;
+    std::vector<std::size_t> id_map(this->collapseNodeIndices(eps));
+    std::size_t nNodes(id_map.size());
+    unsigned count(0);
+    for (std::size_t i = 0; i < nNodes; ++i)
+        if (i != id_map[i])
+            count++;
+    return count;
 }
 
 MeshLib::Mesh* MeshRevision::simplifyMesh(const std::string &new_mesh_name,
-	double eps, unsigned min_elem_dim)
+    double eps, unsigned min_elem_dim)
 {
-	if (this->_mesh.getNElements() == 0)
-		return nullptr;
-
-	// original data
-	std::vector<MeshLib::Element*> const& elements(this->_mesh.getElements());
-	MeshLib::Properties const& properties(_mesh.getProperties());
-	boost::optional<MeshLib::PropertyVector<int> const&> material_vec(
-		properties.getPropertyVector<int>("MaterialIDs"));
-
-	// data structures for the new mesh
-	std::vector<MeshLib::Node*> new_nodes = this->constructNewNodesArray(this->collapseNodeIndices(eps));
-	std::vector<MeshLib::Element*> new_elements;
-	MeshLib::Properties new_properties;
-	boost::optional<PropertyVector<int> &> new_material_vec;
-	if (material_vec) {
-		new_properties.createNewPropertyVector<int>(
-			"MaterialIDs", MeshItemType::Cell, 1);
-	}
-
-	for (std::size_t k(0); k<elements.size(); ++k) {
-		MeshLib::Element const*const elem(elements[k]);
-		unsigned n_unique_nodes(this->getNUniqueNodes(elem));
-		if (n_unique_nodes == elem->getNBaseNodes()
-			&& elem->getDimension() >= min_elem_dim)
-		{
-			ElementErrorCode e(elem->validate());
-			if (e[ElementErrorFlag::NonCoplanar])
-			{
-				std::size_t const n_new_elements(
-					subdivideElement(elem, new_nodes, new_elements));
-				if (n_new_elements == 0)
-				{
-					ERR("Element %d has unknown element type.", k);
-					this->resetNodeIDs();
-					this->cleanUp(new_nodes, new_elements);
-					return nullptr;
-				}
-				if (!material_vec)
-					continue;
-				new_material_vec->insert(new_material_vec->end(),
-					n_new_elements, (*material_vec)[k]);
-			} else {
-				new_elements.push_back(MeshLib::copyElement(elem, new_nodes));
-				// copy material values
-				if (material_vec)
-					new_material_vec->push_back((*material_vec)[k]);
-			}
-		}
-		else if (n_unique_nodes < elem->getNBaseNodes() && n_unique_nodes>1) {
-			std::size_t const n_new_elements(reduceElement(
-				elem, n_unique_nodes, new_nodes, new_elements, min_elem_dim)
-			);
-			if (!material_vec)
-				continue;
-			new_material_vec->insert(new_material_vec->end(),
-				n_new_elements, (*material_vec)[k]);
-		} else
-			ERR ("Something is wrong, more unique nodes than actual nodes");
-	}
-
-	this->resetNodeIDs();
-	if (!new_elements.empty())
-		return new MeshLib::Mesh(
-			new_mesh_name, new_nodes, new_elements, new_properties);
-
-	this->cleanUp(new_nodes, new_elements);
-	return nullptr;
+    if (this->_mesh.getNElements() == 0)
+        return nullptr;
+
+    // original data
+    std::vector<MeshLib::Element*> const& elements(this->_mesh.getElements());
+    MeshLib::Properties const& properties(_mesh.getProperties());
+    boost::optional<MeshLib::PropertyVector<int> const&> material_vec(
+        properties.getPropertyVector<int>("MaterialIDs"));
+
+    // data structures for the new mesh
+    std::vector<MeshLib::Node*> new_nodes = this->constructNewNodesArray(this->collapseNodeIndices(eps));
+    std::vector<MeshLib::Element*> new_elements;
+    MeshLib::Properties new_properties;
+    boost::optional<PropertyVector<int> &> new_material_vec;
+    if (material_vec) {
+        new_properties.createNewPropertyVector<int>(
+            "MaterialIDs", MeshItemType::Cell, 1);
+    }
+
+    for (std::size_t k(0); k<elements.size(); ++k) {
+        MeshLib::Element const*const elem(elements[k]);
+        unsigned n_unique_nodes(this->getNUniqueNodes(elem));
+        if (n_unique_nodes == elem->getNBaseNodes()
+            && elem->getDimension() >= min_elem_dim)
+        {
+            ElementErrorCode e(elem->validate());
+            if (e[ElementErrorFlag::NonCoplanar])
+            {
+                std::size_t const n_new_elements(
+                    subdivideElement(elem, new_nodes, new_elements));
+                if (n_new_elements == 0)
+                {
+                    ERR("Element %d has unknown element type.", k);
+                    this->resetNodeIDs();
+                    this->cleanUp(new_nodes, new_elements);
+                    return nullptr;
+                }
+                if (!material_vec)
+                    continue;
+                new_material_vec->insert(new_material_vec->end(),
+                    n_new_elements, (*material_vec)[k]);
+            } else {
+                new_elements.push_back(MeshLib::copyElement(elem, new_nodes));
+                // copy material values
+                if (material_vec)
+                    new_material_vec->push_back((*material_vec)[k]);
+            }
+        }
+        else if (n_unique_nodes < elem->getNBaseNodes() && n_unique_nodes>1) {
+            std::size_t const n_new_elements(reduceElement(
+                elem, n_unique_nodes, new_nodes, new_elements, min_elem_dim)
+            );
+            if (!material_vec)
+                continue;
+            new_material_vec->insert(new_material_vec->end(),
+                n_new_elements, (*material_vec)[k]);
+        } else
+            ERR ("Something is wrong, more unique nodes than actual nodes");
+    }
+
+    this->resetNodeIDs();
+    if (!new_elements.empty())
+        return new MeshLib::Mesh(
+            new_mesh_name, new_nodes, new_elements, new_properties);
+
+    this->cleanUp(new_nodes, new_elements);
+    return nullptr;
 }
 
 MeshLib::Mesh* MeshRevision::subdivideMesh(const std::string &new_mesh_name) const
 {
-	if (this->_mesh.getNElements() == 0)
-		return nullptr;
-
-	// original data
-	std::vector<MeshLib::Element*> const& elements(this->_mesh.getElements());
-	MeshLib::Properties const& properties(_mesh.getProperties());
-	boost::optional<MeshLib::PropertyVector<int> const&> material_vec(
-		properties.getPropertyVector<int>("MaterialIDs"));
-
-	// data structures for the new mesh
-	std::vector<MeshLib::Node*> new_nodes = MeshLib::copyNodeVector(_mesh.getNodes());
-	std::vector<MeshLib::Element*> new_elements;
-	MeshLib::Properties new_properties;
-	boost::optional<PropertyVector<int> &> new_material_vec;
-	if (material_vec) {
-		new_material_vec = new_properties.createNewPropertyVector<int>(
-			"MaterialIDs", MeshItemType::Cell, 1
-		);
-	}
-
-	for (std::size_t k(0); k<elements.size(); ++k) {
-		MeshLib::Element const*const elem(elements[k]);
-		ElementErrorCode error_code(elem->validate());
-		if (error_code[ElementErrorFlag::NonCoplanar])
-		{
-			std::size_t const n_new_elements(
-				subdivideElement(elem, new_nodes, new_elements));
-			if (n_new_elements == 0)
-			{
-				ERR("Element %d has unknown element type.", k);
-				this->cleanUp(new_nodes, new_elements);
-				return nullptr;
-			}
-			// copy material values
-			if (!material_vec)
-				continue;
-			new_material_vec->insert(new_material_vec->end(), n_new_elements,
-				(*material_vec)[k]);
-		} else {
-			new_elements.push_back(MeshLib::copyElement(elem, new_nodes));
-			// copy material values
-			if (material_vec)
-				new_material_vec->push_back((*material_vec)[k]);
-		}
-	}
-
-	if (!new_elements.empty())
-		return new MeshLib::Mesh(
-			new_mesh_name, new_nodes, new_elements, new_properties);
-
-	this->cleanUp(new_nodes, new_elements);
-	return nullptr;
+    if (this->_mesh.getNElements() == 0)
+        return nullptr;
+
+    // original data
+    std::vector<MeshLib::Element*> const& elements(this->_mesh.getElements());
+    MeshLib::Properties const& properties(_mesh.getProperties());
+    boost::optional<MeshLib::PropertyVector<int> const&> material_vec(
+        properties.getPropertyVector<int>("MaterialIDs"));
+
+    // data structures for the new mesh
+    std::vector<MeshLib::Node*> new_nodes = MeshLib::copyNodeVector(_mesh.getNodes());
+    std::vector<MeshLib::Element*> new_elements;
+    MeshLib::Properties new_properties;
+    boost::optional<PropertyVector<int> &> new_material_vec;
+    if (material_vec) {
+        new_material_vec = new_properties.createNewPropertyVector<int>(
+            "MaterialIDs", MeshItemType::Cell, 1
+        );
+    }
+
+    for (std::size_t k(0); k<elements.size(); ++k) {
+        MeshLib::Element const*const elem(elements[k]);
+        ElementErrorCode error_code(elem->validate());
+        if (error_code[ElementErrorFlag::NonCoplanar])
+        {
+            std::size_t const n_new_elements(
+                subdivideElement(elem, new_nodes, new_elements));
+            if (n_new_elements == 0)
+            {
+                ERR("Element %d has unknown element type.", k);
+                this->cleanUp(new_nodes, new_elements);
+                return nullptr;
+            }
+            // copy material values
+            if (!material_vec)
+                continue;
+            new_material_vec->insert(new_material_vec->end(), n_new_elements,
+                (*material_vec)[k]);
+        } else {
+            new_elements.push_back(MeshLib::copyElement(elem, new_nodes));
+            // copy material values
+            if (material_vec)
+                new_material_vec->push_back((*material_vec)[k]);
+        }
+    }
+
+    if (!new_elements.empty())
+        return new MeshLib::Mesh(
+            new_mesh_name, new_nodes, new_elements, new_properties);
+
+    this->cleanUp(new_nodes, new_elements);
+    return nullptr;
 }
 
 std::vector<std::size_t> MeshRevision::collapseNodeIndices(double eps) const
 {
-	const std::vector<MeshLib::Node*> &nodes(_mesh.getNodes());
-	const std::size_t nNodes(_mesh.getNNodes());
-	std::vector<std::size_t> id_map(nNodes);
-	const double half_eps(eps / 2.0);
-	const double sqr_eps(eps*eps);
-	std::iota(id_map.begin(), id_map.end(), 0);
-
-	GeoLib::Grid<MeshLib::Node> const grid(nodes.begin(), nodes.end(), 64);
-
-	for (std::size_t k = 0; k < nNodes; ++k)
-	{
-		MeshLib::Node const*const node(nodes[k]);
-		if (node->getID() != k)
-			continue;
-		std::vector<std::vector<MeshLib::Node*> const*> node_vectors(
-			grid.getPntVecsOfGridCellsIntersectingCube(*node, half_eps));
-
-		const std::size_t nVectors(node_vectors.size());
-		for (std::size_t i = 0; i < nVectors; ++i)
-		{
-			const std::vector<MeshLib::Node*> &cell_vector(*node_vectors[i]);
-			const std::size_t nGridCellNodes(cell_vector.size());
-			for (std::size_t j = 0; j < nGridCellNodes; ++j)
-			{
-				MeshLib::Node const*const test_node(cell_vector[j]);
-				// are node indices already identical (i.e. nodes will be collapsed)
-				if (id_map[node->getID()] == id_map[test_node->getID()])
-					continue;
-
-				// if test_node has already been collapsed to another node x, ignore it
-				// (if the current node would need to be collapsed with x it would already have happened when x was tested)
-				if (test_node->getID() != id_map[test_node->getID()])
-					continue;
-
-				// calc distance
-				if (MathLib::sqrDist(node->getCoords(), test_node->getCoords()) < sqr_eps)
-					id_map[test_node->getID()] = node->getID();
-			}
-		}
-	}
-	return id_map;
+    const std::vector<MeshLib::Node*> &nodes(_mesh.getNodes());
+    const std::size_t nNodes(_mesh.getNNodes());
+    std::vector<std::size_t> id_map(nNodes);
+    const double half_eps(eps / 2.0);
+    const double sqr_eps(eps*eps);
+    std::iota(id_map.begin(), id_map.end(), 0);
+
+    GeoLib::Grid<MeshLib::Node> const grid(nodes.begin(), nodes.end(), 64);
+
+    for (std::size_t k = 0; k < nNodes; ++k)
+    {
+        MeshLib::Node const*const node(nodes[k]);
+        if (node->getID() != k)
+            continue;
+        std::vector<std::vector<MeshLib::Node*> const*> node_vectors(
+            grid.getPntVecsOfGridCellsIntersectingCube(*node, half_eps));
+
+        const std::size_t nVectors(node_vectors.size());
+        for (std::size_t i = 0; i < nVectors; ++i)
+        {
+            const std::vector<MeshLib::Node*> &cell_vector(*node_vectors[i]);
+            const std::size_t nGridCellNodes(cell_vector.size());
+            for (std::size_t j = 0; j < nGridCellNodes; ++j)
+            {
+                MeshLib::Node const*const test_node(cell_vector[j]);
+                // are node indices already identical (i.e. nodes will be collapsed)
+                if (id_map[node->getID()] == id_map[test_node->getID()])
+                    continue;
+
+                // if test_node has already been collapsed to another node x, ignore it
+                // (if the current node would need to be collapsed with x it would already have happened when x was tested)
+                if (test_node->getID() != id_map[test_node->getID()])
+                    continue;
+
+                // calc distance
+                if (MathLib::sqrDist(node->getCoords(), test_node->getCoords()) < sqr_eps)
+                    id_map[test_node->getID()] = node->getID();
+            }
+        }
+    }
+    return id_map;
 }
 
 std::vector<MeshLib::Node*> MeshRevision::constructNewNodesArray(const std::vector<std::size_t> &id_map) const
 {
-	const std::vector<MeshLib::Node*> &nodes(_mesh.getNodes());
-	const std::size_t nNodes(nodes.size());
-	std::vector<MeshLib::Node*> new_nodes;
-	new_nodes.reserve(nNodes);
-	for (std::size_t k = 0; k < nNodes; ++k)
-	{
-		// all nodes that have not been collapsed with other nodes are copied into new array
-		if (nodes[k]->getID() == id_map[k])
-		{
-			std::size_t const id(new_nodes.size());
-			new_nodes.push_back(new MeshLib::Node((*nodes[k])[0], (*nodes[k])[1], (*nodes[k])[2], id));
-			nodes[k]->setID(id); // the node in the old array gets the index of the same node in the new array
-		}
-		// the other nodes are not copied and get the index of the nodes they will have been collapsed with
-		else
-			nodes[k]->setID(nodes[id_map[k]]->getID());
-	}
-	return new_nodes;
+    const std::vector<MeshLib::Node*> &nodes(_mesh.getNodes());
+    const std::size_t nNodes(nodes.size());
+    std::vector<MeshLib::Node*> new_nodes;
+    new_nodes.reserve(nNodes);
+    for (std::size_t k = 0; k < nNodes; ++k)
+    {
+        // all nodes that have not been collapsed with other nodes are copied into new array
+        if (nodes[k]->getID() == id_map[k])
+        {
+            std::size_t const id(new_nodes.size());
+            new_nodes.push_back(new MeshLib::Node((*nodes[k])[0], (*nodes[k])[1], (*nodes[k])[2], id));
+            nodes[k]->setID(id); // the node in the old array gets the index of the same node in the new array
+        }
+        // the other nodes are not copied and get the index of the nodes they will have been collapsed with
+        else
+            nodes[k]->setID(nodes[id_map[k]]->getID());
+    }
+    return new_nodes;
 }
 
 unsigned MeshRevision::getNUniqueNodes(MeshLib::Element const*const element) const
 {
-	unsigned const nNodes(element->getNBaseNodes());
-	unsigned count(nNodes);
-
-	for (unsigned i = 0; i < nNodes - 1; ++i)
-		for (unsigned j = i + 1; j < nNodes; ++j)
-			if (element->getNode(i)->getID() == element->getNode(j)->getID())
-			{
-				count--;
-				break;
-			}
-	return count;
+    unsigned const nNodes(element->getNBaseNodes());
+    unsigned count(nNodes);
+
+    for (unsigned i = 0; i < nNodes - 1; ++i)
+        for (unsigned j = i + 1; j < nNodes; ++j)
+            if (element->getNode(i)->getID() == element->getNode(j)->getID())
+            {
+                count--;
+                break;
+            }
+    return count;
 }
 
 void MeshRevision::resetNodeIDs()
 {
-	const std::size_t nNodes(this->_mesh.getNNodes());
-	const std::vector<MeshLib::Node*> &nodes(_mesh.getNodes());
-	for (std::size_t i = 0; i < nNodes; ++i)
-		nodes[i]->setID(i);
+    const std::size_t nNodes(this->_mesh.getNNodes());
+    const std::vector<MeshLib::Node*> &nodes(_mesh.getNodes());
+    for (std::size_t i = 0; i < nNodes; ++i)
+        nodes[i]->setID(i);
 }
 
 std::size_t MeshRevision::subdivideElement(
-	MeshLib::Element const*const element,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::vector<MeshLib::Element*> & elements) const
+    MeshLib::Element const*const element,
+    std::vector<MeshLib::Node*> const& nodes,
+    std::vector<MeshLib::Element*> & elements) const
 {
-	if (element->getGeomType() == MeshElemType::QUAD)
-		return this->subdivideQuad(element, nodes, elements);
-	else if (element->getGeomType() == MeshElemType::HEXAHEDRON)
-		return this->subdivideHex(element, nodes, elements);
-	else if (element->getGeomType() == MeshElemType::PYRAMID)
-		return this->subdividePyramid(element, nodes, elements);
-	else if (element->getGeomType() == MeshElemType::PRISM)
-		return this->subdividePrism(element, nodes, elements);
-	return 0;
+    if (element->getGeomType() == MeshElemType::QUAD)
+        return this->subdivideQuad(element, nodes, elements);
+    else if (element->getGeomType() == MeshElemType::HEXAHEDRON)
+        return this->subdivideHex(element, nodes, elements);
+    else if (element->getGeomType() == MeshElemType::PYRAMID)
+        return this->subdividePyramid(element, nodes, elements);
+    else if (element->getGeomType() == MeshElemType::PRISM)
+        return this->subdividePrism(element, nodes, elements);
+    return 0;
 }
 
 std::size_t MeshRevision::reduceElement(MeshLib::Element const*const element,
-	unsigned n_unique_nodes,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::vector<MeshLib::Element*> & elements,
-	unsigned min_elem_dim) const
+    unsigned n_unique_nodes,
+    std::vector<MeshLib::Node*> const& nodes,
+    std::vector<MeshLib::Element*> & elements,
+    unsigned min_elem_dim) const
 {
-	/***************
-	 * TODO: modify neighbouring elements if one elements has been subdivided
-	 ***************/
-	if (element->getGeomType() == MeshElemType::TRIANGLE && min_elem_dim == 1)
-	{
-		elements.push_back (this->constructLine(element, nodes));
-		return 1;
-	} else
-		if ((element->getGeomType() == MeshElemType::QUAD) ||
-			(element->getGeomType() == MeshElemType::TETRAHEDRON))
-	{
-		if (n_unique_nodes == 3 && min_elem_dim < 3)
-			elements.push_back (this->constructTri(element, nodes));
-		else if (min_elem_dim == 1)
-			elements.push_back (this->constructLine(element, nodes));
-		return 1;
-	}
-	else if (element->getGeomType() == MeshElemType::HEXAHEDRON) {
-		return reduceHex(element, n_unique_nodes, nodes, elements, min_elem_dim);
-	} else if (element->getGeomType() == MeshElemType::PYRAMID) {
-		this->reducePyramid(element, n_unique_nodes, nodes, elements, min_elem_dim);
-		return 1;
-	} else if (element->getGeomType() == MeshElemType::PRISM) {
-		return reducePrism(element, n_unique_nodes, nodes, elements, min_elem_dim);
-	}
-
-	ERR ("Unknown element type.");
-	return 0;
+    /***************
+     * TODO: modify neighbouring elements if one elements has been subdivided
+     ***************/
+    if (element->getGeomType() == MeshElemType::TRIANGLE && min_elem_dim == 1)
+    {
+        elements.push_back (this->constructLine(element, nodes));
+        return 1;
+    } else
+        if ((element->getGeomType() == MeshElemType::QUAD) ||
+            (element->getGeomType() == MeshElemType::TETRAHEDRON))
+    {
+        if (n_unique_nodes == 3 && min_elem_dim < 3)
+            elements.push_back (this->constructTri(element, nodes));
+        else if (min_elem_dim == 1)
+            elements.push_back (this->constructLine(element, nodes));
+        return 1;
+    }
+    else if (element->getGeomType() == MeshElemType::HEXAHEDRON) {
+        return reduceHex(element, n_unique_nodes, nodes, elements, min_elem_dim);
+    } else if (element->getGeomType() == MeshElemType::PYRAMID) {
+        this->reducePyramid(element, n_unique_nodes, nodes, elements, min_elem_dim);
+        return 1;
+    } else if (element->getGeomType() == MeshElemType::PRISM) {
+        return reducePrism(element, n_unique_nodes, nodes, elements, min_elem_dim);
+    }
+
+    ERR ("Unknown element type.");
+    return 0;
 }
 
 unsigned MeshRevision::subdivideQuad(MeshLib::Element const*const quad,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::vector<MeshLib::Element*> &new_elements) const
+    std::vector<MeshLib::Node*> const& nodes,
+    std::vector<MeshLib::Element*> &new_elements) const
 {
-	MeshLib::Node** tri1_nodes = new MeshLib::Node*[3];
-	tri1_nodes[0] = nodes[quad->getNode(0)->getID()];
-	tri1_nodes[1] = nodes[quad->getNode(1)->getID()];
-	tri1_nodes[2] = nodes[quad->getNode(2)->getID()];
-	new_elements.push_back(new MeshLib::Tri(tri1_nodes));
-
-	MeshLib::Node** tri2_nodes = new MeshLib::Node*[3];
-	tri2_nodes[0] = nodes[quad->getNode(0)->getID()];
-	tri2_nodes[1] = nodes[quad->getNode(2)->getID()];
-	tri2_nodes[2] = nodes[quad->getNode(3)->getID()];
-	new_elements.push_back(new MeshLib::Tri(tri2_nodes));
-
-	return 2;
+    MeshLib::Node** tri1_nodes = new MeshLib::Node*[3];
+    tri1_nodes[0] = nodes[quad->getNode(0)->getID()];
+    tri1_nodes[1] = nodes[quad->getNode(1)->getID()];
+    tri1_nodes[2] = nodes[quad->getNode(2)->getID()];
+    new_elements.push_back(new MeshLib::Tri(tri1_nodes));
+
+    MeshLib::Node** tri2_nodes = new MeshLib::Node*[3];
+    tri2_nodes[0] = nodes[quad->getNode(0)->getID()];
+    tri2_nodes[1] = nodes[quad->getNode(2)->getID()];
+    tri2_nodes[2] = nodes[quad->getNode(3)->getID()];
+    new_elements.push_back(new MeshLib::Tri(tri2_nodes));
+
+    return 2;
 }
 
 unsigned MeshRevision::subdivideHex(MeshLib::Element const*const hex,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::vector<MeshLib::Element*> &new_elements) const
+    std::vector<MeshLib::Node*> const& nodes,
+    std::vector<MeshLib::Element*> &new_elements) const
 {
-	MeshLib::Node** prism1_nodes = new MeshLib::Node*[6];
-	prism1_nodes[0] = nodes[hex->getNode(0)->getID()];
-	prism1_nodes[1] = nodes[hex->getNode(2)->getID()];
-	prism1_nodes[2] = nodes[hex->getNode(1)->getID()];
-	prism1_nodes[3] = nodes[hex->getNode(4)->getID()];
-	prism1_nodes[4] = nodes[hex->getNode(6)->getID()];
-	prism1_nodes[5] = nodes[hex->getNode(5)->getID()];
-	MeshLib::Prism* prism1 (new MeshLib::Prism(prism1_nodes));
-	this->subdividePrism(prism1, nodes, new_elements);
-	delete prism1;
-
-	MeshLib::Node** prism2_nodes = new MeshLib::Node*[6];
-	prism2_nodes[0] = nodes[hex->getNode(4)->getID()];
-	prism2_nodes[1] = nodes[hex->getNode(6)->getID()];
-	prism2_nodes[2] = nodes[hex->getNode(7)->getID()];
-	prism2_nodes[3] = nodes[hex->getNode(0)->getID()];
-	prism2_nodes[4] = nodes[hex->getNode(2)->getID()];
-	prism2_nodes[5] = nodes[hex->getNode(3)->getID()];
-	MeshLib::Prism* prism2 (new MeshLib::Prism(prism2_nodes));
-	this->subdividePrism(prism2, nodes, new_elements);
-	delete prism2;
-
-	return 6;
+    MeshLib::Node** prism1_nodes = new MeshLib::Node*[6];
+    prism1_nodes[0] = nodes[hex->getNode(0)->getID()];
+    prism1_nodes[1] = nodes[hex->getNode(2)->getID()];
+    prism1_nodes[2] = nodes[hex->getNode(1)->getID()];
+    prism1_nodes[3] = nodes[hex->getNode(4)->getID()];
+    prism1_nodes[4] = nodes[hex->getNode(6)->getID()];
+    prism1_nodes[5] = nodes[hex->getNode(5)->getID()];
+    MeshLib::Prism* prism1 (new MeshLib::Prism(prism1_nodes));
+    this->subdividePrism(prism1, nodes, new_elements);
+    delete prism1;
+
+    MeshLib::Node** prism2_nodes = new MeshLib::Node*[6];
+    prism2_nodes[0] = nodes[hex->getNode(4)->getID()];
+    prism2_nodes[1] = nodes[hex->getNode(6)->getID()];
+    prism2_nodes[2] = nodes[hex->getNode(7)->getID()];
+    prism2_nodes[3] = nodes[hex->getNode(0)->getID()];
+    prism2_nodes[4] = nodes[hex->getNode(2)->getID()];
+    prism2_nodes[5] = nodes[hex->getNode(3)->getID()];
+    MeshLib::Prism* prism2 (new MeshLib::Prism(prism2_nodes));
+    this->subdividePrism(prism2, nodes, new_elements);
+    delete prism2;
+
+    return 6;
 }
 
 unsigned MeshRevision::subdividePyramid(MeshLib::Element const*const pyramid,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::vector<MeshLib::Element*> &new_elements) const
+    std::vector<MeshLib::Node*> const& nodes,
+    std::vector<MeshLib::Element*> &new_elements) const
 {
-	auto addTetrahedron = [&pyramid, &nodes, &new_elements](
-	    std::size_t id0, std::size_t id1, std::size_t id2, std::size_t id3)
-	{
-		MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
-		tet_nodes[0] = nodes[pyramid->getNode(id0)->getID()];
-		tet_nodes[1] = nodes[pyramid->getNode(id1)->getID()];
-		tet_nodes[2] = nodes[pyramid->getNode(id2)->getID()];
-		tet_nodes[3] = nodes[pyramid->getNode(id3)->getID()];
-		new_elements.push_back(new MeshLib::Tet(tet_nodes));
-	};
-
-	addTetrahedron(0,1,2,4);
-
-	addTetrahedron(0,2,3,4);
-
-	return 2;
+    auto addTetrahedron = [&pyramid, &nodes, &new_elements](
+        std::size_t id0, std::size_t id1, std::size_t id2, std::size_t id3)
+    {
+        MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
+        tet_nodes[0] = nodes[pyramid->getNode(id0)->getID()];
+        tet_nodes[1] = nodes[pyramid->getNode(id1)->getID()];
+        tet_nodes[2] = nodes[pyramid->getNode(id2)->getID()];
+        tet_nodes[3] = nodes[pyramid->getNode(id3)->getID()];
+        new_elements.push_back(new MeshLib::Tet(tet_nodes));
+    };
+
+    addTetrahedron(0,1,2,4);
+
+    addTetrahedron(0,2,3,4);
+
+    return 2;
 }
 
 unsigned MeshRevision::subdividePrism(MeshLib::Element const*const prism,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::vector<MeshLib::Element*> &new_elements) const
+    std::vector<MeshLib::Node*> const& nodes,
+    std::vector<MeshLib::Element*> &new_elements) const
 {
-	auto addTetrahedron = [&prism, &nodes, &new_elements](
-	    std::size_t id0, std::size_t id1, std::size_t id2, std::size_t id3)
-	{
-		MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
-		tet_nodes[0] = nodes[prism->getNode(id0)->getID()];
-		tet_nodes[1] = nodes[prism->getNode(id1)->getID()];
-		tet_nodes[2] = nodes[prism->getNode(id2)->getID()];
-		tet_nodes[3] = nodes[prism->getNode(id3)->getID()];
-		new_elements.push_back(new MeshLib::Tet(tet_nodes));
-	};
+    auto addTetrahedron = [&prism, &nodes, &new_elements](
+        std::size_t id0, std::size_t id1, std::size_t id2, std::size_t id3)
+    {
+        MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
+        tet_nodes[0] = nodes[prism->getNode(id0)->getID()];
+        tet_nodes[1] = nodes[prism->getNode(id1)->getID()];
+        tet_nodes[2] = nodes[prism->getNode(id2)->getID()];
+        tet_nodes[3] = nodes[prism->getNode(id3)->getID()];
+        new_elements.push_back(new MeshLib::Tet(tet_nodes));
+    };
 
-	addTetrahedron(0, 1, 2, 3);
+    addTetrahedron(0, 1, 2, 3);
 
-	addTetrahedron(3, 2, 4, 5);
+    addTetrahedron(3, 2, 4, 5);
 
-	addTetrahedron(2, 1, 3, 4);
+    addTetrahedron(2, 1, 3, 4);
 
-	return 3;
+    return 3;
 }
 
 unsigned MeshRevision::reduceHex(MeshLib::Element const*const org_elem,
-	unsigned n_unique_nodes,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::vector<MeshLib::Element*> &new_elements,
-	unsigned min_elem_dim) const
+    unsigned n_unique_nodes,
+    std::vector<MeshLib::Node*> const& nodes,
+    std::vector<MeshLib::Element*> &new_elements,
+    unsigned min_elem_dim) const
 {
-	// TODO?
-	// if two diametral nodes collapse, all kinds of bizarre (2D-)element combinations could be the result.
-	// this case is currently not implemented!
-
-	if (n_unique_nodes == 7)
-	{
-		// reduce to prism + pyramid
-		for (unsigned i=0; i<7; ++i)
-			for (unsigned j=i+1; j<8; ++j)
-				if (org_elem->getNode(i)->getID() == org_elem->getNode(j)->getID())
-				{
-					const std::array<unsigned,4> base_nodes (this->lutHexCuttingQuadNodes(i,j));
-					MeshLib::Node** pyr_nodes = new MeshLib::Node*[5];
-					pyr_nodes[0] = nodes[org_elem->getNode(base_nodes[0])->getID()];
-					pyr_nodes[1] = nodes[org_elem->getNode(base_nodes[1])->getID()];
-					pyr_nodes[2] = nodes[org_elem->getNode(base_nodes[2])->getID()];
-					pyr_nodes[3] = nodes[org_elem->getNode(base_nodes[3])->getID()];
-					pyr_nodes[4] = nodes[org_elem->getNode(i)->getID()];
-					new_elements.push_back (new MeshLib::Pyramid(pyr_nodes));
-
-					if (i<4 && j>=4) std::swap(i,j);
-					MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
-					prism_nodes[0] = nodes[org_elem->getNode(base_nodes[0])->getID()];
-					prism_nodes[1] = nodes[org_elem->getNode(base_nodes[3])->getID()];
-					prism_nodes[2] = nodes[org_elem->getNode(this->lutHexDiametralNode(j))->getID()];
-					prism_nodes[3] = nodes[org_elem->getNode(base_nodes[1])->getID()];
-					prism_nodes[4] = nodes[org_elem->getNode(base_nodes[2])->getID()];
-					prism_nodes[5] = nodes[org_elem->getNode(this->lutHexDiametralNode(i))->getID()];
-					new_elements.push_back (new MeshLib::Prism(prism_nodes));
-					return 2;
-				}
-	}
-	else if (n_unique_nodes == 6)
-	{
-		// reduce to prism
-		for (unsigned i=0; i<6; ++i)
-		{
-			const MeshLib::Element* face (org_elem->getFace(i));
-			if (face->getNode(0)->getID() == face->getNode(1)->getID() && face->getNode(2)->getID() == face->getNode(3)->getID())
-			{
-				MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
-				prism_nodes[0] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(0))))->getID()];
-				prism_nodes[1] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(1))))->getID()];
-				prism_nodes[2] = nodes[org_elem->getNode(org_elem->getNodeIDinElement(face->getNode(2)))->getID()];
-				prism_nodes[3] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(2))))->getID()];
-				prism_nodes[4] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(3))))->getID()];
-				prism_nodes[5] = nodes[org_elem->getNode(org_elem->getNodeIDinElement(face->getNode(0)))->getID()];
-				new_elements.push_back (new MeshLib::Prism(prism_nodes));
-				delete face;
-				return 1;
-			}
-			if (face->getNode(0)->getID() == face->getNode(3)->getID() && face->getNode(1)->getID() == face->getNode(2)->getID())
-			{
-				MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
-				prism_nodes[0] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(0))))->getID()];
-				prism_nodes[1] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(3))))->getID()];
-				prism_nodes[2] = nodes[org_elem->getNode(org_elem->getNodeIDinElement(face->getNode(2)))->getID()];
-				prism_nodes[3] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(1))))->getID()];
-				prism_nodes[4] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(2))))->getID()];
-				prism_nodes[5] = nodes[org_elem->getNode(org_elem->getNodeIDinElement(face->getNode(0)))->getID()];
-				delete face;
-				return 1;
-			}
-			delete face;
-		}
-		// reduce to four tets -> divide into 2 prisms such that each has one collapsed node
-		for (unsigned i=0; i<7; ++i)
-			for (unsigned j=i+1; j<8; ++j)
-				if (org_elem->getNode(i)->getID() == org_elem->getNode(j)->getID())
-				{
-					for (unsigned k=i; k<7; ++k)
-						for (unsigned l=k+1; l<8; ++l)
-							if (!(i==k && j==l) && org_elem->isEdge(i,j) && org_elem->isEdge(k,l) &&
-								org_elem->getNode(k)->getID() == org_elem->getNode(l)->getID())
-							{
-								const std::pair<unsigned, unsigned> back (this->lutHexBackNodes(i,j,k,l));
-								if (back.first == std::numeric_limits<unsigned>::max() || back.second == std::numeric_limits<unsigned>::max())
-								{
-									ERR ("Unexpected error during Hex reduction");
-									return 0;
-								}
-
-								std::array<unsigned, 4> cutting_plane (this->lutHexCuttingQuadNodes(back.first, back.second));
-								MeshLib::Node** pris1_nodes = new MeshLib::Node*[6];
-								pris1_nodes[0] = const_cast<MeshLib::Node*>(org_elem->getNode(back.first));
-								pris1_nodes[1] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[0]));
-								pris1_nodes[2] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[3]));
-								pris1_nodes[3] = const_cast<MeshLib::Node*>(org_elem->getNode(back.second));
-								pris1_nodes[4] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[1]));
-								pris1_nodes[5] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[2]));
-								MeshLib::Prism* prism1 (new MeshLib::Prism(pris1_nodes));
-								unsigned nNewElements = this->reducePrism(prism1, 5, nodes, new_elements, min_elem_dim);
-								delete prism1;
-
-								MeshLib::Node** pris2_nodes = new MeshLib::Node*[6];
-								pris2_nodes[0] = const_cast<MeshLib::Node*>(org_elem->getNode(this->lutHexDiametralNode(back.first)));
-								pris2_nodes[1] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[0]));
-								pris2_nodes[2] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[3]));
-								pris2_nodes[3] = const_cast<MeshLib::Node*>(org_elem->getNode(this->lutHexDiametralNode(back.second)));
-								pris2_nodes[4] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[1]));
-								pris2_nodes[5] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[2]));
-								MeshLib::Prism* prism2 (new MeshLib::Prism(pris2_nodes));
-								nNewElements += this->reducePrism(prism2, 5, nodes, new_elements, min_elem_dim);
-								delete prism2;
-								return nNewElements;
-							}
-				}
-	}
-	else if (n_unique_nodes == 5)
-	{
-		MeshLib::Element* tet1 (this->constructFourNodeElement(org_elem, nodes));
-		std::array<std::size_t, 4> first_four_nodes = {{ tet1->getNode(0)->getID(), tet1->getNode(1)->getID(), tet1->getNode(2)->getID(), tet1->getNode(3)->getID() }};
-		unsigned fifth_node (this->findPyramidTopNode(*org_elem, first_four_nodes));
-
-		bool tet_changed (false);
-		if (tet1->getGeomType() == MeshElemType::QUAD)
-		{
-			delete tet1;
-			tet_changed =true;
-			MeshLib::Node** tet1_nodes = new MeshLib::Node*[4];
-			tet1_nodes[0] = nodes[first_four_nodes[0]];
-			tet1_nodes[1] = nodes[first_four_nodes[1]];
-			tet1_nodes[2] = nodes[first_four_nodes[2]];
-			tet1_nodes[3] = nodes[org_elem->getNode(fifth_node)->getID()];
-			new_elements.push_back(new MeshLib::Tet(tet1_nodes));
-		}
-		else
-			new_elements.push_back(tet1);
-
-		MeshLib::Node** tet2_nodes = new MeshLib::Node*[4];
-		tet2_nodes[0] = (tet_changed) ? nodes[first_four_nodes[0]] : nodes[first_four_nodes[1]];
-		tet2_nodes[1] = nodes[first_four_nodes[2]];
-		tet2_nodes[2] = nodes[first_four_nodes[3]];
-		tet2_nodes[3] = nodes[org_elem->getNode(fifth_node)->getID()];
-		new_elements.push_back(new MeshLib::Tet(tet2_nodes));
-		return 2;
-	}
-	else if (n_unique_nodes == 4)
-	{
-		MeshLib::Element* elem (this->constructFourNodeElement(org_elem, nodes, min_elem_dim));
-		if (elem)
-		{
-			new_elements.push_back (elem);
-			return 1;
-		}
-	}
-	else if (n_unique_nodes == 3 && min_elem_dim < 3)
-	{
-		new_elements.push_back (this->constructTri(org_elem, nodes));
-		return 1;
-	}
-	else if (min_elem_dim == 1)
-	{
-		new_elements.push_back (this->constructLine(org_elem, nodes));
-		return 1;
-	}
-	return 0;
+    // TODO?
+    // if two diametral nodes collapse, all kinds of bizarre (2D-)element combinations could be the result.
+    // this case is currently not implemented!
+
+    if (n_unique_nodes == 7)
+    {
+        // reduce to prism + pyramid
+        for (unsigned i=0; i<7; ++i)
+            for (unsigned j=i+1; j<8; ++j)
+                if (org_elem->getNode(i)->getID() == org_elem->getNode(j)->getID())
+                {
+                    const std::array<unsigned,4> base_nodes (this->lutHexCuttingQuadNodes(i,j));
+                    MeshLib::Node** pyr_nodes = new MeshLib::Node*[5];
+                    pyr_nodes[0] = nodes[org_elem->getNode(base_nodes[0])->getID()];
+                    pyr_nodes[1] = nodes[org_elem->getNode(base_nodes[1])->getID()];
+                    pyr_nodes[2] = nodes[org_elem->getNode(base_nodes[2])->getID()];
+                    pyr_nodes[3] = nodes[org_elem->getNode(base_nodes[3])->getID()];
+                    pyr_nodes[4] = nodes[org_elem->getNode(i)->getID()];
+                    new_elements.push_back (new MeshLib::Pyramid(pyr_nodes));
+
+                    if (i<4 && j>=4) std::swap(i,j);
+                    MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
+                    prism_nodes[0] = nodes[org_elem->getNode(base_nodes[0])->getID()];
+                    prism_nodes[1] = nodes[org_elem->getNode(base_nodes[3])->getID()];
+                    prism_nodes[2] = nodes[org_elem->getNode(this->lutHexDiametralNode(j))->getID()];
+                    prism_nodes[3] = nodes[org_elem->getNode(base_nodes[1])->getID()];
+                    prism_nodes[4] = nodes[org_elem->getNode(base_nodes[2])->getID()];
+                    prism_nodes[5] = nodes[org_elem->getNode(this->lutHexDiametralNode(i))->getID()];
+                    new_elements.push_back (new MeshLib::Prism(prism_nodes));
+                    return 2;
+                }
+    }
+    else if (n_unique_nodes == 6)
+    {
+        // reduce to prism
+        for (unsigned i=0; i<6; ++i)
+        {
+            const MeshLib::Element* face (org_elem->getFace(i));
+            if (face->getNode(0)->getID() == face->getNode(1)->getID() && face->getNode(2)->getID() == face->getNode(3)->getID())
+            {
+                MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
+                prism_nodes[0] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(0))))->getID()];
+                prism_nodes[1] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(1))))->getID()];
+                prism_nodes[2] = nodes[org_elem->getNode(org_elem->getNodeIDinElement(face->getNode(2)))->getID()];
+                prism_nodes[3] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(2))))->getID()];
+                prism_nodes[4] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(3))))->getID()];
+                prism_nodes[5] = nodes[org_elem->getNode(org_elem->getNodeIDinElement(face->getNode(0)))->getID()];
+                new_elements.push_back (new MeshLib::Prism(prism_nodes));
+                delete face;
+                return 1;
+            }
+            if (face->getNode(0)->getID() == face->getNode(3)->getID() && face->getNode(1)->getID() == face->getNode(2)->getID())
+            {
+                MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
+                prism_nodes[0] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(0))))->getID()];
+                prism_nodes[1] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(3))))->getID()];
+                prism_nodes[2] = nodes[org_elem->getNode(org_elem->getNodeIDinElement(face->getNode(2)))->getID()];
+                prism_nodes[3] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(1))))->getID()];
+                prism_nodes[4] = nodes[org_elem->getNode(this->lutHexDiametralNode(org_elem->getNodeIDinElement(face->getNode(2))))->getID()];
+                prism_nodes[5] = nodes[org_elem->getNode(org_elem->getNodeIDinElement(face->getNode(0)))->getID()];
+                delete face;
+                return 1;
+            }
+            delete face;
+        }
+        // reduce to four tets -> divide into 2 prisms such that each has one collapsed node
+        for (unsigned i=0; i<7; ++i)
+            for (unsigned j=i+1; j<8; ++j)
+                if (org_elem->getNode(i)->getID() == org_elem->getNode(j)->getID())
+                {
+                    for (unsigned k=i; k<7; ++k)
+                        for (unsigned l=k+1; l<8; ++l)
+                            if (!(i==k && j==l) && org_elem->isEdge(i,j) && org_elem->isEdge(k,l) &&
+                                org_elem->getNode(k)->getID() == org_elem->getNode(l)->getID())
+                            {
+                                const std::pair<unsigned, unsigned> back (this->lutHexBackNodes(i,j,k,l));
+                                if (back.first == std::numeric_limits<unsigned>::max() || back.second == std::numeric_limits<unsigned>::max())
+                                {
+                                    ERR ("Unexpected error during Hex reduction");
+                                    return 0;
+                                }
+
+                                std::array<unsigned, 4> cutting_plane (this->lutHexCuttingQuadNodes(back.first, back.second));
+                                MeshLib::Node** pris1_nodes = new MeshLib::Node*[6];
+                                pris1_nodes[0] = const_cast<MeshLib::Node*>(org_elem->getNode(back.first));
+                                pris1_nodes[1] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[0]));
+                                pris1_nodes[2] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[3]));
+                                pris1_nodes[3] = const_cast<MeshLib::Node*>(org_elem->getNode(back.second));
+                                pris1_nodes[4] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[1]));
+                                pris1_nodes[5] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[2]));
+                                MeshLib::Prism* prism1 (new MeshLib::Prism(pris1_nodes));
+                                unsigned nNewElements = this->reducePrism(prism1, 5, nodes, new_elements, min_elem_dim);
+                                delete prism1;
+
+                                MeshLib::Node** pris2_nodes = new MeshLib::Node*[6];
+                                pris2_nodes[0] = const_cast<MeshLib::Node*>(org_elem->getNode(this->lutHexDiametralNode(back.first)));
+                                pris2_nodes[1] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[0]));
+                                pris2_nodes[2] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[3]));
+                                pris2_nodes[3] = const_cast<MeshLib::Node*>(org_elem->getNode(this->lutHexDiametralNode(back.second)));
+                                pris2_nodes[4] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[1]));
+                                pris2_nodes[5] = const_cast<MeshLib::Node*>(org_elem->getNode(cutting_plane[2]));
+                                MeshLib::Prism* prism2 (new MeshLib::Prism(pris2_nodes));
+                                nNewElements += this->reducePrism(prism2, 5, nodes, new_elements, min_elem_dim);
+                                delete prism2;
+                                return nNewElements;
+                            }
+                }
+    }
+    else if (n_unique_nodes == 5)
+    {
+        MeshLib::Element* tet1 (this->constructFourNodeElement(org_elem, nodes));
+        std::array<std::size_t, 4> first_four_nodes = {{ tet1->getNode(0)->getID(), tet1->getNode(1)->getID(), tet1->getNode(2)->getID(), tet1->getNode(3)->getID() }};
+        unsigned fifth_node (this->findPyramidTopNode(*org_elem, first_four_nodes));
+
+        bool tet_changed (false);
+        if (tet1->getGeomType() == MeshElemType::QUAD)
+        {
+            delete tet1;
+            tet_changed =true;
+            MeshLib::Node** tet1_nodes = new MeshLib::Node*[4];
+            tet1_nodes[0] = nodes[first_four_nodes[0]];
+            tet1_nodes[1] = nodes[first_four_nodes[1]];
+            tet1_nodes[2] = nodes[first_four_nodes[2]];
+            tet1_nodes[3] = nodes[org_elem->getNode(fifth_node)->getID()];
+            new_elements.push_back(new MeshLib::Tet(tet1_nodes));
+        }
+        else
+            new_elements.push_back(tet1);
+
+        MeshLib::Node** tet2_nodes = new MeshLib::Node*[4];
+        tet2_nodes[0] = (tet_changed) ? nodes[first_four_nodes[0]] : nodes[first_four_nodes[1]];
+        tet2_nodes[1] = nodes[first_four_nodes[2]];
+        tet2_nodes[2] = nodes[first_four_nodes[3]];
+        tet2_nodes[3] = nodes[org_elem->getNode(fifth_node)->getID()];
+        new_elements.push_back(new MeshLib::Tet(tet2_nodes));
+        return 2;
+    }
+    else if (n_unique_nodes == 4)
+    {
+        MeshLib::Element* elem (this->constructFourNodeElement(org_elem, nodes, min_elem_dim));
+        if (elem)
+        {
+            new_elements.push_back (elem);
+            return 1;
+        }
+    }
+    else if (n_unique_nodes == 3 && min_elem_dim < 3)
+    {
+        new_elements.push_back (this->constructTri(org_elem, nodes));
+        return 1;
+    }
+    else if (min_elem_dim == 1)
+    {
+        new_elements.push_back (this->constructLine(org_elem, nodes));
+        return 1;
+    }
+    return 0;
 }
 
 void MeshRevision::reducePyramid(MeshLib::Element const*const org_elem,
-	unsigned n_unique_nodes,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::vector<MeshLib::Element*> & new_elements,
-	unsigned min_elem_dim) const
+    unsigned n_unique_nodes,
+    std::vector<MeshLib::Node*> const& nodes,
+    std::vector<MeshLib::Element*> & new_elements,
+    unsigned min_elem_dim) const
 {
-	if (n_unique_nodes == 4)
-	{
-		MeshLib::Element* elem (this->constructFourNodeElement(org_elem, nodes, min_elem_dim));
-		if (elem)
-			new_elements.push_back (elem);
-	}
-	else if (n_unique_nodes == 3 && min_elem_dim < 3)
-		new_elements.push_back (this->constructTri(org_elem, nodes));
-	else if (n_unique_nodes == 2 && min_elem_dim == 1)
-		new_elements.push_back (this->constructLine(org_elem, nodes));
-	return;
+    if (n_unique_nodes == 4)
+    {
+        MeshLib::Element* elem (this->constructFourNodeElement(org_elem, nodes, min_elem_dim));
+        if (elem)
+            new_elements.push_back (elem);
+    }
+    else if (n_unique_nodes == 3 && min_elem_dim < 3)
+        new_elements.push_back (this->constructTri(org_elem, nodes));
+    else if (n_unique_nodes == 2 && min_elem_dim == 1)
+        new_elements.push_back (this->constructLine(org_elem, nodes));
+    return;
 }
 
 unsigned MeshRevision::reducePrism(MeshLib::Element const*const org_elem,
-	unsigned n_unique_nodes,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::vector<MeshLib::Element*> & new_elements,
-	unsigned min_elem_dim) const
+    unsigned n_unique_nodes,
+    std::vector<MeshLib::Node*> const& nodes,
+    std::vector<MeshLib::Element*> & new_elements,
+    unsigned min_elem_dim) const
 {
-	auto addTetrahedron = [&org_elem, &nodes, &new_elements](
-	    std::size_t id0, std::size_t id1, std::size_t id2, std::size_t id3)
-	{
-		MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
-		tet_nodes[0] = nodes[org_elem->getNode(id0)->getID()];
-		tet_nodes[1] = nodes[org_elem->getNode(id1)->getID()];
-		tet_nodes[2] = nodes[org_elem->getNode(id2)->getID()];
-		tet_nodes[3] = nodes[org_elem->getNode(id3)->getID()];
-		new_elements.push_back(new MeshLib::Tet(tet_nodes));
-	};
-
-	// TODO?
-	// In theory a node from the bottom triangle and a node from the top
-	// triangle that are not connected by an edge could collapse, resulting in a
-	// combination of tri and quad elements. This case is currently not tested.
-
-	// if one of the non-triangle edges collapsed, elem can be reduced to a
-	// pyramid, otherwise it will be two tets
-	if (n_unique_nodes == 5)
-	{
-		for (unsigned i=0; i<5; ++i)
-			for (unsigned j=i+1; j<6; ++j)
-				if (i!=j && org_elem->getNode(i)->getID() == org_elem->getNode(j)->getID())
-				{
-					// non triangle edge collapsed
-					if (i%3 == j%3)
-					{
-						addTetrahedron((i + 1) % 3, (i + 2) % 3, i,
-						               (i + 1) % 3 + 3);
-						addTetrahedron((i + 1) % 3 + 3, (i + 2) % 3, i,
-						               (i + 2) % 3 + 3);
-						return 2;
-					}
-
-					// triangle edge collapsed
-					const unsigned i_offset = (i>2) ? i-3 : i+3;
-					const unsigned j_offset = (i>2) ? j-3 : j+3;
-					const unsigned k = this->lutPrismThirdNode(i,j);
-					if (k == std::numeric_limits<unsigned>::max())
-					{
-						ERR ("Unexpected error during prism reduction.")
-						return 0;
-					}
-					const unsigned k_offset = (i>2) ? k-3 : k+3;
-
-					addTetrahedron(i_offset, j_offset, k_offset, i);
-
-					const unsigned l =
-					    (GeoLib::isCoplanar(*org_elem->getNode(i_offset),
-					                        *org_elem->getNode(k_offset),
-					                        *org_elem->getNode(i),
-					                        *org_elem->getNode(k)))
-					        ? j
-					        : i;
-					const unsigned l_offset = (i>2) ? l-3 : l+3;
-					addTetrahedron(l_offset, k_offset, i, k);
-					return 2;
-				}
-	}
-	else if (n_unique_nodes == 4)
-	{
-		MeshLib::Element* elem (this->constructFourNodeElement(org_elem, nodes, min_elem_dim));
-		if (elem)
-			new_elements.push_back (elem);
-	}
-	else if (n_unique_nodes == 3 && min_elem_dim < 3)
-		new_elements.push_back (this->constructTri(org_elem, nodes));
-	else if (n_unique_nodes == 2 && min_elem_dim == 1)
-		new_elements.push_back (this->constructLine(org_elem, nodes));
-	return 1;
+    auto addTetrahedron = [&org_elem, &nodes, &new_elements](
+        std::size_t id0, std::size_t id1, std::size_t id2, std::size_t id3)
+    {
+        MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
+        tet_nodes[0] = nodes[org_elem->getNode(id0)->getID()];
+        tet_nodes[1] = nodes[org_elem->getNode(id1)->getID()];
+        tet_nodes[2] = nodes[org_elem->getNode(id2)->getID()];
+        tet_nodes[3] = nodes[org_elem->getNode(id3)->getID()];
+        new_elements.push_back(new MeshLib::Tet(tet_nodes));
+    };
+
+    // TODO?
+    // In theory a node from the bottom triangle and a node from the top
+    // triangle that are not connected by an edge could collapse, resulting in a
+    // combination of tri and quad elements. This case is currently not tested.
+
+    // if one of the non-triangle edges collapsed, elem can be reduced to a
+    // pyramid, otherwise it will be two tets
+    if (n_unique_nodes == 5)
+    {
+        for (unsigned i=0; i<5; ++i)
+            for (unsigned j=i+1; j<6; ++j)
+                if (i!=j && org_elem->getNode(i)->getID() == org_elem->getNode(j)->getID())
+                {
+                    // non triangle edge collapsed
+                    if (i%3 == j%3)
+                    {
+                        addTetrahedron((i + 1) % 3, (i + 2) % 3, i,
+                                       (i + 1) % 3 + 3);
+                        addTetrahedron((i + 1) % 3 + 3, (i + 2) % 3, i,
+                                       (i + 2) % 3 + 3);
+                        return 2;
+                    }
+
+                    // triangle edge collapsed
+                    const unsigned i_offset = (i>2) ? i-3 : i+3;
+                    const unsigned j_offset = (i>2) ? j-3 : j+3;
+                    const unsigned k = this->lutPrismThirdNode(i,j);
+                    if (k == std::numeric_limits<unsigned>::max())
+                    {
+                        ERR ("Unexpected error during prism reduction.")
+                        return 0;
+                    }
+                    const unsigned k_offset = (i>2) ? k-3 : k+3;
+
+                    addTetrahedron(i_offset, j_offset, k_offset, i);
+
+                    const unsigned l =
+                        (GeoLib::isCoplanar(*org_elem->getNode(i_offset),
+                                            *org_elem->getNode(k_offset),
+                                            *org_elem->getNode(i),
+                                            *org_elem->getNode(k)))
+                            ? j
+                            : i;
+                    const unsigned l_offset = (i>2) ? l-3 : l+3;
+                    addTetrahedron(l_offset, k_offset, i, k);
+                    return 2;
+                }
+    }
+    else if (n_unique_nodes == 4)
+    {
+        MeshLib::Element* elem (this->constructFourNodeElement(org_elem, nodes, min_elem_dim));
+        if (elem)
+            new_elements.push_back (elem);
+    }
+    else if (n_unique_nodes == 3 && min_elem_dim < 3)
+        new_elements.push_back (this->constructTri(org_elem, nodes));
+    else if (n_unique_nodes == 2 && min_elem_dim == 1)
+        new_elements.push_back (this->constructLine(org_elem, nodes));
+    return 1;
 }
 
 MeshLib::Element* MeshRevision::constructLine(MeshLib::Element const*const element,
-	const std::vector<MeshLib::Node*> &nodes) const
+    const std::vector<MeshLib::Node*> &nodes) const
 {
-	MeshLib::Node** line_nodes = new MeshLib::Node*[2];
-	line_nodes[0] = nodes[element->getNode(0)->getID()];
-	line_nodes[1] = nullptr;
-	for (unsigned i=1; i<element->getNBaseNodes(); ++i)
-	{
-		if (element->getNode(i)->getID() != element->getNode(0)->getID())
-		{
-			line_nodes[1] = nodes[element->getNode(i)->getID()];
-			break;
-		}
-	}
-	assert(line_nodes[1] != nullptr);
-	return new MeshLib::Line(line_nodes);
+    MeshLib::Node** line_nodes = new MeshLib::Node*[2];
+    line_nodes[0] = nodes[element->getNode(0)->getID()];
+    line_nodes[1] = nullptr;
+    for (unsigned i=1; i<element->getNBaseNodes(); ++i)
+    {
+        if (element->getNode(i)->getID() != element->getNode(0)->getID())
+        {
+            line_nodes[1] = nodes[element->getNode(i)->getID()];
+            break;
+        }
+    }
+    assert(line_nodes[1] != nullptr);
+    return new MeshLib::Line(line_nodes);
 }
 
 MeshLib::Element* MeshRevision::constructTri(MeshLib::Element const*const element,
-	                                         const std::vector<MeshLib::Node*> &nodes) const
+                                             const std::vector<MeshLib::Node*> &nodes) const
 {
-	// TODO?
-	// In theory three unique nodes could also be reduced to two lines e.g. with
-	// a quad where two diametral nodes collapse. This case is currently not implemented!
-	MeshLib::Node** tri_nodes = new MeshLib::Node*[3];
-	tri_nodes[0] = nodes[element->getNode(0)->getID()];
-	tri_nodes[2] = nullptr;
-	for (unsigned i = 1; i < element->getNBaseNodes(); ++i)
-	{
-		if (element->getNode(i)->getID() != tri_nodes[0]->getID())
-		{
-			tri_nodes[1] = nodes[element->getNode(i)->getID()];
-			for (unsigned j = i + 1; j < element->getNBaseNodes(); ++j)
-			{
-				if (element->getNode(j)->getID() != tri_nodes[1]->getID())
-				{
-					tri_nodes[2] = nodes[element->getNode(j)->getID()];
-					break;
-				}
-			}
-			if (tri_nodes[2]) break;
-		}
-	}
-	assert(tri_nodes[2] != nullptr);
-	return new MeshLib::Tri(tri_nodes);
+    // TODO?
+    // In theory three unique nodes could also be reduced to two lines e.g. with
+    // a quad where two diametral nodes collapse. This case is currently not implemented!
+    MeshLib::Node** tri_nodes = new MeshLib::Node*[3];
+    tri_nodes[0] = nodes[element->getNode(0)->getID()];
+    tri_nodes[2] = nullptr;
+    for (unsigned i = 1; i < element->getNBaseNodes(); ++i)
+    {
+        if (element->getNode(i)->getID() != tri_nodes[0]->getID())
+        {
+            tri_nodes[1] = nodes[element->getNode(i)->getID()];
+            for (unsigned j = i + 1; j < element->getNBaseNodes(); ++j)
+            {
+                if (element->getNode(j)->getID() != tri_nodes[1]->getID())
+                {
+                    tri_nodes[2] = nodes[element->getNode(j)->getID()];
+                    break;
+                }
+            }
+            if (tri_nodes[2]) break;
+        }
+    }
+    assert(tri_nodes[2] != nullptr);
+    return new MeshLib::Tri(tri_nodes);
 }
 
 MeshLib::Element* MeshRevision::constructFourNodeElement(
-	MeshLib::Element const*const element,
-	std::vector<MeshLib::Node*> const& nodes,
-	unsigned min_elem_dim) const
+    MeshLib::Element const*const element,
+    std::vector<MeshLib::Node*> const& nodes,
+    unsigned min_elem_dim) const
 {
-	MeshLib::Node** new_nodes = new MeshLib::Node*[4];
-	unsigned count(0);
-	new_nodes[count++] = nodes[element->getNode(0)->getID()];
-	for (unsigned i=1; i<element->getNBaseNodes(); ++i)
-	{
-		if (count>3)
-			break;
-		bool unique_node (true);
-		for (unsigned j=0; j<i; ++j)
-		{
-			if (element->getNode(i)->getID() == element->getNode(j)->getID())
-			{
-				unique_node = false;
-				break;
-			}
-		}
-		if (unique_node)
-			new_nodes[count++] = nodes[element->getNode(i)->getID()];;
-	}
-
-	// test if quad or tet
-	const bool isQuad (GeoLib::isCoplanar(*new_nodes[0], *new_nodes[1], *new_nodes[2], *new_nodes[3]));
-	if (isQuad && min_elem_dim < 3)
-	{
-		MeshLib::Element* elem (new MeshLib::Quad(new_nodes));
-		for (unsigned i=1; i<3; ++i)
-		{
-			if (elem->validate().none())
-				return elem;
-			else
-			{
-				// change node order if not convex
-				MeshLib::Node* tmp = new_nodes[i+1];
-				new_nodes[i+1] = new_nodes[i];
-				new_nodes[i] = tmp;
-			}
-		}
-		return elem;
-	}
-	else if (!isQuad)
-		return new MeshLib::Tet(new_nodes);
-	else // is quad but min elem dim == 3
-		return nullptr;
+    MeshLib::Node** new_nodes = new MeshLib::Node*[4];
+    unsigned count(0);
+    new_nodes[count++] = nodes[element->getNode(0)->getID()];
+    for (unsigned i=1; i<element->getNBaseNodes(); ++i)
+    {
+        if (count>3)
+            break;
+        bool unique_node (true);
+        for (unsigned j=0; j<i; ++j)
+        {
+            if (element->getNode(i)->getID() == element->getNode(j)->getID())
+            {
+                unique_node = false;
+                break;
+            }
+        }
+        if (unique_node)
+            new_nodes[count++] = nodes[element->getNode(i)->getID()];;
+    }
+
+    // test if quad or tet
+    const bool isQuad (GeoLib::isCoplanar(*new_nodes[0], *new_nodes[1], *new_nodes[2], *new_nodes[3]));
+    if (isQuad && min_elem_dim < 3)
+    {
+        MeshLib::Element* elem (new MeshLib::Quad(new_nodes));
+        for (unsigned i=1; i<3; ++i)
+        {
+            if (elem->validate().none())
+                return elem;
+            else
+            {
+                // change node order if not convex
+                MeshLib::Node* tmp = new_nodes[i+1];
+                new_nodes[i+1] = new_nodes[i];
+                new_nodes[i] = tmp;
+            }
+        }
+        return elem;
+    }
+    else if (!isQuad)
+        return new MeshLib::Tet(new_nodes);
+    else // is quad but min elem dim == 3
+        return nullptr;
 }
 
 unsigned MeshRevision::findPyramidTopNode(MeshLib::Element const& element,
-	std::array<std::size_t,4> const& base_node_ids) const
+    std::array<std::size_t,4> const& base_node_ids) const
 {
-	const std::size_t nNodes (element.getNBaseNodes());
-	for (std::size_t i=0; i<nNodes; ++i)
-	{
-		bool top_node=true;
-		for (unsigned j=0; j<4; ++j)
-			if (element.getNode(i)->getID() == base_node_ids[j])
-				top_node=false;
-		if (top_node)
-			return i;
-	}
-	return std::numeric_limits<unsigned>::max(); // should never be reached if called correctly
+    const std::size_t nNodes (element.getNBaseNodes());
+    for (std::size_t i=0; i<nNodes; ++i)
+    {
+        bool top_node=true;
+        for (unsigned j=0; j<4; ++j)
+            if (element.getNode(i)->getID() == base_node_ids[j])
+                top_node=false;
+        if (top_node)
+            return i;
+    }
+    return std::numeric_limits<unsigned>::max(); // should never be reached if called correctly
 }
 
 unsigned MeshRevision::lutHexDiametralNode(unsigned id) const
 {
-	return _hex_diametral_nodes[id];
+    return _hex_diametral_nodes[id];
 }
 
 const std::array<unsigned,4> MeshRevision::lutHexCuttingQuadNodes(
-	unsigned id1, unsigned id2) const
+    unsigned id1, unsigned id2) const
 {
-	std::array<unsigned,4> nodes;
-	if      (id1==0 && id2==1) { nodes[0]=3; nodes[1]=2; nodes[2]=5; nodes[3]=4; }
-	else if (id1==1 && id2==2) { nodes[0]=0; nodes[1]=3; nodes[2]=6; nodes[3]=5; }
-	else if (id1==2 && id2==3) { nodes[0]=1; nodes[1]=0; nodes[2]=7; nodes[3]=6; }
-	else if (id1==3 && id2==0) { nodes[0]=2; nodes[1]=1; nodes[2]=4; nodes[3]=7; }
-	else if (id1==4 && id2==5) { nodes[0]=0; nodes[1]=1; nodes[2]=6; nodes[3]=7; }
-	else if (id1==5 && id2==6) { nodes[0]=1; nodes[1]=2; nodes[2]=7; nodes[3]=4; }
-	else if (id1==6 && id2==7) { nodes[0]=2; nodes[1]=3; nodes[2]=4; nodes[3]=5; }
-	else if (id1==7 && id2==4) { nodes[0]=3; nodes[1]=0; nodes[2]=5; nodes[3]=6; }
-	else if (id1==0 && id2==4) { nodes[0]=3; nodes[1]=7; nodes[2]=5; nodes[3]=1; }
-	else if (id1==1 && id2==5) { nodes[0]=0; nodes[1]=4; nodes[2]=6; nodes[3]=2; }
-	else if (id1==2 && id2==6) { nodes[0]=1; nodes[1]=5; nodes[2]=7; nodes[3]=3; }
-	else if (id1==3 && id2==7) { nodes[0]=2; nodes[1]=6; nodes[2]=4; nodes[3]=0; }
-
-	else if (id1==1 && id2==0) { nodes[0]=2; nodes[1]=3; nodes[2]=4; nodes[3]=5; }
-	else if (id1==2 && id2==1) { nodes[0]=3; nodes[1]=0; nodes[2]=5; nodes[3]=6; }
-	else if (id1==3 && id2==2) { nodes[0]=0; nodes[1]=1; nodes[2]=6; nodes[3]=7; }
-	else if (id1==0 && id2==3) { nodes[0]=1; nodes[1]=2; nodes[2]=7; nodes[3]=4; }
-	else if (id1==5 && id2==4) { nodes[0]=1; nodes[1]=0; nodes[2]=7; nodes[3]=6; }
-	else if (id1==6 && id2==5) { nodes[0]=2; nodes[1]=1; nodes[2]=4; nodes[3]=7; }
-	else if (id1==7 && id2==6) { nodes[0]=3; nodes[1]=2; nodes[2]=5; nodes[3]=4; }
-	else if (id1==4 && id2==7) { nodes[0]=0; nodes[1]=3; nodes[2]=6; nodes[3]=5; }
-	else if (id1==4 && id2==0) { nodes[0]=7; nodes[1]=3; nodes[2]=1; nodes[3]=5; }
-	else if (id1==5 && id2==1) { nodes[0]=4; nodes[1]=0; nodes[2]=2; nodes[3]=6; }
-	else if (id1==6 && id2==2) { nodes[0]=5; nodes[1]=1; nodes[2]=3; nodes[3]=7; }
-	else if (id1==7 && id2==3) { nodes[0]=6; nodes[1]=2; nodes[2]=0; nodes[3]=4; }
-	return nodes;
+    std::array<unsigned,4> nodes;
+    if      (id1==0 && id2==1) { nodes[0]=3; nodes[1]=2; nodes[2]=5; nodes[3]=4; }
+    else if (id1==1 && id2==2) { nodes[0]=0; nodes[1]=3; nodes[2]=6; nodes[3]=5; }
+    else if (id1==2 && id2==3) { nodes[0]=1; nodes[1]=0; nodes[2]=7; nodes[3]=6; }
+    else if (id1==3 && id2==0) { nodes[0]=2; nodes[1]=1; nodes[2]=4; nodes[3]=7; }
+    else if (id1==4 && id2==5) { nodes[0]=0; nodes[1]=1; nodes[2]=6; nodes[3]=7; }
+    else if (id1==5 && id2==6) { nodes[0]=1; nodes[1]=2; nodes[2]=7; nodes[3]=4; }
+    else if (id1==6 && id2==7) { nodes[0]=2; nodes[1]=3; nodes[2]=4; nodes[3]=5; }
+    else if (id1==7 && id2==4) { nodes[0]=3; nodes[1]=0; nodes[2]=5; nodes[3]=6; }
+    else if (id1==0 && id2==4) { nodes[0]=3; nodes[1]=7; nodes[2]=5; nodes[3]=1; }
+    else if (id1==1 && id2==5) { nodes[0]=0; nodes[1]=4; nodes[2]=6; nodes[3]=2; }
+    else if (id1==2 && id2==6) { nodes[0]=1; nodes[1]=5; nodes[2]=7; nodes[3]=3; }
+    else if (id1==3 && id2==7) { nodes[0]=2; nodes[1]=6; nodes[2]=4; nodes[3]=0; }
+
+    else if (id1==1 && id2==0) { nodes[0]=2; nodes[1]=3; nodes[2]=4; nodes[3]=5; }
+    else if (id1==2 && id2==1) { nodes[0]=3; nodes[1]=0; nodes[2]=5; nodes[3]=6; }
+    else if (id1==3 && id2==2) { nodes[0]=0; nodes[1]=1; nodes[2]=6; nodes[3]=7; }
+    else if (id1==0 && id2==3) { nodes[0]=1; nodes[1]=2; nodes[2]=7; nodes[3]=4; }
+    else if (id1==5 && id2==4) { nodes[0]=1; nodes[1]=0; nodes[2]=7; nodes[3]=6; }
+    else if (id1==6 && id2==5) { nodes[0]=2; nodes[1]=1; nodes[2]=4; nodes[3]=7; }
+    else if (id1==7 && id2==6) { nodes[0]=3; nodes[1]=2; nodes[2]=5; nodes[3]=4; }
+    else if (id1==4 && id2==7) { nodes[0]=0; nodes[1]=3; nodes[2]=6; nodes[3]=5; }
+    else if (id1==4 && id2==0) { nodes[0]=7; nodes[1]=3; nodes[2]=1; nodes[3]=5; }
+    else if (id1==5 && id2==1) { nodes[0]=4; nodes[1]=0; nodes[2]=2; nodes[3]=6; }
+    else if (id1==6 && id2==2) { nodes[0]=5; nodes[1]=1; nodes[2]=3; nodes[3]=7; }
+    else if (id1==7 && id2==3) { nodes[0]=6; nodes[1]=2; nodes[2]=0; nodes[3]=4; }
+    return nodes;
 }
 
 const std::pair<unsigned, unsigned> MeshRevision::lutHexBackNodes(
-	unsigned i, unsigned j, unsigned k, unsigned l) const
+    unsigned i, unsigned j, unsigned k, unsigned l) const
 {
-	// collapsed edges are *not* connected
-	std::pair<unsigned, unsigned> back(std::numeric_limits<unsigned>::max(), std::numeric_limits<unsigned>::max());
-	if      (this->lutHexDiametralNode(i) == k) { back.first = i; back.second = this->lutHexDiametralNode(l); }
-	else if (this->lutHexDiametralNode(i) == l) { back.first = i; back.second = this->lutHexDiametralNode(k); }
-	else if (this->lutHexDiametralNode(j) == k) { back.first = j; back.second = this->lutHexDiametralNode(l); }
-	else if (this->lutHexDiametralNode(j) == l) { back.first = j; back.second = this->lutHexDiametralNode(k); }
-	// collapsed edges *are* connected
-	else if (i==k) { back.first = this->lutHexDiametralNode(l); back.second = j; }
-	else if (i==l) { back.first = this->lutHexDiametralNode(k); back.second = j; }
-	else if (j==k) { back.first = this->lutHexDiametralNode(l); back.second = i; }
-	else if (j==l) { back.first = this->lutHexDiametralNode(k); back.second = i; }
-	return back;
+    // collapsed edges are *not* connected
+    std::pair<unsigned, unsigned> back(std::numeric_limits<unsigned>::max(), std::numeric_limits<unsigned>::max());
+    if      (this->lutHexDiametralNode(i) == k) { back.first = i; back.second = this->lutHexDiametralNode(l); }
+    else if (this->lutHexDiametralNode(i) == l) { back.first = i; back.second = this->lutHexDiametralNode(k); }
+    else if (this->lutHexDiametralNode(j) == k) { back.first = j; back.second = this->lutHexDiametralNode(l); }
+    else if (this->lutHexDiametralNode(j) == l) { back.first = j; back.second = this->lutHexDiametralNode(k); }
+    // collapsed edges *are* connected
+    else if (i==k) { back.first = this->lutHexDiametralNode(l); back.second = j; }
+    else if (i==l) { back.first = this->lutHexDiametralNode(k); back.second = j; }
+    else if (j==k) { back.first = this->lutHexDiametralNode(l); back.second = i; }
+    else if (j==l) { back.first = this->lutHexDiametralNode(k); back.second = i; }
+    return back;
 }
 
 unsigned MeshRevision::lutPrismThirdNode(unsigned id1, unsigned id2) const
 {
-	if      ((id1==0 && id2==1) || (id1==1 && id2==2)) return 2;
-	else if ((id1==1 && id2==2) || (id1==2 && id2==1)) return 0;
-	else if ((id1==0 && id2==2) || (id1==2 && id2==0)) return 1;
-	else if ((id1==3 && id2==4) || (id1==4 && id2==3)) return 5;
-	else if ((id1==4 && id2==5) || (id1==5 && id2==4)) return 3;
-	else if ((id1==3 && id2==5) || (id1==5 && id2==3)) return 4;
-	else return std::numeric_limits<unsigned>::max();
+    if      ((id1==0 && id2==1) || (id1==1 && id2==2)) return 2;
+    else if ((id1==1 && id2==2) || (id1==2 && id2==1)) return 0;
+    else if ((id1==0 && id2==2) || (id1==2 && id2==0)) return 1;
+    else if ((id1==3 && id2==4) || (id1==4 && id2==3)) return 5;
+    else if ((id1==4 && id2==5) || (id1==5 && id2==4)) return 3;
+    else if ((id1==3 && id2==5) || (id1==5 && id2==3)) return 4;
+    else return std::numeric_limits<unsigned>::max();
 }
 
 void MeshRevision::cleanUp(std::vector<MeshLib::Node*> &new_nodes, std::vector<MeshLib::Element*> &new_elements) const
 {
-	for (auto elem = new_elements.begin(); elem != new_elements.end(); ++elem)
-		delete *elem;
+    for (auto elem = new_elements.begin(); elem != new_elements.end(); ++elem)
+        delete *elem;
 
-	for (auto node = new_nodes.begin(); node != new_nodes.end(); ++node)
-		delete *node;
+    for (auto node = new_nodes.begin(); node != new_nodes.end(); ++node)
+        delete *node;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshEditing/MeshRevision.h b/MeshLib/MeshEditing/MeshRevision.h
index e6881e74724..b6296244490 100644
--- a/MeshLib/MeshEditing/MeshRevision.h
+++ b/MeshLib/MeshEditing/MeshRevision.h
@@ -22,9 +22,9 @@
 
 // forward declaration
 namespace MeshLib {
-	class Mesh;
-	class Node;
-	class Element;
+    class Mesh;
+    class Node;
+    class Element;
 }
 
 namespace MeshLib {
@@ -36,156 +36,156 @@ namespace MeshLib {
 class MeshRevision {
 
 public:
-	/**
-	 * Constructor
-	 * @param mesh The mesh which is being revised. Note that node IDs in mesh are changed during computation but are resetted after the algorithms implemented here are finished
-	 */
-	MeshRevision(MeshLib::Mesh &mesh);
-
-	virtual ~MeshRevision() {}
-
-	/**
-	 * Collapsed all nodes with distance < eps but ignores elements
-	 * (i.e. elements with collapsed nodes may result)
-	 * This is implicitely called when calling simplifyMesh(), so it does not need to be
-	 * called seperately when using simplifyMesh().
-	 */
-	MeshLib::Mesh* collapseNodes(const std::string &new_mesh_name, double eps);
-
-	/// Returns the number of potentially collapsable nodes
-	unsigned getNCollapsableNodes(double eps = std::numeric_limits<double>::epsilon()) const;
-
-	/// Designates nodes to be collapsed by setting their ID to the index of the node they will get merged with.
-	std::vector<std::size_t> collapseNodeIndices(double eps) const;
-
-	/**
-	 * Create a new mesh where all nodes with a distance < eps from each other are collapsed.
-	 * Elements are adjusted accordingly and elements with nonplanar faces are subdivided into
-	 * geometrically correct elements.
-	 * @param eps Minimum distance for nodes not to be collapsed
-	 * @param min_elem_dim Minimum dimension of elements to be inserted into new mesh (i.e.
-	 *                     min_elem_dim=3 will prevent the new mesh to contain 2D elements)
-	 */
-	MeshLib::Mesh* simplifyMesh(const std::string &new_mesh_name, double eps,
-		unsigned min_elem_dim = 1);
-
-	/**
-	 * Create a new mesh where all elements with nonplanar faces are subdivided into simpler
-	 * element types. This method does not collapse or remove any nodes.
-	 */
-	MeshLib::Mesh* subdivideMesh(const std::string &new_mesh_name) const;
+    /**
+     * Constructor
+     * @param mesh The mesh which is being revised. Note that node IDs in mesh are changed during computation but are resetted after the algorithms implemented here are finished
+     */
+    MeshRevision(MeshLib::Mesh &mesh);
+
+    virtual ~MeshRevision() {}
+
+    /**
+     * Collapsed all nodes with distance < eps but ignores elements
+     * (i.e. elements with collapsed nodes may result)
+     * This is implicitely called when calling simplifyMesh(), so it does not need to be
+     * called seperately when using simplifyMesh().
+     */
+    MeshLib::Mesh* collapseNodes(const std::string &new_mesh_name, double eps);
+
+    /// Returns the number of potentially collapsable nodes
+    unsigned getNCollapsableNodes(double eps = std::numeric_limits<double>::epsilon()) const;
+
+    /// Designates nodes to be collapsed by setting their ID to the index of the node they will get merged with.
+    std::vector<std::size_t> collapseNodeIndices(double eps) const;
+
+    /**
+     * Create a new mesh where all nodes with a distance < eps from each other are collapsed.
+     * Elements are adjusted accordingly and elements with nonplanar faces are subdivided into
+     * geometrically correct elements.
+     * @param eps Minimum distance for nodes not to be collapsed
+     * @param min_elem_dim Minimum dimension of elements to be inserted into new mesh (i.e.
+     *                     min_elem_dim=3 will prevent the new mesh to contain 2D elements)
+     */
+    MeshLib::Mesh* simplifyMesh(const std::string &new_mesh_name, double eps,
+        unsigned min_elem_dim = 1);
+
+    /**
+     * Create a new mesh where all elements with nonplanar faces are subdivided into simpler
+     * element types. This method does not collapse or remove any nodes.
+     */
+    MeshLib::Mesh* subdivideMesh(const std::string &new_mesh_name) const;
 
 private:
-	/// Constructs a new node vector for the resulting mesh by removing all nodes whose ID indicates they need to be merged/removed.
-	std::vector<MeshLib::Node*> constructNewNodesArray(
-		const std::vector<std::size_t> &id_map) const;
-
-	/// Calculates the number of unique nodes in an element (i.e. uncollapsed nodes)
-	unsigned getNUniqueNodes(MeshLib::Element const*const element) const;
-
-	/// Resets the node IDs of the source mesh (needs to be called after everything is done).
-	void resetNodeIDs();
-
-	/// Subdivides an element if it has a face that is not coplanar
-	/// @param element the element that will be subdivided
-	/// @param nodes vector containing the nodes the elements originated by the
-	/// subdivision are based on
-	/// @param elements vector of MeshLib::Elements; the elements originated by
-	/// the subdivision will be inserted into elements
-	/// @return the number of elements originated by the subdivision
-	std::size_t subdivideElement(MeshLib::Element const*const element,
-		std::vector<MeshLib::Node*> const& nodes,
-		std::vector<MeshLib::Element*> & elements) const;
-
-	// Revises an element by removing collapsed nodes, using the nodes vector from the result mesh.
-	std::size_t reduceElement(MeshLib::Element const*const element,
-		unsigned n_unique_nodes,
-		const std::vector<MeshLib::Node*> &nodes,
-		std::vector<MeshLib::Element*> &elements,
-		unsigned min_elem_dim) const;
-
-	/// Cleans up all nodes and elements if something went wrong
-	void cleanUp(std::vector<MeshLib::Node*> &nodes,
-		std::vector<MeshLib::Element*> &new_elements) const;
-
-	/// Subdivides a nonplanar quad into two triangles
-	unsigned subdivideQuad(MeshLib::Element const*const quad,
-		const std::vector<MeshLib::Node*> &nodes,
-		std::vector<MeshLib::Element*> &new_elements) const;
-
-	/// Subdivides a Hex with nonplanar faces into tets
-	unsigned subdivideHex(MeshLib::Element const*const hex,
-		const std::vector<MeshLib::Node*> &nodes,
-		std::vector<MeshLib::Element*> &new_elements) const;
-
-	/// Subdivides a pyramid with a nonplanar base into two tets
-	unsigned subdividePyramid(MeshLib::Element const*const pyramid,
-		const std::vector<MeshLib::Node*> &nodes,
-		std::vector<MeshLib::Element*> &new_elements) const;
-
-	/// Subdivides a prism with nonplanar quad faces into two tets
-	unsigned subdividePrism(MeshLib::Element const*const prism,
-		const std::vector<MeshLib::Node*> &nodes,
-		std::vector<MeshLib::Element*> &new_elements) const;
-
-	/// Creates a line element from the first two unique nodes found in the element (element *should* have exactly two unique nodes!)
-	MeshLib::Element* constructLine(MeshLib::Element const*const element,
-		const std::vector<MeshLib::Node*> &nodes) const;
-	/// Creates a triangle element from the first three unique nodes found in the element (element *should* have exactly three unique nodes!)
-	MeshLib::Element* constructTri(MeshLib::Element const*const element,
-		const std::vector<MeshLib::Node*> &nodes) const;
-	/// Creates a quad or a tet, depending if the four nodes being coplanar or not (element *should* have exactly four unique nodes!)
-	MeshLib::Element* constructFourNodeElement(
-		MeshLib::Element const*const element,
-		const std::vector<MeshLib::Node*> &nodes,
-		unsigned min_elem_dim = 1) const;
-
-	/**
-	 * Reduces a hexahedron element by removing collapsed nodes and constructing one or more new elements from the remaining nodes.
-	 * @return The number of newly created elements
-	 */
-	unsigned reduceHex(MeshLib::Element const*const hex,
-		unsigned n_unique_nodes,
-		const std::vector<MeshLib::Node*> &nodes,
-		std::vector<MeshLib::Element*> &new_elements,
-		unsigned min_elem_dim) const;
-	/// Reduces a pyramid element by removing collapsed nodes and constructing a new elements from the remaining nodes.
-	void reducePyramid(MeshLib::Element const*const pyramid,
-		unsigned n_unique_nodes,
-		const std::vector<MeshLib::Node*> &nodes,
-		std::vector<MeshLib::Element*> &new_elements,
-		unsigned min_elem_dim) const;
-	/**
-	 * Reduces a prism element by removing collapsed nodes and constructing one or two new elements from the remaining nodes.
-	 * @return The number of newly created elements
-	 */
-	unsigned reducePrism(MeshLib::Element const*const prism,
-		unsigned n_unique_nodes,
-		std::vector<MeshLib::Node*> const& nodes,
-		std::vector<MeshLib::Element*> & new_elements,
-		unsigned min_elem_dim) const;
-
-	// In an element with 5 unique nodes, return the node that will be the top of the resulting pyramid
-	unsigned findPyramidTopNode(MeshLib::Element const& element,
-		std::array<std::size_t,4> const& base_node_ids) const;
-
-	/// Lookup-table for returning the diametral node id of the given node id in a Hex
-	unsigned lutHexDiametralNode(unsigned id) const;
-
-	/// Lookup-table for returning four nodes connected to the two nodes (id1, id2) forming an edge in a Hex
-	const std::array<unsigned,4> lutHexCuttingQuadNodes(unsigned id1, unsigned id2) const;
-
-	/// When a hex is subdivided into two prisms, this returns the nodes of the hex edge that will serve as the back of one of the prisms.
-	const std::pair<unsigned, unsigned> lutHexBackNodes(
-		unsigned i, unsigned j, unsigned k, unsigned l) const;
-
-	/// Lookup-table for returning the third node of bottom or top triangle given the other two
-	unsigned lutPrismThirdNode(unsigned id1, unsigned id2) const;
-
-	/// The original mesh used for constructing the class
-	Mesh& _mesh;
-
-	static const std::array<unsigned,8> _hex_diametral_nodes;
+    /// Constructs a new node vector for the resulting mesh by removing all nodes whose ID indicates they need to be merged/removed.
+    std::vector<MeshLib::Node*> constructNewNodesArray(
+        const std::vector<std::size_t> &id_map) const;
+
+    /// Calculates the number of unique nodes in an element (i.e. uncollapsed nodes)
+    unsigned getNUniqueNodes(MeshLib::Element const*const element) const;
+
+    /// Resets the node IDs of the source mesh (needs to be called after everything is done).
+    void resetNodeIDs();
+
+    /// Subdivides an element if it has a face that is not coplanar
+    /// @param element the element that will be subdivided
+    /// @param nodes vector containing the nodes the elements originated by the
+    /// subdivision are based on
+    /// @param elements vector of MeshLib::Elements; the elements originated by
+    /// the subdivision will be inserted into elements
+    /// @return the number of elements originated by the subdivision
+    std::size_t subdivideElement(MeshLib::Element const*const element,
+        std::vector<MeshLib::Node*> const& nodes,
+        std::vector<MeshLib::Element*> & elements) const;
+
+    // Revises an element by removing collapsed nodes, using the nodes vector from the result mesh.
+    std::size_t reduceElement(MeshLib::Element const*const element,
+        unsigned n_unique_nodes,
+        const std::vector<MeshLib::Node*> &nodes,
+        std::vector<MeshLib::Element*> &elements,
+        unsigned min_elem_dim) const;
+
+    /// Cleans up all nodes and elements if something went wrong
+    void cleanUp(std::vector<MeshLib::Node*> &nodes,
+        std::vector<MeshLib::Element*> &new_elements) const;
+
+    /// Subdivides a nonplanar quad into two triangles
+    unsigned subdivideQuad(MeshLib::Element const*const quad,
+        const std::vector<MeshLib::Node*> &nodes,
+        std::vector<MeshLib::Element*> &new_elements) const;
+
+    /// Subdivides a Hex with nonplanar faces into tets
+    unsigned subdivideHex(MeshLib::Element const*const hex,
+        const std::vector<MeshLib::Node*> &nodes,
+        std::vector<MeshLib::Element*> &new_elements) const;
+
+    /// Subdivides a pyramid with a nonplanar base into two tets
+    unsigned subdividePyramid(MeshLib::Element const*const pyramid,
+        const std::vector<MeshLib::Node*> &nodes,
+        std::vector<MeshLib::Element*> &new_elements) const;
+
+    /// Subdivides a prism with nonplanar quad faces into two tets
+    unsigned subdividePrism(MeshLib::Element const*const prism,
+        const std::vector<MeshLib::Node*> &nodes,
+        std::vector<MeshLib::Element*> &new_elements) const;
+
+    /// Creates a line element from the first two unique nodes found in the element (element *should* have exactly two unique nodes!)
+    MeshLib::Element* constructLine(MeshLib::Element const*const element,
+        const std::vector<MeshLib::Node*> &nodes) const;
+    /// Creates a triangle element from the first three unique nodes found in the element (element *should* have exactly three unique nodes!)
+    MeshLib::Element* constructTri(MeshLib::Element const*const element,
+        const std::vector<MeshLib::Node*> &nodes) const;
+    /// Creates a quad or a tet, depending if the four nodes being coplanar or not (element *should* have exactly four unique nodes!)
+    MeshLib::Element* constructFourNodeElement(
+        MeshLib::Element const*const element,
+        const std::vector<MeshLib::Node*> &nodes,
+        unsigned min_elem_dim = 1) const;
+
+    /**
+     * Reduces a hexahedron element by removing collapsed nodes and constructing one or more new elements from the remaining nodes.
+     * @return The number of newly created elements
+     */
+    unsigned reduceHex(MeshLib::Element const*const hex,
+        unsigned n_unique_nodes,
+        const std::vector<MeshLib::Node*> &nodes,
+        std::vector<MeshLib::Element*> &new_elements,
+        unsigned min_elem_dim) const;
+    /// Reduces a pyramid element by removing collapsed nodes and constructing a new elements from the remaining nodes.
+    void reducePyramid(MeshLib::Element const*const pyramid,
+        unsigned n_unique_nodes,
+        const std::vector<MeshLib::Node*> &nodes,
+        std::vector<MeshLib::Element*> &new_elements,
+        unsigned min_elem_dim) const;
+    /**
+     * Reduces a prism element by removing collapsed nodes and constructing one or two new elements from the remaining nodes.
+     * @return The number of newly created elements
+     */
+    unsigned reducePrism(MeshLib::Element const*const prism,
+        unsigned n_unique_nodes,
+        std::vector<MeshLib::Node*> const& nodes,
+        std::vector<MeshLib::Element*> & new_elements,
+        unsigned min_elem_dim) const;
+
+    // In an element with 5 unique nodes, return the node that will be the top of the resulting pyramid
+    unsigned findPyramidTopNode(MeshLib::Element const& element,
+        std::array<std::size_t,4> const& base_node_ids) const;
+
+    /// Lookup-table for returning the diametral node id of the given node id in a Hex
+    unsigned lutHexDiametralNode(unsigned id) const;
+
+    /// Lookup-table for returning four nodes connected to the two nodes (id1, id2) forming an edge in a Hex
+    const std::array<unsigned,4> lutHexCuttingQuadNodes(unsigned id1, unsigned id2) const;
+
+    /// When a hex is subdivided into two prisms, this returns the nodes of the hex edge that will serve as the back of one of the prisms.
+    const std::pair<unsigned, unsigned> lutHexBackNodes(
+        unsigned i, unsigned j, unsigned k, unsigned l) const;
+
+    /// Lookup-table for returning the third node of bottom or top triangle given the other two
+    unsigned lutPrismThirdNode(unsigned id1, unsigned id2) const;
+
+    /// The original mesh used for constructing the class
+    Mesh& _mesh;
+
+    static const std::array<unsigned,8> _hex_diametral_nodes;
 };
 
 }
diff --git a/MeshLib/MeshEditing/RemoveMeshComponents.cpp b/MeshLib/MeshEditing/RemoveMeshComponents.cpp
index 5af6fa0d639..42a5db1af18 100644
--- a/MeshLib/MeshEditing/RemoveMeshComponents.cpp
+++ b/MeshLib/MeshEditing/RemoveMeshComponents.cpp
@@ -23,119 +23,119 @@ namespace details
 {
 
 std::vector<MeshLib::Element*> excludeElementCopy(
-	std::vector<MeshLib::Element*> const& vec_src_eles,
-	std::vector<std::size_t> const& vec_removed)
+    std::vector<MeshLib::Element*> const& vec_src_eles,
+    std::vector<std::size_t> const& vec_removed)
 {
-	std::vector<MeshLib::Element*> vec_dest_eles(vec_src_eles.size()-vec_removed.size());
-
-	unsigned cnt (0);
-	for (std::size_t i=0; i<vec_removed[0]; ++i)
-		vec_dest_eles[cnt++] = vec_src_eles[i];
-	for (std::size_t i=1; i<vec_removed.size(); ++i)
-		for (std::size_t j=vec_removed[i-1]+1; j<vec_removed[i]; ++j)
-			vec_dest_eles[cnt++] = vec_src_eles[j];
-	for (std::size_t i=vec_removed.back()+1; i<vec_src_eles.size(); ++i)
-		vec_dest_eles[cnt++] = vec_src_eles[i];
-
-	return vec_dest_eles;
+    std::vector<MeshLib::Element*> vec_dest_eles(vec_src_eles.size()-vec_removed.size());
+
+    unsigned cnt (0);
+    for (std::size_t i=0; i<vec_removed[0]; ++i)
+        vec_dest_eles[cnt++] = vec_src_eles[i];
+    for (std::size_t i=1; i<vec_removed.size(); ++i)
+        for (std::size_t j=vec_removed[i-1]+1; j<vec_removed[i]; ++j)
+            vec_dest_eles[cnt++] = vec_src_eles[j];
+    for (std::size_t i=vec_removed.back()+1; i<vec_src_eles.size(); ++i)
+        vec_dest_eles[cnt++] = vec_src_eles[i];
+
+    return vec_dest_eles;
 }
 
 } // details
 
 MeshLib::Mesh* removeElements(const MeshLib::Mesh& mesh, const std::vector<std::size_t> &removed_element_ids, const std::string &new_mesh_name)
 {
-	if (removed_element_ids.empty())
-	{
-		INFO("No elements to remove");
-		return nullptr;
-	}
-
-	INFO("Removing total %d elements...", removed_element_ids.size());
-	std::vector<MeshLib::Element*> tmp_elems = details::excludeElementCopy(
-		mesh.getElements(),
-		removed_element_ids
-	);
-	INFO("%d elements remain in mesh.", tmp_elems.size());
-
-	// copy node and element objects
-	std::vector<MeshLib::Node*> new_nodes = MeshLib::copyNodeVector(mesh.getNodes());
-	std::vector<MeshLib::Element*> new_elems = MeshLib::copyElementVector(tmp_elems, new_nodes);
-
-	// delete unused nodes
-	NodeSearch ns(mesh);
-	ns.searchNodesConnectedToOnlyGivenElements(removed_element_ids);
-	auto &removed_node_ids(ns.getSearchedNodeIDs());
-	INFO("Removing total %d nodes...", removed_node_ids.size());
-	for (auto nodeid : removed_node_ids)
-	{
-		delete new_nodes[nodeid];
-		new_nodes[nodeid] = nullptr;
-	}
-	new_nodes.erase(std::remove(new_nodes.begin(), new_nodes.end(), nullptr), new_nodes.end());
-
-	if (!new_elems.empty())
-	{
-		MeshLib::Mesh* new_mesh =
-		    new MeshLib::Mesh(new_mesh_name, new_nodes, new_elems,
-		                      mesh.getProperties().excludeCopyProperties(
-		                          removed_element_ids, removed_node_ids));
-		return new_mesh;
-	}
-	else
-	{
-		INFO("Current selection removes all elements.");
-		return nullptr;
-	}
+    if (removed_element_ids.empty())
+    {
+        INFO("No elements to remove");
+        return nullptr;
+    }
+
+    INFO("Removing total %d elements...", removed_element_ids.size());
+    std::vector<MeshLib::Element*> tmp_elems = details::excludeElementCopy(
+        mesh.getElements(),
+        removed_element_ids
+    );
+    INFO("%d elements remain in mesh.", tmp_elems.size());
+
+    // copy node and element objects
+    std::vector<MeshLib::Node*> new_nodes = MeshLib::copyNodeVector(mesh.getNodes());
+    std::vector<MeshLib::Element*> new_elems = MeshLib::copyElementVector(tmp_elems, new_nodes);
+
+    // delete unused nodes
+    NodeSearch ns(mesh);
+    ns.searchNodesConnectedToOnlyGivenElements(removed_element_ids);
+    auto &removed_node_ids(ns.getSearchedNodeIDs());
+    INFO("Removing total %d nodes...", removed_node_ids.size());
+    for (auto nodeid : removed_node_ids)
+    {
+        delete new_nodes[nodeid];
+        new_nodes[nodeid] = nullptr;
+    }
+    new_nodes.erase(std::remove(new_nodes.begin(), new_nodes.end(), nullptr), new_nodes.end());
+
+    if (!new_elems.empty())
+    {
+        MeshLib::Mesh* new_mesh =
+            new MeshLib::Mesh(new_mesh_name, new_nodes, new_elems,
+                              mesh.getProperties().excludeCopyProperties(
+                                  removed_element_ids, removed_node_ids));
+        return new_mesh;
+    }
+    else
+    {
+        INFO("Current selection removes all elements.");
+        return nullptr;
+    }
 }
 
 MeshLib::Mesh* removeNodes(const MeshLib::Mesh &mesh, const std::vector<std::size_t> &del_nodes_idx, const std::string &new_mesh_name)
 {
-	if (del_nodes_idx.empty())
-		return nullptr;
-
-	// copy node and element objects
-	std::vector<MeshLib::Node*> new_nodes = MeshLib::copyNodeVector(mesh.getNodes());
-	std::vector<MeshLib::Element*> new_elems = MeshLib::copyElementVector(mesh.getElements(), new_nodes);
-
-	// delete elements
-	MeshLib::ElementSearch es(mesh);
-	es.searchByNodeIDs(del_nodes_idx);
-	auto& removed_element_ids = es.getSearchedElementIDs();
-	for (auto eid : removed_element_ids)
-	{
-		delete new_elems[eid];
-		new_elems[eid] = nullptr;
-	}
-	new_elems.erase(std::remove(new_elems.begin(), new_elems.end(), nullptr), new_elems.end());
-
-	// check unused nodes due to element deletion
-	std::vector<bool> node_delete_flag(new_nodes.size(), true);
-	for (auto e : new_elems) {
-		for (unsigned i=0; i<e->getNNodes(); i++)
-			node_delete_flag[e->getNodeIndex(i)] = false;
-	}
-
-	// delete unused nodes
-	for (std::size_t i=0; i<new_nodes.size(); i++)
-	{
-		if (!node_delete_flag[i]) continue;
-		delete new_nodes[i];
-		new_nodes[i] = nullptr;
-	}
-	new_nodes.erase(std::remove(new_nodes.begin(), new_nodes.end(), nullptr), new_nodes.end());
-
-	if (!new_elems.empty())
-	{
-		MeshLib::Mesh* new_mesh =
-		    new MeshLib::Mesh(new_mesh_name, new_nodes, new_elems,
-		                      mesh.getProperties().excludeCopyProperties(
-		                          removed_element_ids, del_nodes_idx));
-		return new_mesh;
-	}
-	else
-	{
-		return nullptr;
-	}
+    if (del_nodes_idx.empty())
+        return nullptr;
+
+    // copy node and element objects
+    std::vector<MeshLib::Node*> new_nodes = MeshLib::copyNodeVector(mesh.getNodes());
+    std::vector<MeshLib::Element*> new_elems = MeshLib::copyElementVector(mesh.getElements(), new_nodes);
+
+    // delete elements
+    MeshLib::ElementSearch es(mesh);
+    es.searchByNodeIDs(del_nodes_idx);
+    auto& removed_element_ids = es.getSearchedElementIDs();
+    for (auto eid : removed_element_ids)
+    {
+        delete new_elems[eid];
+        new_elems[eid] = nullptr;
+    }
+    new_elems.erase(std::remove(new_elems.begin(), new_elems.end(), nullptr), new_elems.end());
+
+    // check unused nodes due to element deletion
+    std::vector<bool> node_delete_flag(new_nodes.size(), true);
+    for (auto e : new_elems) {
+        for (unsigned i=0; i<e->getNNodes(); i++)
+            node_delete_flag[e->getNodeIndex(i)] = false;
+    }
+
+    // delete unused nodes
+    for (std::size_t i=0; i<new_nodes.size(); i++)
+    {
+        if (!node_delete_flag[i]) continue;
+        delete new_nodes[i];
+        new_nodes[i] = nullptr;
+    }
+    new_nodes.erase(std::remove(new_nodes.begin(), new_nodes.end(), nullptr), new_nodes.end());
+
+    if (!new_elems.empty())
+    {
+        MeshLib::Mesh* new_mesh =
+            new MeshLib::Mesh(new_mesh_name, new_nodes, new_elems,
+                              mesh.getProperties().excludeCopyProperties(
+                                  removed_element_ids, del_nodes_idx));
+        return new_mesh;
+    }
+    else
+    {
+        return nullptr;
+    }
 }
 } // end namespace MeshLib
 
diff --git a/MeshLib/MeshEditing/RemoveMeshComponents.h b/MeshLib/MeshEditing/RemoveMeshComponents.h
index 05970c5ae0c..3cf8a35f727 100644
--- a/MeshLib/MeshEditing/RemoveMeshComponents.h
+++ b/MeshLib/MeshEditing/RemoveMeshComponents.h
@@ -26,7 +26,7 @@ class Element;
  * @return a new mesh object
  */
 MeshLib::Mesh* removeElements(const MeshLib::Mesh& mesh,
-		const std::vector<std::size_t> &removed_element_ids, const std::string &new_mesh_name);
+        const std::vector<std::size_t> &removed_element_ids, const std::string &new_mesh_name);
 
 /**
  * Removes the mesh nodes (and connected elements) given in the nodes-list from the mesh.
diff --git a/MeshLib/MeshEditing/moveMeshNodes.h b/MeshLib/MeshEditing/moveMeshNodes.h
index dda1cb35300..0dbe7e6a4be 100644
--- a/MeshLib/MeshEditing/moveMeshNodes.h
+++ b/MeshLib/MeshEditing/moveMeshNodes.h
@@ -19,28 +19,28 @@ namespace MeshLib
 {
 
 /**
-	* Function that moves mesh nodes.
-	*
-	* The function iterates over all mesh nodes between the
-	* begin and the end iterator and moves them using the
-	* given displacement.
-	* @param begin begin iterator
-	* @param end end iterator
-	* @param displacement the displacement to use
+    * Function that moves mesh nodes.
+    *
+    * The function iterates over all mesh nodes between the
+    * begin and the end iterator and moves them using the
+    * given displacement.
+    * @param begin begin iterator
+    * @param end end iterator
+    * @param displacement the displacement to use
 */
 template <typename Iterator>
 void moveMeshNodes(
-	Iterator begin,
-	Iterator end,
-	MeshLib::Node const& displacement)
+    Iterator begin,
+    Iterator end,
+    MeshLib::Node const& displacement)
 {
-	std::for_each(begin, end, [&displacement](MeshLib::Node* node)
-		{
-			(*node)[0] += displacement[0];
-			(*node)[1] += displacement[1];
-			(*node)[2] += displacement[2];
-		}
-	);
+    std::for_each(begin, end, [&displacement](MeshLib::Node* node)
+        {
+            (*node)[0] += displacement[0];
+            (*node)[1] += displacement[1];
+            (*node)[2] += displacement[2];
+        }
+    );
 };
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshEditing/projectMeshOntoPlane.h b/MeshLib/MeshEditing/projectMeshOntoPlane.h
index 63d4c72b816..b7892f8a7ae 100644
--- a/MeshLib/MeshEditing/projectMeshOntoPlane.h
+++ b/MeshLib/MeshEditing/projectMeshOntoPlane.h
@@ -38,22 +38,22 @@ MeshLib::Mesh* projectMeshOntoPlane(MeshLib::Mesh const& mesh,
                                     MathLib::Point3d const& plane_origin,
                                     MathLib::Vector3 const& plane_normal)
 {
-	std::size_t const n_nodes (mesh.getNNodes());
-	std::vector<MeshLib::Node*> const& nodes (mesh.getNodes());
-	MathLib::Vector3 normal (plane_normal);
-	normal.normalize();
-	std::vector<MeshLib::Node*> new_nodes;
-	new_nodes.reserve(n_nodes);
-	for (std::size_t i=0; i<n_nodes; ++i)
-	{
-		MeshLib::Node const& node(*nodes[i]);
-		MathLib::Vector3 const v(plane_origin, node);
-		double const dist (MathLib::scalarProduct(v,normal));
-		new_nodes.push_back(new MeshLib::Node(node - dist * normal));
-	}
-
-	return new MeshLib::Mesh("Projected_Mesh", new_nodes,
-	                         MeshLib::copyElementVector(mesh.getElements(), new_nodes));
+    std::size_t const n_nodes (mesh.getNNodes());
+    std::vector<MeshLib::Node*> const& nodes (mesh.getNodes());
+    MathLib::Vector3 normal (plane_normal);
+    normal.normalize();
+    std::vector<MeshLib::Node*> new_nodes;
+    new_nodes.reserve(n_nodes);
+    for (std::size_t i=0; i<n_nodes; ++i)
+    {
+        MeshLib::Node const& node(*nodes[i]);
+        MathLib::Vector3 const v(plane_origin, node);
+        double const dist (MathLib::scalarProduct(v,normal));
+        new_nodes.push_back(new MeshLib::Node(node - dist * normal));
+    }
+
+    return new MeshLib::Mesh("Projected_Mesh", new_nodes,
+                             MeshLib::copyElementVector(mesh.getElements(), new_nodes));
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshEnums.cpp b/MeshLib/MeshEnums.cpp
index dcddb4805f9..1321b09f1c1 100644
--- a/MeshLib/MeshEnums.cpp
+++ b/MeshLib/MeshEnums.cpp
@@ -18,114 +18,114 @@ namespace MeshLib {
 
 const std::string MeshElemType2String(const MeshElemType t)
 {
-	if (t == MeshElemType::POINT)
-		return "Point";
-	if (t == MeshElemType::LINE)
-		return "Line";
-	if (t == MeshElemType::QUAD)
-		return "Quad";
-	if (t == MeshElemType::HEXAHEDRON)
-		return "Hexahedron";
-	if (t == MeshElemType::TRIANGLE)
-		return "Triangle";
-	if (t == MeshElemType::TETRAHEDRON)
-		return "Tetrahedron";
-	if (t == MeshElemType::PRISM)
-		return "Prism";
-	if (t == MeshElemType::PYRAMID)
-		return "Pyramid";
-	return "none";
+    if (t == MeshElemType::POINT)
+        return "Point";
+    if (t == MeshElemType::LINE)
+        return "Line";
+    if (t == MeshElemType::QUAD)
+        return "Quad";
+    if (t == MeshElemType::HEXAHEDRON)
+        return "Hexahedron";
+    if (t == MeshElemType::TRIANGLE)
+        return "Triangle";
+    if (t == MeshElemType::TETRAHEDRON)
+        return "Tetrahedron";
+    if (t == MeshElemType::PRISM)
+        return "Prism";
+    if (t == MeshElemType::PYRAMID)
+        return "Pyramid";
+    return "none";
 }
 
 const std::string MeshElemType2StringShort(const MeshElemType t)
 {
-	if (t == MeshElemType::POINT)
-		return "point";
-	if (t == MeshElemType::LINE)
-		return "line";
-	if (t == MeshElemType::QUAD)
-		return "quad";
-	if (t == MeshElemType::HEXAHEDRON)
-		return "hex";
-	if (t == MeshElemType::TRIANGLE)
-		return "tri";
-	if (t == MeshElemType::TETRAHEDRON)
-		return "tet";
-	if (t == MeshElemType::PRISM)
-		return "pris";
-	if (t == MeshElemType::PYRAMID)
-		return "pyra";
-	return "none";
+    if (t == MeshElemType::POINT)
+        return "point";
+    if (t == MeshElemType::LINE)
+        return "line";
+    if (t == MeshElemType::QUAD)
+        return "quad";
+    if (t == MeshElemType::HEXAHEDRON)
+        return "hex";
+    if (t == MeshElemType::TRIANGLE)
+        return "tri";
+    if (t == MeshElemType::TETRAHEDRON)
+        return "tet";
+    if (t == MeshElemType::PRISM)
+        return "pris";
+    if (t == MeshElemType::PYRAMID)
+        return "pyra";
+    return "none";
 }
 
 MeshElemType String2MeshElemType(const std::string &s)
 {
-	if ((s.compare("point") == 0) || (s.compare("Point") == 0))
-		return MeshElemType::POINT;
-	if ((s.compare("line") == 0) || (s.compare("Line") == 0))
-		return MeshElemType::LINE;
-	if ((s.compare("quad") == 0) || (s.compare("Quadrilateral") == 0))
-		return MeshElemType::QUAD;
-	if ((s.compare("hex")  == 0) || (s.compare("Hexahedron") == 0))
-		return MeshElemType::HEXAHEDRON;
-	if ((s.compare("tri")  == 0) || (s.compare("Triangle") == 0))
-		return MeshElemType::TRIANGLE;
-	if ((s.compare("tet")  == 0) || (s.compare("Tetrahedron") == 0))
-		return MeshElemType::TETRAHEDRON;
-	if ((s.compare("pris") == 0) || (s.compare("Prism") == 0))
-		return MeshElemType::PRISM;
-	if ((s.compare("pyra") == 0) || (s.compare("Pyramid") == 0))
-		return MeshElemType::PYRAMID;
-	return MeshElemType::INVALID;
+    if ((s.compare("point") == 0) || (s.compare("Point") == 0))
+        return MeshElemType::POINT;
+    if ((s.compare("line") == 0) || (s.compare("Line") == 0))
+        return MeshElemType::LINE;
+    if ((s.compare("quad") == 0) || (s.compare("Quadrilateral") == 0))
+        return MeshElemType::QUAD;
+    if ((s.compare("hex")  == 0) || (s.compare("Hexahedron") == 0))
+        return MeshElemType::HEXAHEDRON;
+    if ((s.compare("tri")  == 0) || (s.compare("Triangle") == 0))
+        return MeshElemType::TRIANGLE;
+    if ((s.compare("tet")  == 0) || (s.compare("Tetrahedron") == 0))
+        return MeshElemType::TETRAHEDRON;
+    if ((s.compare("pris") == 0) || (s.compare("Prism") == 0))
+        return MeshElemType::PRISM;
+    if ((s.compare("pyra") == 0) || (s.compare("Pyramid") == 0))
+        return MeshElemType::PYRAMID;
+    return MeshElemType::INVALID;
 }
 
 std::vector<MeshElemType> getMeshElemTypes()
 {
-	std::vector<MeshElemType> vec;
-	vec.push_back(MeshElemType::POINT);
-	vec.push_back(MeshElemType::LINE);
-	vec.push_back(MeshElemType::QUAD);
-	vec.push_back(MeshElemType::HEXAHEDRON);
-	vec.push_back(MeshElemType::TRIANGLE);
-	vec.push_back(MeshElemType::TETRAHEDRON);
-	vec.push_back(MeshElemType::PRISM);
-	vec.push_back(MeshElemType::PYRAMID);
-	return vec;
+    std::vector<MeshElemType> vec;
+    vec.push_back(MeshElemType::POINT);
+    vec.push_back(MeshElemType::LINE);
+    vec.push_back(MeshElemType::QUAD);
+    vec.push_back(MeshElemType::HEXAHEDRON);
+    vec.push_back(MeshElemType::TRIANGLE);
+    vec.push_back(MeshElemType::TETRAHEDRON);
+    vec.push_back(MeshElemType::PRISM);
+    vec.push_back(MeshElemType::PYRAMID);
+    return vec;
 }
 
 std::vector<std::string> getMeshElemTypeStringsShort()
 {
-	std::vector<std::string> vec;
-	for (MeshElemType eleType : getMeshElemTypes())
-		vec.push_back(MeshElemType2StringShort(eleType));
-	return vec;
+    std::vector<std::string> vec;
+    for (MeshElemType eleType : getMeshElemTypes())
+        vec.push_back(MeshElemType2StringShort(eleType));
+    return vec;
 }
 
 const std::string CellType2String(const CellType t)
 {
 #define RETURN_CELL_TYPE_STR(t, type)\
-	if (t == CellType::type)\
-		return #type;
+    if (t == CellType::type)\
+        return #type;
 
-	RETURN_CELL_TYPE_STR(t, POINT1);
-	RETURN_CELL_TYPE_STR(t, LINE2);
-	RETURN_CELL_TYPE_STR(t, LINE3);
-	RETURN_CELL_TYPE_STR(t, QUAD4);
-	RETURN_CELL_TYPE_STR(t, QUAD8);
-	RETURN_CELL_TYPE_STR(t, QUAD9);
-	RETURN_CELL_TYPE_STR(t, HEX8);
-	RETURN_CELL_TYPE_STR(t, HEX20);
-	RETURN_CELL_TYPE_STR(t, HEX27);
-	RETURN_CELL_TYPE_STR(t, TRI3);
-	RETURN_CELL_TYPE_STR(t, TRI6);
-	RETURN_CELL_TYPE_STR(t, TET4);
-	RETURN_CELL_TYPE_STR(t, TET10);
-	RETURN_CELL_TYPE_STR(t, PRISM6);
-	RETURN_CELL_TYPE_STR(t, PRISM15);
-	RETURN_CELL_TYPE_STR(t, PYRAMID5);
-	RETURN_CELL_TYPE_STR(t, PYRAMID13);
+    RETURN_CELL_TYPE_STR(t, POINT1);
+    RETURN_CELL_TYPE_STR(t, LINE2);
+    RETURN_CELL_TYPE_STR(t, LINE3);
+    RETURN_CELL_TYPE_STR(t, QUAD4);
+    RETURN_CELL_TYPE_STR(t, QUAD8);
+    RETURN_CELL_TYPE_STR(t, QUAD9);
+    RETURN_CELL_TYPE_STR(t, HEX8);
+    RETURN_CELL_TYPE_STR(t, HEX20);
+    RETURN_CELL_TYPE_STR(t, HEX27);
+    RETURN_CELL_TYPE_STR(t, TRI3);
+    RETURN_CELL_TYPE_STR(t, TRI6);
+    RETURN_CELL_TYPE_STR(t, TET4);
+    RETURN_CELL_TYPE_STR(t, TET10);
+    RETURN_CELL_TYPE_STR(t, PRISM6);
+    RETURN_CELL_TYPE_STR(t, PRISM15);
+    RETURN_CELL_TYPE_STR(t, PYRAMID5);
+    RETURN_CELL_TYPE_STR(t, PYRAMID13);
 
-	return "none";
+    return "none";
 
 #undef RETURN_CELL_TYPE_STR
 }
diff --git a/MeshLib/MeshEnums.h b/MeshLib/MeshEnums.h
index 3ba1e3c2fd3..e4b75958790 100644
--- a/MeshLib/MeshEnums.h
+++ b/MeshLib/MeshEnums.h
@@ -26,15 +26,15 @@ namespace MeshLib {
  */
 enum class MeshElemType
 {
-	INVALID = 0,
-	POINT = 1,
-	LINE = 3,
-	QUAD = 9,
-	HEXAHEDRON = 12,
-	TRIANGLE = 5,
-	TETRAHEDRON = 10,
-	PRISM = 16,
-	PYRAMID = 14
+    INVALID = 0,
+    POINT = 1,
+    LINE = 3,
+    QUAD = 9,
+    HEXAHEDRON = 12,
+    TRIANGLE = 5,
+    TETRAHEDRON = 10,
+    PRISM = 16,
+    PYRAMID = 14
 };
 
 /**
@@ -42,25 +42,25 @@ enum class MeshElemType
  */
 enum class CellType
 {
-	INVALID,
-	POINT1,
-	LINE2,
-	LINE3,
-	TRI3,
-	TRI6,
-	QUAD4,
-	QUAD8,
-	QUAD9,
-	TET4,
-	TET10,
-	HEX8,
-	HEX20,
-	HEX27,
-	PRISM6,
-	PRISM15,
-	PRISM18,
-	PYRAMID5,
-	PYRAMID13
+    INVALID,
+    POINT1,
+    LINE2,
+    LINE3,
+    TRI3,
+    TRI6,
+    QUAD4,
+    QUAD8,
+    QUAD9,
+    TET4,
+    TET10,
+    HEX8,
+    HEX20,
+    HEX27,
+    PRISM6,
+    PRISM15,
+    PRISM18,
+    PYRAMID5,
+    PYRAMID13
 };
 
 /**
@@ -68,12 +68,12 @@ enum class CellType
  */
 enum class MeshQualityType
 {
-	INVALID = 0,
-	ELEMENTSIZE,
-	SIZEDIFFERENCE,
-	EDGERATIO,
-	EQUIANGLESKEW,
-	RADIUSEDGERATIO
+    INVALID = 0,
+    ELEMENTSIZE,
+    SIZEDIFFERENCE,
+    EDGERATIO,
+    EQUIANGLESKEW,
+    RADIUSEDGERATIO
 };
 
 /**
@@ -81,10 +81,10 @@ enum class MeshQualityType
  */
 enum class UseIntensityAs
 {
-	ELEVATION,
-	MATERIALS,
-	DATAVECTOR,
-	NONE
+    ELEVATION,
+    MATERIALS,
+    DATAVECTOR,
+    NONE
 };
 
 /// Given a MeshElemType this returns the appropriate string.
diff --git a/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp b/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp
index ec7b5ee08a5..488fce75b91 100644
--- a/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp
+++ b/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp
@@ -52,32 +52,32 @@ bool LayeredMeshGenerator::createLayers(
 std::unique_ptr<MeshLib::Mesh>
 LayeredMeshGenerator::getMesh(std::string const& mesh_name) const
 {
-	if (_nodes.empty() || _elements.empty())
-		return nullptr;
+    if (_nodes.empty() || _elements.empty())
+        return nullptr;
 
-	MeshLib::Properties properties;
-	if (_materials.size() == _elements.size())
-	{
-		boost::optional<MeshLib::PropertyVector<int>&> materials =
-		    properties.createNewPropertyVector<int>(
-		        "MaterialIDs", MeshLib::MeshItemType::Cell);
-		assert(materials != boost::none);
-		materials->reserve(_materials.size());
-		std::copy(_materials.cbegin(),
-		          _materials.cend(),
-		          std::back_inserter(*materials));
-	}
-	else
-		WARN ("Skipping MaterialID information, number of entries does not match element number");
+    MeshLib::Properties properties;
+    if (_materials.size() == _elements.size())
+    {
+        boost::optional<MeshLib::PropertyVector<int>&> materials =
+            properties.createNewPropertyVector<int>(
+                "MaterialIDs", MeshLib::MeshItemType::Cell);
+        assert(materials != boost::none);
+        materials->reserve(_materials.size());
+        std::copy(_materials.cbegin(),
+                  _materials.cend(),
+                  std::back_inserter(*materials));
+    }
+    else
+        WARN ("Skipping MaterialID information, number of entries does not match element number");
 
-	std::unique_ptr<MeshLib::Mesh> result(new MeshLib::Mesh(mesh_name, _nodes, _elements, properties));
-	MeshLib::NodeSearch ns(*result.get());
-	if (ns.searchUnused() > 0) {
-		std::unique_ptr<MeshLib::Mesh> new_mesh(MeshLib::removeNodes(
-			*result.get(), ns.getSearchedNodeIDs(), mesh_name));
-		return new_mesh;
-	}
-	return result;
+    std::unique_ptr<MeshLib::Mesh> result(new MeshLib::Mesh(mesh_name, _nodes, _elements, properties));
+    MeshLib::NodeSearch ns(*result.get());
+    if (ns.searchUnused() > 0) {
+        std::unique_ptr<MeshLib::Mesh> new_mesh(MeshLib::removeNodes(
+            *result.get(), ns.getSearchedNodeIDs(), mesh_name));
+        return new_mesh;
+    }
+    return result;
 }
 
 double LayeredMeshGenerator::calcEpsilon(GeoLib::Raster const& low, GeoLib::Raster const& high)
diff --git a/MeshLib/MeshGenerators/LayeredMeshGenerator.h b/MeshLib/MeshGenerators/LayeredMeshGenerator.h
index 6917043bae6..d0f43e9ed67 100644
--- a/MeshLib/MeshGenerators/LayeredMeshGenerator.h
+++ b/MeshLib/MeshGenerators/LayeredMeshGenerator.h
@@ -36,68 +36,68 @@ namespace MeshLib {
 class LayeredMeshGenerator
 {
 public:
-	/**
-	* Returns a subsurface representation of a region represented by a 2D  mesh by reading raster files and calling the appropriate construction method.
-	* @param mesh                    The 2D surface mesh that is used as a basis for the subsurface mesh
-	* @param rasters                 Containing all the rasters for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM)
-	* @param minimum_thickness       Minimum thickness of each of the newly created layers (i.e. nodes with a vertical distance smaller than this will be collapsed)
-	* @param noDataReplacementValue  Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0])
-	* @result true if the subsurface representation has been created, false if there was an error
-	*/
-	virtual bool createLayers(MeshLib::Mesh const& mesh,
-	                          std::vector<GeoLib::Raster const*> const& rasters,
-	                          double minimum_thickness,
-	                          double noDataReplacementValue = 0.0) final;
+    /**
+    * Returns a subsurface representation of a region represented by a 2D  mesh by reading raster files and calling the appropriate construction method.
+    * @param mesh                    The 2D surface mesh that is used as a basis for the subsurface mesh
+    * @param rasters                 Containing all the rasters for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM)
+    * @param minimum_thickness       Minimum thickness of each of the newly created layers (i.e. nodes with a vertical distance smaller than this will be collapsed)
+    * @param noDataReplacementValue  Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0])
+    * @result true if the subsurface representation has been created, false if there was an error
+    */
+    virtual bool createLayers(MeshLib::Mesh const& mesh,
+                              std::vector<GeoLib::Raster const*> const& rasters,
+                              double minimum_thickness,
+                              double noDataReplacementValue = 0.0) final;
 
-	/**
-	* Constructs a subsurface representation based on a 2D mesh and a number of rasters representing subsurface layer boundaries.
-	* @param mesh                    The 2D surface mesh that is used as a basis for the subsurface mesh
-	* @param rasters                 Containing all the raster-data for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM)
-	* @param minimum_thickness       Minimum thickness of each of the newly created layers (i.e. nodes with a vertical distance smaller than this will be collapsed)
-	* @param noDataReplacementValue  Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0])
-	* @result true if the subsurface representation has been created, false if there was an error
-	*/
-	virtual bool createRasterLayers(MeshLib::Mesh const& mesh,
-	                                std::vector<GeoLib::Raster const*> const& rasters,
-	                                double minimum_thickness,
-	                                double noDataReplacementValue) = 0;
+    /**
+    * Constructs a subsurface representation based on a 2D mesh and a number of rasters representing subsurface layer boundaries.
+    * @param mesh                    The 2D surface mesh that is used as a basis for the subsurface mesh
+    * @param rasters                 Containing all the raster-data for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM)
+    * @param minimum_thickness       Minimum thickness of each of the newly created layers (i.e. nodes with a vertical distance smaller than this will be collapsed)
+    * @param noDataReplacementValue  Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0])
+    * @result true if the subsurface representation has been created, false if there was an error
+    */
+    virtual bool createRasterLayers(MeshLib::Mesh const& mesh,
+                                    std::vector<GeoLib::Raster const*> const& rasters,
+                                    double minimum_thickness,
+                                    double noDataReplacementValue) = 0;
 
-	/// Returns a mesh of the subsurface representation
-	std::unique_ptr<MeshLib::Mesh> getMesh(std::string const& mesh_name) const;
+    /// Returns a mesh of the subsurface representation
+    std::unique_ptr<MeshLib::Mesh> getMesh(std::string const& mesh_name) const;
 
 protected:
-	LayeredMeshGenerator();
-	~LayeredMeshGenerator() {}
+    LayeredMeshGenerator();
+    ~LayeredMeshGenerator() {}
 
-	/// Adds another layer to the subsurface mesh
-	virtual void addLayerToMesh(MeshLib::Mesh const& mesh_layer, unsigned layer_id, GeoLib::Raster const& raster) = 0;
+    /// Adds another layer to the subsurface mesh
+    virtual void addLayerToMesh(MeshLib::Mesh const& mesh_layer, unsigned layer_id, GeoLib::Raster const& raster) = 0;
 
-	/**
-	* Calculates the node Position of a subsurface node based on the given raster but also constrained by the DEM layer
-	* as an upper bound and the the layer located below as a lower bound (i.e. older stratigraphic layers are favored and
-	* nodes cannot be located above surface).
-	* @param dem_node          The node at this xy-location on the DEM
-	* @param last_layer_node   The node at this xy-location on the layer below
-	* @param raster            The raster file for the current layer
-	* @param new_node_id       Node ID to be used if there is a meaningful node position to be found
-	* @result A new node at the given xy position.
-	*/
-	MeshLib::Node* getNewLayerNode(MeshLib::Node const& dem_node,
-	                               MeshLib::Node const& last_layer_node,
-	                               GeoLib::Raster const& raster,
-	                               std::size_t new_node_id) const;
+    /**
+    * Calculates the node Position of a subsurface node based on the given raster but also constrained by the DEM layer
+    * as an upper bound and the the layer located below as a lower bound (i.e. older stratigraphic layers are favored and
+    * nodes cannot be located above surface).
+    * @param dem_node          The node at this xy-location on the DEM
+    * @param last_layer_node   The node at this xy-location on the layer below
+    * @param raster            The raster file for the current layer
+    * @param new_node_id       Node ID to be used if there is a meaningful node position to be found
+    * @result A new node at the given xy position.
+    */
+    MeshLib::Node* getNewLayerNode(MeshLib::Node const& dem_node,
+                                   MeshLib::Node const& last_layer_node,
+                                   GeoLib::Raster const& raster,
+                                   std::size_t new_node_id) const;
 
-	/// Calculates a data-dependent epsilon value
-	double calcEpsilon(GeoLib::Raster const& low, GeoLib::Raster const& high);
+    /// Calculates a data-dependent epsilon value
+    double calcEpsilon(GeoLib::Raster const& low, GeoLib::Raster const& high);
 
-	/// Cleans up the already created objects in case of an error
-	void cleanUpOnError();
+    /// Cleans up the already created objects in case of an error
+    void cleanUpOnError();
 
-	double _elevation_epsilon;
-	double _minimum_thickness;
-	std::vector<int> _materials;
-	std::vector<MeshLib::Node*> _nodes;
-	std::vector<MeshLib::Element*> _elements;
+    double _elevation_epsilon;
+    double _minimum_thickness;
+    std::vector<int> _materials;
+    std::vector<MeshLib::Node*> _nodes;
+    std::vector<MeshLib::Element*> _elements;
 };
 
 #endif //LAYEREDMESHGENERATOR_H
diff --git a/MeshLib/MeshGenerators/LayeredVolume.cpp b/MeshLib/MeshGenerators/LayeredVolume.cpp
index a26dc541657..5ba24c61444 100644
--- a/MeshLib/MeshGenerators/LayeredVolume.cpp
+++ b/MeshLib/MeshGenerators/LayeredVolume.cpp
@@ -32,155 +32,155 @@ bool LayeredVolume::createRasterLayers(const MeshLib::Mesh &mesh,
                                        double minimum_thickness,
                                        double noDataReplacementValue)
 {
-	if (mesh.getDimension() != 2)
-		return false;
-
-	_elevation_epsilon = calcEpsilon(*rasters[0], *rasters.back());
-	if (_elevation_epsilon <= 0)
-		return false;
-
-	// remove line elements, only tri + quad remain
-	MeshLib::ElementSearch ex(mesh);
-	ex.searchByElementType(MeshLib::MeshElemType::LINE);
-	std::unique_ptr<MeshLib::Mesh> top(
-	    removeElements(mesh, ex.getSearchedElementIDs(), "MeshLayer"));
-	if (top==nullptr)
-		top.reset(new MeshLib::Mesh(mesh));
-
-	if (!MeshLib::MeshLayerMapper::layerMapping(
-	        *top, *rasters.back(), noDataReplacementValue))
-		return false;
-
-	std::unique_ptr<MeshLib::Mesh> bottom(new MeshLib::Mesh(*top));
-	if (!MeshLib::MeshLayerMapper::layerMapping(*bottom, *rasters[0], 0))
-		return false;
-
-	this->_minimum_thickness = minimum_thickness;
-	_nodes = MeshLib::copyNodeVector(bottom->getNodes());
-	_elements = MeshLib::copyElementVector(bottom->getElements(), _nodes);
-	if (!_materials.empty())
-	{
-		ERR("The materials vector is not empty.");
-		return false;
-	}
-	_materials.resize(_elements.size(), 0);
-
-	// map each layer and attach to subsurface mesh
-	const std::size_t nRasters (rasters.size());
-	for (std::size_t i=1; i<nRasters; ++i)
-		this->addLayerToMesh(*top, i, *rasters[i]);
-
-	// close boundaries between layers
-	this->addLayerBoundaries(*top, nRasters);
-	this->removeCongruentElements(nRasters, top->getNElements());
-
-	return true;
+    if (mesh.getDimension() != 2)
+        return false;
+
+    _elevation_epsilon = calcEpsilon(*rasters[0], *rasters.back());
+    if (_elevation_epsilon <= 0)
+        return false;
+
+    // remove line elements, only tri + quad remain
+    MeshLib::ElementSearch ex(mesh);
+    ex.searchByElementType(MeshLib::MeshElemType::LINE);
+    std::unique_ptr<MeshLib::Mesh> top(
+        removeElements(mesh, ex.getSearchedElementIDs(), "MeshLayer"));
+    if (top==nullptr)
+        top.reset(new MeshLib::Mesh(mesh));
+
+    if (!MeshLib::MeshLayerMapper::layerMapping(
+            *top, *rasters.back(), noDataReplacementValue))
+        return false;
+
+    std::unique_ptr<MeshLib::Mesh> bottom(new MeshLib::Mesh(*top));
+    if (!MeshLib::MeshLayerMapper::layerMapping(*bottom, *rasters[0], 0))
+        return false;
+
+    this->_minimum_thickness = minimum_thickness;
+    _nodes = MeshLib::copyNodeVector(bottom->getNodes());
+    _elements = MeshLib::copyElementVector(bottom->getElements(), _nodes);
+    if (!_materials.empty())
+    {
+        ERR("The materials vector is not empty.");
+        return false;
+    }
+    _materials.resize(_elements.size(), 0);
+
+    // map each layer and attach to subsurface mesh
+    const std::size_t nRasters (rasters.size());
+    for (std::size_t i=1; i<nRasters; ++i)
+        this->addLayerToMesh(*top, i, *rasters[i]);
+
+    // close boundaries between layers
+    this->addLayerBoundaries(*top, nRasters);
+    this->removeCongruentElements(nRasters, top->getNElements());
+
+    return true;
 }
 
 void LayeredVolume::addLayerToMesh(const MeshLib::Mesh &dem_mesh, unsigned layer_id, GeoLib::Raster const& raster)
 {
-	const std::size_t nNodes (dem_mesh.getNNodes());
-	const std::vector<MeshLib::Node*> &nodes (dem_mesh.getNodes());
-	const std::size_t node_id_offset (_nodes.size());
-	const std::size_t last_layer_node_offset (node_id_offset-nNodes);
-
-	for (std::size_t i=0; i<nNodes; ++i)
-		_nodes.push_back(getNewLayerNode(*nodes[i], *_nodes[last_layer_node_offset + i], raster, _nodes.size()));
-
-	const std::vector<MeshLib::Element*> &layer_elements (dem_mesh.getElements());
-	for (MeshLib::Element* elem : layer_elements)
-	{
-		if (elem->getGeomType() == MeshLib::MeshElemType::TRIANGLE)
-		{
-			std::array<MeshLib::Node*,3> tri_nodes = {{ _nodes[node_id_offset+elem->getNodeIndex(0)],
-			                                            _nodes[node_id_offset+elem->getNodeIndex(1)],
-			                                            _nodes[node_id_offset+elem->getNodeIndex(2)] }};
-			_elements.push_back(new MeshLib::Tri(tri_nodes));
-			_materials.push_back(layer_id);
-		}
-		else if (elem->getGeomType() == MeshLib::MeshElemType::QUAD)
-		{
-			std::array<MeshLib::Node*,4> quad_nodes = {{ _nodes[node_id_offset+elem->getNodeIndex(0)],
-			                                             _nodes[node_id_offset+elem->getNodeIndex(1)],
-			                                             _nodes[node_id_offset+elem->getNodeIndex(2)],
-			                                             _nodes[node_id_offset+elem->getNodeIndex(3)] }};
-			_elements.push_back(new MeshLib::Quad(quad_nodes));
-			_materials.push_back(layer_id);
-		}
-	}
+    const std::size_t nNodes (dem_mesh.getNNodes());
+    const std::vector<MeshLib::Node*> &nodes (dem_mesh.getNodes());
+    const std::size_t node_id_offset (_nodes.size());
+    const std::size_t last_layer_node_offset (node_id_offset-nNodes);
+
+    for (std::size_t i=0; i<nNodes; ++i)
+        _nodes.push_back(getNewLayerNode(*nodes[i], *_nodes[last_layer_node_offset + i], raster, _nodes.size()));
+
+    const std::vector<MeshLib::Element*> &layer_elements (dem_mesh.getElements());
+    for (MeshLib::Element* elem : layer_elements)
+    {
+        if (elem->getGeomType() == MeshLib::MeshElemType::TRIANGLE)
+        {
+            std::array<MeshLib::Node*,3> tri_nodes = {{ _nodes[node_id_offset+elem->getNodeIndex(0)],
+                                                        _nodes[node_id_offset+elem->getNodeIndex(1)],
+                                                        _nodes[node_id_offset+elem->getNodeIndex(2)] }};
+            _elements.push_back(new MeshLib::Tri(tri_nodes));
+            _materials.push_back(layer_id);
+        }
+        else if (elem->getGeomType() == MeshLib::MeshElemType::QUAD)
+        {
+            std::array<MeshLib::Node*,4> quad_nodes = {{ _nodes[node_id_offset+elem->getNodeIndex(0)],
+                                                         _nodes[node_id_offset+elem->getNodeIndex(1)],
+                                                         _nodes[node_id_offset+elem->getNodeIndex(2)],
+                                                         _nodes[node_id_offset+elem->getNodeIndex(3)] }};
+            _elements.push_back(new MeshLib::Quad(quad_nodes));
+            _materials.push_back(layer_id);
+        }
+    }
 }
 
 void LayeredVolume::addLayerBoundaries(const MeshLib::Mesh &layer, std::size_t nLayers)
 {
-	const unsigned nLayerBoundaries (nLayers-1);
-	const std::size_t nNodes (layer.getNNodes());
-	const std::vector<MeshLib::Element*> &layer_elements (layer.getElements());
-	for (MeshLib::Element* elem : layer_elements)
-	{
-		const std::size_t nElemNodes (elem->getNBaseNodes());
-		for (unsigned i=0; i<nElemNodes; ++i)
-			if (elem->getNeighbor(i) == nullptr)
-				for (unsigned j=0; j<nLayerBoundaries; ++j)
-				{
-					const std::size_t offset (j*nNodes);
-					MeshLib::Node* n0 = _nodes[offset + elem->getNodeIndex(i)];
-					MeshLib::Node* n1 = _nodes[offset + elem->getNodeIndex((i+1)%nElemNodes)];
-					MeshLib::Node* n2 = _nodes[offset + nNodes + elem->getNodeIndex((i+1)%nElemNodes)];
-					MeshLib::Node* n3 = _nodes[offset + nNodes + elem->getNodeIndex(i)];
-
-					if (MathLib::Vector3(*n1, *n2).getLength() > std::numeric_limits<double>::epsilon())
-					{
-						const std::array<MeshLib::Node*,3> tri_nodes = {{ n0, n2, n1 }};
-						_elements.push_back(new MeshLib::Tri(tri_nodes));
-						_materials.push_back(nLayers+j);
-					}
-					if (MathLib::Vector3(*n0, *n3).getLength() > std::numeric_limits<double>::epsilon())
-					{
-						const std::array<MeshLib::Node*,3> tri_nodes = {{ n0, n3, n2 }};
-						_elements.push_back(new MeshLib::Tri(tri_nodes));
-						_materials.push_back(nLayers+j);
-					}
-				}
-	}
+    const unsigned nLayerBoundaries (nLayers-1);
+    const std::size_t nNodes (layer.getNNodes());
+    const std::vector<MeshLib::Element*> &layer_elements (layer.getElements());
+    for (MeshLib::Element* elem : layer_elements)
+    {
+        const std::size_t nElemNodes (elem->getNBaseNodes());
+        for (unsigned i=0; i<nElemNodes; ++i)
+            if (elem->getNeighbor(i) == nullptr)
+                for (unsigned j=0; j<nLayerBoundaries; ++j)
+                {
+                    const std::size_t offset (j*nNodes);
+                    MeshLib::Node* n0 = _nodes[offset + elem->getNodeIndex(i)];
+                    MeshLib::Node* n1 = _nodes[offset + elem->getNodeIndex((i+1)%nElemNodes)];
+                    MeshLib::Node* n2 = _nodes[offset + nNodes + elem->getNodeIndex((i+1)%nElemNodes)];
+                    MeshLib::Node* n3 = _nodes[offset + nNodes + elem->getNodeIndex(i)];
+
+                    if (MathLib::Vector3(*n1, *n2).getLength() > std::numeric_limits<double>::epsilon())
+                    {
+                        const std::array<MeshLib::Node*,3> tri_nodes = {{ n0, n2, n1 }};
+                        _elements.push_back(new MeshLib::Tri(tri_nodes));
+                        _materials.push_back(nLayers+j);
+                    }
+                    if (MathLib::Vector3(*n0, *n3).getLength() > std::numeric_limits<double>::epsilon())
+                    {
+                        const std::array<MeshLib::Node*,3> tri_nodes = {{ n0, n3, n2 }};
+                        _elements.push_back(new MeshLib::Tri(tri_nodes));
+                        _materials.push_back(nLayers+j);
+                    }
+                }
+    }
 }
 
 void LayeredVolume::removeCongruentElements(std::size_t nLayers, std::size_t nElementsPerLayer)
 {
-	for (std::size_t i=nLayers-1; i>0; --i)
-	{
-		const std::size_t lower_offset ((i-1) * nElementsPerLayer);
-		const std::size_t upper_offset ( i    * nElementsPerLayer);
-		for (std::size_t j=0; j<nElementsPerLayer; ++j)
-		{
-			MeshLib::Element const*const high (_elements[upper_offset+j]);
-			MeshLib::Element *const low  (_elements[lower_offset+j]);
-
-			unsigned count(0);
-			const std::size_t nElemNodes (low->getNBaseNodes());
-			for (std::size_t k=0; k<nElemNodes; ++k)
-				if (high->getNodeIndex(k) == low->getNodeIndex(k))
-				{
-					low->setNode(k, _nodes[high->getNodeIndex(k)]);
-					count++;
-				}
-
-			if (count == nElemNodes)
-			{
-				delete _elements[upper_offset+j];
-				// mark element and material entries for deletion
-				_elements[upper_offset+j] = nullptr;
-				_materials[upper_offset+j] = -1;
-			}
-			else
-			{
-				MeshLib::Node attr = high->getCenterOfGravity();
-				_attribute_points.push_back(MeshLib::Node(attr[0], attr[1], (attr[2] + low->getCenterOfGravity()[2])/2.0, _materials[lower_offset+j]));
-			}
-		}
-	}
-	// delete marked entries
-	auto elem_vec_end = std::remove(_elements.begin(), _elements.end(), nullptr);
-	_elements.erase(elem_vec_end, _elements.end());
-	auto mat_vec_end = std::remove(_materials.begin(), _materials.end(), -1);
-	_materials.erase(mat_vec_end, _materials.end());
+    for (std::size_t i=nLayers-1; i>0; --i)
+    {
+        const std::size_t lower_offset ((i-1) * nElementsPerLayer);
+        const std::size_t upper_offset ( i    * nElementsPerLayer);
+        for (std::size_t j=0; j<nElementsPerLayer; ++j)
+        {
+            MeshLib::Element const*const high (_elements[upper_offset+j]);
+            MeshLib::Element *const low  (_elements[lower_offset+j]);
+
+            unsigned count(0);
+            const std::size_t nElemNodes (low->getNBaseNodes());
+            for (std::size_t k=0; k<nElemNodes; ++k)
+                if (high->getNodeIndex(k) == low->getNodeIndex(k))
+                {
+                    low->setNode(k, _nodes[high->getNodeIndex(k)]);
+                    count++;
+                }
+
+            if (count == nElemNodes)
+            {
+                delete _elements[upper_offset+j];
+                // mark element and material entries for deletion
+                _elements[upper_offset+j] = nullptr;
+                _materials[upper_offset+j] = -1;
+            }
+            else
+            {
+                MeshLib::Node attr = high->getCenterOfGravity();
+                _attribute_points.push_back(MeshLib::Node(attr[0], attr[1], (attr[2] + low->getCenterOfGravity()[2])/2.0, _materials[lower_offset+j]));
+            }
+        }
+    }
+    // delete marked entries
+    auto elem_vec_end = std::remove(_elements.begin(), _elements.end(), nullptr);
+    _elements.erase(elem_vec_end, _elements.end());
+    auto mat_vec_end = std::remove(_materials.begin(), _materials.end(), -1);
+    _materials.erase(mat_vec_end, _materials.end());
 }
diff --git a/MeshLib/MeshGenerators/LayeredVolume.h b/MeshLib/MeshGenerators/LayeredVolume.h
index 035d8c8e0fe..fb0bd1b280c 100644
--- a/MeshLib/MeshGenerators/LayeredVolume.h
+++ b/MeshLib/MeshGenerators/LayeredVolume.h
@@ -22,8 +22,8 @@
 #include "LayeredMeshGenerator.h"
 
 namespace GeoLib {
-	class GEOObjects;
-	class Surface;
+    class GEOObjects;
+    class Surface;
 }
 
 /**
@@ -32,36 +32,36 @@ namespace GeoLib {
 class LayeredVolume : public LayeredMeshGenerator
 {
 public:
-	LayeredVolume() {}
-	~LayeredVolume() {}
+    LayeredVolume() {}
+    ~LayeredVolume() {}
 
-	/**
-	 * Constructs a subsurface representation of a mesh using only 2D elements (i.e. layer boundaries are represented by surfaces)
-	 * @param mesh                    The 2D surface mesh that is used as a basis for the subsurface mesh
-	 * @param rasters                 Containing all the raster-data for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM)
-	 * @param minimum_thickness       Minimum thickness of each of the newly created layers (i.e. nodes with a vertical distance smaller than this will be collapsed)
-	 * @param noDataReplacementValue  Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0])
-	 * @result true if the subsurface representation has been created, false if there was an error
-	 */
-	bool createRasterLayers(const MeshLib::Mesh &mesh,
-	                        const std::vector<GeoLib::Raster const*> &rasters,
-	                        double minimum_thickness,
-	                        double noDataReplacementValue = 0.0);
+    /**
+     * Constructs a subsurface representation of a mesh using only 2D elements (i.e. layer boundaries are represented by surfaces)
+     * @param mesh                    The 2D surface mesh that is used as a basis for the subsurface mesh
+     * @param rasters                 Containing all the raster-data for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM)
+     * @param minimum_thickness       Minimum thickness of each of the newly created layers (i.e. nodes with a vertical distance smaller than this will be collapsed)
+     * @param noDataReplacementValue  Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0])
+     * @result true if the subsurface representation has been created, false if there was an error
+     */
+    bool createRasterLayers(const MeshLib::Mesh &mesh,
+                            const std::vector<GeoLib::Raster const*> &rasters,
+                            double minimum_thickness,
+                            double noDataReplacementValue = 0.0);
 
-	/// Returns the region attribute vector necessary for assigning region attributes via TetGen
-	std::vector<MeshLib::Node> getAttributePoints() { return _attribute_points; }
+    /// Returns the region attribute vector necessary for assigning region attributes via TetGen
+    std::vector<MeshLib::Node> getAttributePoints() { return _attribute_points; }
 
 private:
-	/// Adds another layer to the subsurface mesh
-	void addLayerToMesh(const MeshLib::Mesh &mesh_layer, unsigned layer_id, GeoLib::Raster const& raster);
+    /// Adds another layer to the subsurface mesh
+    void addLayerToMesh(const MeshLib::Mesh &mesh_layer, unsigned layer_id, GeoLib::Raster const& raster);
 
-	/// Creates boundary surfaces between the mapped layers to make the volumes watertight
-	void addLayerBoundaries(const MeshLib::Mesh &layer, std::size_t nLayers);
+    /// Creates boundary surfaces between the mapped layers to make the volumes watertight
+    void addLayerBoundaries(const MeshLib::Mesh &layer, std::size_t nLayers);
 
-	/// Removes duplicate 2D elements (possible due to outcroppings)
-	void removeCongruentElements(std::size_t nLayers, std::size_t nElementsPerLayer);
+    /// Removes duplicate 2D elements (possible due to outcroppings)
+    void removeCongruentElements(std::size_t nLayers, std::size_t nElementsPerLayer);
 
-	std::vector<MeshLib::Node> _attribute_points;
+    std::vector<MeshLib::Node> _attribute_points;
 };
 
 #endif //LAYEREDVOLUME_H
diff --git a/MeshLib/MeshGenerators/MeshGenerator.cpp b/MeshLib/MeshGenerators/MeshGenerator.cpp
index 426816f8474..1ea477e731c 100644
--- a/MeshLib/MeshGenerators/MeshGenerator.cpp
+++ b/MeshLib/MeshGenerators/MeshGenerator.cpp
@@ -24,478 +24,478 @@ namespace MeshLib
 {
 
 std::vector<MeshLib::Node*> MeshGenerator::generateRegularNodes(
-	const std::vector<const std::vector<double>*> &vec_xyz_coords,
-	const GeoLib::Point& origin)
+    const std::vector<const std::vector<double>*> &vec_xyz_coords,
+    const GeoLib::Point& origin)
 {
-	std::vector<Node*> nodes;
-	nodes.reserve(vec_xyz_coords[0]->size()*vec_xyz_coords[1]->size()*vec_xyz_coords[2]->size());
-
-	for (std::size_t i = 0; i < vec_xyz_coords[2]->size(); i++)
-	{
-		const double z ((*vec_xyz_coords[2])[i]+origin[2]);
-		for (std::size_t j = 0; j < vec_xyz_coords[1]->size(); j++)
-		{
-			const double y ((*vec_xyz_coords[1])[j]+origin[1]);
-			for (std::size_t k = 0; k < vec_xyz_coords[0]->size(); k++)
-			{
-				nodes.push_back (new Node((*vec_xyz_coords[0])[k]+origin[0], y, z));
-			}
-		}
-	}
-	return nodes;
+    std::vector<Node*> nodes;
+    nodes.reserve(vec_xyz_coords[0]->size()*vec_xyz_coords[1]->size()*vec_xyz_coords[2]->size());
+
+    for (std::size_t i = 0; i < vec_xyz_coords[2]->size(); i++)
+    {
+        const double z ((*vec_xyz_coords[2])[i]+origin[2]);
+        for (std::size_t j = 0; j < vec_xyz_coords[1]->size(); j++)
+        {
+            const double y ((*vec_xyz_coords[1])[j]+origin[1]);
+            for (std::size_t k = 0; k < vec_xyz_coords[0]->size(); k++)
+            {
+                nodes.push_back (new Node((*vec_xyz_coords[0])[k]+origin[0], y, z));
+            }
+        }
+    }
+    return nodes;
 }
 
 std::vector<MeshLib::Node*> MeshGenerator::generateRegularNodes(
-	const std::vector<double> &vec_x_coords,
-	const GeoLib::Point& origin)
+    const std::vector<double> &vec_x_coords,
+    const GeoLib::Point& origin)
 {
-	std::vector<const std::vector<double>*> vec_xyz_coords;
-	vec_xyz_coords.push_back(&vec_x_coords);
-	std::vector<double> dummy(1,0.0);
-	for (unsigned i=vec_xyz_coords.size()-1; i<3u; i++)
-		vec_xyz_coords.push_back(&dummy);
-	return generateRegularNodes(vec_xyz_coords, origin);
+    std::vector<const std::vector<double>*> vec_xyz_coords;
+    vec_xyz_coords.push_back(&vec_x_coords);
+    std::vector<double> dummy(1,0.0);
+    for (unsigned i=vec_xyz_coords.size()-1; i<3u; i++)
+        vec_xyz_coords.push_back(&dummy);
+    return generateRegularNodes(vec_xyz_coords, origin);
 }
 
 std::vector<MeshLib::Node*> MeshGenerator::generateRegularNodes(
-	std::vector<double> &vec_x_coords,
-	std::vector<double> &vec_y_coords,
-	const GeoLib::Point& origin)
+    std::vector<double> &vec_x_coords,
+    std::vector<double> &vec_y_coords,
+    const GeoLib::Point& origin)
 {
-	std::vector<const std::vector<double>*> vec_xyz_coords;
-	vec_xyz_coords.push_back(&vec_x_coords);
-	vec_xyz_coords.push_back(&vec_y_coords);
-	std::vector<double> dummy(1,0.0);
-	for (unsigned i=vec_xyz_coords.size()-1; i<3u; i++)
-		vec_xyz_coords.push_back(&dummy);
-	return generateRegularNodes(vec_xyz_coords, origin);
+    std::vector<const std::vector<double>*> vec_xyz_coords;
+    vec_xyz_coords.push_back(&vec_x_coords);
+    vec_xyz_coords.push_back(&vec_y_coords);
+    std::vector<double> dummy(1,0.0);
+    for (unsigned i=vec_xyz_coords.size()-1; i<3u; i++)
+        vec_xyz_coords.push_back(&dummy);
+    return generateRegularNodes(vec_xyz_coords, origin);
 }
 
 std::vector<MeshLib::Node*> MeshGenerator::generateRegularNodes(
-	std::vector<double> &vec_x_coords,
-	std::vector<double> &vec_y_coords,
-	std::vector<double> &vec_z_coords,
-	const GeoLib::Point& origin)
+    std::vector<double> &vec_x_coords,
+    std::vector<double> &vec_y_coords,
+    std::vector<double> &vec_z_coords,
+    const GeoLib::Point& origin)
 {
-	std::vector<const std::vector<double>*> vec_xyz_coords;
-	vec_xyz_coords.push_back(&vec_x_coords);
-	vec_xyz_coords.push_back(&vec_y_coords);
-	vec_xyz_coords.push_back(&vec_z_coords);
-	return generateRegularNodes(vec_xyz_coords, origin);
+    std::vector<const std::vector<double>*> vec_xyz_coords;
+    vec_xyz_coords.push_back(&vec_x_coords);
+    vec_xyz_coords.push_back(&vec_y_coords);
+    vec_xyz_coords.push_back(&vec_z_coords);
+    return generateRegularNodes(vec_xyz_coords, origin);
 }
 
 std::vector<MeshLib::Node*> MeshGenerator::generateRegularNodes(
-	const std::array<unsigned,3> &n_cells,
-	const std::array<double,3> &cell_size,
-	const GeoLib::Point& origin)
+    const std::array<unsigned,3> &n_cells,
+    const std::array<double,3> &cell_size,
+    const GeoLib::Point& origin)
 {
-	std::vector<Node*> nodes;
-	nodes.reserve((n_cells[0]+1)*(n_cells[1]+1)*(n_cells[2]+1));
-
-	for (std::size_t i = 0; i < n_cells[2]+1; i++)
-	{
-		const double z (origin[2] + cell_size[2] * i);
-		for (std::size_t j = 0; j < n_cells[1]+1; j++)
-		{
-			const double y (origin[1] + cell_size[1] * j);
-			for (std::size_t k = 0; k < n_cells[0]+1; k++)
-			{
-				nodes.push_back (new Node(origin[0] + cell_size[0] * k, y, z));
-			}
-		}
-	}
-	return nodes;
+    std::vector<Node*> nodes;
+    nodes.reserve((n_cells[0]+1)*(n_cells[1]+1)*(n_cells[2]+1));
+
+    for (std::size_t i = 0; i < n_cells[2]+1; i++)
+    {
+        const double z (origin[2] + cell_size[2] * i);
+        for (std::size_t j = 0; j < n_cells[1]+1; j++)
+        {
+            const double y (origin[1] + cell_size[1] * j);
+            for (std::size_t k = 0; k < n_cells[0]+1; k++)
+            {
+                nodes.push_back (new Node(origin[0] + cell_size[0] * k, y, z));
+            }
+        }
+    }
+    return nodes;
 }
 
 Mesh* MeshGenerator::generateLineMesh(
-	const double length,
-	const std::size_t subdivision,
-	const GeoLib::Point& origin,
-	std::string   const& mesh_name)
+    const double length,
+    const std::size_t subdivision,
+    const GeoLib::Point& origin,
+    std::string   const& mesh_name)
 {
-	return generateLineMesh(subdivision, length/subdivision, origin, mesh_name);
+    return generateLineMesh(subdivision, length/subdivision, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateLineMesh(
-	const unsigned n_cells,
-	const double   cell_size,
-	GeoLib::Point const& origin,
-	std::string   const& mesh_name)
+    const unsigned n_cells,
+    const double   cell_size,
+    GeoLib::Point const& origin,
+    std::string   const& mesh_name)
 {
-	return generateLineMesh(BaseLib::UniformSubdivision(n_cells*cell_size, n_cells), origin, mesh_name);
+    return generateLineMesh(BaseLib::UniformSubdivision(n_cells*cell_size, n_cells), origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateLineMesh(
-	const BaseLib::ISubdivision &div,
-	GeoLib::Point const& origin,
-	std::string const& mesh_name)
+    const BaseLib::ISubdivision &div,
+    GeoLib::Point const& origin,
+    std::string const& mesh_name)
 {
-	const std::vector<double> vec_x(div());
-	std::vector<Node*> nodes(generateRegularNodes(vec_x, origin));
-
-	//elements
-	const std::size_t n_cells = nodes.size()-1;
-	std::vector<Element*> elements;
-	elements.reserve(n_cells);
-
-	for (std::size_t i = 0; i < n_cells; i++)
-	{
-		std::array<Node*, 2> element_nodes;
-		element_nodes[0] = nodes[i];
-		element_nodes[1] = nodes[i + 1];
-		elements.push_back (new Line(element_nodes));
-	}
-
-	return new Mesh(mesh_name, nodes, elements);
+    const std::vector<double> vec_x(div());
+    std::vector<Node*> nodes(generateRegularNodes(vec_x, origin));
+
+    //elements
+    const std::size_t n_cells = nodes.size()-1;
+    std::vector<Element*> elements;
+    elements.reserve(n_cells);
+
+    for (std::size_t i = 0; i < n_cells; i++)
+    {
+        std::array<Node*, 2> element_nodes;
+        element_nodes[0] = nodes[i];
+        element_nodes[1] = nodes[i + 1];
+        elements.push_back (new Line(element_nodes));
+    }
+
+    return new Mesh(mesh_name, nodes, elements);
 }
 
 Mesh* MeshGenerator::generateRegularQuadMesh(
-	const double length,
-	const std::size_t subdivision,
-	const GeoLib::Point& origin,
-	std::string const& mesh_name)
+    const double length,
+    const std::size_t subdivision,
+    const GeoLib::Point& origin,
+    std::string const& mesh_name)
 {
-	return generateRegularQuadMesh(subdivision, subdivision,
-		length/subdivision, length/subdivision, origin, mesh_name);
+    return generateRegularQuadMesh(subdivision, subdivision,
+        length/subdivision, length/subdivision, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularQuadMesh(
-	const double x_length,
-	const double y_length,
-	const std::size_t x_subdivision,
-	const std::size_t y_subdivision,
-	const GeoLib::Point& origin,
-	std::string const& mesh_name)
+    const double x_length,
+    const double y_length,
+    const std::size_t x_subdivision,
+    const std::size_t y_subdivision,
+    const GeoLib::Point& origin,
+    std::string const& mesh_name)
 {
-	return generateRegularQuadMesh(x_subdivision, y_subdivision,
-		x_length/x_subdivision, y_length/y_subdivision, origin, mesh_name);
+    return generateRegularQuadMesh(x_subdivision, y_subdivision,
+        x_length/x_subdivision, y_length/y_subdivision, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularQuadMesh(
-	const unsigned n_x_cells,
-	const unsigned n_y_cells,
-	const double cell_size,
-	GeoLib::Point const& origin,
-	std::string const& mesh_name)
+    const unsigned n_x_cells,
+    const unsigned n_y_cells,
+    const double cell_size,
+    GeoLib::Point const& origin,
+    std::string const& mesh_name)
 {
-	return generateRegularQuadMesh(n_x_cells, n_y_cells, cell_size, cell_size, origin, mesh_name);
+    return generateRegularQuadMesh(n_x_cells, n_y_cells, cell_size, cell_size, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularQuadMesh(
-	const unsigned n_x_cells,
-	const unsigned n_y_cells,
-	const double cell_size_x,
-	const double cell_size_y,
-	GeoLib::Point const& origin,
-	std::string const& mesh_name)
+    const unsigned n_x_cells,
+    const unsigned n_y_cells,
+    const double cell_size_x,
+    const double cell_size_y,
+    GeoLib::Point const& origin,
+    std::string const& mesh_name)
 {
-	return generateRegularQuadMesh(BaseLib::UniformSubdivision(n_x_cells*cell_size_x, n_x_cells),
-		BaseLib::UniformSubdivision(n_y_cells*cell_size_y, n_y_cells), origin, mesh_name);
+    return generateRegularQuadMesh(BaseLib::UniformSubdivision(n_x_cells*cell_size_x, n_x_cells),
+        BaseLib::UniformSubdivision(n_y_cells*cell_size_y, n_y_cells), origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularQuadMesh(
-	const BaseLib::ISubdivision &div_x,
-	const BaseLib::ISubdivision &div_y,
-	GeoLib::Point const& origin,
-	std::string const& mesh_name)
+    const BaseLib::ISubdivision &div_x,
+    const BaseLib::ISubdivision &div_y,
+    GeoLib::Point const& origin,
+    std::string const& mesh_name)
 {
-	std::vector<double> vec_x(div_x());
-	std::vector<double> vec_y(div_y());
-	std::vector<Node*> nodes(generateRegularNodes(vec_x, vec_y, origin));
-	const unsigned n_x_nodes (vec_x.size());
-
-	//elements
-	std::vector<Element*> elements;
-	const unsigned n_x_cells (vec_x.size()-1);
-	const unsigned n_y_cells (vec_y.size()-1);
-	elements.reserve(n_x_cells * n_y_cells);
-
-	for (std::size_t j = 0; j < n_y_cells; j++)
-	{
-		const std::size_t offset_y1 = j * n_x_nodes;
-		const std::size_t offset_y2 = (j + 1) * n_x_nodes;
-		for (std::size_t k = 0; k < n_x_cells; k++)
-		{
-			std::array<Node*, 4> element_nodes;
-			element_nodes[0] = nodes[offset_y1 + k];
-			element_nodes[1] = nodes[offset_y1 + k + 1];
-			element_nodes[2] = nodes[offset_y2 + k + 1];
-			element_nodes[3] = nodes[offset_y2 + k];
-			elements.push_back (new Quad(element_nodes));
-		}
-	}
-
-	return new Mesh(mesh_name, nodes, elements);
+    std::vector<double> vec_x(div_x());
+    std::vector<double> vec_y(div_y());
+    std::vector<Node*> nodes(generateRegularNodes(vec_x, vec_y, origin));
+    const unsigned n_x_nodes (vec_x.size());
+
+    //elements
+    std::vector<Element*> elements;
+    const unsigned n_x_cells (vec_x.size()-1);
+    const unsigned n_y_cells (vec_y.size()-1);
+    elements.reserve(n_x_cells * n_y_cells);
+
+    for (std::size_t j = 0; j < n_y_cells; j++)
+    {
+        const std::size_t offset_y1 = j * n_x_nodes;
+        const std::size_t offset_y2 = (j + 1) * n_x_nodes;
+        for (std::size_t k = 0; k < n_x_cells; k++)
+        {
+            std::array<Node*, 4> element_nodes;
+            element_nodes[0] = nodes[offset_y1 + k];
+            element_nodes[1] = nodes[offset_y1 + k + 1];
+            element_nodes[2] = nodes[offset_y2 + k + 1];
+            element_nodes[3] = nodes[offset_y2 + k];
+            elements.push_back (new Quad(element_nodes));
+        }
+    }
+
+    return new Mesh(mesh_name, nodes, elements);
 }
 
 Mesh* MeshGenerator::generateRegularHexMesh(
-	const double length,
-	const std::size_t subdivision,
-	const GeoLib::Point& origin,
-	std::string const& mesh_name)
+    const double length,
+    const std::size_t subdivision,
+    const GeoLib::Point& origin,
+    std::string const& mesh_name)
 {
-	return MeshGenerator::generateRegularHexMesh(subdivision, subdivision,
-		subdivision, length/subdivision, origin, mesh_name);
+    return MeshGenerator::generateRegularHexMesh(subdivision, subdivision,
+        subdivision, length/subdivision, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularHexMesh(
-	const double x_length,
-	const double y_length,
-	const double z_length,
-	const std::size_t x_subdivision,
-	const std::size_t y_subdivision,
-	const std::size_t z_subdivision,
-	const GeoLib::Point& origin,
-	std::string const& mesh_name)
+    const double x_length,
+    const double y_length,
+    const double z_length,
+    const std::size_t x_subdivision,
+    const std::size_t y_subdivision,
+    const std::size_t z_subdivision,
+    const GeoLib::Point& origin,
+    std::string const& mesh_name)
 {
-	return MeshGenerator::generateRegularHexMesh(x_subdivision, y_subdivision, z_subdivision,
-		x_length/x_subdivision, y_length/y_subdivision, z_length/z_subdivision, origin, mesh_name);
+    return MeshGenerator::generateRegularHexMesh(x_subdivision, y_subdivision, z_subdivision,
+        x_length/x_subdivision, y_length/y_subdivision, z_length/z_subdivision, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularHexMesh(
-	const unsigned n_x_cells,
-	const unsigned n_y_cells,
-	const unsigned n_z_cells,
-	const double   cell_size,
-	GeoLib::Point const& origin,
-	std::string   const& mesh_name)
+    const unsigned n_x_cells,
+    const unsigned n_y_cells,
+    const unsigned n_z_cells,
+    const double   cell_size,
+    GeoLib::Point const& origin,
+    std::string   const& mesh_name)
 {
-	return MeshGenerator::generateRegularHexMesh(n_x_cells, n_y_cells, n_z_cells,
-		cell_size, cell_size, cell_size, origin, mesh_name);
+    return MeshGenerator::generateRegularHexMesh(n_x_cells, n_y_cells, n_z_cells,
+        cell_size, cell_size, cell_size, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularHexMesh(
-	const unsigned n_x_cells,
-	const unsigned n_y_cells,
-	const unsigned n_z_cells,
-	const double   cell_size_x,
-	const double   cell_size_y,
-	const double   cell_size_z,
-	GeoLib::Point const& origin,
-	std::string   const& mesh_name)
+    const unsigned n_x_cells,
+    const unsigned n_y_cells,
+    const unsigned n_z_cells,
+    const double   cell_size_x,
+    const double   cell_size_y,
+    const double   cell_size_z,
+    GeoLib::Point const& origin,
+    std::string   const& mesh_name)
 {
-	return generateRegularHexMesh(
-			BaseLib::UniformSubdivision(n_x_cells*cell_size_x, n_x_cells),
-			BaseLib::UniformSubdivision(n_y_cells*cell_size_y, n_y_cells),
-			BaseLib::UniformSubdivision(n_z_cells*cell_size_z, n_z_cells),
-			origin, mesh_name);
+    return generateRegularHexMesh(
+            BaseLib::UniformSubdivision(n_x_cells*cell_size_x, n_x_cells),
+            BaseLib::UniformSubdivision(n_y_cells*cell_size_y, n_y_cells),
+            BaseLib::UniformSubdivision(n_z_cells*cell_size_z, n_z_cells),
+            origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularHexMesh(
-	const BaseLib::ISubdivision &div_x,
-	const BaseLib::ISubdivision &div_y,
-	const BaseLib::ISubdivision &div_z,
-	GeoLib::Point const& origin,
-	std::string const& mesh_name)
+    const BaseLib::ISubdivision &div_x,
+    const BaseLib::ISubdivision &div_y,
+    const BaseLib::ISubdivision &div_z,
+    GeoLib::Point const& origin,
+    std::string const& mesh_name)
 {
-	std::vector<double> vec_x(div_x());
-	std::vector<double> vec_y(div_y());
-	std::vector<double> vec_z(div_z());
-	std::vector<Node*> nodes(generateRegularNodes(vec_x, vec_y, vec_z, origin));
-
-	const unsigned n_x_nodes (vec_x.size());
-	const unsigned n_y_nodes (vec_y.size());
-	const unsigned n_x_cells (vec_x.size()-1);
-	const unsigned n_y_cells (vec_y.size()-1);
-	const unsigned n_z_cells (vec_z.size()-1);
-
-	//elements
-	std::vector<Element*> elements;
-	elements.reserve(n_x_cells * n_y_cells * n_z_cells);
-
-	for (std::size_t i = 0; i < n_z_cells; i++)
-	{
-		const std::size_t offset_z1 = i * n_x_nodes * n_y_nodes; // bottom
-		const std::size_t offset_z2 = (i + 1) * n_x_nodes * n_y_nodes; // top
-		for (std::size_t j = 0; j < n_y_cells; j++)
-		{
-			const std::size_t offset_y1 = j * n_x_nodes;
-			const std::size_t offset_y2 = (j + 1) * n_x_nodes;
-			for (std::size_t k = 0; k < n_x_cells; k++)
-			{
-				std::array<Node*, 8> element_nodes;
-				// bottom
-				element_nodes[0] = nodes[offset_z1 + offset_y1 + k];
-				element_nodes[1] = nodes[offset_z1 + offset_y1 + k + 1];
-				element_nodes[2] = nodes[offset_z1 + offset_y2 + k + 1];
-				element_nodes[3] = nodes[offset_z1 + offset_y2 + k];
-				// top
-				element_nodes[4] = nodes[offset_z2 + offset_y1 + k];
-				element_nodes[5] = nodes[offset_z2 + offset_y1 + k + 1];
-				element_nodes[6] = nodes[offset_z2 + offset_y2 + k + 1];
-				element_nodes[7] = nodes[offset_z2 + offset_y2 + k];
-				elements.push_back (new Hex(element_nodes));
-			}
-		}
-	}
-
-	return new Mesh(mesh_name, nodes, elements);
+    std::vector<double> vec_x(div_x());
+    std::vector<double> vec_y(div_y());
+    std::vector<double> vec_z(div_z());
+    std::vector<Node*> nodes(generateRegularNodes(vec_x, vec_y, vec_z, origin));
+
+    const unsigned n_x_nodes (vec_x.size());
+    const unsigned n_y_nodes (vec_y.size());
+    const unsigned n_x_cells (vec_x.size()-1);
+    const unsigned n_y_cells (vec_y.size()-1);
+    const unsigned n_z_cells (vec_z.size()-1);
+
+    //elements
+    std::vector<Element*> elements;
+    elements.reserve(n_x_cells * n_y_cells * n_z_cells);
+
+    for (std::size_t i = 0; i < n_z_cells; i++)
+    {
+        const std::size_t offset_z1 = i * n_x_nodes * n_y_nodes; // bottom
+        const std::size_t offset_z2 = (i + 1) * n_x_nodes * n_y_nodes; // top
+        for (std::size_t j = 0; j < n_y_cells; j++)
+        {
+            const std::size_t offset_y1 = j * n_x_nodes;
+            const std::size_t offset_y2 = (j + 1) * n_x_nodes;
+            for (std::size_t k = 0; k < n_x_cells; k++)
+            {
+                std::array<Node*, 8> element_nodes;
+                // bottom
+                element_nodes[0] = nodes[offset_z1 + offset_y1 + k];
+                element_nodes[1] = nodes[offset_z1 + offset_y1 + k + 1];
+                element_nodes[2] = nodes[offset_z1 + offset_y2 + k + 1];
+                element_nodes[3] = nodes[offset_z1 + offset_y2 + k];
+                // top
+                element_nodes[4] = nodes[offset_z2 + offset_y1 + k];
+                element_nodes[5] = nodes[offset_z2 + offset_y1 + k + 1];
+                element_nodes[6] = nodes[offset_z2 + offset_y2 + k + 1];
+                element_nodes[7] = nodes[offset_z2 + offset_y2 + k];
+                elements.push_back (new Hex(element_nodes));
+            }
+        }
+    }
+
+    return new Mesh(mesh_name, nodes, elements);
 }
 
 Mesh* MeshGenerator::generateRegularTriMesh(
-	const double length,
-	const std::size_t subdivision,
-	const GeoLib::Point& origin,
-	std::string const& mesh_name)
+    const double length,
+    const std::size_t subdivision,
+    const GeoLib::Point& origin,
+    std::string const& mesh_name)
 {
-	return generateRegularTriMesh(subdivision, subdivision, length/subdivision, origin, mesh_name);
+    return generateRegularTriMesh(subdivision, subdivision, length/subdivision, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularTriMesh(
-	const double x_length,
-	const double y_length,
-	const std::size_t x_subdivision,
-	const std::size_t y_subdivision,
-	const GeoLib::Point& origin,
-	std::string const& mesh_name)
+    const double x_length,
+    const double y_length,
+    const std::size_t x_subdivision,
+    const std::size_t y_subdivision,
+    const GeoLib::Point& origin,
+    std::string const& mesh_name)
 {
-	return generateRegularTriMesh(x_subdivision, y_subdivision, x_length/x_subdivision, y_length/y_subdivision, origin, mesh_name);
+    return generateRegularTriMesh(x_subdivision, y_subdivision, x_length/x_subdivision, y_length/y_subdivision, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularTriMesh(
-	const unsigned n_x_cells,
-	const unsigned n_y_cells,
-	const double cell_size,
-	GeoLib::Point const& origin,
-	std::string const& mesh_name)
+    const unsigned n_x_cells,
+    const unsigned n_y_cells,
+    const double cell_size,
+    GeoLib::Point const& origin,
+    std::string const& mesh_name)
 {
-	return generateRegularTriMesh(n_x_cells, n_y_cells, cell_size, cell_size, origin, mesh_name);
+    return generateRegularTriMesh(n_x_cells, n_y_cells, cell_size, cell_size, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularTriMesh(
-	const unsigned n_x_cells,
-	const unsigned n_y_cells,
-	const double   cell_size_x,
-	const double   cell_size_y,
-	GeoLib::Point const& origin,
-	std::string   const& mesh_name)
+    const unsigned n_x_cells,
+    const unsigned n_y_cells,
+    const double   cell_size_x,
+    const double   cell_size_y,
+    GeoLib::Point const& origin,
+    std::string   const& mesh_name)
 {
-	return generateRegularTriMesh(BaseLib::UniformSubdivision(n_x_cells*cell_size_x, n_x_cells),
-		BaseLib::UniformSubdivision(n_y_cells*cell_size_y, n_y_cells), origin, mesh_name);
+    return generateRegularTriMesh(BaseLib::UniformSubdivision(n_x_cells*cell_size_x, n_x_cells),
+        BaseLib::UniformSubdivision(n_y_cells*cell_size_y, n_y_cells), origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularTriMesh(
-	const BaseLib::ISubdivision &div_x,
-	const BaseLib::ISubdivision &div_y,
-	GeoLib::Point const& origin,
-	std::string const& mesh_name)
+    const BaseLib::ISubdivision &div_x,
+    const BaseLib::ISubdivision &div_y,
+    GeoLib::Point const& origin,
+    std::string const& mesh_name)
 {
-	std::vector<double> vec_x(div_x());
-	std::vector<double> vec_y(div_y());
-	std::vector<Node*> nodes(generateRegularNodes(vec_x, vec_y, origin));
-	const unsigned n_x_nodes (vec_x.size());
-	const unsigned n_x_cells (vec_x.size()-1);
-	const unsigned n_y_cells (vec_y.size()-1);
-
-	//elements
-	std::vector<Element*> elements;
-	elements.reserve(n_x_cells * n_y_cells * 2);
-
-	for (std::size_t j = 0; j < n_y_cells; j++)
-	{
-		const std::size_t offset_y1 = j * n_x_nodes;
-		const std::size_t offset_y2 = (j + 1) * n_x_nodes;
-		for (std::size_t k = 0; k < n_x_cells; k++)
-		{
-			std::array<Node*, 3> element1_nodes;
-			element1_nodes[0] = nodes[offset_y1 + k];
-			element1_nodes[1] = nodes[offset_y2 + k + 1];
-			element1_nodes[2] = nodes[offset_y2 + k];
-			elements.push_back (new Tri(element1_nodes));
-			std::array<Node*, 3> element2_nodes;
-			element2_nodes[0] = nodes[offset_y1 + k];
-			element2_nodes[1] = nodes[offset_y1 + k + 1];
-			element2_nodes[2] = nodes[offset_y2 + k + 1];
-			elements.push_back (new Tri(element2_nodes));
-		}
-	}
-
-	return new Mesh(mesh_name, nodes, elements);
+    std::vector<double> vec_x(div_x());
+    std::vector<double> vec_y(div_y());
+    std::vector<Node*> nodes(generateRegularNodes(vec_x, vec_y, origin));
+    const unsigned n_x_nodes (vec_x.size());
+    const unsigned n_x_cells (vec_x.size()-1);
+    const unsigned n_y_cells (vec_y.size()-1);
+
+    //elements
+    std::vector<Element*> elements;
+    elements.reserve(n_x_cells * n_y_cells * 2);
+
+    for (std::size_t j = 0; j < n_y_cells; j++)
+    {
+        const std::size_t offset_y1 = j * n_x_nodes;
+        const std::size_t offset_y2 = (j + 1) * n_x_nodes;
+        for (std::size_t k = 0; k < n_x_cells; k++)
+        {
+            std::array<Node*, 3> element1_nodes;
+            element1_nodes[0] = nodes[offset_y1 + k];
+            element1_nodes[1] = nodes[offset_y2 + k + 1];
+            element1_nodes[2] = nodes[offset_y2 + k];
+            elements.push_back (new Tri(element1_nodes));
+            std::array<Node*, 3> element2_nodes;
+            element2_nodes[0] = nodes[offset_y1 + k];
+            element2_nodes[1] = nodes[offset_y1 + k + 1];
+            element2_nodes[2] = nodes[offset_y2 + k + 1];
+            elements.push_back (new Tri(element2_nodes));
+        }
+    }
+
+    return new Mesh(mesh_name, nodes, elements);
 }
 
 Mesh* MeshGenerator::generateRegularPrismMesh(
-	const double x_length,
-	const double y_length,
-	const double z_length,
-	const std::size_t x_subdivision,
-	const std::size_t y_subdivision,
-	const std::size_t z_subdivision,
-	const GeoLib::Point& origin,
-	std::string const& mesh_name)
+    const double x_length,
+    const double y_length,
+    const double z_length,
+    const std::size_t x_subdivision,
+    const std::size_t y_subdivision,
+    const std::size_t z_subdivision,
+    const GeoLib::Point& origin,
+    std::string const& mesh_name)
 {
-	return generateRegularPrismMesh(x_subdivision, y_subdivision, z_subdivision,
-		x_length/x_subdivision, y_length/y_subdivision, z_length/z_subdivision,
-		origin, mesh_name);
+    return generateRegularPrismMesh(x_subdivision, y_subdivision, z_subdivision,
+        x_length/x_subdivision, y_length/y_subdivision, z_length/z_subdivision,
+        origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularPrismMesh(
-	const unsigned n_x_cells,
-	const unsigned n_y_cells,
-	const unsigned n_z_cells,
-	const double cell_size,
-	GeoLib::Point const& origin,
-	std::string const& mesh_name)
+    const unsigned n_x_cells,
+    const unsigned n_y_cells,
+    const unsigned n_z_cells,
+    const double cell_size,
+    GeoLib::Point const& origin,
+    std::string const& mesh_name)
 {
-	return generateRegularPrismMesh(n_x_cells, n_y_cells, n_z_cells,
-		cell_size, cell_size, cell_size, origin, mesh_name);
+    return generateRegularPrismMesh(n_x_cells, n_y_cells, n_z_cells,
+        cell_size, cell_size, cell_size, origin, mesh_name);
 }
 
 Mesh* MeshGenerator::generateRegularPrismMesh(
-	const unsigned n_x_cells,
-	const unsigned n_y_cells,
-	const unsigned n_z_cells,
-	const double   cell_size_x,
-	const double   cell_size_y,
-	const double   cell_size_z,
-	GeoLib::Point const& origin,
-	std::string   const& mesh_name)
+    const unsigned n_x_cells,
+    const unsigned n_y_cells,
+    const unsigned n_z_cells,
+    const double   cell_size_x,
+    const double   cell_size_y,
+    const double   cell_size_z,
+    GeoLib::Point const& origin,
+    std::string   const& mesh_name)
 {
-	std::unique_ptr<MeshLib::Mesh> mesh (
-		generateRegularTriMesh(n_x_cells, n_y_cells, cell_size_x, cell_size_y, origin, mesh_name));
-	std::size_t const n_tris (mesh->getNElements());
-	for (std::size_t i=0; i<n_z_cells; ++i)
-		mesh.reset(MeshLib::addTopLayerToMesh(*mesh, cell_size_z, mesh_name));
-	std::vector<std::size_t> elem_ids (n_tris);
-	std::iota(elem_ids.begin(), elem_ids.end(), 0);
-	return MeshLib::removeElements(*mesh, elem_ids, mesh_name);
+    std::unique_ptr<MeshLib::Mesh> mesh (
+        generateRegularTriMesh(n_x_cells, n_y_cells, cell_size_x, cell_size_y, origin, mesh_name));
+    std::size_t const n_tris (mesh->getNElements());
+    for (std::size_t i=0; i<n_z_cells; ++i)
+        mesh.reset(MeshLib::addTopLayerToMesh(*mesh, cell_size_z, mesh_name));
+    std::vector<std::size_t> elem_ids (n_tris);
+    std::iota(elem_ids.begin(), elem_ids.end(), 0);
+    return MeshLib::removeElements(*mesh, elem_ids, mesh_name);
 }
 
 MeshLib::Mesh*
 MeshGenerator::createSurfaceMesh(std::string const& mesh_name,
-	MathLib::Point3d const& ll, MathLib::Point3d const& ur,
-	std::array<std::size_t, 2> const& n_steps,
-	std::function<double(double,double)> f)
+    MathLib::Point3d const& ll, MathLib::Point3d const& ur,
+    std::array<std::size_t, 2> const& n_steps,
+    std::function<double(double,double)> f)
 {
-	std::array<double, 2> step_size{{
-		(ur[0]-ll[0])/(n_steps[0]-1), (ur[1]-ll[1])/(n_steps[1]-1)}};
-
-	std::vector<MeshLib::Node*> nodes;
-	for (std::size_t j(0); j<n_steps[1]; ++j) {
-		for (std::size_t i(0); i<n_steps[0]; ++i) {
-			std::size_t const id(i+j*n_steps[1]);
-			std::array<double, 3> coords;
-			coords[0] = ll[0]+i*step_size[0];
-			coords[1] = ll[1]+j*step_size[1];
-			coords[2] = f(coords[0],coords[1]);
-			nodes.push_back(new MeshLib::Node(coords, id));
-		}
-	}
-
-	std::vector<MeshLib::Element*> sfc_eles;
-	for (std::size_t j(0); j<n_steps[1]-1; ++j) {
-		for (std::size_t i(0); i<n_steps[0]-1; ++i) {
-			std::size_t id_ll(i+j*n_steps[0]);
-			std::size_t id_lr(i+1+j*n_steps[0]);
-			std::size_t id_ul(i+(j+1)*n_steps[0]);
-			std::size_t id_ur(i+1+(j+1)*n_steps[0]);
-			sfc_eles.push_back(new MeshLib::Tri(std::array<MeshLib::Node*,3>
-				{{nodes[id_ll], nodes[id_lr], nodes[id_ur]}}));
-			sfc_eles.push_back(new MeshLib::Tri(std::array<MeshLib::Node*,3>
-				{{nodes[id_ll], nodes[id_ur], nodes[id_ul]}}));
-		}
-	}
-
-	return new MeshLib::Mesh(mesh_name, nodes, sfc_eles);
+    std::array<double, 2> step_size{{
+        (ur[0]-ll[0])/(n_steps[0]-1), (ur[1]-ll[1])/(n_steps[1]-1)}};
+
+    std::vector<MeshLib::Node*> nodes;
+    for (std::size_t j(0); j<n_steps[1]; ++j) {
+        for (std::size_t i(0); i<n_steps[0]; ++i) {
+            std::size_t const id(i+j*n_steps[1]);
+            std::array<double, 3> coords;
+            coords[0] = ll[0]+i*step_size[0];
+            coords[1] = ll[1]+j*step_size[1];
+            coords[2] = f(coords[0],coords[1]);
+            nodes.push_back(new MeshLib::Node(coords, id));
+        }
+    }
+
+    std::vector<MeshLib::Element*> sfc_eles;
+    for (std::size_t j(0); j<n_steps[1]-1; ++j) {
+        for (std::size_t i(0); i<n_steps[0]-1; ++i) {
+            std::size_t id_ll(i+j*n_steps[0]);
+            std::size_t id_lr(i+1+j*n_steps[0]);
+            std::size_t id_ul(i+(j+1)*n_steps[0]);
+            std::size_t id_ur(i+1+(j+1)*n_steps[0]);
+            sfc_eles.push_back(new MeshLib::Tri(std::array<MeshLib::Node*,3>
+                {{nodes[id_ll], nodes[id_lr], nodes[id_ur]}}));
+            sfc_eles.push_back(new MeshLib::Tri(std::array<MeshLib::Node*,3>
+                {{nodes[id_ll], nodes[id_ur], nodes[id_ul]}}));
+        }
+    }
+
+    return new MeshLib::Mesh(mesh_name, nodes, sfc_eles);
 }
 
 }
diff --git a/MeshLib/MeshGenerators/MeshGenerator.h b/MeshLib/MeshGenerators/MeshGenerator.h
index 8cf516d939e..8dca5bda95c 100644
--- a/MeshLib/MeshGenerators/MeshGenerator.h
+++ b/MeshLib/MeshGenerators/MeshGenerator.h
@@ -175,10 +175,10 @@ Mesh* generateRegularQuadMesh(const double x_length,
  * \param mesh_name Name of the new mesh.
  */
 Mesh* generateRegularQuadMesh(const unsigned n_x_cells,
-	                          const unsigned n_y_cells,
-	                          const double   cell_size,
-	                          GeoLib::Point const& origin = GeoLib::ORIGIN,
-	                          std::string   const& mesh_name = "mesh");
+                              const unsigned n_y_cells,
+                              const double   cell_size,
+                              GeoLib::Point const& origin = GeoLib::ORIGIN,
+                              std::string   const& mesh_name = "mesh");
 
 /**
  * Generate a regular 2D Quad-Element mesh. The mesh is generated in the
@@ -192,11 +192,11 @@ Mesh* generateRegularQuadMesh(const unsigned n_x_cells,
  * \param mesh_name Name of the new mesh.
  */
 Mesh* generateRegularQuadMesh(const unsigned n_x_cells,
-	                          const unsigned n_y_cells,
-	                          const double   cell_size_x,
-	                          const double   cell_size_y,
-	                          GeoLib::Point const& origin = GeoLib::ORIGIN,
-	                          std::string   const& mesh_name = "mesh");
+                              const unsigned n_y_cells,
+                              const double   cell_size_x,
+                              const double   cell_size_y,
+                              GeoLib::Point const& origin = GeoLib::ORIGIN,
+                              std::string   const& mesh_name = "mesh");
 
 
 
@@ -259,11 +259,11 @@ Mesh* generateRegularHexMesh(const double x_length,
  * \param mesh_name Name of the new mesh.
  */
 Mesh* generateRegularHexMesh(const unsigned n_x_cells,
-	                         const unsigned n_y_cells,
-	                         const unsigned n_z_cells,
-	                         const double   cell_size,
-	                         GeoLib::Point const& origin = GeoLib::ORIGIN,
-	                         std::string   const& mesh_name = "mesh");
+                             const unsigned n_y_cells,
+                             const unsigned n_z_cells,
+                             const double   cell_size,
+                             GeoLib::Point const& origin = GeoLib::ORIGIN,
+                             std::string   const& mesh_name = "mesh");
 
 /**
  * Generate a regular 3D Hex-Element mesh.
@@ -278,13 +278,13 @@ Mesh* generateRegularHexMesh(const unsigned n_x_cells,
  * \param mesh_name    Name of the new mesh.
  */
 Mesh* generateRegularHexMesh(const unsigned n_x_cells,
-	                         const unsigned n_y_cells,
-	                         const unsigned n_z_cells,
-	                         const double   cell_size_x,
-	                         const double   cell_size_y,
-	                         const double   cell_size_z,
-	                         GeoLib::Point const& origin = GeoLib::ORIGIN,
-	                         std::string   const& mesh_name = "mesh");
+                             const unsigned n_y_cells,
+                             const unsigned n_z_cells,
+                             const double   cell_size_x,
+                             const double   cell_size_y,
+                             const double   cell_size_z,
+                             GeoLib::Point const& origin = GeoLib::ORIGIN,
+                             std::string   const& mesh_name = "mesh");
 
 /**
  * Generate a regular 2D Triangle-Element mesh. The mesh is generated in the
@@ -427,9 +427,9 @@ Mesh* generateRegularPrismMesh(const unsigned n_x_cells,
 /// is described using the function \f$f(x,y)\f$.
 MeshLib::Mesh*
 createSurfaceMesh(std::string const& mesh_name,
-	MathLib::Point3d const& ll, MathLib::Point3d const& ur,
-	std::array<std::size_t, 2> const& n_steps,
-	std::function<double(double,double)> f);
+    MathLib::Point3d const& ll, MathLib::Point3d const& ur,
+    std::array<std::size_t, 2> const& n_steps,
+    std::function<double(double,double)> f);
 
 }  //MeshGenerator
 } //MeshLib
diff --git a/MeshLib/MeshGenerators/MeshLayerMapper.cpp b/MeshLib/MeshGenerators/MeshLayerMapper.cpp
index 288fd704721..89b681168ce 100644
--- a/MeshLib/MeshGenerators/MeshLayerMapper.cpp
+++ b/MeshLib/MeshGenerators/MeshLayerMapper.cpp
@@ -34,134 +34,134 @@ namespace MeshLib
 
 MeshLib::Mesh* MeshLayerMapper::createStaticLayers(MeshLib::Mesh const& mesh, std::vector<float> const& layer_thickness_vector, std::string const& mesh_name)
 {
-	std::vector<float> thickness;
-	for (std::size_t i=0; i<layer_thickness_vector.size(); ++i)
-		if (layer_thickness_vector[i] > std::numeric_limits<float>::epsilon())
-			thickness.push_back(layer_thickness_vector[i]);
-		else
-			WARN ("Ignoring layer %d with thickness %f.", i, layer_thickness_vector[i]);
-
-	const std::size_t nLayers(thickness.size());
-	if (nLayers < 1 || mesh.getDimension() != 2)
-	{
-		ERR("MeshLayerMapper::createStaticLayers(): A 2D mesh with nLayers > 0 is required as input.");
-		return nullptr;
-	}
-
-	const std::size_t nNodes = mesh.getNNodes();
-	// count number of 2d elements in the original mesh
-	const std::size_t nElems (std::count_if(mesh.getElements().begin(), mesh.getElements().end(),
-			[](MeshLib::Element const* elem) { return (elem->getDimension() == 2);}));
-
-	const std::size_t nOrgElems (mesh.getNElements());
-	const std::vector<MeshLib::Node*> &nodes = mesh.getNodes();
-	const std::vector<MeshLib::Element*> &elems = mesh.getElements();
-	std::vector<MeshLib::Node*> new_nodes(nNodes + (nLayers * nNodes));
-	std::vector<MeshLib::Element*> new_elems;
-	new_elems.reserve(nElems * nLayers);
-	MeshLib::Properties properties;
-	boost::optional<PropertyVector<int>&> materials =
-	    properties.createNewPropertyVector<int>("MaterialIDs",
-	                                            MeshLib::MeshItemType::Cell);
-	if (!materials)
-	{
-		ERR("Could not create PropertyVector object \"MaterialIDs\".");
-		return nullptr;
-	}
-
-	materials->reserve(nElems * nLayers);
-	double z_offset (0.0);
-
-	for (unsigned layer_id = 0; layer_id <= nLayers; ++layer_id)
-	{
-		// add nodes for new layer
-		unsigned node_offset (nNodes * layer_id);
-		if (layer_id > 0) z_offset += thickness[layer_id-1];
-
-		std::transform(nodes.cbegin(), nodes.cend(), new_nodes.begin() + node_offset,
-			[&z_offset](MeshLib::Node* node){ return new MeshLib::Node((*node)[0], (*node)[1], (*node)[2]-z_offset); });
-
-		// starting with 2nd layer create prism or hex elements connecting the last layer with the current one
-		if (layer_id == 0)
-			continue;
-
-		node_offset -= nNodes;
-		const unsigned mat_id (nLayers - layer_id);
-
-		for (unsigned i = 0; i < nOrgElems; ++i)
-		{
-			const MeshLib::Element* sfc_elem( elems[i] );
-			if (sfc_elem->getDimension() < 2) // ignore line-elements
-				continue;
-
-			const unsigned nElemNodes(sfc_elem->getNBaseNodes());
-			MeshLib::Node** e_nodes = new MeshLib::Node*[2*nElemNodes];
-
-			for (unsigned j=0; j<nElemNodes; ++j)
-			{
-				const unsigned node_id = sfc_elem->getNode(j)->getID() + node_offset;
-				e_nodes[j] = new_nodes[node_id+nNodes];
-				e_nodes[j+nElemNodes] = new_nodes[node_id];
-			}
-			// extrude triangles to prism
-			if (sfc_elem->getGeomType() == MeshLib::MeshElemType::TRIANGLE)
-				new_elems.push_back (new MeshLib::Prism(e_nodes));
-			// extrude quads to hexes
-			else if (sfc_elem->getGeomType() == MeshLib::MeshElemType::QUAD)
-				new_elems.push_back (new MeshLib::Hex(e_nodes));
-			materials->push_back(mat_id);
-		}
-	}
-	return new MeshLib::Mesh(mesh_name, new_nodes, new_elems, properties);
+    std::vector<float> thickness;
+    for (std::size_t i=0; i<layer_thickness_vector.size(); ++i)
+        if (layer_thickness_vector[i] > std::numeric_limits<float>::epsilon())
+            thickness.push_back(layer_thickness_vector[i]);
+        else
+            WARN ("Ignoring layer %d with thickness %f.", i, layer_thickness_vector[i]);
+
+    const std::size_t nLayers(thickness.size());
+    if (nLayers < 1 || mesh.getDimension() != 2)
+    {
+        ERR("MeshLayerMapper::createStaticLayers(): A 2D mesh with nLayers > 0 is required as input.");
+        return nullptr;
+    }
+
+    const std::size_t nNodes = mesh.getNNodes();
+    // count number of 2d elements in the original mesh
+    const std::size_t nElems (std::count_if(mesh.getElements().begin(), mesh.getElements().end(),
+            [](MeshLib::Element const* elem) { return (elem->getDimension() == 2);}));
+
+    const std::size_t nOrgElems (mesh.getNElements());
+    const std::vector<MeshLib::Node*> &nodes = mesh.getNodes();
+    const std::vector<MeshLib::Element*> &elems = mesh.getElements();
+    std::vector<MeshLib::Node*> new_nodes(nNodes + (nLayers * nNodes));
+    std::vector<MeshLib::Element*> new_elems;
+    new_elems.reserve(nElems * nLayers);
+    MeshLib::Properties properties;
+    boost::optional<PropertyVector<int>&> materials =
+        properties.createNewPropertyVector<int>("MaterialIDs",
+                                                MeshLib::MeshItemType::Cell);
+    if (!materials)
+    {
+        ERR("Could not create PropertyVector object \"MaterialIDs\".");
+        return nullptr;
+    }
+
+    materials->reserve(nElems * nLayers);
+    double z_offset (0.0);
+
+    for (unsigned layer_id = 0; layer_id <= nLayers; ++layer_id)
+    {
+        // add nodes for new layer
+        unsigned node_offset (nNodes * layer_id);
+        if (layer_id > 0) z_offset += thickness[layer_id-1];
+
+        std::transform(nodes.cbegin(), nodes.cend(), new_nodes.begin() + node_offset,
+            [&z_offset](MeshLib::Node* node){ return new MeshLib::Node((*node)[0], (*node)[1], (*node)[2]-z_offset); });
+
+        // starting with 2nd layer create prism or hex elements connecting the last layer with the current one
+        if (layer_id == 0)
+            continue;
+
+        node_offset -= nNodes;
+        const unsigned mat_id (nLayers - layer_id);
+
+        for (unsigned i = 0; i < nOrgElems; ++i)
+        {
+            const MeshLib::Element* sfc_elem( elems[i] );
+            if (sfc_elem->getDimension() < 2) // ignore line-elements
+                continue;
+
+            const unsigned nElemNodes(sfc_elem->getNBaseNodes());
+            MeshLib::Node** e_nodes = new MeshLib::Node*[2*nElemNodes];
+
+            for (unsigned j=0; j<nElemNodes; ++j)
+            {
+                const unsigned node_id = sfc_elem->getNode(j)->getID() + node_offset;
+                e_nodes[j] = new_nodes[node_id+nNodes];
+                e_nodes[j+nElemNodes] = new_nodes[node_id];
+            }
+            // extrude triangles to prism
+            if (sfc_elem->getGeomType() == MeshLib::MeshElemType::TRIANGLE)
+                new_elems.push_back (new MeshLib::Prism(e_nodes));
+            // extrude quads to hexes
+            else if (sfc_elem->getGeomType() == MeshLib::MeshElemType::QUAD)
+                new_elems.push_back (new MeshLib::Hex(e_nodes));
+            materials->push_back(mat_id);
+        }
+    }
+    return new MeshLib::Mesh(mesh_name, new_nodes, new_elems, properties);
 }
 
 bool MeshLayerMapper::createRasterLayers(
-	MeshLib::Mesh const& mesh,
-	std::vector<GeoLib::Raster const*> const& rasters,
-	double minimum_thickness,
-	double noDataReplacementValue)
+    MeshLib::Mesh const& mesh,
+    std::vector<GeoLib::Raster const*> const& rasters,
+    double minimum_thickness,
+    double noDataReplacementValue)
 {
-	const std::size_t nLayers(rasters.size());
-	if (nLayers < 2 || mesh.getDimension() != 2)
-	{
-		ERR("MeshLayerMapper::createRasterLayers(): A 2D mesh and at least two rasters required as input.");
-		return false;
-	}
-
-	MeshLib::Mesh* top (new MeshLib::Mesh(mesh));
-	if (!layerMapping(*top, *rasters.back(), noDataReplacementValue))
-		return false;
-
-	MeshLib::Mesh* bottom (new MeshLib::Mesh(mesh));
-	if (!layerMapping(*bottom, *rasters[0], 0))
-	{
-		delete top;
-		return false;
-	}
-
-	this->_minimum_thickness = minimum_thickness;
-	std::size_t const nNodes = mesh.getNNodes();
-	_nodes.reserve(nLayers * nNodes);
-
-	// number of triangles in the original mesh
-	std::size_t const nElems (std::count_if(mesh.getElements().begin(), mesh.getElements().end(),
-		[](MeshLib::Element const* elem)
-			{ return (elem->getGeomType() == MeshLib::MeshElemType::TRIANGLE);}));
-	_elements.reserve(nElems * (nLayers-1));
-	_materials.reserve(nElems *  (nLayers-1));
-
-	// add bottom layer
-	std::vector<MeshLib::Node*> const& nodes = bottom->getNodes();
-	for (MeshLib::Node* node : nodes)
-		_nodes.push_back(new MeshLib::Node(*node));
-	delete bottom;
-
-	// add the other layers
-	for (std::size_t i=0; i<nLayers-1; ++i)
-		addLayerToMesh(*top, i, *rasters[i+1]);
-
-	delete top;
-	return true;
+    const std::size_t nLayers(rasters.size());
+    if (nLayers < 2 || mesh.getDimension() != 2)
+    {
+        ERR("MeshLayerMapper::createRasterLayers(): A 2D mesh and at least two rasters required as input.");
+        return false;
+    }
+
+    MeshLib::Mesh* top (new MeshLib::Mesh(mesh));
+    if (!layerMapping(*top, *rasters.back(), noDataReplacementValue))
+        return false;
+
+    MeshLib::Mesh* bottom (new MeshLib::Mesh(mesh));
+    if (!layerMapping(*bottom, *rasters[0], 0))
+    {
+        delete top;
+        return false;
+    }
+
+    this->_minimum_thickness = minimum_thickness;
+    std::size_t const nNodes = mesh.getNNodes();
+    _nodes.reserve(nLayers * nNodes);
+
+    // number of triangles in the original mesh
+    std::size_t const nElems (std::count_if(mesh.getElements().begin(), mesh.getElements().end(),
+        [](MeshLib::Element const* elem)
+            { return (elem->getGeomType() == MeshLib::MeshElemType::TRIANGLE);}));
+    _elements.reserve(nElems * (nLayers-1));
+    _materials.reserve(nElems *  (nLayers-1));
+
+    // add bottom layer
+    std::vector<MeshLib::Node*> const& nodes = bottom->getNodes();
+    for (MeshLib::Node* node : nodes)
+        _nodes.push_back(new MeshLib::Node(*node));
+    delete bottom;
+
+    // add the other layers
+    for (std::size_t i=0; i<nLayers-1; ++i)
+        addLayerToMesh(*top, i, *rasters[i+1]);
+
+    delete top;
+    return true;
 }
 
 void MeshLayerMapper::addLayerToMesh(const MeshLib::Mesh &dem_mesh, unsigned layer_id, GeoLib::Raster const& raster)
@@ -231,52 +231,52 @@ void MeshLayerMapper::addLayerToMesh(const MeshLib::Mesh &dem_mesh, unsigned lay
 
 bool MeshLayerMapper::layerMapping(MeshLib::Mesh &new_mesh, GeoLib::Raster const& raster, double noDataReplacementValue = 0.0)
 {
-	if (new_mesh.getDimension() != 2)
-	{
-		ERR("MshLayerMapper::layerMapping() - requires 2D mesh");
-		return false;
-	}
-
-	GeoLib::RasterHeader const& header (raster.getHeader());
-	const double x0(header.origin[0]);
-	const double y0(header.origin[1]);
-	const double delta(header.cell_size);
-
-	const std::pair<double, double> xDim(x0, x0 + header.n_cols * delta); // extension in x-dimension
-	const std::pair<double, double> yDim(y0, y0 + header.n_rows * delta); // extension in y-dimension
-
-	const std::size_t nNodes (new_mesh.getNNodes());
-	const std::vector<MeshLib::Node*> &nodes = new_mesh.getNodes();
-	for (unsigned i = 0; i < nNodes; ++i)
-	{
-		if (!raster.isPntOnRaster(*nodes[i]))
-		{
-			// use either default value or elevation from layer above
-			nodes[i]->updateCoordinates((*nodes[i])[0], (*nodes[i])[1], noDataReplacementValue);
-			continue;
-		}
-
-		double elevation (raster.interpolateValueAtPoint(*nodes[i]));
-		if (std::abs(elevation - header.no_data) < std::numeric_limits<double>::epsilon())
-			elevation = noDataReplacementValue;
-		nodes[i]->updateCoordinates((*nodes[i])[0], (*nodes[i])[1], elevation);
-	}
-
-	return true;
+    if (new_mesh.getDimension() != 2)
+    {
+        ERR("MshLayerMapper::layerMapping() - requires 2D mesh");
+        return false;
+    }
+
+    GeoLib::RasterHeader const& header (raster.getHeader());
+    const double x0(header.origin[0]);
+    const double y0(header.origin[1]);
+    const double delta(header.cell_size);
+
+    const std::pair<double, double> xDim(x0, x0 + header.n_cols * delta); // extension in x-dimension
+    const std::pair<double, double> yDim(y0, y0 + header.n_rows * delta); // extension in y-dimension
+
+    const std::size_t nNodes (new_mesh.getNNodes());
+    const std::vector<MeshLib::Node*> &nodes = new_mesh.getNodes();
+    for (unsigned i = 0; i < nNodes; ++i)
+    {
+        if (!raster.isPntOnRaster(*nodes[i]))
+        {
+            // use either default value or elevation from layer above
+            nodes[i]->updateCoordinates((*nodes[i])[0], (*nodes[i])[1], noDataReplacementValue);
+            continue;
+        }
+
+        double elevation (raster.interpolateValueAtPoint(*nodes[i]));
+        if (std::abs(elevation - header.no_data) < std::numeric_limits<double>::epsilon())
+            elevation = noDataReplacementValue;
+        nodes[i]->updateCoordinates((*nodes[i])[0], (*nodes[i])[1], elevation);
+    }
+
+    return true;
 }
 
 bool MeshLayerMapper::mapToStaticValue(MeshLib::Mesh &mesh, double value)
 {
-	if (mesh.getDimension() != 2)
-	{
-		ERR("MshLayerMapper::mapToStaticValue() - requires 2D mesh");
-		return false;
-	}
-
-	std::vector<MeshLib::Node*> const& nodes (mesh.getNodes());
-	for (MeshLib::Node* node : nodes)
-		node->updateCoordinates((*node)[0], (*node)[1], value);
-	return true;
+    if (mesh.getDimension() != 2)
+    {
+        ERR("MshLayerMapper::mapToStaticValue() - requires 2D mesh");
+        return false;
+    }
+
+    std::vector<MeshLib::Node*> const& nodes (mesh.getNodes());
+    for (MeshLib::Node* node : nodes)
+        node->updateCoordinates((*node)[0], (*node)[1], value);
+    return true;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshGenerators/MeshLayerMapper.h b/MeshLib/MeshGenerators/MeshLayerMapper.h
index e4c4fa8e781..06af1cfcaef 100644
--- a/MeshLib/MeshGenerators/MeshLayerMapper.h
+++ b/MeshLib/MeshGenerators/MeshLayerMapper.h
@@ -26,48 +26,48 @@ namespace MeshLib
 class MeshLayerMapper : public LayeredMeshGenerator
 {
 public:
-	virtual ~MeshLayerMapper() = default;
+    virtual ~MeshLayerMapper() = default;
 
-	/**
-	* Based on a 2D triangle-or quad mesh this method creates a 3D mesh with a given number of prism- or hex-layers
-	* \param mesh The triangle/quad mesh that is the basis for the new prism/hex mesh
-	* \param layer_thickness_vector The size of the vector equals the number of
-		layers of prism/hex elements that will be extruded from the
-		triangle/quad elements of the original mesh. The thickness of the
-		\f$i\f$-th layer corresponds to the \f$i\f$ entry of the vector.
-	* \param mesh_name The name of the newly created mesh
-	* \return A mesh with the requested number of layers of prism/hex elements
-	*/
-	static MeshLib::Mesh* createStaticLayers(MeshLib::Mesh const& mesh, std::vector<float> const& layer_thickness_vector, std::string const& mesh_name = "SubsurfaceMesh");
+    /**
+    * Based on a 2D triangle-or quad mesh this method creates a 3D mesh with a given number of prism- or hex-layers
+    * \param mesh The triangle/quad mesh that is the basis for the new prism/hex mesh
+    * \param layer_thickness_vector The size of the vector equals the number of
+        layers of prism/hex elements that will be extruded from the
+        triangle/quad elements of the original mesh. The thickness of the
+        \f$i\f$-th layer corresponds to the \f$i\f$ entry of the vector.
+    * \param mesh_name The name of the newly created mesh
+    * \return A mesh with the requested number of layers of prism/hex elements
+    */
+    static MeshLib::Mesh* createStaticLayers(MeshLib::Mesh const& mesh, std::vector<float> const& layer_thickness_vector, std::string const& mesh_name = "SubsurfaceMesh");
 
-	/**
-	* Based on a 2D triangle mesh this method creates a 3D mesh with a given number of prism-layers.
-	* Note: While this method would technically also work with quad meshes, this is discouraged as quad elements will most likely not
-	* be coplanar after the mapping process which result in invaled mesh elements.
-	* \param mesh                    The 2D triangle mesh that is the basis for the new 3D prism mesh
-	* \param rasters                 Containing all the raster-data for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM)
-	* \param minimum_thickness       Minimum thickness of each of the newly created layers (i.e. nodes with a vertical distance smaller than this will be collapsed)
-	* \param noDataReplacementValue  Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0])
-	* \return A mesh with the requested number of layers of prism elements (also including Tet- & Pyramid-elements in case of degenerated prisms)
-	*/
-	bool createRasterLayers(MeshLib::Mesh const& mesh,
-	                        std::vector<GeoLib::Raster const*> const& rasters,
-	                        double minimum_thickness,
-	                        double noDataReplacementValue = 0.0);
+    /**
+    * Based on a 2D triangle mesh this method creates a 3D mesh with a given number of prism-layers.
+    * Note: While this method would technically also work with quad meshes, this is discouraged as quad elements will most likely not
+    * be coplanar after the mapping process which result in invaled mesh elements.
+    * \param mesh                    The 2D triangle mesh that is the basis for the new 3D prism mesh
+    * \param rasters                 Containing all the raster-data for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM)
+    * \param minimum_thickness       Minimum thickness of each of the newly created layers (i.e. nodes with a vertical distance smaller than this will be collapsed)
+    * \param noDataReplacementValue  Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0])
+    * \return A mesh with the requested number of layers of prism elements (also including Tet- & Pyramid-elements in case of degenerated prisms)
+    */
+    bool createRasterLayers(MeshLib::Mesh const& mesh,
+                            std::vector<GeoLib::Raster const*> const& rasters,
+                            double minimum_thickness,
+                            double noDataReplacementValue = 0.0);
 
-	/**
-	* Maps the elevation of nodes of a given 2D mesh according to the raster. At
-	* locations where no information is given, node elevation is set to
-	* noDataReplacementValue.
-	*/
-	static bool layerMapping(MeshLib::Mesh &mesh, const GeoLib::Raster &raster, double noDataReplacementValue);
+    /**
+    * Maps the elevation of nodes of a given 2D mesh according to the raster. At
+    * locations where no information is given, node elevation is set to
+    * noDataReplacementValue.
+    */
+    static bool layerMapping(MeshLib::Mesh &mesh, const GeoLib::Raster &raster, double noDataReplacementValue);
 
-	/// Maps the elevation of all mesh nodes to the specified static value.
-	static bool mapToStaticValue(MeshLib::Mesh &mesh, double value);
+    /// Maps the elevation of all mesh nodes to the specified static value.
+    static bool mapToStaticValue(MeshLib::Mesh &mesh, double value);
 
 private:
-	/// Adds another layer to a subsurface mesh
-	void addLayerToMesh(const MeshLib::Mesh &mesh_layer, unsigned layer_id, GeoLib::Raster const& raster);
+    /// Adds another layer to a subsurface mesh
+    void addLayerToMesh(const MeshLib::Mesh &mesh_layer, unsigned layer_id, GeoLib::Raster const& raster);
 };
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshGenerators/RasterToMesh.cpp b/MeshLib/MeshGenerators/RasterToMesh.cpp
index 8e74a6958b4..9731a06689e 100644
--- a/MeshLib/MeshGenerators/RasterToMesh.cpp
+++ b/MeshLib/MeshGenerators/RasterToMesh.cpp
@@ -24,222 +24,222 @@ namespace MeshLib
 {
 
 MeshLib::Mesh* RasterToMesh::convert(
-	GeoLib::Raster const& raster,
-	MeshElemType elem_type,
-	UseIntensityAs intensity_type,
-	std::string const& array_name)
+    GeoLib::Raster const& raster,
+    MeshElemType elem_type,
+    UseIntensityAs intensity_type,
+    std::string const& array_name)
 {
-	return convert(raster.begin(), raster.getHeader(), elem_type, intensity_type, array_name);
+    return convert(raster.begin(), raster.getHeader(), elem_type, intensity_type, array_name);
 }
 
 MeshLib::Mesh* RasterToMesh::convert(
-	vtkImageData* img,
-	const double origin[3],
-	const double scalingFactor,
-	MeshElemType elem_type,
-	UseIntensityAs intensity_type,
-	std::string const& array_name)
+    vtkImageData* img,
+    const double origin[3],
+    const double scalingFactor,
+    MeshElemType elem_type,
+    UseIntensityAs intensity_type,
+    std::string const& array_name)
 {
-	if ((elem_type != MeshElemType::TRIANGLE) && (elem_type != MeshElemType::QUAD))
-	{
-		ERR("VtkMeshConverter::convertImgToMesh(): Invalid Mesh Element Type.");
-		return nullptr;
-	}
-
-	vtkSmartPointer<vtkDataArray> pixelData = vtkSmartPointer<vtkDataArray>(img->GetPointData()->GetScalars());
-	int* dims = img->GetDimensions();
-	int nTuple = pixelData->GetNumberOfComponents();
-	if (nTuple < 1 || nTuple > 4)
-	{
-		ERR("VtkMeshConverter::convertImgToMesh(): Unsupported pixel composition!");
-		return nullptr;
-	}
-
-	MathLib::Point3d const orig (std::array<double,3>{{origin[0], origin[1], origin[2]}});
-	GeoLib::RasterHeader const header =
-		{static_cast<std::size_t>(dims[0]), static_cast<std::size_t>(dims[1]), orig, scalingFactor, -9999};
-	const std::size_t incHeight = header.n_rows+1;
-	const std::size_t incWidth  = header.n_cols+1;
-	std::vector<double> pix_val (incHeight * incWidth, std::numeric_limits<double>::max());
-	std::vector<bool> pix_vis (header.n_rows * header.n_cols, false);
-
-	for (std::size_t i = 0; i < header.n_rows; i++)
-		for (std::size_t j = 0; j < header.n_cols; j++)
-		{
-			std::size_t const img_idx = i*header.n_cols + j;
-			std::size_t const fld_idx = i*incWidth + j;
-
-			// colour of current pixel
-			double* colour = pixelData->GetTuple(img_idx);
-			// is current pixel visible?
-			bool const visible = (nTuple == 2 || nTuple == 4) ? (colour[nTuple-1] != 0) : true;
-			if (!visible)
-				continue;
-
-			double const value = (nTuple < 3) ?
-				colour[0] : // grey (+ alpha)
-				(0.3 * colour[0] + 0.6 * colour[1] + 0.1 * colour[2]); // rgb(a)
-			pix_vis[img_idx] = true;
-			pix_val[fld_idx] = value;
-			pix_val[fld_idx+1] = value;
-			pix_val[fld_idx+incWidth] = value;
-			pix_val[fld_idx+incWidth+1] = value;
-		}
-
-	return constructMesh(pix_val, array_name, pix_vis, header, elem_type, intensity_type);
+    if ((elem_type != MeshElemType::TRIANGLE) && (elem_type != MeshElemType::QUAD))
+    {
+        ERR("VtkMeshConverter::convertImgToMesh(): Invalid Mesh Element Type.");
+        return nullptr;
+    }
+
+    vtkSmartPointer<vtkDataArray> pixelData = vtkSmartPointer<vtkDataArray>(img->GetPointData()->GetScalars());
+    int* dims = img->GetDimensions();
+    int nTuple = pixelData->GetNumberOfComponents();
+    if (nTuple < 1 || nTuple > 4)
+    {
+        ERR("VtkMeshConverter::convertImgToMesh(): Unsupported pixel composition!");
+        return nullptr;
+    }
+
+    MathLib::Point3d const orig (std::array<double,3>{{origin[0], origin[1], origin[2]}});
+    GeoLib::RasterHeader const header =
+        {static_cast<std::size_t>(dims[0]), static_cast<std::size_t>(dims[1]), orig, scalingFactor, -9999};
+    const std::size_t incHeight = header.n_rows+1;
+    const std::size_t incWidth  = header.n_cols+1;
+    std::vector<double> pix_val (incHeight * incWidth, std::numeric_limits<double>::max());
+    std::vector<bool> pix_vis (header.n_rows * header.n_cols, false);
+
+    for (std::size_t i = 0; i < header.n_rows; i++)
+        for (std::size_t j = 0; j < header.n_cols; j++)
+        {
+            std::size_t const img_idx = i*header.n_cols + j;
+            std::size_t const fld_idx = i*incWidth + j;
+
+            // colour of current pixel
+            double* colour = pixelData->GetTuple(img_idx);
+            // is current pixel visible?
+            bool const visible = (nTuple == 2 || nTuple == 4) ? (colour[nTuple-1] != 0) : true;
+            if (!visible)
+                continue;
+
+            double const value = (nTuple < 3) ?
+                colour[0] : // grey (+ alpha)
+                (0.3 * colour[0] + 0.6 * colour[1] + 0.1 * colour[2]); // rgb(a)
+            pix_vis[img_idx] = true;
+            pix_val[fld_idx] = value;
+            pix_val[fld_idx+1] = value;
+            pix_val[fld_idx+incWidth] = value;
+            pix_val[fld_idx+incWidth+1] = value;
+        }
+
+    return constructMesh(pix_val, array_name, pix_vis, header, elem_type, intensity_type);
 }
 
 MeshLib::Mesh* RasterToMesh::convert(
-	double const* img,
-	GeoLib::RasterHeader const& header,
-	MeshElemType elem_type,
-	UseIntensityAs intensity_type,
-	std::string const& array_name)
+    double const* img,
+    GeoLib::RasterHeader const& header,
+    MeshElemType elem_type,
+    UseIntensityAs intensity_type,
+    std::string const& array_name)
 {
-	if ((elem_type != MeshElemType::TRIANGLE) && (elem_type != MeshElemType::QUAD))
-	{
-		ERR("Invalid Mesh Element Type.");
-		return nullptr;
-	}
-
-	std::size_t const incHeight (header.n_rows+1);
-	std::size_t const incWidth (header.n_cols+1);
-	std::vector<double> pix_val (incHeight * incWidth, std::numeric_limits<double>::max());
-	std::vector<bool> pix_vis (incHeight * incWidth, false);
-
-	for (std::size_t i = 0; i < header.n_rows; i++)
-		for (std::size_t j = 0; j < header.n_cols; j++)
-		{
-			std::size_t const img_idx = i*header.n_cols + j;
-			std::size_t const fld_idx = i*incWidth + j;
-			if (img[img_idx] == -9999)
-				continue;
-
-			pix_vis[img_idx] = true;
-			pix_val[fld_idx] = img[img_idx];
-			pix_val[fld_idx+1] = img[img_idx];
-			pix_val[fld_idx+incWidth] = img[img_idx];
-			pix_val[fld_idx+incWidth+1] = img[img_idx];
-		}
-
-	return constructMesh(pix_val, array_name, pix_vis, header, elem_type, intensity_type);
+    if ((elem_type != MeshElemType::TRIANGLE) && (elem_type != MeshElemType::QUAD))
+    {
+        ERR("Invalid Mesh Element Type.");
+        return nullptr;
+    }
+
+    std::size_t const incHeight (header.n_rows+1);
+    std::size_t const incWidth (header.n_cols+1);
+    std::vector<double> pix_val (incHeight * incWidth, std::numeric_limits<double>::max());
+    std::vector<bool> pix_vis (incHeight * incWidth, false);
+
+    for (std::size_t i = 0; i < header.n_rows; i++)
+        for (std::size_t j = 0; j < header.n_cols; j++)
+        {
+            std::size_t const img_idx = i*header.n_cols + j;
+            std::size_t const fld_idx = i*incWidth + j;
+            if (img[img_idx] == -9999)
+                continue;
+
+            pix_vis[img_idx] = true;
+            pix_val[fld_idx] = img[img_idx];
+            pix_val[fld_idx+1] = img[img_idx];
+            pix_val[fld_idx+incWidth] = img[img_idx];
+            pix_val[fld_idx+incWidth+1] = img[img_idx];
+        }
+
+    return constructMesh(pix_val, array_name, pix_vis, header, elem_type, intensity_type);
 }
 
 MeshLib::Mesh* RasterToMesh::constructMesh(
-	std::vector<double> const& pix_val,
-	std::string const& array_name,
-	std::vector<bool> const& pix_vis,
-	GeoLib::RasterHeader const& header,
-	MeshLib::MeshElemType elem_type,
-	MeshLib::UseIntensityAs intensity_type)
+    std::vector<double> const& pix_val,
+    std::string const& array_name,
+    std::vector<bool> const& pix_vis,
+    GeoLib::RasterHeader const& header,
+    MeshLib::MeshElemType elem_type,
+    MeshLib::UseIntensityAs intensity_type)
 {
-	std::vector<int> node_idx_map ((header.n_rows+1) * (header.n_cols+1), -1);
-	bool const use_elevation (intensity_type == MeshLib::UseIntensityAs::ELEVATION);
-	std::vector<MeshLib::Node*> nodes (createNodeVector(pix_val, node_idx_map, header, use_elevation));
-	if (nodes.empty())
-		return nullptr;
-
-	std::vector<MeshLib::Element*> elements(createElementVector(
-	    pix_vis, nodes, node_idx_map, header.n_rows, header.n_cols, elem_type));
-	if (elements.empty())
-		return nullptr;
-
-	MeshLib::Properties properties;
-	if (intensity_type == MeshLib::UseIntensityAs::MATERIALS)
-	{
-		boost::optional< MeshLib::PropertyVector<int>& > prop_vec =
-			properties.createNewPropertyVector<int>("MaterialIDs", MeshLib::MeshItemType::Cell, 1);
-		fillPropertyVector<int>(*prop_vec, pix_val, pix_vis, header.n_rows, header.n_cols, elem_type);
-	}
-	else if (intensity_type == MeshLib::UseIntensityAs::DATAVECTOR)
-	{
-		boost::optional< MeshLib::PropertyVector<double>& > prop_vec =
-			properties.createNewPropertyVector<double>(array_name, MeshLib::MeshItemType::Cell, 1);
-		fillPropertyVector<double>(*prop_vec, pix_val, pix_vis, header.n_rows, header.n_cols, elem_type);
-	}
-
-	return new MeshLib::Mesh("RasterDataMesh", nodes, elements, properties);
+    std::vector<int> node_idx_map ((header.n_rows+1) * (header.n_cols+1), -1);
+    bool const use_elevation (intensity_type == MeshLib::UseIntensityAs::ELEVATION);
+    std::vector<MeshLib::Node*> nodes (createNodeVector(pix_val, node_idx_map, header, use_elevation));
+    if (nodes.empty())
+        return nullptr;
+
+    std::vector<MeshLib::Element*> elements(createElementVector(
+        pix_vis, nodes, node_idx_map, header.n_rows, header.n_cols, elem_type));
+    if (elements.empty())
+        return nullptr;
+
+    MeshLib::Properties properties;
+    if (intensity_type == MeshLib::UseIntensityAs::MATERIALS)
+    {
+        boost::optional< MeshLib::PropertyVector<int>& > prop_vec =
+            properties.createNewPropertyVector<int>("MaterialIDs", MeshLib::MeshItemType::Cell, 1);
+        fillPropertyVector<int>(*prop_vec, pix_val, pix_vis, header.n_rows, header.n_cols, elem_type);
+    }
+    else if (intensity_type == MeshLib::UseIntensityAs::DATAVECTOR)
+    {
+        boost::optional< MeshLib::PropertyVector<double>& > prop_vec =
+            properties.createNewPropertyVector<double>(array_name, MeshLib::MeshItemType::Cell, 1);
+        fillPropertyVector<double>(*prop_vec, pix_val, pix_vis, header.n_rows, header.n_cols, elem_type);
+    }
+
+    return new MeshLib::Mesh("RasterDataMesh", nodes, elements, properties);
 }
 
 std::vector<MeshLib::Node*> RasterToMesh::createNodeVector(
-	std::vector<double> const&  elevation,
-	std::vector<int> & node_idx_map,
-	GeoLib::RasterHeader const& header,
-	bool use_elevation)
+    std::vector<double> const&  elevation,
+    std::vector<int> & node_idx_map,
+    GeoLib::RasterHeader const& header,
+    bool use_elevation)
 {
-	std::size_t node_idx_count(0);
-	double const x_offset(header.origin[0] - header.cell_size/2.0);
-	double const y_offset(header.origin[1] - header.cell_size/2.0);
-	std::vector<MeshLib::Node*> nodes;
-	for (std::size_t i = 0; i < (header.n_rows+1); i++)
-		for (std::size_t j = 0; j < (header.n_cols+1); j++)
-		{
-			std::size_t const index = i * (header.n_cols+1) + j;
-			if (elevation[index] == std::numeric_limits<double>::max())
-				continue;
-
-			double const zValue = (use_elevation) ? elevation[index] : 0;
-			MeshLib::Node* node (new MeshLib::Node(x_offset + (header.cell_size * j), y_offset + (header.cell_size * i), zValue));
-			nodes.push_back(node);
-			node_idx_map[index] = node_idx_count;
-			node_idx_count++;
-		}
-	return nodes;
+    std::size_t node_idx_count(0);
+    double const x_offset(header.origin[0] - header.cell_size/2.0);
+    double const y_offset(header.origin[1] - header.cell_size/2.0);
+    std::vector<MeshLib::Node*> nodes;
+    for (std::size_t i = 0; i < (header.n_rows+1); i++)
+        for (std::size_t j = 0; j < (header.n_cols+1); j++)
+        {
+            std::size_t const index = i * (header.n_cols+1) + j;
+            if (elevation[index] == std::numeric_limits<double>::max())
+                continue;
+
+            double const zValue = (use_elevation) ? elevation[index] : 0;
+            MeshLib::Node* node (new MeshLib::Node(x_offset + (header.cell_size * j), y_offset + (header.cell_size * i), zValue));
+            nodes.push_back(node);
+            node_idx_map[index] = node_idx_count;
+            node_idx_count++;
+        }
+    return nodes;
 }
 
 std::vector<MeshLib::Element*> RasterToMesh::createElementVector(
-	std::vector<bool> const& pix_vis,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::vector<int> const&node_idx_map,
-	std::size_t const imgHeight,
-	std::size_t const imgWidth,
-	MeshElemType elem_type)
+    std::vector<bool> const& pix_vis,
+    std::vector<MeshLib::Node*> const& nodes,
+    std::vector<int> const&node_idx_map,
+    std::size_t const imgHeight,
+    std::size_t const imgWidth,
+    MeshElemType elem_type)
 {
-	std::vector<MeshLib::Element*> elements;
-	std::size_t const incWidth (imgWidth+1);
-	for (std::size_t i = 0; i < imgHeight; i++)
-		for (std::size_t j = 0; j < imgWidth; j++)
-		{
-			if (!pix_vis[i*imgWidth+j])
-				continue;
-
-			int const idx = i * incWidth + j;
-			if (elem_type == MeshElemType::TRIANGLE)
-			{
-				MeshLib::Node** tri1_nodes = new MeshLib::Node*[3];
-				tri1_nodes[0] = nodes[node_idx_map[idx]];
-				tri1_nodes[1] = nodes[node_idx_map[idx+1]];
-				tri1_nodes[2] = nodes[node_idx_map[idx+incWidth]];
-
-				MeshLib::Node** tri2_nodes = new MeshLib::Node*[3];
-				tri2_nodes[0] = nodes[node_idx_map[idx+1]];
-				tri2_nodes[1] = nodes[node_idx_map[idx+incWidth+1]];
-				tri2_nodes[2] = nodes[node_idx_map[idx+incWidth]];
-
-				elements.push_back(new MeshLib::Tri(tri1_nodes)); // upper left triangle
-				elements.push_back(new MeshLib::Tri(tri2_nodes)); // lower right triangle
-			}
-			else if (elem_type == MeshElemType::QUAD)
-			{
-				MeshLib::Node** quad_nodes = new MeshLib::Node*[4];
-				quad_nodes[0] = nodes[node_idx_map[idx]];
-				quad_nodes[1] = nodes[node_idx_map[idx + 1]];
-				quad_nodes[2] = nodes[node_idx_map[idx + incWidth + 1]];
-				quad_nodes[3] = nodes[node_idx_map[idx + incWidth]];
-				elements.push_back(new MeshLib::Quad(quad_nodes));
-			}
-		}
-	return elements;
+    std::vector<MeshLib::Element*> elements;
+    std::size_t const incWidth (imgWidth+1);
+    for (std::size_t i = 0; i < imgHeight; i++)
+        for (std::size_t j = 0; j < imgWidth; j++)
+        {
+            if (!pix_vis[i*imgWidth+j])
+                continue;
+
+            int const idx = i * incWidth + j;
+            if (elem_type == MeshElemType::TRIANGLE)
+            {
+                MeshLib::Node** tri1_nodes = new MeshLib::Node*[3];
+                tri1_nodes[0] = nodes[node_idx_map[idx]];
+                tri1_nodes[1] = nodes[node_idx_map[idx+1]];
+                tri1_nodes[2] = nodes[node_idx_map[idx+incWidth]];
+
+                MeshLib::Node** tri2_nodes = new MeshLib::Node*[3];
+                tri2_nodes[0] = nodes[node_idx_map[idx+1]];
+                tri2_nodes[1] = nodes[node_idx_map[idx+incWidth+1]];
+                tri2_nodes[2] = nodes[node_idx_map[idx+incWidth]];
+
+                elements.push_back(new MeshLib::Tri(tri1_nodes)); // upper left triangle
+                elements.push_back(new MeshLib::Tri(tri2_nodes)); // lower right triangle
+            }
+            else if (elem_type == MeshElemType::QUAD)
+            {
+                MeshLib::Node** quad_nodes = new MeshLib::Node*[4];
+                quad_nodes[0] = nodes[node_idx_map[idx]];
+                quad_nodes[1] = nodes[node_idx_map[idx + 1]];
+                quad_nodes[2] = nodes[node_idx_map[idx + incWidth + 1]];
+                quad_nodes[3] = nodes[node_idx_map[idx + incWidth]];
+                elements.push_back(new MeshLib::Quad(quad_nodes));
+            }
+        }
+    return elements;
 }
 
 double RasterToMesh::getExistingValue(const double* img, std::size_t length)
 {
-	for (std::size_t i=0; i<length; i++)
-	{
-		if (img[i] != -9999)
-			return img[i];
-	}
-	return -9999;
+    for (std::size_t i=0; i<length; i++)
+    {
+        if (img[i] != -9999)
+            return img[i];
+    }
+    return -9999;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshGenerators/RasterToMesh.h b/MeshLib/MeshGenerators/RasterToMesh.h
index 45e2384541a..8d060df4e9b 100644
--- a/MeshLib/MeshGenerators/RasterToMesh.h
+++ b/MeshLib/MeshGenerators/RasterToMesh.h
@@ -34,88 +34,88 @@ class Element;
 class RasterToMesh
 {
 public:
-	/**
-	 * Converts greyscale raster into a mesh
-	 * \param elem_type defines if elements of the new mesh should be triangles or quads (or hexes for 3D)
-	 * \param intensity_type defines how image intensities are interpreted
-	 */
-	static MeshLib::Mesh* convert(GeoLib::Raster const& raster,
-	                              MeshElemType elem_type,
-	                              UseIntensityAs intensity_type,
-	                              std::string const& array_name = "Colour");
-
-	/**
-	 * Converts a vtkImageData into a mesh.
-	 * \param elem_type defines if elements of the new mesh should be triangles or quads (or hexes for 3D)
-	 * \param intensity_type defines how image intensities are interpreted
-	 */
-	static MeshLib::Mesh* convert(vtkImageData* img,
-	                              const double origin[3],
-	                              const double scalingFactor,
-	                              MeshElemType elem_type,
-	                              UseIntensityAs intensity_type,
-	                              std::string const& array_name = "Colour");
-
-	/**
-	 * Converts double array with raster values into a mesh.
-	 * \param elem_type defines if elements of the new mesh should be triangles or quads (or hexes for 3D)
-	 * \param intensity_type defines how image intensities are interpreted
-	 */
-	static MeshLib::Mesh* convert(const double* img,
-	                              GeoLib::RasterHeader const& header,
-	                              MeshElemType elem_type,
-	                              UseIntensityAs intensity_type,
-	                              std::string const& array_name = "Colour");
+    /**
+     * Converts greyscale raster into a mesh
+     * \param elem_type defines if elements of the new mesh should be triangles or quads (or hexes for 3D)
+     * \param intensity_type defines how image intensities are interpreted
+     */
+    static MeshLib::Mesh* convert(GeoLib::Raster const& raster,
+                                  MeshElemType elem_type,
+                                  UseIntensityAs intensity_type,
+                                  std::string const& array_name = "Colour");
+
+    /**
+     * Converts a vtkImageData into a mesh.
+     * \param elem_type defines if elements of the new mesh should be triangles or quads (or hexes for 3D)
+     * \param intensity_type defines how image intensities are interpreted
+     */
+    static MeshLib::Mesh* convert(vtkImageData* img,
+                                  const double origin[3],
+                                  const double scalingFactor,
+                                  MeshElemType elem_type,
+                                  UseIntensityAs intensity_type,
+                                  std::string const& array_name = "Colour");
+
+    /**
+     * Converts double array with raster values into a mesh.
+     * \param elem_type defines if elements of the new mesh should be triangles or quads (or hexes for 3D)
+     * \param intensity_type defines how image intensities are interpreted
+     */
+    static MeshLib::Mesh* convert(const double* img,
+                                  GeoLib::RasterHeader const& header,
+                                  MeshElemType elem_type,
+                                  UseIntensityAs intensity_type,
+                                  std::string const& array_name = "Colour");
 
 private:
-	static MeshLib::Mesh* constructMesh(
-		std::vector<double> const& pix_val,
-		std::string const& array_name,
-		std::vector<bool> const& pix_vis,
-		GeoLib::RasterHeader const& header,
-		MeshLib::MeshElemType elem_type,
-		MeshLib::UseIntensityAs intensity_type);
-
-	static std::vector<MeshLib::Node*> createNodeVector(
-		std::vector<double> const& elevation,
-		std::vector<int> &node_idx_map,
-		GeoLib::RasterHeader const& header,
-		bool use_elevation);
-
-	static std::vector<MeshLib::Element*> createElementVector(
-		std::vector<bool> const& pix_vis,
-		std::vector<MeshLib::Node*> const& nodes,
-		std::vector<int> const& node_idx_map,
-		std::size_t const imgHeight,
-		std::size_t const imgWidth,
-		MeshElemType elem_type);
-
-	template<typename T>
-	static void fillPropertyVector(
-		MeshLib::PropertyVector<T> &prop_vec,
-		std::vector<double> const& pix_val,
-		std::vector<bool> const& pix_vis,
-		const std::size_t &imgHeight,
-		const std::size_t &imgWidth,
-		MeshElemType elem_type)
-	{
-		for (std::size_t i = 0; i < imgHeight; i++)
-			for (std::size_t j = 0; j < imgWidth; j++)
-			{
-				if (!pix_vis[i*imgWidth+j])
-					continue;
-				T val (static_cast<T>(pix_val[i*(imgWidth+1)+j]));
-				if (elem_type == MeshElemType::TRIANGLE)
-				{
-					prop_vec.push_back(val);
-					prop_vec.push_back(val);
-				}
-				else if (elem_type == MeshElemType::QUAD)
-					prop_vec.push_back(val);
-			}
-	}
-
-	static double getExistingValue(const double* img, std::size_t length);
+    static MeshLib::Mesh* constructMesh(
+        std::vector<double> const& pix_val,
+        std::string const& array_name,
+        std::vector<bool> const& pix_vis,
+        GeoLib::RasterHeader const& header,
+        MeshLib::MeshElemType elem_type,
+        MeshLib::UseIntensityAs intensity_type);
+
+    static std::vector<MeshLib::Node*> createNodeVector(
+        std::vector<double> const& elevation,
+        std::vector<int> &node_idx_map,
+        GeoLib::RasterHeader const& header,
+        bool use_elevation);
+
+    static std::vector<MeshLib::Element*> createElementVector(
+        std::vector<bool> const& pix_vis,
+        std::vector<MeshLib::Node*> const& nodes,
+        std::vector<int> const& node_idx_map,
+        std::size_t const imgHeight,
+        std::size_t const imgWidth,
+        MeshElemType elem_type);
+
+    template<typename T>
+    static void fillPropertyVector(
+        MeshLib::PropertyVector<T> &prop_vec,
+        std::vector<double> const& pix_val,
+        std::vector<bool> const& pix_vis,
+        const std::size_t &imgHeight,
+        const std::size_t &imgWidth,
+        MeshElemType elem_type)
+    {
+        for (std::size_t i = 0; i < imgHeight; i++)
+            for (std::size_t j = 0; j < imgWidth; j++)
+            {
+                if (!pix_vis[i*imgWidth+j])
+                    continue;
+                T val (static_cast<T>(pix_val[i*(imgWidth+1)+j]));
+                if (elem_type == MeshElemType::TRIANGLE)
+                {
+                    prop_vec.push_back(val);
+                    prop_vec.push_back(val);
+                }
+                else if (elem_type == MeshElemType::QUAD)
+                    prop_vec.push_back(val);
+            }
+    }
+
+    static double getExistingValue(const double* img, std::size_t length);
 };
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshGenerators/VtkMeshConverter.cpp b/MeshLib/MeshGenerators/VtkMeshConverter.cpp
index 2ecbd08bdf0..78a99853fb4 100644
--- a/MeshLib/MeshGenerators/VtkMeshConverter.cpp
+++ b/MeshLib/MeshGenerators/VtkMeshConverter.cpp
@@ -42,215 +42,215 @@ namespace detail
 {
 template <class T_ELEMENT>
 MeshLib::Element* createElementWithSameNodeOrder(const std::vector<MeshLib::Node*> &nodes,
-		vtkIdList* const node_ids)
+        vtkIdList* const node_ids)
 {
-	MeshLib::Node** ele_nodes = new MeshLib::Node*[T_ELEMENT::n_all_nodes];
-	for (unsigned k(0); k<T_ELEMENT::n_all_nodes; k++)
-		ele_nodes[k] = nodes[node_ids->GetId(k)];
-	return new T_ELEMENT(ele_nodes);
+    MeshLib::Node** ele_nodes = new MeshLib::Node*[T_ELEMENT::n_all_nodes];
+    for (unsigned k(0); k<T_ELEMENT::n_all_nodes; k++)
+        ele_nodes[k] = nodes[node_ids->GetId(k)];
+    return new T_ELEMENT(ele_nodes);
 }
 }
 
 MeshLib::Mesh* VtkMeshConverter::convertUnstructuredGrid(vtkUnstructuredGrid* grid, std::string const& mesh_name)
 {
-	if (!grid)
-		return nullptr;
+    if (!grid)
+        return nullptr;
 
-	// set mesh nodes
-	const std::size_t nNodes = grid->GetPoints()->GetNumberOfPoints();
-	std::vector<MeshLib::Node*> nodes(nNodes);
-	double* coords = nullptr;
-	for (std::size_t i = 0; i < nNodes; i++)
-	{
-		coords = grid->GetPoints()->GetPoint(i);
-		nodes[i] = new MeshLib::Node(coords[0], coords[1], coords[2]);
-	}
+    // set mesh nodes
+    const std::size_t nNodes = grid->GetPoints()->GetNumberOfPoints();
+    std::vector<MeshLib::Node*> nodes(nNodes);
+    double* coords = nullptr;
+    for (std::size_t i = 0; i < nNodes; i++)
+    {
+        coords = grid->GetPoints()->GetPoint(i);
+        nodes[i] = new MeshLib::Node(coords[0], coords[1], coords[2]);
+    }
 
-	// set mesh elements
-	const std::size_t nElems = grid->GetNumberOfCells();
-	std::vector<MeshLib::Element*> elements(nElems);
-	auto node_ids = vtkSmartPointer<vtkIdList>::New();
-	for (std::size_t i = 0; i < nElems; i++)
-	{
-		MeshLib::Element* elem;
-		grid->GetCellPoints(i, node_ids);
+    // set mesh elements
+    const std::size_t nElems = grid->GetNumberOfCells();
+    std::vector<MeshLib::Element*> elements(nElems);
+    auto node_ids = vtkSmartPointer<vtkIdList>::New();
+    for (std::size_t i = 0; i < nElems; i++)
+    {
+        MeshLib::Element* elem;
+        grid->GetCellPoints(i, node_ids);
 
-		int cell_type = grid->GetCellType(i);
-		switch (cell_type)
-		{
-		case VTK_LINE: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Line>(nodes, node_ids);
-			break;
-		}
-		case VTK_TRIANGLE: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Tri>(nodes, node_ids);
-			break;
-		}
-		case VTK_QUAD: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Quad>(nodes, node_ids);
-			break;
-		}
-		case VTK_PIXEL: {
-			MeshLib::Node** quad_nodes = new MeshLib::Node*[4];
-			quad_nodes[0] = nodes[node_ids->GetId(0)];
-			quad_nodes[1] = nodes[node_ids->GetId(1)];
-			quad_nodes[2] = nodes[node_ids->GetId(3)];
-			quad_nodes[3] = nodes[node_ids->GetId(2)];
-			elem = new MeshLib::Quad(quad_nodes);
-			break;
-		}
-		case VTK_TETRA: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Tet>(nodes, node_ids);
-			break;
-		}
-		case VTK_HEXAHEDRON: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Hex>(nodes, node_ids);
-			break;
-		}
-		case VTK_VOXEL: {
-			MeshLib::Node** voxel_nodes = new MeshLib::Node*[8];
-			voxel_nodes[0] = nodes[node_ids->GetId(0)];
-			voxel_nodes[1] = nodes[node_ids->GetId(1)];
-			voxel_nodes[2] = nodes[node_ids->GetId(3)];
-			voxel_nodes[3] = nodes[node_ids->GetId(2)];
-			voxel_nodes[4] = nodes[node_ids->GetId(4)];
-			voxel_nodes[5] = nodes[node_ids->GetId(5)];
-			voxel_nodes[6] = nodes[node_ids->GetId(7)];
-			voxel_nodes[7] = nodes[node_ids->GetId(6)];
-			elem = new MeshLib::Hex(voxel_nodes);
-			break;
-		}
-		case VTK_PYRAMID: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Pyramid>(nodes, node_ids);
-			break;
-		}
-		case VTK_WEDGE: {
-			MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
-			for (unsigned i=0; i<3; ++i)
-			{
-				prism_nodes[i] = nodes[node_ids->GetId(i+3)];
-				prism_nodes[i+3] = nodes[node_ids->GetId(i)];
-			}
-			elem = new MeshLib::Prism(prism_nodes);
-			break;
-		}
-		case VTK_QUADRATIC_EDGE: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Line3>(nodes, node_ids);
-			break;
-		}
-		case VTK_QUADRATIC_TRIANGLE: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Tri6>(nodes, node_ids);
-			break;
-		}
-		case VTK_QUADRATIC_QUAD: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Quad8>(nodes, node_ids);
-			break;
-		}
-		case VTK_BIQUADRATIC_QUAD: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Quad9>(nodes, node_ids);
-			break;
-		}
-		case VTK_QUADRATIC_TETRA: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Tet10>(nodes, node_ids);
-			break;
-		}
-		case VTK_QUADRATIC_HEXAHEDRON: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Hex20>(nodes, node_ids);
-			break;
-		}
-		case VTK_QUADRATIC_PYRAMID: {
-			elem = detail::createElementWithSameNodeOrder<MeshLib::Pyramid13>(nodes, node_ids);
-			break;
-		}
-		case VTK_QUADRATIC_WEDGE: {
-			MeshLib::Node** prism_nodes = new MeshLib::Node*[15];
-			for (unsigned i=0; i<3; ++i)
-			{
-				prism_nodes[i] = nodes[node_ids->GetId(i+3)];
-				prism_nodes[i+3] = nodes[node_ids->GetId(i)];
-			}
-			for (unsigned i=0; i<3; ++i)
-				prism_nodes[6+i] = nodes[node_ids->GetId(8-i)];
-			prism_nodes[9] = nodes[node_ids->GetId(12)];
-			prism_nodes[10] = nodes[node_ids->GetId(14)];
-			prism_nodes[11] = nodes[node_ids->GetId(13)];
-			for (unsigned i=0; i<3; ++i)
-				prism_nodes[12+i] = nodes[node_ids->GetId(11-i)];
-			elem = new MeshLib::Prism15(prism_nodes);
-			break;
-		}
-		default:
-			ERR("VtkMeshConverter::convertUnstructuredGrid(): Unknown mesh element type \"%d\".", cell_type);
-			return nullptr;
-		}
+        int cell_type = grid->GetCellType(i);
+        switch (cell_type)
+        {
+        case VTK_LINE: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Line>(nodes, node_ids);
+            break;
+        }
+        case VTK_TRIANGLE: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Tri>(nodes, node_ids);
+            break;
+        }
+        case VTK_QUAD: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Quad>(nodes, node_ids);
+            break;
+        }
+        case VTK_PIXEL: {
+            MeshLib::Node** quad_nodes = new MeshLib::Node*[4];
+            quad_nodes[0] = nodes[node_ids->GetId(0)];
+            quad_nodes[1] = nodes[node_ids->GetId(1)];
+            quad_nodes[2] = nodes[node_ids->GetId(3)];
+            quad_nodes[3] = nodes[node_ids->GetId(2)];
+            elem = new MeshLib::Quad(quad_nodes);
+            break;
+        }
+        case VTK_TETRA: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Tet>(nodes, node_ids);
+            break;
+        }
+        case VTK_HEXAHEDRON: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Hex>(nodes, node_ids);
+            break;
+        }
+        case VTK_VOXEL: {
+            MeshLib::Node** voxel_nodes = new MeshLib::Node*[8];
+            voxel_nodes[0] = nodes[node_ids->GetId(0)];
+            voxel_nodes[1] = nodes[node_ids->GetId(1)];
+            voxel_nodes[2] = nodes[node_ids->GetId(3)];
+            voxel_nodes[3] = nodes[node_ids->GetId(2)];
+            voxel_nodes[4] = nodes[node_ids->GetId(4)];
+            voxel_nodes[5] = nodes[node_ids->GetId(5)];
+            voxel_nodes[6] = nodes[node_ids->GetId(7)];
+            voxel_nodes[7] = nodes[node_ids->GetId(6)];
+            elem = new MeshLib::Hex(voxel_nodes);
+            break;
+        }
+        case VTK_PYRAMID: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Pyramid>(nodes, node_ids);
+            break;
+        }
+        case VTK_WEDGE: {
+            MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
+            for (unsigned i=0; i<3; ++i)
+            {
+                prism_nodes[i] = nodes[node_ids->GetId(i+3)];
+                prism_nodes[i+3] = nodes[node_ids->GetId(i)];
+            }
+            elem = new MeshLib::Prism(prism_nodes);
+            break;
+        }
+        case VTK_QUADRATIC_EDGE: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Line3>(nodes, node_ids);
+            break;
+        }
+        case VTK_QUADRATIC_TRIANGLE: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Tri6>(nodes, node_ids);
+            break;
+        }
+        case VTK_QUADRATIC_QUAD: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Quad8>(nodes, node_ids);
+            break;
+        }
+        case VTK_BIQUADRATIC_QUAD: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Quad9>(nodes, node_ids);
+            break;
+        }
+        case VTK_QUADRATIC_TETRA: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Tet10>(nodes, node_ids);
+            break;
+        }
+        case VTK_QUADRATIC_HEXAHEDRON: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Hex20>(nodes, node_ids);
+            break;
+        }
+        case VTK_QUADRATIC_PYRAMID: {
+            elem = detail::createElementWithSameNodeOrder<MeshLib::Pyramid13>(nodes, node_ids);
+            break;
+        }
+        case VTK_QUADRATIC_WEDGE: {
+            MeshLib::Node** prism_nodes = new MeshLib::Node*[15];
+            for (unsigned i=0; i<3; ++i)
+            {
+                prism_nodes[i] = nodes[node_ids->GetId(i+3)];
+                prism_nodes[i+3] = nodes[node_ids->GetId(i)];
+            }
+            for (unsigned i=0; i<3; ++i)
+                prism_nodes[6+i] = nodes[node_ids->GetId(8-i)];
+            prism_nodes[9] = nodes[node_ids->GetId(12)];
+            prism_nodes[10] = nodes[node_ids->GetId(14)];
+            prism_nodes[11] = nodes[node_ids->GetId(13)];
+            for (unsigned i=0; i<3; ++i)
+                prism_nodes[12+i] = nodes[node_ids->GetId(11-i)];
+            elem = new MeshLib::Prism15(prism_nodes);
+            break;
+        }
+        default:
+            ERR("VtkMeshConverter::convertUnstructuredGrid(): Unknown mesh element type \"%d\".", cell_type);
+            return nullptr;
+        }
 
-		elements[i] = elem;
-	}
+        elements[i] = elem;
+    }
 
-	MeshLib::Mesh* mesh = new MeshLib::Mesh(mesh_name, nodes, elements);
-	convertScalarArrays(*grid, *mesh);
+    MeshLib::Mesh* mesh = new MeshLib::Mesh(mesh_name, nodes, elements);
+    convertScalarArrays(*grid, *mesh);
 
-	return mesh;
+    return mesh;
 }
 
 void VtkMeshConverter::convertScalarArrays(vtkUnstructuredGrid &grid, MeshLib::Mesh &mesh)
 {
-	vtkPointData* point_data = grid.GetPointData();
-	unsigned const n_point_arrays = static_cast<unsigned>(point_data->GetNumberOfArrays());
-	for (unsigned i=0; i<n_point_arrays; ++i)
-		convertArray(*point_data->GetArray(i), mesh.getProperties(), MeshLib::MeshItemType::Node);
+    vtkPointData* point_data = grid.GetPointData();
+    unsigned const n_point_arrays = static_cast<unsigned>(point_data->GetNumberOfArrays());
+    for (unsigned i=0; i<n_point_arrays; ++i)
+        convertArray(*point_data->GetArray(i), mesh.getProperties(), MeshLib::MeshItemType::Node);
 
-	vtkCellData* cell_data = grid.GetCellData();
-	unsigned const n_cell_arrays = static_cast<unsigned>(cell_data->GetNumberOfArrays());
-	for (unsigned i=0; i<n_cell_arrays; ++i)
-		convertArray(*cell_data->GetArray(i), mesh.getProperties(), MeshLib::MeshItemType::Cell);
+    vtkCellData* cell_data = grid.GetCellData();
+    unsigned const n_cell_arrays = static_cast<unsigned>(cell_data->GetNumberOfArrays());
+    for (unsigned i=0; i<n_cell_arrays; ++i)
+        convertArray(*cell_data->GetArray(i), mesh.getProperties(), MeshLib::MeshItemType::Cell);
 }
 
 void VtkMeshConverter::convertArray(vtkDataArray &array, MeshLib::Properties &properties, MeshLib::MeshItemType type)
 {
-	if (vtkDoubleArray::SafeDownCast(&array))
-	{
-		VtkMeshConverter::convertTypedArray<double>(array, properties, type);
-		return;
-	}
+    if (vtkDoubleArray::SafeDownCast(&array))
+    {
+        VtkMeshConverter::convertTypedArray<double>(array, properties, type);
+        return;
+    }
 
-	if (vtkIntArray::SafeDownCast(&array))
-	{
-		VtkMeshConverter::convertTypedArray<int>(array, properties, type);
-		return;
-	}
+    if (vtkIntArray::SafeDownCast(&array))
+    {
+        VtkMeshConverter::convertTypedArray<int>(array, properties, type);
+        return;
+    }
 
-	if (vtkBitArray::SafeDownCast(&array))
-	{
-		VtkMeshConverter::convertTypedArray<bool>(array, properties, type);
-		return;
-	}
+    if (vtkBitArray::SafeDownCast(&array))
+    {
+        VtkMeshConverter::convertTypedArray<bool>(array, properties, type);
+        return;
+    }
 
-	if (vtkCharArray::SafeDownCast(&array))
-	{
-		VtkMeshConverter::convertTypedArray<char>(array, properties, type);
-		return;
-	}
+    if (vtkCharArray::SafeDownCast(&array))
+    {
+        VtkMeshConverter::convertTypedArray<char>(array, properties, type);
+        return;
+    }
 
-	if (vtkUnsignedLongArray::SafeDownCast(&array))
-	{
-		VtkMeshConverter::convertTypedArray<unsigned long>(array, properties, type);
-		return;
-	}
+    if (vtkUnsignedLongArray::SafeDownCast(&array))
+    {
+        VtkMeshConverter::convertTypedArray<unsigned long>(array, properties, type);
+        return;
+    }
 
-	if (vtkUnsignedIntArray::SafeDownCast(&array))
-	{
-		// MaterialIDs are assumed to be integers
-		if(std::strncmp(array.GetName(), "MaterialIDs", 11) == 0)
-			VtkMeshConverter::convertTypedArray<int>(array, properties, type);
-		else
-			VtkMeshConverter::convertTypedArray<unsigned>(array, properties, type);
+    if (vtkUnsignedIntArray::SafeDownCast(&array))
+    {
+        // MaterialIDs are assumed to be integers
+        if(std::strncmp(array.GetName(), "MaterialIDs", 11) == 0)
+            VtkMeshConverter::convertTypedArray<int>(array, properties, type);
+        else
+            VtkMeshConverter::convertTypedArray<unsigned>(array, properties, type);
 
-		return;
-	}
+        return;
+    }
 
-	ERR ("Array \"%s\" in VTU file uses unsupported data type.", array.GetName());
-	return;
+    ERR ("Array \"%s\" in VTU file uses unsupported data type.", array.GetName());
+    return;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshGenerators/VtkMeshConverter.h b/MeshLib/MeshGenerators/VtkMeshConverter.h
index 5d628575659..814b8a645b8 100644
--- a/MeshLib/MeshGenerators/VtkMeshConverter.h
+++ b/MeshLib/MeshGenerators/VtkMeshConverter.h
@@ -44,79 +44,79 @@ class Properties;
 class VtkMeshConverter
 {
 public:
-	/// Converts a vtkUnstructuredGrid object to a Mesh
-	static MeshLib::Mesh* convertUnstructuredGrid(vtkUnstructuredGrid* grid,
-	                                              std::string const& mesh_name = "vtkUnstructuredGrid");
+    /// Converts a vtkUnstructuredGrid object to a Mesh
+    static MeshLib::Mesh* convertUnstructuredGrid(vtkUnstructuredGrid* grid,
+                                                  std::string const& mesh_name = "vtkUnstructuredGrid");
 
 private:
-	static void convertScalarArrays(vtkUnstructuredGrid &grid, MeshLib::Mesh &mesh);
-
-	static std::vector<MeshLib::Node*> createNodeVector(
-		std::vector<double> const& elevation,
-		std::vector<int> &node_idx_map,
-		GeoLib::RasterHeader const& header,
-		bool use_elevation);
-
-	/// Creates a mesh element vector based on image data
-	static std::vector<MeshLib::Element*> createElementVector(
-		std::vector<double> const&  pix_val,
-		std::vector<bool> const& pix_vis,
-		std::vector<MeshLib::Node*> const& nodes,
-		std::vector<int> const& node_idx_map,
-		std::size_t const imgHeight,
-		std::size_t const imgWidth,
-		MeshElemType elem_type);
-
-	/// Creates a scalar array/mesh property based on pixel values
-	template<typename T>
-	static void fillPropertyVector(
-		MeshLib::PropertyVector<T> &prop_vec,
-		std::vector<double> const& pix_val,
-		std::vector<bool> const& pix_vis,
-		const std::size_t &imgHeight,
-		const std::size_t &imgWidth,
-		MeshElemType elem_type)
-	{
-		for (std::size_t i = 0; i < imgHeight; i++)
-			for (std::size_t j = 0; j < imgWidth; j++)
-			{
-				if (!pix_vis[i*imgWidth+j])
-					continue;
-				T val (static_cast<T>(pix_val[i*(imgWidth+1)+j]));
-				if (elem_type == MeshElemType::TRIANGLE)
-				{
-					prop_vec.push_back(val);
-					prop_vec.push_back(val);
-				}
-				else if (elem_type == MeshElemType::QUAD)
-					prop_vec.push_back(val);
-			}
-	}
-
-	static void convertArray(vtkDataArray &array,
-	                         MeshLib::Properties &properties,
-	                         MeshLib::MeshItemType type);
-
-	template<typename T> static void convertTypedArray(vtkDataArray &array,
-	                                                   MeshLib::Properties &properties,
-	                                                   MeshLib::MeshItemType type)
-	{
-		vtkIdType const nTuples (array.GetNumberOfTuples());
-		int const nComponents (array.GetNumberOfComponents());
-		char const*const array_name (array.GetName());
-
-		boost::optional<MeshLib::PropertyVector<T> &> vec
-			(properties.createNewPropertyVector<T>(array_name, type, nComponents));
-		if (!vec)
-		{
-			WARN("Array %s could not be converted to PropertyVector.", array_name);
-			return;
-		}
-		vec->reserve(nTuples*nComponents);
-		T* data_array = static_cast<T*>(array.GetVoidPointer(0));
-		std::copy(&data_array[0], &data_array[nTuples*nComponents], std::back_inserter(*vec));
-		return;
-	}
+    static void convertScalarArrays(vtkUnstructuredGrid &grid, MeshLib::Mesh &mesh);
+
+    static std::vector<MeshLib::Node*> createNodeVector(
+        std::vector<double> const& elevation,
+        std::vector<int> &node_idx_map,
+        GeoLib::RasterHeader const& header,
+        bool use_elevation);
+
+    /// Creates a mesh element vector based on image data
+    static std::vector<MeshLib::Element*> createElementVector(
+        std::vector<double> const&  pix_val,
+        std::vector<bool> const& pix_vis,
+        std::vector<MeshLib::Node*> const& nodes,
+        std::vector<int> const& node_idx_map,
+        std::size_t const imgHeight,
+        std::size_t const imgWidth,
+        MeshElemType elem_type);
+
+    /// Creates a scalar array/mesh property based on pixel values
+    template<typename T>
+    static void fillPropertyVector(
+        MeshLib::PropertyVector<T> &prop_vec,
+        std::vector<double> const& pix_val,
+        std::vector<bool> const& pix_vis,
+        const std::size_t &imgHeight,
+        const std::size_t &imgWidth,
+        MeshElemType elem_type)
+    {
+        for (std::size_t i = 0; i < imgHeight; i++)
+            for (std::size_t j = 0; j < imgWidth; j++)
+            {
+                if (!pix_vis[i*imgWidth+j])
+                    continue;
+                T val (static_cast<T>(pix_val[i*(imgWidth+1)+j]));
+                if (elem_type == MeshElemType::TRIANGLE)
+                {
+                    prop_vec.push_back(val);
+                    prop_vec.push_back(val);
+                }
+                else if (elem_type == MeshElemType::QUAD)
+                    prop_vec.push_back(val);
+            }
+    }
+
+    static void convertArray(vtkDataArray &array,
+                             MeshLib::Properties &properties,
+                             MeshLib::MeshItemType type);
+
+    template<typename T> static void convertTypedArray(vtkDataArray &array,
+                                                       MeshLib::Properties &properties,
+                                                       MeshLib::MeshItemType type)
+    {
+        vtkIdType const nTuples (array.GetNumberOfTuples());
+        int const nComponents (array.GetNumberOfComponents());
+        char const*const array_name (array.GetName());
+
+        boost::optional<MeshLib::PropertyVector<T> &> vec
+            (properties.createNewPropertyVector<T>(array_name, type, nComponents));
+        if (!vec)
+        {
+            WARN("Array %s could not be converted to PropertyVector.", array_name);
+            return;
+        }
+        vec->reserve(nTuples*nComponents);
+        T* data_array = static_cast<T*>(array.GetVoidPointer(0));
+        std::copy(&data_array[0], &data_array[nTuples*nComponents], std::back_inserter(*vec));
+        return;
+    }
 };
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshInformation.cpp b/MeshLib/MeshInformation.cpp
index aa28b22a8fa..804f68d904c 100644
--- a/MeshLib/MeshInformation.cpp
+++ b/MeshLib/MeshInformation.cpp
@@ -20,26 +20,26 @@ namespace MeshLib
 
 const GeoLib::AABB MeshInformation::getBoundingBox(const MeshLib::Mesh &mesh)
 {
-	const std::vector<MeshLib::Node*> &nodes (mesh.getNodes());
-	return GeoLib::AABB(nodes.begin(), nodes.end());
+    const std::vector<MeshLib::Node*> &nodes (mesh.getNodes());
+    return GeoLib::AABB(nodes.begin(), nodes.end());
 }
 
 const std::array<unsigned, 7> MeshInformation::getNumberOfElementTypes(const MeshLib::Mesh &mesh)
 {
-	std::array<unsigned, 7> n_element_types = {{0, 0, 0, 0, 0, 0, 0}};
-	const std::vector<MeshLib::Element*> &elements (mesh.getElements());
-	for (auto it = elements.begin(); it != elements.end(); ++it)
-	{
-		MeshElemType t = (*it)->getGeomType();
-		if (t == MeshElemType::LINE) n_element_types[0]++;
-		if (t == MeshElemType::TRIANGLE) n_element_types[1]++;
-		if (t == MeshElemType::QUAD) n_element_types[2]++;
-		if (t == MeshElemType::TETRAHEDRON) n_element_types[3]++;
-		if (t == MeshElemType::HEXAHEDRON) n_element_types[4]++;
-		if (t == MeshElemType::PYRAMID) n_element_types[5]++;
-		if (t == MeshElemType::PRISM) n_element_types[6]++;
-	}
-	return n_element_types;
+    std::array<unsigned, 7> n_element_types = {{0, 0, 0, 0, 0, 0, 0}};
+    const std::vector<MeshLib::Element*> &elements (mesh.getElements());
+    for (auto it = elements.begin(); it != elements.end(); ++it)
+    {
+        MeshElemType t = (*it)->getGeomType();
+        if (t == MeshElemType::LINE) n_element_types[0]++;
+        if (t == MeshElemType::TRIANGLE) n_element_types[1]++;
+        if (t == MeshElemType::QUAD) n_element_types[2]++;
+        if (t == MeshElemType::TETRAHEDRON) n_element_types[3]++;
+        if (t == MeshElemType::HEXAHEDRON) n_element_types[4]++;
+        if (t == MeshElemType::PYRAMID) n_element_types[5]++;
+        if (t == MeshElemType::PRISM) n_element_types[6]++;
+    }
+    return n_element_types;
 }
 
 } //end MeshLib
diff --git a/MeshLib/MeshInformation.h b/MeshLib/MeshInformation.h
index e19719209aa..9f7e51c84ca 100644
--- a/MeshLib/MeshInformation.h
+++ b/MeshLib/MeshInformation.h
@@ -33,39 +33,39 @@ namespace MeshLib
 class MeshInformation
 {
 public:
-	/// Returns the smallest and largest value of a scalar array with the given name.
-	template<typename T>
-	static std::pair<T, T> const
-		getValueBounds(MeshLib::Mesh const& mesh, std::string const& name)
-	{
-		boost::optional<MeshLib::PropertyVector<T> const&> 
-			data_vec (mesh.getProperties().getPropertyVector<T>(name));
-		if (!data_vec)
-			return {std::numeric_limits<T>::max(), std::numeric_limits<T>::max()};
-		if (data_vec->empty()) {
-			INFO("Mesh does not contain values for the property \"%s\".", name.c_str());
-			return {std::numeric_limits<T>::max(), std::numeric_limits<T>::max()};
-		}
-		auto vec_bounds = std::minmax_element(data_vec->cbegin(), data_vec->cend());
-		return {*(vec_bounds.first), *(vec_bounds.second)};
-	}
+    /// Returns the smallest and largest value of a scalar array with the given name.
+    template<typename T>
+    static std::pair<T, T> const
+        getValueBounds(MeshLib::Mesh const& mesh, std::string const& name)
+    {
+        boost::optional<MeshLib::PropertyVector<T> const&> 
+            data_vec (mesh.getProperties().getPropertyVector<T>(name));
+        if (!data_vec)
+            return {std::numeric_limits<T>::max(), std::numeric_limits<T>::max()};
+        if (data_vec->empty()) {
+            INFO("Mesh does not contain values for the property \"%s\".", name.c_str());
+            return {std::numeric_limits<T>::max(), std::numeric_limits<T>::max()};
+        }
+        auto vec_bounds = std::minmax_element(data_vec->cbegin(), data_vec->cend());
+        return {*(vec_bounds.first), *(vec_bounds.second)};
+    }
 
-	/// Returns the bounding box of the mesh.
-	static const GeoLib::AABB getBoundingBox(const MeshLib::Mesh &mesh);
+    /// Returns the bounding box of the mesh.
+    static const GeoLib::AABB getBoundingBox(const MeshLib::Mesh &mesh);
 
-	/**
-	 * Returns an array with the number of elements of each type in the given mesh.
-	 * On completion, n_element_types array contains the number of elements of each of the seven
-	 * supported types. The index to element type conversion is this:
-	 *		0: \#lines
-	 *		1: \#triangles
-	 *		2: \#quads
-	 *		3: \#tetrahedra
-	 *		4: \#hexahedra
-	 *		5: \#pyramids
-	 *		6: \#prisms
-	 */
-	static const std::array<unsigned, 7> getNumberOfElementTypes(const MeshLib::Mesh &mesh);
+    /**
+     * Returns an array with the number of elements of each type in the given mesh.
+     * On completion, n_element_types array contains the number of elements of each of the seven
+     * supported types. The index to element type conversion is this:
+     *        0: \#lines
+     *        1: \#triangles
+     *        2: \#quads
+     *        3: \#tetrahedra
+     *        4: \#hexahedra
+     *        5: \#pyramids
+     *        6: \#prisms
+     */
+    static const std::array<unsigned, 7> getNumberOfElementTypes(const MeshLib::Mesh &mesh);
 
 
 };
diff --git a/MeshLib/MeshQuality/AngleSkewMetric.cpp b/MeshLib/MeshQuality/AngleSkewMetric.cpp
index 08e0276876c..7d556ad14cf 100644
--- a/MeshLib/MeshQuality/AngleSkewMetric.cpp
+++ b/MeshLib/MeshQuality/AngleSkewMetric.cpp
@@ -26,7 +26,7 @@ using namespace boost::math::double_constants;
 namespace MeshLib
 {
 AngleSkewMetric::AngleSkewMetric(Mesh const& mesh) :
-	ElementQualityMetric(mesh)
+    ElementQualityMetric(mesh)
 {}
 
 AngleSkewMetric::~AngleSkewMetric()
@@ -34,155 +34,155 @@ AngleSkewMetric::~AngleSkewMetric()
 
 void AngleSkewMetric::calculateQuality ()
 {
-	const std::vector<MeshLib::Element*>& elements(_mesh.getElements());
-	const std::size_t nElements (_mesh.getNElements());
-
-	for (std::size_t k(0); k < nElements; k++)
-	{
-		Element const& elem (*elements[k]);
-		switch (elem.getGeomType())
-		{
-		case MeshElemType::LINE:
-			_element_quality_metric[k] = -1.0;
-			break;
-		case MeshElemType::TRIANGLE:
-			_element_quality_metric[k] = checkTriangle (elem);
-			break;
-		case MeshElemType::QUAD:
-			_element_quality_metric[k] = checkQuad (elem);
-			break;
-		case MeshElemType::TETRAHEDRON:
-			_element_quality_metric[k] = checkTetrahedron (elem);
-			break;
-		case MeshElemType::HEXAHEDRON:
-			_element_quality_metric[k] = checkHexahedron (elem);
-			break;
-		case MeshElemType::PRISM:
-			_element_quality_metric[k] = checkPrism (elem);
-			break;
-		default:
-			break;
-		}
-	}
+    const std::vector<MeshLib::Element*>& elements(_mesh.getElements());
+    const std::size_t nElements (_mesh.getNElements());
+
+    for (std::size_t k(0); k < nElements; k++)
+    {
+        Element const& elem (*elements[k]);
+        switch (elem.getGeomType())
+        {
+        case MeshElemType::LINE:
+            _element_quality_metric[k] = -1.0;
+            break;
+        case MeshElemType::TRIANGLE:
+            _element_quality_metric[k] = checkTriangle (elem);
+            break;
+        case MeshElemType::QUAD:
+            _element_quality_metric[k] = checkQuad (elem);
+            break;
+        case MeshElemType::TETRAHEDRON:
+            _element_quality_metric[k] = checkTetrahedron (elem);
+            break;
+        case MeshElemType::HEXAHEDRON:
+            _element_quality_metric[k] = checkHexahedron (elem);
+            break;
+        case MeshElemType::PRISM:
+            _element_quality_metric[k] = checkPrism (elem);
+            break;
+        default:
+            break;
+        }
+    }
 }
 
 double AngleSkewMetric::checkTriangle (Element const& elem) const
 {
-	double const* const node0 (elem.getNode(0)->getCoords());
-	double const* const node1 (elem.getNode(1)->getCoords());
-	double const* const node2 (elem.getNode(2)->getCoords());
+    double const* const node0 (elem.getNode(0)->getCoords());
+    double const* const node1 (elem.getNode(1)->getCoords());
+    double const* const node2 (elem.getNode(2)->getCoords());
 
-	double min_angle (two_pi), max_angle (0.0);
-	getMinMaxAngleFromTriangle (node0, node1, node2, min_angle, max_angle);
+    double min_angle (two_pi), max_angle (0.0);
+    getMinMaxAngleFromTriangle (node0, node1, node2, min_angle, max_angle);
 
-	return 1.0 -
-	       std::max((max_angle - third_pi) / two_thirds_pi,
-	                (third_pi - min_angle) / third_pi);
+    return 1.0 -
+           std::max((max_angle - third_pi) / two_thirds_pi,
+                    (third_pi - min_angle) / third_pi);
 }
 
 double AngleSkewMetric::checkQuad (Element const& elem) const
 {
-	double const* const node0 (elem.getNode(0)->getCoords());
-	double const* const node1 (elem.getNode(1)->getCoords());
-	double const* const node2 (elem.getNode(2)->getCoords());
-	double const* const node3 (elem.getNode(3)->getCoords());
+    double const* const node0 (elem.getNode(0)->getCoords());
+    double const* const node1 (elem.getNode(1)->getCoords());
+    double const* const node2 (elem.getNode(2)->getCoords());
+    double const* const node3 (elem.getNode(3)->getCoords());
 
-	double min_angle (two_pi);
-	double max_angle (0.0);
+    double min_angle (two_pi);
+    double max_angle (0.0);
 
-	getMinMaxAngleFromQuad (node0, node1, node2, node3, min_angle, max_angle);
+    getMinMaxAngleFromQuad (node0, node1, node2, node3, min_angle, max_angle);
 
-	return 1.0 -
-	       std::max((max_angle - two_pi) / (-pi), (two_pi - min_angle) / (two_pi));
+    return 1.0 -
+           std::max((max_angle - two_pi) / (-pi), (two_pi - min_angle) / (two_pi));
 }
 
 double AngleSkewMetric::checkTetrahedron (Element const& elem) const
 {
-	double const* const node0 (elem.getNode(0)->getCoords());
-	double const* const node1 (elem.getNode(1)->getCoords());
-	double const* const node2 (elem.getNode(2)->getCoords());
-	double const* const node3 (elem.getNode(3)->getCoords());
-
-	double min_angle (two_pi);
-	double max_angle (0.0);
-
-	// first triangle (0,1,2)
-	getMinMaxAngleFromTriangle(node0, node1, node2, min_angle, max_angle);
-	// second triangle (0,1,3)
-	getMinMaxAngleFromTriangle(node0, node1, node3, min_angle, max_angle);
-	// third triangle (0,2,3)
-	getMinMaxAngleFromTriangle(node0, node2, node3, min_angle, max_angle);
-	// fourth triangle (1,2,3)
-	getMinMaxAngleFromTriangle(node1, node2, node3, min_angle, max_angle);
-
-	return 1.0 - std::max((max_angle - two_pi) / two_thirds_pi,
-	                      (third_pi - min_angle) / third_pi);
+    double const* const node0 (elem.getNode(0)->getCoords());
+    double const* const node1 (elem.getNode(1)->getCoords());
+    double const* const node2 (elem.getNode(2)->getCoords());
+    double const* const node3 (elem.getNode(3)->getCoords());
+
+    double min_angle (two_pi);
+    double max_angle (0.0);
+
+    // first triangle (0,1,2)
+    getMinMaxAngleFromTriangle(node0, node1, node2, min_angle, max_angle);
+    // second triangle (0,1,3)
+    getMinMaxAngleFromTriangle(node0, node1, node3, min_angle, max_angle);
+    // third triangle (0,2,3)
+    getMinMaxAngleFromTriangle(node0, node2, node3, min_angle, max_angle);
+    // fourth triangle (1,2,3)
+    getMinMaxAngleFromTriangle(node1, node2, node3, min_angle, max_angle);
+
+    return 1.0 - std::max((max_angle - two_pi) / two_thirds_pi,
+                          (third_pi - min_angle) / third_pi);
 }
 
 double AngleSkewMetric::checkHexahedron (Element const& elem) const
 {
-	double const* const node0 (elem.getNode(0)->getCoords());
-	double const* const node1 (elem.getNode(1)->getCoords());
-	double const* const node2 (elem.getNode(2)->getCoords());
-	double const* const node3 (elem.getNode(3)->getCoords());
-	double const* const node4 (elem.getNode(4)->getCoords());
-	double const* const node5 (elem.getNode(5)->getCoords());
-	double const* const node6 (elem.getNode(6)->getCoords());
-	double const* const node7 (elem.getNode(7)->getCoords());
-
-	double min_angle (two_pi);
-	double max_angle (0.0);
-
-	// first surface (0,1,2,3)
-	getMinMaxAngleFromQuad (node0, node1, node2, node3, min_angle, max_angle);
-	// second surface (0,3,7,4)
-	getMinMaxAngleFromQuad (node0, node3, node7, node4, min_angle, max_angle);
-	// third surface (4,5,6,7)
-	getMinMaxAngleFromQuad (node4, node5, node6, node7, min_angle, max_angle);
-	// fourth surface (5,1,2,6)
-	getMinMaxAngleFromQuad (node5, node1, node2, node6, min_angle, max_angle);
-	// fifth surface (5,1,0,4)
-	getMinMaxAngleFromQuad (node5, node1, node0, node4, min_angle, max_angle);
-	// sixth surface (6,2,3,7)
-	getMinMaxAngleFromQuad (node6, node2, node3, node7, min_angle, max_angle);
-
-	return 1.0 -
-	       std::max((max_angle - two_pi) / (-pi), (two_pi - min_angle) / two_pi);
+    double const* const node0 (elem.getNode(0)->getCoords());
+    double const* const node1 (elem.getNode(1)->getCoords());
+    double const* const node2 (elem.getNode(2)->getCoords());
+    double const* const node3 (elem.getNode(3)->getCoords());
+    double const* const node4 (elem.getNode(4)->getCoords());
+    double const* const node5 (elem.getNode(5)->getCoords());
+    double const* const node6 (elem.getNode(6)->getCoords());
+    double const* const node7 (elem.getNode(7)->getCoords());
+
+    double min_angle (two_pi);
+    double max_angle (0.0);
+
+    // first surface (0,1,2,3)
+    getMinMaxAngleFromQuad (node0, node1, node2, node3, min_angle, max_angle);
+    // second surface (0,3,7,4)
+    getMinMaxAngleFromQuad (node0, node3, node7, node4, min_angle, max_angle);
+    // third surface (4,5,6,7)
+    getMinMaxAngleFromQuad (node4, node5, node6, node7, min_angle, max_angle);
+    // fourth surface (5,1,2,6)
+    getMinMaxAngleFromQuad (node5, node1, node2, node6, min_angle, max_angle);
+    // fifth surface (5,1,0,4)
+    getMinMaxAngleFromQuad (node5, node1, node0, node4, min_angle, max_angle);
+    // sixth surface (6,2,3,7)
+    getMinMaxAngleFromQuad (node6, node2, node3, node7, min_angle, max_angle);
+
+    return 1.0 -
+           std::max((max_angle - two_pi) / (-pi), (two_pi - min_angle) / two_pi);
 }
 
 double AngleSkewMetric::checkPrism (Element const& elem) const
 {
-	double const* const node0 (elem.getNode(0)->getCoords());
-	double const* const node1 (elem.getNode(1)->getCoords());
-	double const* const node2 (elem.getNode(2)->getCoords());
-	double const* const node3 (elem.getNode(3)->getCoords());
-	double const* const node4 (elem.getNode(4)->getCoords());
-	double const* const node5 (elem.getNode(5)->getCoords());
-
-	double min_angle_tri (two_pi);
-	double max_angle_tri (0.0);
-
-	// first triangle (0,1,2)
-	getMinMaxAngleFromTriangle (node0, node1, node2, min_angle_tri, max_angle_tri);
-	// second surface (3,4,5)
-	getMinMaxAngleFromTriangle (node3, node4, node5, min_angle_tri, max_angle_tri);
-
-	double tri_criterion (1.0 - std::max((max_angle_tri - two_pi) / two_thirds_pi,
-	                                     (third_pi - min_angle_tri) / third_pi));
-
-	double min_angle_quad (two_pi);
-	double max_angle_quad (0.0);
-	// surface (0,3,4,1)
-	getMinMaxAngleFromQuad (node0, node3, node4, node1, min_angle_quad, max_angle_quad);
-	// surface (2,5,3,0)
-	getMinMaxAngleFromQuad (node2, node5, node3, node0, min_angle_quad, max_angle_quad);
-	// surface (1,2,5,4)
-	getMinMaxAngleFromQuad (node1, node2, node5, node4, min_angle_quad, max_angle_quad);
-
-	double quad_criterion (1.0 - std::max((max_angle_quad - two_pi) / (-pi),
-	                                      (two_pi - min_angle_quad) / two_pi));
-
-	return std::min (tri_criterion, quad_criterion);
+    double const* const node0 (elem.getNode(0)->getCoords());
+    double const* const node1 (elem.getNode(1)->getCoords());
+    double const* const node2 (elem.getNode(2)->getCoords());
+    double const* const node3 (elem.getNode(3)->getCoords());
+    double const* const node4 (elem.getNode(4)->getCoords());
+    double const* const node5 (elem.getNode(5)->getCoords());
+
+    double min_angle_tri (two_pi);
+    double max_angle_tri (0.0);
+
+    // first triangle (0,1,2)
+    getMinMaxAngleFromTriangle (node0, node1, node2, min_angle_tri, max_angle_tri);
+    // second surface (3,4,5)
+    getMinMaxAngleFromTriangle (node3, node4, node5, min_angle_tri, max_angle_tri);
+
+    double tri_criterion (1.0 - std::max((max_angle_tri - two_pi) / two_thirds_pi,
+                                         (third_pi - min_angle_tri) / third_pi));
+
+    double min_angle_quad (two_pi);
+    double max_angle_quad (0.0);
+    // surface (0,3,4,1)
+    getMinMaxAngleFromQuad (node0, node3, node4, node1, min_angle_quad, max_angle_quad);
+    // surface (2,5,3,0)
+    getMinMaxAngleFromQuad (node2, node5, node3, node0, min_angle_quad, max_angle_quad);
+    // surface (1,2,5,4)
+    getMinMaxAngleFromQuad (node1, node2, node5, node4, min_angle_quad, max_angle_quad);
+
+    double quad_criterion (1.0 - std::max((max_angle_quad - two_pi) / (-pi),
+                                          (two_pi - min_angle_quad) / two_pi));
+
+    return std::min (tri_criterion, quad_criterion);
 }
 
 void AngleSkewMetric::getMinMaxAngleFromQuad (
@@ -190,13 +190,13 @@ void AngleSkewMetric::getMinMaxAngleFromQuad (
         double const* const n2, double const* const n3,
         double &min_angle, double &max_angle) const
 {
-	const double* nodes[4] = {n0, n1, n2, n3};
-	for (unsigned i=0; i<4; ++i)
-	{
-		const double angle (MathLib::getAngle (nodes[i], nodes[(i+1)%4], nodes[(i+2)%4]));
-		min_angle = std::min(angle, min_angle);
-		max_angle = std::max(angle, max_angle);
-	}
+    const double* nodes[4] = {n0, n1, n2, n3};
+    for (unsigned i=0; i<4; ++i)
+    {
+        const double angle (MathLib::getAngle (nodes[i], nodes[(i+1)%4], nodes[(i+2)%4]));
+        min_angle = std::min(angle, min_angle);
+        max_angle = std::max(angle, max_angle);
+    }
 }
 
 void AngleSkewMetric::getMinMaxAngleFromTriangle(double const* const n0,
@@ -205,13 +205,13 @@ void AngleSkewMetric::getMinMaxAngleFromTriangle(double const* const n0,
                                                           double &min_angle,
                                                           double &max_angle) const
 {
-	const double* nodes[3] = {n0, n1, n2};
-	for (unsigned i=0; i<3; ++i)
-	{
-		const double angle (MathLib::getAngle (nodes[i], nodes[(i+1)%3], nodes[(i+2)%3]));
-		min_angle = std::min(angle, min_angle);
-		max_angle = std::max(angle, max_angle);
-	}
+    const double* nodes[3] = {n0, n1, n2};
+    for (unsigned i=0; i<3; ++i)
+    {
+        const double angle (MathLib::getAngle (nodes[i], nodes[(i+1)%3], nodes[(i+2)%3]));
+        min_angle = std::min(angle, min_angle);
+        max_angle = std::max(angle, max_angle);
+    }
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshQuality/AngleSkewMetric.h b/MeshLib/MeshQuality/AngleSkewMetric.h
index ac5dc409c84..c31938eecf8 100644
--- a/MeshLib/MeshQuality/AngleSkewMetric.h
+++ b/MeshLib/MeshQuality/AngleSkewMetric.h
@@ -26,24 +26,24 @@ namespace MeshLib
 class AngleSkewMetric : public ElementQualityMetric
 {
 public:
-	AngleSkewMetric(Mesh const& mesh);
-	virtual ~AngleSkewMetric();
+    AngleSkewMetric(Mesh const& mesh);
+    virtual ~AngleSkewMetric();
 
-	virtual void calculateQuality ();
+    virtual void calculateQuality ();
 
 private:
-	double checkTriangle(Element const& elem) const;
-	double checkQuad(Element const& elem) const;
-	double checkTetrahedron(Element const& elem) const;
-	double checkHexahedron(Element const& elem) const;
-	double checkPrism (Element const& elem) const;
-	void getMinMaxAngleFromQuad(double const* const n0,
-	                            double const* const n1, double const* const n2,
-	                            double const* const n3, double &min_angle,
-	                            double &max_angle) const;
-	void getMinMaxAngleFromTriangle(double const* const n0,
-	                                double const* const n1, double const* const n2,
-	                                double &min_angle, double &max_angle) const;
+    double checkTriangle(Element const& elem) const;
+    double checkQuad(Element const& elem) const;
+    double checkTetrahedron(Element const& elem) const;
+    double checkHexahedron(Element const& elem) const;
+    double checkPrism (Element const& elem) const;
+    void getMinMaxAngleFromQuad(double const* const n0,
+                                double const* const n1, double const* const n2,
+                                double const* const n3, double &min_angle,
+                                double &max_angle) const;
+    void getMinMaxAngleFromTriangle(double const* const n0,
+                                    double const* const n1, double const* const n2,
+                                    double &min_angle, double &max_angle) const;
 };
 }
 
diff --git a/MeshLib/MeshQuality/EdgeRatioMetric.cpp b/MeshLib/MeshQuality/EdgeRatioMetric.cpp
index 23ef5fa0f8d..23cd6a72550 100644
--- a/MeshLib/MeshQuality/EdgeRatioMetric.cpp
+++ b/MeshLib/MeshQuality/EdgeRatioMetric.cpp
@@ -20,95 +20,95 @@
 namespace MeshLib
 {
 EdgeRatioMetric::EdgeRatioMetric(Mesh const& mesh) :
-	ElementQualityMetric(mesh)
+    ElementQualityMetric(mesh)
 {
 }
 
 void EdgeRatioMetric::calculateQuality()
 {
-	// get all elements of mesh
-	const std::vector<MeshLib::Element*>& elements(_mesh.getElements());
-	const std::size_t nElements (_mesh.getNElements());
-	for (std::size_t k(0); k < nElements; k++)
-	{
-		Element const& elem (*elements[k]);
-		switch (elem.getGeomType())
-		{
-		case MeshElemType::LINE:
-			_element_quality_metric[k] = 1.0;
-			break;
-		case MeshElemType::TRIANGLE: {
-			_element_quality_metric[k] = checkTriangle(*elem.getNode(0), *elem.getNode(1), *elem.getNode(2));
-			break;
-		}
-		case MeshElemType::QUAD: {
-			_element_quality_metric[k] = checkQuad(*elem.getNode(0), *elem.getNode(1), *elem.getNode(2), *elem.getNode(3));
-			break;
-		}
-		case MeshElemType::TETRAHEDRON: {
-			_element_quality_metric[k] = checkTetrahedron(*elem.getNode(0), *elem.getNode(1), *elem.getNode(2), *elem.getNode(3));
-			break;
-		}
-		case MeshElemType::PRISM: {
-			std::vector<const MathLib::Point3d*> pnts;
-			for (std::size_t j(0); j < 6; j++)
-				pnts.push_back(elem.getNode(j));
-			_element_quality_metric[k] = checkPrism(pnts);
-			break;
-		}
-		case MeshElemType::PYRAMID: {
-			std::vector<const MathLib::Point3d*> pnts;
-			for (std::size_t j(0); j < 5; j++)
-				pnts.push_back(elem.getNode(j));
-			_element_quality_metric[k] = checkPyramid(pnts);
-			break;
-		}
-		case MeshElemType::HEXAHEDRON: {
-			std::vector<const MathLib::Point3d*> pnts;
-			for (std::size_t j(0); j < 8; j++)
-				pnts.push_back(elem.getNode(j));
-			_element_quality_metric[k] = checkHexahedron(pnts);
-			break;
-		}
-		default:
-			ERR ("MeshQualityShortestLongestRatio::check () check for element type %s not implemented.",
-			     MeshElemType2String(elem.getGeomType()).c_str());
-		}
-	}
+    // get all elements of mesh
+    const std::vector<MeshLib::Element*>& elements(_mesh.getElements());
+    const std::size_t nElements (_mesh.getNElements());
+    for (std::size_t k(0); k < nElements; k++)
+    {
+        Element const& elem (*elements[k]);
+        switch (elem.getGeomType())
+        {
+        case MeshElemType::LINE:
+            _element_quality_metric[k] = 1.0;
+            break;
+        case MeshElemType::TRIANGLE: {
+            _element_quality_metric[k] = checkTriangle(*elem.getNode(0), *elem.getNode(1), *elem.getNode(2));
+            break;
+        }
+        case MeshElemType::QUAD: {
+            _element_quality_metric[k] = checkQuad(*elem.getNode(0), *elem.getNode(1), *elem.getNode(2), *elem.getNode(3));
+            break;
+        }
+        case MeshElemType::TETRAHEDRON: {
+            _element_quality_metric[k] = checkTetrahedron(*elem.getNode(0), *elem.getNode(1), *elem.getNode(2), *elem.getNode(3));
+            break;
+        }
+        case MeshElemType::PRISM: {
+            std::vector<const MathLib::Point3d*> pnts;
+            for (std::size_t j(0); j < 6; j++)
+                pnts.push_back(elem.getNode(j));
+            _element_quality_metric[k] = checkPrism(pnts);
+            break;
+        }
+        case MeshElemType::PYRAMID: {
+            std::vector<const MathLib::Point3d*> pnts;
+            for (std::size_t j(0); j < 5; j++)
+                pnts.push_back(elem.getNode(j));
+            _element_quality_metric[k] = checkPyramid(pnts);
+            break;
+        }
+        case MeshElemType::HEXAHEDRON: {
+            std::vector<const MathLib::Point3d*> pnts;
+            for (std::size_t j(0); j < 8; j++)
+                pnts.push_back(elem.getNode(j));
+            _element_quality_metric[k] = checkHexahedron(pnts);
+            break;
+        }
+        default:
+            ERR ("MeshQualityShortestLongestRatio::check () check for element type %s not implemented.",
+                 MeshElemType2String(elem.getGeomType()).c_str());
+        }
+    }
 }
 
 double EdgeRatioMetric::checkTriangle (MathLib::Point3d const& a,
                                        MathLib::Point3d const& b,
                                        MathLib::Point3d const& c) const
 {
-	double len0 (sqrt(MathLib::sqrDist (b,a)));
-	double len1 (sqrt(MathLib::sqrDist (b,c)));
-	double len2 (sqrt(MathLib::sqrDist (a,c)));
-
-	if (len0 < len1 && len0 < len2)
-	{
-		if (len1 < len2)
-			return len0 / len2;
-		else
-			return len0 / len1;
-	}
-	else
-	{
-		if (len1 < len2)
-		{
-			if (len0 < len2)
-				return len1 / len2;
-			else
-				return len1 / len0;
-		}
-		else
-		{
-			if (len0 < len1)
-				return len2 / len1;
-			else
-				return len2 / len0;
-		}
-	}
+    double len0 (sqrt(MathLib::sqrDist (b,a)));
+    double len1 (sqrt(MathLib::sqrDist (b,c)));
+    double len2 (sqrt(MathLib::sqrDist (a,c)));
+
+    if (len0 < len1 && len0 < len2)
+    {
+        if (len1 < len2)
+            return len0 / len2;
+        else
+            return len0 / len1;
+    }
+    else
+    {
+        if (len1 < len2)
+        {
+            if (len0 < len2)
+                return len1 / len2;
+            else
+                return len1 / len0;
+        }
+        else
+        {
+            if (len0 < len1)
+                return len2 / len1;
+            else
+                return len2 / len0;
+        }
+    }
 }
 
 double EdgeRatioMetric::checkQuad (MathLib::Point3d const& a,
@@ -116,18 +116,18 @@ double EdgeRatioMetric::checkQuad (MathLib::Point3d const& a,
                                    MathLib::Point3d const& c,
                                    MathLib::Point3d const& d) const
 {
-	double sqr_lengths[4] = {MathLib::sqrDist (b,a),
-		                 MathLib::sqrDist (c,b),
-		                 MathLib::sqrDist (d,c),
-		                 MathLib::sqrDist (a,d)};
-
-	// sort lengths - since this is a very small array we use bubble sort
-	for (std::size_t i(0); i < 4; i++)
-		for (std::size_t j(i + 1); j < 4; j++)
-			if (sqr_lengths[i] >= sqr_lengths[j])
-				std::swap (sqr_lengths[i], sqr_lengths[j]);
-
-	return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[3]);
+    double sqr_lengths[4] = {MathLib::sqrDist (b,a),
+                         MathLib::sqrDist (c,b),
+                         MathLib::sqrDist (d,c),
+                         MathLib::sqrDist (a,d)};
+
+    // sort lengths - since this is a very small array we use bubble sort
+    for (std::size_t i(0); i < 4; i++)
+        for (std::size_t j(i + 1); j < 4; j++)
+            if (sqr_lengths[i] >= sqr_lengths[j])
+                std::swap (sqr_lengths[i], sqr_lengths[j]);
+
+    return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[3]);
 }
 
 double EdgeRatioMetric::checkTetrahedron (MathLib::Point3d const& a,
@@ -135,81 +135,81 @@ double EdgeRatioMetric::checkTetrahedron (MathLib::Point3d const& a,
                                           MathLib::Point3d const& c,
                                           MathLib::Point3d const& d) const
 {
-	double sqr_lengths[6] = {MathLib::sqrDist (b,a), MathLib::sqrDist (c,b),
-		                 MathLib::sqrDist (c,a), MathLib::sqrDist (a,d),
-		                 MathLib::sqrDist (b,d), MathLib::sqrDist (c,d)};
+    double sqr_lengths[6] = {MathLib::sqrDist (b,a), MathLib::sqrDist (c,b),
+                         MathLib::sqrDist (c,a), MathLib::sqrDist (a,d),
+                         MathLib::sqrDist (b,d), MathLib::sqrDist (c,d)};
 
-	// sort lengths - since this is a very small array we use bubble sort
-	for (std::size_t i(0); i < 6; i++)
-		for (std::size_t j(i + 1); j < 6; j++)
-			if (sqr_lengths[i] >= sqr_lengths[j])
-				std::swap (sqr_lengths[i], sqr_lengths[j]);
+    // sort lengths - since this is a very small array we use bubble sort
+    for (std::size_t i(0); i < 6; i++)
+        for (std::size_t j(i + 1); j < 6; j++)
+            if (sqr_lengths[i] >= sqr_lengths[j])
+                std::swap (sqr_lengths[i], sqr_lengths[j]);
 
-	return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[5]);
+    return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[5]);
 }
 
 double EdgeRatioMetric::checkPrism (std::vector<const MathLib::Point3d*> const& pnts) const
 {
-	double sqr_lengths[9] = {MathLib::sqrDist (*pnts[0],*pnts[1]),
-		                 MathLib::sqrDist (*pnts[1],*pnts[2]),
-		                 MathLib::sqrDist (*pnts[2],*pnts[0]),
-		                 MathLib::sqrDist (*pnts[3],*pnts[4]),
-		                 MathLib::sqrDist (*pnts[4],*pnts[5]),
-		                 MathLib::sqrDist (*pnts[5],*pnts[3]),
-		                 MathLib::sqrDist (*pnts[0],*pnts[3]),
-		                 MathLib::sqrDist (*pnts[1],*pnts[4]),
-		                 MathLib::sqrDist (*pnts[2],*pnts[5])};
-
-	// sort lengths - since this is a very small array we use bubble sort
-	for (std::size_t i(0); i < 9; i++)
-		for (std::size_t j(i + 1); j < 9; j++)
-			if (sqr_lengths[i] >= sqr_lengths[j])
-				std::swap (sqr_lengths[i], sqr_lengths[j]);
-
-	return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[8]);
+    double sqr_lengths[9] = {MathLib::sqrDist (*pnts[0],*pnts[1]),
+                         MathLib::sqrDist (*pnts[1],*pnts[2]),
+                         MathLib::sqrDist (*pnts[2],*pnts[0]),
+                         MathLib::sqrDist (*pnts[3],*pnts[4]),
+                         MathLib::sqrDist (*pnts[4],*pnts[5]),
+                         MathLib::sqrDist (*pnts[5],*pnts[3]),
+                         MathLib::sqrDist (*pnts[0],*pnts[3]),
+                         MathLib::sqrDist (*pnts[1],*pnts[4]),
+                         MathLib::sqrDist (*pnts[2],*pnts[5])};
+
+    // sort lengths - since this is a very small array we use bubble sort
+    for (std::size_t i(0); i < 9; i++)
+        for (std::size_t j(i + 1); j < 9; j++)
+            if (sqr_lengths[i] >= sqr_lengths[j])
+                std::swap (sqr_lengths[i], sqr_lengths[j]);
+
+    return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[8]);
 }
 
 double EdgeRatioMetric::checkPyramid (std::vector<const MathLib::Point3d*> const &pnts) const
 {
-	double sqr_lengths[8] = {MathLib::sqrDist (*pnts[0],*pnts[1]),
-		                 MathLib::sqrDist (*pnts[1],*pnts[2]),
-		                 MathLib::sqrDist (*pnts[2],*pnts[3]),
-		                 MathLib::sqrDist (*pnts[3],*pnts[0]),
-		                 MathLib::sqrDist (*pnts[0],*pnts[4]),
-		                 MathLib::sqrDist (*pnts[1],*pnts[4]),
-		                 MathLib::sqrDist (*pnts[2],*pnts[4]),
-		                 MathLib::sqrDist (*pnts[3],*pnts[4])};
-
-	// sort lengths - since this is a very small array we use bubble sort
-	for (std::size_t i(0); i < 8; i++)
-		for (std::size_t j(i + 1); j < 8; j++)
-			if (sqr_lengths[i] >= sqr_lengths[j])
-				std::swap (sqr_lengths[i], sqr_lengths[j]);
-
-	return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[7]);
+    double sqr_lengths[8] = {MathLib::sqrDist (*pnts[0],*pnts[1]),
+                         MathLib::sqrDist (*pnts[1],*pnts[2]),
+                         MathLib::sqrDist (*pnts[2],*pnts[3]),
+                         MathLib::sqrDist (*pnts[3],*pnts[0]),
+                         MathLib::sqrDist (*pnts[0],*pnts[4]),
+                         MathLib::sqrDist (*pnts[1],*pnts[4]),
+                         MathLib::sqrDist (*pnts[2],*pnts[4]),
+                         MathLib::sqrDist (*pnts[3],*pnts[4])};
+
+    // sort lengths - since this is a very small array we use bubble sort
+    for (std::size_t i(0); i < 8; i++)
+        for (std::size_t j(i + 1); j < 8; j++)
+            if (sqr_lengths[i] >= sqr_lengths[j])
+                std::swap (sqr_lengths[i], sqr_lengths[j]);
+
+    return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[7]);
 }
 
 double EdgeRatioMetric::checkHexahedron (std::vector<const MathLib::Point3d*> const & pnts) const
 {
-	double sqr_lengths[12] = {MathLib::sqrDist (*pnts[0],*pnts[1]),
-		                  MathLib::sqrDist (*pnts[1],*pnts[2]),
-		                  MathLib::sqrDist (*pnts[2],*pnts[3]),
-		                  MathLib::sqrDist (*pnts[3],*pnts[0]),
-		                  MathLib::sqrDist (*pnts[4],*pnts[5]),
-		                  MathLib::sqrDist (*pnts[5],*pnts[6]),
-		                  MathLib::sqrDist (*pnts[6],*pnts[7]),
-		                  MathLib::sqrDist (*pnts[7],*pnts[4]),
-		                  MathLib::sqrDist (*pnts[0],*pnts[4]),
-		                  MathLib::sqrDist (*pnts[1],*pnts[5]),
-		                  MathLib::sqrDist (*pnts[2],*pnts[6]),
-		                  MathLib::sqrDist (*pnts[3],*pnts[7])};
-
-	// sort lengths - since this is a very small array we use bubble sort
-	for (std::size_t i(0); i < 12; i++)
-		for (std::size_t j(i + 1); j < 12; j++)
-			if (sqr_lengths[i] >= sqr_lengths[j])
-				std::swap (sqr_lengths[i], sqr_lengths[j]);
-
-	return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[11]);
+    double sqr_lengths[12] = {MathLib::sqrDist (*pnts[0],*pnts[1]),
+                          MathLib::sqrDist (*pnts[1],*pnts[2]),
+                          MathLib::sqrDist (*pnts[2],*pnts[3]),
+                          MathLib::sqrDist (*pnts[3],*pnts[0]),
+                          MathLib::sqrDist (*pnts[4],*pnts[5]),
+                          MathLib::sqrDist (*pnts[5],*pnts[6]),
+                          MathLib::sqrDist (*pnts[6],*pnts[7]),
+                          MathLib::sqrDist (*pnts[7],*pnts[4]),
+                          MathLib::sqrDist (*pnts[0],*pnts[4]),
+                          MathLib::sqrDist (*pnts[1],*pnts[5]),
+                          MathLib::sqrDist (*pnts[2],*pnts[6]),
+                          MathLib::sqrDist (*pnts[3],*pnts[7])};
+
+    // sort lengths - since this is a very small array we use bubble sort
+    for (std::size_t i(0); i < 12; i++)
+        for (std::size_t j(i + 1); j < 12; j++)
+            if (sqr_lengths[i] >= sqr_lengths[j])
+                std::swap (sqr_lengths[i], sqr_lengths[j]);
+
+    return sqrt(sqr_lengths[0]) / sqrt(sqr_lengths[11]);
 }
 } // end namespace MeshLib
diff --git a/MeshLib/MeshQuality/ElementErrorCode.h b/MeshLib/MeshQuality/ElementErrorCode.h
index 258df63039e..03cd1389914 100644
--- a/MeshLib/MeshQuality/ElementErrorCode.h
+++ b/MeshLib/MeshQuality/ElementErrorCode.h
@@ -22,41 +22,41 @@
 /// Possible error flags for mesh elements
 enum class ElementErrorFlag
 {
-	ZeroVolume,
-	NonCoplanar,
-	NonConvex,
-	NodeOrder,
-	//... add other error flags here
-	MaxValue // this needs to be last to set the bitset size correctly!
+    ZeroVolume,
+    NonCoplanar,
+    NonConvex,
+    NodeOrder,
+    //... add other error flags here
+    MaxValue // this needs to be last to set the bitset size correctly!
 };
 
 /// Collects error flags for mesh elements
 class ElementErrorCode : public std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>
 {
 public:
-	/// Get value for a specific flag
-	bool get(ElementErrorFlag e) const { return test(static_cast<std::size_t>(e)); }
-	/// Set a specific flag
-	void set(ElementErrorFlag e) { std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::set(static_cast<std::size_t>(e), true); }
-	/// Reset a specific flag
-	void reset(ElementErrorFlag e) { std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::set(static_cast<std::size_t>(e), false); }
+    /// Get value for a specific flag
+    bool get(ElementErrorFlag e) const { return test(static_cast<std::size_t>(e)); }
+    /// Set a specific flag
+    void set(ElementErrorFlag e) { std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::set(static_cast<std::size_t>(e), true); }
+    /// Reset a specific flag
+    void reset(ElementErrorFlag e) { std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::set(static_cast<std::size_t>(e), false); }
 
-	inline reference operator[](const ElementErrorFlag e) { return std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::operator[](static_cast<std::size_t>(e)); }
-	inline bool operator[](const ElementErrorFlag e) const { return std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::operator[](static_cast<std::size_t>(e)); }
+    inline reference operator[](const ElementErrorFlag e) { return std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::operator[](static_cast<std::size_t>(e)); }
+    inline bool operator[](const ElementErrorFlag e) const { return std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)>::operator[](static_cast<std::size_t>(e)); }
 
-	/// Returns a string output for a specific error flag
-	static std::string toString(const ElementErrorFlag e)
-	{
-		if (e == ElementErrorFlag::ZeroVolume)
-			return "zero volume";
-		else if (e == ElementErrorFlag::NonCoplanar)
-			return "non coplanar nodes";
-		else if (e == ElementErrorFlag::NonConvex)
-			return "non-convex geometry";
-		else if (e == ElementErrorFlag::NodeOrder)
-			return "wrong node order";
-		return "nonspecified error";
-	}
+    /// Returns a string output for a specific error flag
+    static std::string toString(const ElementErrorFlag e)
+    {
+        if (e == ElementErrorFlag::ZeroVolume)
+            return "zero volume";
+        else if (e == ElementErrorFlag::NonCoplanar)
+            return "non coplanar nodes";
+        else if (e == ElementErrorFlag::NonConvex)
+            return "non-convex geometry";
+        else if (e == ElementErrorFlag::NodeOrder)
+            return "wrong node order";
+        return "nonspecified error";
+    }
 
 private:
 
diff --git a/MeshLib/MeshQuality/ElementQualityInterface.h b/MeshLib/MeshQuality/ElementQualityInterface.h
index bc5c1e2b49a..2cc8d85508e 100644
--- a/MeshLib/MeshQuality/ElementQualityInterface.h
+++ b/MeshLib/MeshQuality/ElementQualityInterface.h
@@ -36,76 +36,76 @@ namespace MeshLib
 class ElementQualityInterface
 {
 public:
-	/// Constructor
-	ElementQualityInterface(MeshLib::Mesh const& mesh, MeshQualityType t)
-	: _type(t), _mesh(mesh), _quality_tester(nullptr)
-	{
-		calculateElementQuality(_mesh, _type);
-	}
-
-	/// Destructor
-	~ElementQualityInterface()
-	{
-		delete _quality_tester;
-	}
-
-	/// Returns the vector containing a quality measure for each element.
-	std::vector<double> const getQualityVector() const
-	{
-		if (_quality_tester)
-			return _quality_tester->getElementQuality();
-
-		std::vector<double> empty_quality_vec(0);
-		return empty_quality_vec;
-	}
-
-	/// Returns a histogram of the quality vector seperated into the given number of bins.
-	/// If no number of bins is specified, one will be calculated based on the Sturges criterium.
-	BaseLib::Histogram<double> getHistogram(std::size_t n_bins = 0) const
-	{
-		if (_quality_tester)
-			return _quality_tester->getHistogram(static_cast<std::size_t>(n_bins));
-
-		std::vector<double> empty_quality_vec(0);
-		return empty_quality_vec;
-	}
-
-	/// Writes a histogram of the quality vector to a specified file.
-	int writeHistogram(std::string const& file_name, std::size_t n_bins = 0) const
-	{
-		if (_quality_tester == nullptr)
-			return 1;
-
-		BaseLib::Histogram<double> const histogram (_quality_tester->getHistogram(n_bins));
-		histogram.write(file_name, _mesh.getName(), MeshQualityType2String(_type));
-		return 0;
-	}
+    /// Constructor
+    ElementQualityInterface(MeshLib::Mesh const& mesh, MeshQualityType t)
+    : _type(t), _mesh(mesh), _quality_tester(nullptr)
+    {
+        calculateElementQuality(_mesh, _type);
+    }
+
+    /// Destructor
+    ~ElementQualityInterface()
+    {
+        delete _quality_tester;
+    }
+
+    /// Returns the vector containing a quality measure for each element.
+    std::vector<double> const getQualityVector() const
+    {
+        if (_quality_tester)
+            return _quality_tester->getElementQuality();
+
+        std::vector<double> empty_quality_vec(0);
+        return empty_quality_vec;
+    }
+
+    /// Returns a histogram of the quality vector seperated into the given number of bins.
+    /// If no number of bins is specified, one will be calculated based on the Sturges criterium.
+    BaseLib::Histogram<double> getHistogram(std::size_t n_bins = 0) const
+    {
+        if (_quality_tester)
+            return _quality_tester->getHistogram(static_cast<std::size_t>(n_bins));
+
+        std::vector<double> empty_quality_vec(0);
+        return empty_quality_vec;
+    }
+
+    /// Writes a histogram of the quality vector to a specified file.
+    int writeHistogram(std::string const& file_name, std::size_t n_bins = 0) const
+    {
+        if (_quality_tester == nullptr)
+            return 1;
+
+        BaseLib::Histogram<double> const histogram (_quality_tester->getHistogram(n_bins));
+        histogram.write(file_name, _mesh.getName(), MeshQualityType2String(_type));
+        return 0;
+    }
 
 private:
-	/// Calculates the quality of each mesh element based on the specified metric
-	void calculateElementQuality(MeshLib::Mesh const& mesh, MeshQualityType t)
-	{
-		if (t == MeshQualityType::EDGERATIO)
-			_quality_tester = new MeshLib::EdgeRatioMetric(mesh);
-		else if (t == MeshQualityType::ELEMENTSIZE)
-			_quality_tester = new MeshLib::ElementSizeMetric(mesh);
-		else if (t == MeshQualityType::SIZEDIFFERENCE)
-			_quality_tester = new MeshLib::SizeDifferenceMetric(mesh);
-		else if (t == MeshQualityType::EQUIANGLESKEW)
-			_quality_tester = new MeshLib::AngleSkewMetric(mesh);
-		else if (t == MeshQualityType::RADIUSEDGERATIO)
-			_quality_tester = new MeshLib::RadiusEdgeRatioMetric(mesh);
-		else
-		{
-			ERR("ElementQualityInterface::calculateElementQuality(): Unknown MeshQualityType.");
-			return;
-		}
-		_quality_tester->calculateQuality();
-	}
-
-	MeshQualityType const _type;
-	MeshLib::Mesh const& _mesh;
-	MeshLib::ElementQualityMetric* _quality_tester;
+    /// Calculates the quality of each mesh element based on the specified metric
+    void calculateElementQuality(MeshLib::Mesh const& mesh, MeshQualityType t)
+    {
+        if (t == MeshQualityType::EDGERATIO)
+            _quality_tester = new MeshLib::EdgeRatioMetric(mesh);
+        else if (t == MeshQualityType::ELEMENTSIZE)
+            _quality_tester = new MeshLib::ElementSizeMetric(mesh);
+        else if (t == MeshQualityType::SIZEDIFFERENCE)
+            _quality_tester = new MeshLib::SizeDifferenceMetric(mesh);
+        else if (t == MeshQualityType::EQUIANGLESKEW)
+            _quality_tester = new MeshLib::AngleSkewMetric(mesh);
+        else if (t == MeshQualityType::RADIUSEDGERATIO)
+            _quality_tester = new MeshLib::RadiusEdgeRatioMetric(mesh);
+        else
+        {
+            ERR("ElementQualityInterface::calculateElementQuality(): Unknown MeshQualityType.");
+            return;
+        }
+        _quality_tester->calculateQuality();
+    }
+
+    MeshQualityType const _type;
+    MeshLib::Mesh const& _mesh;
+    MeshLib::ElementQualityMetric* _quality_tester;
 };
 
 }
diff --git a/MeshLib/MeshQuality/ElementQualityMetric.cpp b/MeshLib/MeshQuality/ElementQualityMetric.cpp
index 117004425dd..25f29dfcc76 100644
--- a/MeshLib/MeshQuality/ElementQualityMetric.cpp
+++ b/MeshLib/MeshQuality/ElementQualityMetric.cpp
@@ -23,43 +23,43 @@
 namespace MeshLib
 {
 ElementQualityMetric::ElementQualityMetric(Mesh const& mesh) :
-	_min (std::numeric_limits<double>::max()), _max (0), _mesh (mesh)
+    _min (std::numeric_limits<double>::max()), _max (0), _mesh (mesh)
 {
-	_element_quality_metric.resize (_mesh.getNElements(), -1.0);
+    _element_quality_metric.resize (_mesh.getNElements(), -1.0);
 }
 
 BaseLib::Histogram<double> ElementQualityMetric::getHistogram (std::size_t n_bins) const
 {
-	if (n_bins == 0)
-		n_bins = static_cast<std::size_t>(1 + 3.3 * log (static_cast<float>((_mesh.getNElements()))));
+    if (n_bins == 0)
+        n_bins = static_cast<std::size_t>(1 + 3.3 * log (static_cast<float>((_mesh.getNElements()))));
 
-	return BaseLib::Histogram<double>(getElementQuality(), n_bins, true);
+    return BaseLib::Histogram<double>(getElementQuality(), n_bins, true);
 }
 
 void ElementQualityMetric::errorMsg (Element const& elem, std::size_t idx) const
 {
-	ERR ("Error in MeshQualityChecker::check() - Calculated value of element is below double precision minimum.");
-	ERR ("Points of %s-Element %d: ", MeshElemType2String(elem.getGeomType()).c_str(), idx);
-	for (std::size_t i(0); i < elem.getNBaseNodes(); i++)
-	{
-		const double* coords = elem.getNode(i)->getCoords();
-		ERR ("\t Node %d: (%f, %f, %f)", i, coords[0], coords[1], coords[2]);
-	}
+    ERR ("Error in MeshQualityChecker::check() - Calculated value of element is below double precision minimum.");
+    ERR ("Points of %s-Element %d: ", MeshElemType2String(elem.getGeomType()).c_str(), idx);
+    for (std::size_t i(0); i < elem.getNBaseNodes(); i++)
+    {
+        const double* coords = elem.getNode(i)->getCoords();
+        ERR ("\t Node %d: (%f, %f, %f)", i, coords[0], coords[1], coords[2]);
+    }
 }
 
 std::vector<double> const& ElementQualityMetric::getElementQuality () const
 {
-	return _element_quality_metric;
+    return _element_quality_metric;
 }
 
 double ElementQualityMetric::getMinValue() const
 {
-	return _min;
+    return _min;
 }
 
 double ElementQualityMetric::getMaxValue() const
 {
-	return _max;
+    return _max;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshQuality/ElementQualityMetric.h b/MeshLib/MeshQuality/ElementQualityMetric.h
index 06d5cba46f8..3b451829396 100644
--- a/MeshLib/MeshQuality/ElementQualityMetric.h
+++ b/MeshLib/MeshQuality/ElementQualityMetric.h
@@ -33,33 +33,33 @@ namespace MeshLib
 class ElementQualityMetric
 {
 public:
-	ElementQualityMetric(Mesh const& mesh);
+    ElementQualityMetric(Mesh const& mesh);
 
-	virtual ~ElementQualityMetric () {}
+    virtual ~ElementQualityMetric () {}
 
-	/// Calculates the quality metric for each element of the mesh
-	virtual void calculateQuality () = 0;
+    /// Calculates the quality metric for each element of the mesh
+    virtual void calculateQuality () = 0;
 
-	/// Returns the result vector
-	std::vector<double> const& getElementQuality () const;
+    /// Returns the result vector
+    std::vector<double> const& getElementQuality () const;
 
-	/// Returns the minimum calculated value
-	double getMinValue() const;
+    /// Returns the minimum calculated value
+    double getMinValue() const;
 
-	/// Returns the maximum calculated value
-	double getMaxValue() const;
+    /// Returns the maximum calculated value
+    double getMaxValue() const;
 
-	/// Returns a histogram of the quality vector seperated into the given number of bins.
-	/// If no number of bins is specified, one will be calculated based on the Sturges criterium.
-	virtual BaseLib::Histogram<double> getHistogram (std::size_t n_bins = 0) const;
+    /// Returns a histogram of the quality vector seperated into the given number of bins.
+    /// If no number of bins is specified, one will be calculated based on the Sturges criterium.
+    virtual BaseLib::Histogram<double> getHistogram (std::size_t n_bins = 0) const;
 
 protected:
-	void errorMsg (Element const& elem, std::size_t idx) const;
+    void errorMsg (Element const& elem, std::size_t idx) const;
 
-	double _min;
-	double _max;
-	Mesh const& _mesh;
-	std::vector<double> _element_quality_metric;
+    double _min;
+    double _max;
+    Mesh const& _mesh;
+    std::vector<double> _element_quality_metric;
 };
 }
 
diff --git a/MeshLib/MeshQuality/ElementSizeMetric.cpp b/MeshLib/MeshQuality/ElementSizeMetric.cpp
index ecdd3af0b53..add56618f85 100644
--- a/MeshLib/MeshQuality/ElementSizeMetric.cpp
+++ b/MeshLib/MeshQuality/ElementSizeMetric.cpp
@@ -25,90 +25,90 @@ ElementSizeMetric::ElementSizeMetric(Mesh const& mesh)
 
 void ElementSizeMetric::calculateQuality()
 {
-	std::size_t error_count(0);
-	if (_mesh.getDimension() == 1)
-		error_count = calc1dQuality();
-	else if (_mesh.getDimension() == 2)
-		error_count = calc2dQuality();
-	else if (_mesh.getDimension() == 3)
-		error_count = calc3dQuality();
-
-	INFO ("ElementSizeMetric::calculateQuality() minimum: %f, max_volume: %f", _min, _max);
-	if (error_count > 0)
-		WARN ("Warning: %d elements with zero volume found.", error_count);
+    std::size_t error_count(0);
+    if (_mesh.getDimension() == 1)
+        error_count = calc1dQuality();
+    else if (_mesh.getDimension() == 2)
+        error_count = calc2dQuality();
+    else if (_mesh.getDimension() == 3)
+        error_count = calc3dQuality();
+
+    INFO ("ElementSizeMetric::calculateQuality() minimum: %f, max_volume: %f", _min, _max);
+    if (error_count > 0)
+        WARN ("Warning: %d elements with zero volume found.", error_count);
 }
 
 std::size_t ElementSizeMetric::calc1dQuality()
 {
-	const std::vector<MeshLib::Element*> &elements(_mesh.getElements());
-	const std::size_t nElems(elements.size());
-	std::size_t error_count(0);
-
-	for (std::size_t k(0); k < nElems; k++)
-	{
-		double area(std::numeric_limits<double>::max());
-		_element_quality_metric[k] = elements[k]->getContent();
-		if (_element_quality_metric[k] < sqrt(fabs(std::numeric_limits<double>::epsilon())))
-			error_count++;
-
-		// update _min and _max values
-		if (_min > area) _min = area;
-		if (_max < area) _max = area;
-	}
-	return error_count;
+    const std::vector<MeshLib::Element*> &elements(_mesh.getElements());
+    const std::size_t nElems(elements.size());
+    std::size_t error_count(0);
+
+    for (std::size_t k(0); k < nElems; k++)
+    {
+        double area(std::numeric_limits<double>::max());
+        _element_quality_metric[k] = elements[k]->getContent();
+        if (_element_quality_metric[k] < sqrt(fabs(std::numeric_limits<double>::epsilon())))
+            error_count++;
+
+        // update _min and _max values
+        if (_min > area) _min = area;
+        if (_max < area) _max = area;
+    }
+    return error_count;
 }
 
 std::size_t ElementSizeMetric::calc2dQuality()
 {
-	const std::vector<MeshLib::Element*> &elements(_mesh.getElements());
-	const std::size_t nElems(elements.size());
-	std::size_t error_count(0);
-
-	for (std::size_t k(0); k < nElems; k++)
-	{
-		Element const& elem (*elements[k]);
-
-		if (elem.getDimension() == 1)
-		{
-			_element_quality_metric[k] = 0.0;
-			continue;
-		}
-		double const area = elem.getContent();
-		if (area < sqrt(fabs(std::numeric_limits<double>::epsilon())))
-			error_count++;
-
-		// update _min and _max values
-		if (_min > area) _min = area;
-		if (_max < area) _max = area;
-		_element_quality_metric[k] = area;
-	}
-	return error_count;
+    const std::vector<MeshLib::Element*> &elements(_mesh.getElements());
+    const std::size_t nElems(elements.size());
+    std::size_t error_count(0);
+
+    for (std::size_t k(0); k < nElems; k++)
+    {
+        Element const& elem (*elements[k]);
+
+        if (elem.getDimension() == 1)
+        {
+            _element_quality_metric[k] = 0.0;
+            continue;
+        }
+        double const area = elem.getContent();
+        if (area < sqrt(fabs(std::numeric_limits<double>::epsilon())))
+            error_count++;
+
+        // update _min and _max values
+        if (_min > area) _min = area;
+        if (_max < area) _max = area;
+        _element_quality_metric[k] = area;
+    }
+    return error_count;
 }
 
 std::size_t ElementSizeMetric::calc3dQuality()
 {
-	const std::vector<MeshLib::Element*>& elements(_mesh.getElements());
-	const std::size_t nElems(elements.size());
-	std::size_t error_count(0);
-
-	for (std::size_t k(0); k < nElems; k++)
-	{
-		Element const& elem (*elements[k]);
-		if (elem.getDimension()<3)
-		{
-			_element_quality_metric[k] = 0.0;
+    const std::vector<MeshLib::Element*>& elements(_mesh.getElements());
+    const std::size_t nElems(elements.size());
+    std::size_t error_count(0);
+
+    for (std::size_t k(0); k < nElems; k++)
+    {
+        Element const& elem (*elements[k]);
+        if (elem.getDimension()<3)
+        {
+            _element_quality_metric[k] = 0.0;
             continue;
         }
 
         double const volume (elem.getContent());
         if (volume < sqrt(fabs(std::numeric_limits<double>::epsilon())))
-			error_count++;
+            error_count++;
 
-		if (_min > volume) _min = volume;
-		if (_max < volume) _max = volume;
-		_element_quality_metric[k] = volume;
-	}
-	return error_count;
+        if (_min > volume) _min = volume;
+        if (_max < volume) _max = volume;
+        _element_quality_metric[k] = volume;
+    }
+    return error_count;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshQuality/ElementSizeMetric.h b/MeshLib/MeshQuality/ElementSizeMetric.h
index e07e1854595..a8e27aada65 100644
--- a/MeshLib/MeshQuality/ElementSizeMetric.h
+++ b/MeshLib/MeshQuality/ElementSizeMetric.h
@@ -26,15 +26,15 @@ namespace MeshLib
 class ElementSizeMetric : public ElementQualityMetric
 {
 public:
-	ElementSizeMetric(Mesh const& mesh);
-	virtual ~ElementSizeMetric() {}
+    ElementSizeMetric(Mesh const& mesh);
+    virtual ~ElementSizeMetric() {}
 
-	virtual void calculateQuality ();
+    virtual void calculateQuality ();
 
 private:
-	std::size_t calc1dQuality();
-	std::size_t calc2dQuality();
-	std::size_t calc3dQuality();
+    std::size_t calc1dQuality();
+    std::size_t calc2dQuality();
+    std::size_t calc3dQuality();
 };
 }
 
diff --git a/MeshLib/MeshQuality/MeshValidation.cpp b/MeshLib/MeshQuality/MeshValidation.cpp
index e3e0fa5fdea..1b3837c7a49 100644
--- a/MeshLib/MeshQuality/MeshValidation.cpp
+++ b/MeshLib/MeshQuality/MeshValidation.cpp
@@ -31,140 +31,140 @@ namespace MeshLib {
 
 MeshValidation::MeshValidation(MeshLib::Mesh &mesh)
 {
-	INFO ("Mesh Quality Control:");
-	INFO ("%Looking for unused nodes...");
-	NodeSearch ns(mesh);
-	ns.searchUnused();
-	if (!ns.getSearchedNodeIDs().empty()) {
-		INFO ("%d unused mesh nodes found.", ns.getSearchedNodeIDs().size());
-	}
-	MeshRevision rev(mesh);
-	INFO ("Found %d potentially collapsable nodes.", rev.getNCollapsableNodes());
-
-	const std::vector<ElementErrorCode> codes (this->testElementGeometry(mesh));
-	std::array<std::string, static_cast<std::size_t>(ElementErrorFlag::MaxValue)> output_str (this->ElementErrorCodeOutput(codes));
-	for (std::size_t i = 0; i < output_str.size(); ++i)
-		INFO (output_str[i].c_str());
+    INFO ("Mesh Quality Control:");
+    INFO ("%Looking for unused nodes...");
+    NodeSearch ns(mesh);
+    ns.searchUnused();
+    if (!ns.getSearchedNodeIDs().empty()) {
+        INFO ("%d unused mesh nodes found.", ns.getSearchedNodeIDs().size());
+    }
+    MeshRevision rev(mesh);
+    INFO ("Found %d potentially collapsable nodes.", rev.getNCollapsableNodes());
+
+    const std::vector<ElementErrorCode> codes (this->testElementGeometry(mesh));
+    std::array<std::string, static_cast<std::size_t>(ElementErrorFlag::MaxValue)> output_str (this->ElementErrorCodeOutput(codes));
+    for (std::size_t i = 0; i < output_str.size(); ++i)
+        INFO (output_str[i].c_str());
 }
 
 std::vector<ElementErrorCode> MeshValidation::testElementGeometry(const MeshLib::Mesh &mesh, double min_volume)
 {
-	INFO ("Testing mesh element geometry:");
-	const std::size_t nErrorCodes (static_cast<std::size_t>(ElementErrorFlag::MaxValue));
-	unsigned error_count[nErrorCodes];
-	std::fill_n(error_count, 4, 0);
-	const std::size_t nElements (mesh.getNElements());
-	const std::vector<MeshLib::Element*> &elements (mesh.getElements());
-	std::vector<ElementErrorCode> error_code_vector;
-	error_code_vector.reserve(nElements);
-
-	for (std::size_t i=0; i<nElements; ++i)
-	{
-		const ElementErrorCode e = elements[i]->validate();
-		error_code_vector.push_back(e);
-		if (e.none())
-			continue;
-
-		// increment error statistics
-		const std::bitset< static_cast<std::size_t>(ElementErrorFlag::MaxValue) > flags (static_cast< std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)> >(e));
-		for (unsigned j=0; j<nErrorCodes; ++j)
-			error_count[j] += flags[j];
-	}
-
-	// if a larger volume threshold is given, evaluate elements again to add them even if they are formally okay
-	if (min_volume > std::numeric_limits<double>::epsilon())
-		for (std::size_t i=0; i<nElements; ++i)
-			if (elements[i]->getContent() < min_volume)
-				error_code_vector[i].set(ElementErrorFlag::ZeroVolume);
-
-	// output
-	const unsigned error_sum (static_cast<unsigned>(std::accumulate(error_count, error_count+nErrorCodes, 0.0)));
-	if (error_sum != 0)
-	{
-		ElementErrorFlag flags[nErrorCodes] = { ElementErrorFlag::ZeroVolume, ElementErrorFlag::NonCoplanar,
-											    ElementErrorFlag::NonConvex,  ElementErrorFlag::NodeOrder };
-		for (std::size_t i=0; i<nErrorCodes; ++i)
-			if (error_count[i])
-				INFO ("%d elements found with %s.", error_count[i], ElementErrorCode::toString(flags[i]).c_str());
-	}
-	else
-		INFO ("No errors found.");
-	return error_code_vector;
+    INFO ("Testing mesh element geometry:");
+    const std::size_t nErrorCodes (static_cast<std::size_t>(ElementErrorFlag::MaxValue));
+    unsigned error_count[nErrorCodes];
+    std::fill_n(error_count, 4, 0);
+    const std::size_t nElements (mesh.getNElements());
+    const std::vector<MeshLib::Element*> &elements (mesh.getElements());
+    std::vector<ElementErrorCode> error_code_vector;
+    error_code_vector.reserve(nElements);
+
+    for (std::size_t i=0; i<nElements; ++i)
+    {
+        const ElementErrorCode e = elements[i]->validate();
+        error_code_vector.push_back(e);
+        if (e.none())
+            continue;
+
+        // increment error statistics
+        const std::bitset< static_cast<std::size_t>(ElementErrorFlag::MaxValue) > flags (static_cast< std::bitset<static_cast<std::size_t>(ElementErrorFlag::MaxValue)> >(e));
+        for (unsigned j=0; j<nErrorCodes; ++j)
+            error_count[j] += flags[j];
+    }
+
+    // if a larger volume threshold is given, evaluate elements again to add them even if they are formally okay
+    if (min_volume > std::numeric_limits<double>::epsilon())
+        for (std::size_t i=0; i<nElements; ++i)
+            if (elements[i]->getContent() < min_volume)
+                error_code_vector[i].set(ElementErrorFlag::ZeroVolume);
+
+    // output
+    const unsigned error_sum (static_cast<unsigned>(std::accumulate(error_count, error_count+nErrorCodes, 0.0)));
+    if (error_sum != 0)
+    {
+        ElementErrorFlag flags[nErrorCodes] = { ElementErrorFlag::ZeroVolume, ElementErrorFlag::NonCoplanar,
+                                                ElementErrorFlag::NonConvex,  ElementErrorFlag::NodeOrder };
+        for (std::size_t i=0; i<nErrorCodes; ++i)
+            if (error_count[i])
+                INFO ("%d elements found with %s.", error_count[i], ElementErrorCode::toString(flags[i]).c_str());
+    }
+    else
+        INFO ("No errors found.");
+    return error_code_vector;
 }
 
 std::array<std::string, static_cast<std::size_t>(ElementErrorFlag::MaxValue)>
 MeshValidation::ElementErrorCodeOutput(const std::vector<ElementErrorCode> &error_codes)
 {
-	const std::size_t nErrorFlags (static_cast<std::size_t>(ElementErrorFlag::MaxValue));
-	ElementErrorFlag flags[nErrorFlags] = { ElementErrorFlag::ZeroVolume, ElementErrorFlag::NonCoplanar,
-		                                    ElementErrorFlag::NonConvex,  ElementErrorFlag::NodeOrder };
-	const std::size_t nElements (error_codes.size());
-	std::array<std::string, static_cast<std::size_t>(ElementErrorFlag::MaxValue)> output;
-
-	for (std::size_t i=0; i<nErrorFlags; ++i)
-	{
-		unsigned count(0);
-		std::string elementIdStr("");
-
-		for (std::size_t j=0; j<nElements; ++j)
-		{
-			if (error_codes[j][flags[i]])
-			{
-				elementIdStr += (std::to_string(j) + ", ");
-				count++;
-			}
-
-		}
-		const std::string nErrorsStr = (count) ? std::to_string(count) : "No";
-		output[i] = (nErrorsStr + " elements found with " + ElementErrorCode::toString(flags[i]) + ".\n");
-
-		if (count)
-			output[i] += ("ElementIDs: " + elementIdStr + "\n");
-	}
-	return output;
+    const std::size_t nErrorFlags (static_cast<std::size_t>(ElementErrorFlag::MaxValue));
+    ElementErrorFlag flags[nErrorFlags] = { ElementErrorFlag::ZeroVolume, ElementErrorFlag::NonCoplanar,
+                                            ElementErrorFlag::NonConvex,  ElementErrorFlag::NodeOrder };
+    const std::size_t nElements (error_codes.size());
+    std::array<std::string, static_cast<std::size_t>(ElementErrorFlag::MaxValue)> output;
+
+    for (std::size_t i=0; i<nErrorFlags; ++i)
+    {
+        unsigned count(0);
+        std::string elementIdStr("");
+
+        for (std::size_t j=0; j<nElements; ++j)
+        {
+            if (error_codes[j][flags[i]])
+            {
+                elementIdStr += (std::to_string(j) + ", ");
+                count++;
+            }
+
+        }
+        const std::string nErrorsStr = (count) ? std::to_string(count) : "No";
+        output[i] = (nErrorsStr + " elements found with " + ElementErrorCode::toString(flags[i]) + ".\n");
+
+        if (count)
+            output[i] += ("ElementIDs: " + elementIdStr + "\n");
+    }
+    return output;
 }
 
 unsigned MeshValidation::detectHoles(MeshLib::Mesh const& mesh)
 {
-	if (mesh.getDimension() == 1)
-		return 0;
-
-	MeshLib::Mesh* boundary_mesh (MeshSurfaceExtraction::getMeshBoundary(mesh));
-	std::vector<MeshLib::Element*> const& elements (boundary_mesh->getElements());
-
-	std::vector<unsigned> sfc_idx (elements.size(), std::numeric_limits<unsigned>::max());
-	unsigned current_surface_id (0);
-	std::vector<unsigned>::const_iterator it = sfc_idx.cbegin();
-
-	while (it != sfc_idx.cend())
-	{
-		std::size_t const idx = static_cast<std::size_t>(std::distance(sfc_idx.cbegin(), it));
-		trackSurface(elements[idx], sfc_idx, current_surface_id++);
-		it = std::find(sfc_idx.cbegin(), sfc_idx.cend(), std::numeric_limits<unsigned>::max());
-	}
-	delete boundary_mesh;
-
-	// Subtract "1" from the number of surfaces found to get the number of holes.
-	return (--current_surface_id);
+    if (mesh.getDimension() == 1)
+        return 0;
+
+    MeshLib::Mesh* boundary_mesh (MeshSurfaceExtraction::getMeshBoundary(mesh));
+    std::vector<MeshLib::Element*> const& elements (boundary_mesh->getElements());
+
+    std::vector<unsigned> sfc_idx (elements.size(), std::numeric_limits<unsigned>::max());
+    unsigned current_surface_id (0);
+    std::vector<unsigned>::const_iterator it = sfc_idx.cbegin();
+
+    while (it != sfc_idx.cend())
+    {
+        std::size_t const idx = static_cast<std::size_t>(std::distance(sfc_idx.cbegin(), it));
+        trackSurface(elements[idx], sfc_idx, current_surface_id++);
+        it = std::find(sfc_idx.cbegin(), sfc_idx.cend(), std::numeric_limits<unsigned>::max());
+    }
+    delete boundary_mesh;
+
+    // Subtract "1" from the number of surfaces found to get the number of holes.
+    return (--current_surface_id);
 }
 
 void MeshValidation::trackSurface(MeshLib::Element const* element, std::vector<unsigned> &sfc_idx, unsigned const current_index)
 {
-	std::stack<MeshLib::Element const*> elem_stack;
-	elem_stack.push(element);
-	while (!elem_stack.empty())
-	{
-		MeshLib::Element const*const elem = elem_stack.top();
-		elem_stack.pop();
-		sfc_idx[elem->getID()] = current_index;
-		std::size_t const n_neighbors (elem->getNNeighbors());
-		for (std::size_t i=0; i<n_neighbors; ++i)
-		{
-			MeshLib::Element const* neighbor (elem->getNeighbor(i));
-			if ( neighbor != nullptr && sfc_idx[neighbor->getID()] == std::numeric_limits<unsigned>::max())
-				elem_stack.push(neighbor);
-		}
-	}
+    std::stack<MeshLib::Element const*> elem_stack;
+    elem_stack.push(element);
+    while (!elem_stack.empty())
+    {
+        MeshLib::Element const*const elem = elem_stack.top();
+        elem_stack.pop();
+        sfc_idx[elem->getID()] = current_index;
+        std::size_t const n_neighbors (elem->getNNeighbors());
+        for (std::size_t i=0; i<n_neighbors; ++i)
+        {
+            MeshLib::Element const* neighbor (elem->getNeighbor(i));
+            if ( neighbor != nullptr && sfc_idx[neighbor->getID()] == std::numeric_limits<unsigned>::max())
+                elem_stack.push(neighbor);
+        }
+    }
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshQuality/MeshValidation.h b/MeshLib/MeshQuality/MeshValidation.h
index 8ecf072c5f3..fdb616e8768 100644
--- a/MeshLib/MeshQuality/MeshValidation.h
+++ b/MeshLib/MeshQuality/MeshValidation.h
@@ -22,8 +22,8 @@
 #include "ElementErrorCode.h"
 
 namespace MeshLib {
-	class Mesh;
-	class Element;
+    class Mesh;
+    class Element;
 
 /**
  * \brief A collection of methods for testing mesh quality and correctness
@@ -31,48 +31,48 @@ namespace MeshLib {
 class MeshValidation
 {
 public:
-	/// Constructor
-	/// \warning This might change the mesh when removing unused mesh nodes.
-	MeshValidation(MeshLib::Mesh &mesh);
-	~MeshValidation() {}
+    /// Constructor
+    /// \warning This might change the mesh when removing unused mesh nodes.
+    MeshValidation(MeshLib::Mesh &mesh);
+    ~MeshValidation() {}
 
-	/**
-	 * Tests if elements are geometrically correct.
-	 * @param mesh The mesh that is tested
-	 * @param min_volume The minimum required volume for a mesh element, so it is NOT considered faulty
-	 * @return Vector of error codes for each mesh element
-	 */
-	static std::vector<ElementErrorCode> testElementGeometry(
-		const MeshLib::Mesh &mesh,
-		double min_volume = std::numeric_limits<double>::epsilon());
+    /**
+     * Tests if elements are geometrically correct.
+     * @param mesh The mesh that is tested
+     * @param min_volume The minimum required volume for a mesh element, so it is NOT considered faulty
+     * @return Vector of error codes for each mesh element
+     */
+    static std::vector<ElementErrorCode> testElementGeometry(
+        const MeshLib::Mesh &mesh,
+        double min_volume = std::numeric_limits<double>::epsilon());
 
-	/**
-	 * Detailed output which ElementID is associated with which error(s)
-	 * @return String containing the report
-	 */
-	static std::array<std::string, static_cast<std::size_t>(ElementErrorFlag::MaxValue)>
-		ElementErrorCodeOutput(const std::vector<ElementErrorCode> &error_codes);
+    /**
+     * Detailed output which ElementID is associated with which error(s)
+     * @return String containing the report
+     */
+    static std::array<std::string, static_cast<std::size_t>(ElementErrorFlag::MaxValue)>
+        ElementErrorCodeOutput(const std::vector<ElementErrorCode> &error_codes);
 
-	/**
-	 * Tests if holes are located within the mesh.
-	 * In this context, a hole is a boundary of an element with no neighbor that cannot be reached from
-	 * the actual boundary of the mesh. Examples include a missing triangle in a 2D mesh or a missing
-	 * Tetrahedron in a 3D mesh. The method does not work for 1d-meshes.
-	 * Note, that this method does not work when complex 3D structures are build from 2D mesh elements,
-	 * e.g. using the LayeredVolume-class, where more than two 2D elements may share an edge.
-	 * @param mesh The mesh that is tested
-	 * @return The number of holes that have been found.
-	 */
-	static unsigned detectHoles(MeshLib::Mesh const& mesh);
+    /**
+     * Tests if holes are located within the mesh.
+     * In this context, a hole is a boundary of an element with no neighbor that cannot be reached from
+     * the actual boundary of the mesh. Examples include a missing triangle in a 2D mesh or a missing
+     * Tetrahedron in a 3D mesh. The method does not work for 1d-meshes.
+     * Note, that this method does not work when complex 3D structures are build from 2D mesh elements,
+     * e.g. using the LayeredVolume-class, where more than two 2D elements may share an edge.
+     * @param mesh The mesh that is tested
+     * @return The number of holes that have been found.
+     */
+    static unsigned detectHoles(MeshLib::Mesh const& mesh);
 
 private:
-	/** Finds all surface elements that can be reached from element. All elements that are found in this
-	 * way are marked in the global sfc_idx vector using the current_index.
-	 * @param element The mesh element from which the search is started
-	 * @param sfc_idx The global index vector notifying to which surface elements belong
-	 * @param current_index The index that all elements reachable from element will be assigned in sfc_idx
-	 */
-	static void trackSurface(MeshLib::Element const*const element, std::vector<unsigned> &sfc_idx, unsigned const current_index);
+    /** Finds all surface elements that can be reached from element. All elements that are found in this
+     * way are marked in the global sfc_idx vector using the current_index.
+     * @param element The mesh element from which the search is started
+     * @param sfc_idx The global index vector notifying to which surface elements belong
+     * @param current_index The index that all elements reachable from element will be assigned in sfc_idx
+     */
+    static void trackSurface(MeshLib::Element const*const element, std::vector<unsigned> &sfc_idx, unsigned const current_index);
 
 };
 
diff --git a/MeshLib/MeshQuality/SizeDifferenceMetric.cpp b/MeshLib/MeshQuality/SizeDifferenceMetric.cpp
index 20909cbe8a3..0a0fa9c0fbe 100644
--- a/MeshLib/MeshQuality/SizeDifferenceMetric.cpp
+++ b/MeshLib/MeshQuality/SizeDifferenceMetric.cpp
@@ -25,35 +25,35 @@ ElementQualityMetric(mesh)
 
 void SizeDifferenceMetric::calculateQuality()
 {
-	std::vector<MeshLib::Element*> const& elements(_mesh.getElements());
-	std::size_t const nElements (_mesh.getNElements());
-	std::size_t const mesh_dim (_mesh.getDimension());
-
-	for (std::size_t k=0; k < nElements; ++k)
-	{
-		Element const& elem (*elements[k]);
-		if (elem.getDimension() < mesh_dim)
-		{
-			_element_quality_metric[k] = 0;
-			continue;
-		}
-
-		std::size_t const n_neighbors (elem.getNNeighbors());
-		double const vol_a (elem.getContent());
-
-		double worst_ratio(1.0);
-		for (std::size_t i=0; i < n_neighbors; ++i)
-		{
-			MeshLib::Element const*const neighbor (elem.getNeighbor(i));
-			if (neighbor == nullptr)
-				continue;
-			double const vol_b (neighbor->getContent());
-			double const ratio = (vol_a > vol_b) ? vol_b / vol_a : vol_a / vol_b;
-			if (ratio < worst_ratio)
-				worst_ratio = ratio;
-		}
-		_element_quality_metric[k] = worst_ratio;
-	}
+    std::vector<MeshLib::Element*> const& elements(_mesh.getElements());
+    std::size_t const nElements (_mesh.getNElements());
+    std::size_t const mesh_dim (_mesh.getDimension());
+
+    for (std::size_t k=0; k < nElements; ++k)
+    {
+        Element const& elem (*elements[k]);
+        if (elem.getDimension() < mesh_dim)
+        {
+            _element_quality_metric[k] = 0;
+            continue;
+        }
+
+        std::size_t const n_neighbors (elem.getNNeighbors());
+        double const vol_a (elem.getContent());
+
+        double worst_ratio(1.0);
+        for (std::size_t i=0; i < n_neighbors; ++i)
+        {
+            MeshLib::Element const*const neighbor (elem.getNeighbor(i));
+            if (neighbor == nullptr)
+                continue;
+            double const vol_b (neighbor->getContent());
+            double const ratio = (vol_a > vol_b) ? vol_b / vol_a : vol_a / vol_b;
+            if (ratio < worst_ratio)
+                worst_ratio = ratio;
+        }
+        _element_quality_metric[k] = worst_ratio;
+    }
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshQuality/SizeDifferenceMetric.h b/MeshLib/MeshQuality/SizeDifferenceMetric.h
index e4d47350ee1..d93f8d472d5 100644
--- a/MeshLib/MeshQuality/SizeDifferenceMetric.h
+++ b/MeshLib/MeshQuality/SizeDifferenceMetric.h
@@ -27,10 +27,10 @@ namespace MeshLib
 class SizeDifferenceMetric : public ElementQualityMetric
 {
 public:
-	SizeDifferenceMetric(Mesh const& mesh);
-	virtual ~SizeDifferenceMetric() {}
+    SizeDifferenceMetric(Mesh const& mesh);
+    virtual ~SizeDifferenceMetric() {}
 
-	virtual void calculateQuality ();
+    virtual void calculateQuality ();
 };
 }
 
diff --git a/MeshLib/MeshSearch/ElementSearch.cpp b/MeshLib/MeshSearch/ElementSearch.cpp
index f8d30092812..79d0c9e4a12 100644
--- a/MeshLib/MeshSearch/ElementSearch.cpp
+++ b/MeshLib/MeshSearch/ElementSearch.cpp
@@ -17,80 +17,80 @@
 namespace MeshLib {
 
 ElementSearch::ElementSearch(const MeshLib::Mesh &mesh)
-	: _mesh(mesh)
+    : _mesh(mesh)
 {
 }
 
 template <typename Container, typename Predicate>
 std::vector<std::size_t> filter(Container const& container, Predicate const& p)
 {
-	std::vector<std::size_t> matchedIDs;
-	std::size_t i = 0;
-	for (auto value : container) {
-		if (p(value))
-			matchedIDs.push_back(i);
-		i++;
-	}
-	return matchedIDs;
+    std::vector<std::size_t> matchedIDs;
+    std::size_t i = 0;
+    for (auto value : container) {
+        if (p(value))
+            matchedIDs.push_back(i);
+        i++;
+    }
+    return matchedIDs;
 }
 
 std::size_t ElementSearch::searchByElementType(MeshElemType eleType)
 {
-	auto matchedIDs = filter(_mesh.getElements(),
-		[&](MeshLib::Element* e) { return e->getGeomType()==eleType; });
+    auto matchedIDs = filter(_mesh.getElements(),
+        [&](MeshLib::Element* e) { return e->getGeomType()==eleType; });
 
-	this->updateUnion(matchedIDs);
-	return matchedIDs.size();
+    this->updateUnion(matchedIDs);
+    return matchedIDs.size();
 }
 
 std::size_t ElementSearch::searchByContent(double eps)
 {
-	auto matchedIDs = filter(_mesh.getElements(),
-		[&eps](MeshLib::Element* e) { return e->getContent() < eps; });
+    auto matchedIDs = filter(_mesh.getElements(),
+        [&eps](MeshLib::Element* e) { return e->getContent() < eps; });
 
-	this->updateUnion(matchedIDs);
-	return matchedIDs.size();
+    this->updateUnion(matchedIDs);
+    return matchedIDs.size();
 }
 
 std::size_t ElementSearch::searchByBoundingBox(
-	GeoLib::AABB const& aabb)
+    GeoLib::AABB const& aabb)
 {
-	auto matchedIDs = filter(_mesh.getElements(),
-		[&aabb](MeshLib::Element* e) {
-			std::size_t const nElemNodes (e->getNBaseNodes());
-			for (std::size_t n=0; n < nElemNodes; ++n)
-				if (aabb.containsPoint(*e->getNode(n)))
-					return true;	// any node of element is in aabb.
-			return false;	// no nodes of element are in aabb.
-		});
-
-	this->updateUnion(matchedIDs);
-	return matchedIDs.size();
+    auto matchedIDs = filter(_mesh.getElements(),
+        [&aabb](MeshLib::Element* e) {
+            std::size_t const nElemNodes (e->getNBaseNodes());
+            for (std::size_t n=0; n < nElemNodes; ++n)
+                if (aabb.containsPoint(*e->getNode(n)))
+                    return true;    // any node of element is in aabb.
+            return false;    // no nodes of element are in aabb.
+        });
+
+    this->updateUnion(matchedIDs);
+    return matchedIDs.size();
 }
 
 std::size_t ElementSearch::searchByNodeIDs(const std::vector<std::size_t> &nodes)
 {
-	std::vector<std::size_t> connected_elements;
-	for (std::size_t node_id : nodes)
-	{
-		for (auto* e : _mesh.getNode(node_id)->getElements()) {
-			connected_elements.push_back(e->getID());
-		}
-	}
-	std::sort(connected_elements.begin(), connected_elements.end());
-	auto it = std::unique(connected_elements.begin(), connected_elements.end());
-	connected_elements.resize(std::distance(connected_elements.begin(),it));
-
-	this->updateUnion(connected_elements);
-	return connected_elements.size();
+    std::vector<std::size_t> connected_elements;
+    for (std::size_t node_id : nodes)
+    {
+        for (auto* e : _mesh.getNode(node_id)->getElements()) {
+            connected_elements.push_back(e->getID());
+        }
+    }
+    std::sort(connected_elements.begin(), connected_elements.end());
+    auto it = std::unique(connected_elements.begin(), connected_elements.end());
+    connected_elements.resize(std::distance(connected_elements.begin(),it));
+
+    this->updateUnion(connected_elements);
+    return connected_elements.size();
 }
 
 void ElementSearch::updateUnion(const std::vector<std::size_t> &vec)
 {
-	std::vector<std::size_t> vec_temp(vec.size() + _marked_elements.size());
-	auto it = std::set_union(vec.begin(), vec.end(), _marked_elements.begin(), _marked_elements.end(), vec_temp.begin());
-	vec_temp.resize(it - vec_temp.begin());
-	_marked_elements.assign(vec_temp.begin(), vec_temp.end());
+    std::vector<std::size_t> vec_temp(vec.size() + _marked_elements.size());
+    auto it = std::set_union(vec.begin(), vec.end(), _marked_elements.begin(), _marked_elements.end(), vec_temp.begin());
+    vec_temp.resize(it - vec_temp.begin());
+    _marked_elements.assign(vec_temp.begin(), vec_temp.end());
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshSearch/ElementSearch.h b/MeshLib/MeshSearch/ElementSearch.h
index 98e38e60cfd..c68115ac80a 100644
--- a/MeshLib/MeshSearch/ElementSearch.h
+++ b/MeshLib/MeshSearch/ElementSearch.h
@@ -27,72 +27,72 @@ class Element;
 class ElementSearch final
 {
 public:
-	explicit ElementSearch(const MeshLib::Mesh &mesh);
-
-	/// return marked elements
-	const std::vector<std::size_t>& getSearchedElementIDs() const { return _marked_elements; }
-
-	/// @tparam PROPERTY_TYPE integral type of the property
-	/// Different properties can be assigned to the elements of the mesh. These
-	/// properties can be accessed by the name of the property. The method marks
-	/// all elements of the mesh for the property \c property_name with the
-	/// given property value \c property_value.
-	/// @param property_value the value of the property the elements have to
-	/// have to be marked
-	/// @param property_name the name of the property the searching/marking is
-	/// based on
-	/// @return The number of marked elements will be returned. The concrete
-	/// element ids can be requested by getSearchedElementIDs().
-	template <typename PROPERTY_TYPE>
-	std::size_t searchByPropertyValue(
-	    PROPERTY_TYPE const property_value,
-	    std::string const& property_name = "MaterialIDs")
-	{
-		boost::optional<MeshLib::PropertyVector<PROPERTY_TYPE> const&> opt_pv(
-		    _mesh.getProperties().getPropertyVector<PROPERTY_TYPE>(
-		        property_name));
-		if (!opt_pv) {
-			WARN("Property \"%s\" not found in mesh.", property_name.c_str());
-			return 0;
-		}
-
-		MeshLib::PropertyVector<PROPERTY_TYPE> const& pv(opt_pv.get());
-		if (pv.getMeshItemType() != MeshLib::MeshItemType::Cell) {
-			WARN("The property \"%s\" is not assigned to mesh elements.",
-			     property_name.c_str());
-			return 0;
-		}
-
-		std::vector<std::size_t> matchedIDs;
-		for (std::size_t i(0); i < pv.getNumberOfTuples(); ++i) {
-			if (pv[i] == property_value)
-				matchedIDs.push_back(i);
-		}
-
-		updateUnion(matchedIDs);
-		return matchedIDs.size();
-	}
-
-	/// Marks all elements of the given element type.
-	std::size_t searchByElementType(MeshElemType eleType);
-
-	/// Marks all elements with a volume smaller than eps.
-	std::size_t searchByContent(double eps = std::numeric_limits<double>::epsilon());
-
-	/// Marks all elements with at least one node outside the bounding box spanned by x1 and x2;
-	std::size_t searchByBoundingBox(GeoLib::AABB const& aabb);
-
-	/// Marks all elements connecting to any of the given nodes
-	std::size_t searchByNodeIDs(const std::vector<std::size_t> &node_ids);
+    explicit ElementSearch(const MeshLib::Mesh &mesh);
+
+    /// return marked elements
+    const std::vector<std::size_t>& getSearchedElementIDs() const { return _marked_elements; }
+
+    /// @tparam PROPERTY_TYPE integral type of the property
+    /// Different properties can be assigned to the elements of the mesh. These
+    /// properties can be accessed by the name of the property. The method marks
+    /// all elements of the mesh for the property \c property_name with the
+    /// given property value \c property_value.
+    /// @param property_value the value of the property the elements have to
+    /// have to be marked
+    /// @param property_name the name of the property the searching/marking is
+    /// based on
+    /// @return The number of marked elements will be returned. The concrete
+    /// element ids can be requested by getSearchedElementIDs().
+    template <typename PROPERTY_TYPE>
+    std::size_t searchByPropertyValue(
+        PROPERTY_TYPE const property_value,
+        std::string const& property_name = "MaterialIDs")
+    {
+        boost::optional<MeshLib::PropertyVector<PROPERTY_TYPE> const&> opt_pv(
+            _mesh.getProperties().getPropertyVector<PROPERTY_TYPE>(
+                property_name));
+        if (!opt_pv) {
+            WARN("Property \"%s\" not found in mesh.", property_name.c_str());
+            return 0;
+        }
+
+        MeshLib::PropertyVector<PROPERTY_TYPE> const& pv(opt_pv.get());
+        if (pv.getMeshItemType() != MeshLib::MeshItemType::Cell) {
+            WARN("The property \"%s\" is not assigned to mesh elements.",
+                 property_name.c_str());
+            return 0;
+        }
+
+        std::vector<std::size_t> matchedIDs;
+        for (std::size_t i(0); i < pv.getNumberOfTuples(); ++i) {
+            if (pv[i] == property_value)
+                matchedIDs.push_back(i);
+        }
+
+        updateUnion(matchedIDs);
+        return matchedIDs.size();
+    }
+
+    /// Marks all elements of the given element type.
+    std::size_t searchByElementType(MeshElemType eleType);
+
+    /// Marks all elements with a volume smaller than eps.
+    std::size_t searchByContent(double eps = std::numeric_limits<double>::epsilon());
+
+    /// Marks all elements with at least one node outside the bounding box spanned by x1 and x2;
+    std::size_t searchByBoundingBox(GeoLib::AABB const& aabb);
+
+    /// Marks all elements connecting to any of the given nodes
+    std::size_t searchByNodeIDs(const std::vector<std::size_t> &node_ids);
 
 private:
-	/// Updates the vector of marked elements with values from vec.
-	void updateUnion(const std::vector<std::size_t> &vec);
+    /// Updates the vector of marked elements with values from vec.
+    void updateUnion(const std::vector<std::size_t> &vec);
 
-	/// The mesh from which elements should be removed.
-	const MeshLib::Mesh &_mesh;
-	/// The vector of element indices that should be removed.
-	std::vector<std::size_t> _marked_elements;
+    /// The mesh from which elements should be removed.
+    const MeshLib::Mesh &_mesh;
+    /// The vector of element indices that should be removed.
+    std::vector<std::size_t> _marked_elements;
 };
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshSearch/MeshElementGrid.cpp b/MeshLib/MeshSearch/MeshElementGrid.cpp
index 55297d6cd33..87fc85d98b7 100644
--- a/MeshLib/MeshSearch/MeshElementGrid.cpp
+++ b/MeshLib/MeshSearch/MeshElementGrid.cpp
@@ -25,155 +25,155 @@
 namespace MeshLib {
 
 MeshElementGrid::MeshElementGrid(MeshLib::Mesh const& sfc_mesh) :
-	_aabb{sfc_mesh.getNodes().cbegin(), sfc_mesh.getNodes().cend()},
-	_n_steps({{1,1,1}})
+    _aabb{sfc_mesh.getNodes().cbegin(), sfc_mesh.getNodes().cend()},
+    _n_steps({{1,1,1}})
 {
-	auto getDimensions =
-	    [](MathLib::Point3d const& min, MathLib::Point3d const& max)
-	{
-		std::bitset<3> dim;  // all bits are set to zero.
-		for (std::size_t k(0); k < 3; ++k) {
-			double const tolerance(
-				std::nexttoward(max[k],std::numeric_limits<double>::max())-max[k]);
-			if (std::abs(max[k]-min[k]) > tolerance)
-				dim[k] = true;
-		}
-		return dim;
-	};
-
-	MathLib::Point3d const& min_pnt(_aabb.getMinPoint());
-	MathLib::Point3d const& max_pnt(_aabb.getMaxPoint());
-	auto const dim = getDimensions(min_pnt, max_pnt);
-
-	std::array<double, 3> delta{{ max_pnt[0] - min_pnt[0],
-		max_pnt[1] - min_pnt[1], max_pnt[2] - min_pnt[2] }};
-
-	const std::size_t n_eles(sfc_mesh.getNElements());
-	const std::size_t n_eles_per_cell(100);
-
-	// *** condition: n_eles / n_cells < n_eles_per_cell
-	//                where n_cells = _n_steps[0] * _n_steps[1] * _n_steps[2]
-	// *** with _n_steps[0] = ceil(pow(n_eles*delta[0]*delta[0]/(n_eles_per_cell*delta[1]*delta[2]), 1/3.)));
-	//          _n_steps[1] = _n_steps[0] * delta[1]/delta[0],
-	//          _n_steps[2] = _n_steps[0] * delta[2]/delta[0]
-	auto sc_ceil = [](double v){
-		return static_cast<std::size_t>(std::ceil(v));
-	};
-
-	switch (dim.count()) {
-	case 3: // 3d case
-		_n_steps[0] = sc_ceil(std::cbrt(
-			n_eles*delta[0]*delta[0]/(n_eles_per_cell*delta[1]*delta[2])));
-		_n_steps[1] = sc_ceil(_n_steps[0] * std::min(delta[1] / delta[0], 100.0));
-		_n_steps[2] = sc_ceil(_n_steps[0] * std::min(delta[2] / delta[0], 100.0));
-		break;
-	case 2: // 2d cases
-		if (dim[0] && dim[2]) { // 2d case: xz plane, y = const
-			_n_steps[0] = sc_ceil(std::sqrt(n_eles*delta[0]/(n_eles_per_cell*delta[2])));
-			_n_steps[2] = sc_ceil(_n_steps[0]*delta[2]/delta[0]);
-		}
-		else if (dim[0] && dim[1]) { // 2d case: xy plane, z = const
-			_n_steps[0] = sc_ceil(std::sqrt(n_eles*delta[0]/(n_eles_per_cell*delta[1])));
-			_n_steps[1] = sc_ceil(_n_steps[0] * delta[1]/delta[0]);
-		}
-		else if (dim[1] && dim[2]) { // 2d case: yz plane, x = const
-			_n_steps[1] = sc_ceil(std::sqrt(n_eles*delta[1]/(n_eles_per_cell*delta[2])));
-			_n_steps[2] = sc_ceil(n_eles * delta[2] / (n_eles_per_cell*delta[1]));
-		}
-		break;
-	case 1: // 1d cases
-		for (std::size_t k(0); k<3; ++k) {
-			if (dim[k]) {
-				_n_steps[k] = sc_ceil(static_cast<double>(n_eles)/n_eles_per_cell);
-			}
-		}
-	}
-
-	// some frequently used expressions to fill the vector of elements per grid
-	// cell
-	for (std::size_t k(0); k<3; k++) {
-		_step_sizes[k] = delta[k] / _n_steps[k];
-		_inverse_step_sizes[k] = 1.0 / _step_sizes[k];
-	}
-
-	_elements_in_grid_box.resize(_n_steps[0]*_n_steps[1]*_n_steps[2]);
-	sortElementsInGridCells(sfc_mesh);
+    auto getDimensions =
+        [](MathLib::Point3d const& min, MathLib::Point3d const& max)
+    {
+        std::bitset<3> dim;  // all bits are set to zero.
+        for (std::size_t k(0); k < 3; ++k) {
+            double const tolerance(
+                std::nexttoward(max[k],std::numeric_limits<double>::max())-max[k]);
+            if (std::abs(max[k]-min[k]) > tolerance)
+                dim[k] = true;
+        }
+        return dim;
+    };
+
+    MathLib::Point3d const& min_pnt(_aabb.getMinPoint());
+    MathLib::Point3d const& max_pnt(_aabb.getMaxPoint());
+    auto const dim = getDimensions(min_pnt, max_pnt);
+
+    std::array<double, 3> delta{{ max_pnt[0] - min_pnt[0],
+        max_pnt[1] - min_pnt[1], max_pnt[2] - min_pnt[2] }};
+
+    const std::size_t n_eles(sfc_mesh.getNElements());
+    const std::size_t n_eles_per_cell(100);
+
+    // *** condition: n_eles / n_cells < n_eles_per_cell
+    //                where n_cells = _n_steps[0] * _n_steps[1] * _n_steps[2]
+    // *** with _n_steps[0] = ceil(pow(n_eles*delta[0]*delta[0]/(n_eles_per_cell*delta[1]*delta[2]), 1/3.)));
+    //          _n_steps[1] = _n_steps[0] * delta[1]/delta[0],
+    //          _n_steps[2] = _n_steps[0] * delta[2]/delta[0]
+    auto sc_ceil = [](double v){
+        return static_cast<std::size_t>(std::ceil(v));
+    };
+
+    switch (dim.count()) {
+    case 3: // 3d case
+        _n_steps[0] = sc_ceil(std::cbrt(
+            n_eles*delta[0]*delta[0]/(n_eles_per_cell*delta[1]*delta[2])));
+        _n_steps[1] = sc_ceil(_n_steps[0] * std::min(delta[1] / delta[0], 100.0));
+        _n_steps[2] = sc_ceil(_n_steps[0] * std::min(delta[2] / delta[0], 100.0));
+        break;
+    case 2: // 2d cases
+        if (dim[0] && dim[2]) { // 2d case: xz plane, y = const
+            _n_steps[0] = sc_ceil(std::sqrt(n_eles*delta[0]/(n_eles_per_cell*delta[2])));
+            _n_steps[2] = sc_ceil(_n_steps[0]*delta[2]/delta[0]);
+        }
+        else if (dim[0] && dim[1]) { // 2d case: xy plane, z = const
+            _n_steps[0] = sc_ceil(std::sqrt(n_eles*delta[0]/(n_eles_per_cell*delta[1])));
+            _n_steps[1] = sc_ceil(_n_steps[0] * delta[1]/delta[0]);
+        }
+        else if (dim[1] && dim[2]) { // 2d case: yz plane, x = const
+            _n_steps[1] = sc_ceil(std::sqrt(n_eles*delta[1]/(n_eles_per_cell*delta[2])));
+            _n_steps[2] = sc_ceil(n_eles * delta[2] / (n_eles_per_cell*delta[1]));
+        }
+        break;
+    case 1: // 1d cases
+        for (std::size_t k(0); k<3; ++k) {
+            if (dim[k]) {
+                _n_steps[k] = sc_ceil(static_cast<double>(n_eles)/n_eles_per_cell);
+            }
+        }
+    }
+
+    // some frequently used expressions to fill the vector of elements per grid
+    // cell
+    for (std::size_t k(0); k<3; k++) {
+        _step_sizes[k] = delta[k] / _n_steps[k];
+        _inverse_step_sizes[k] = 1.0 / _step_sizes[k];
+    }
+
+    _elements_in_grid_box.resize(_n_steps[0]*_n_steps[1]*_n_steps[2]);
+    sortElementsInGridCells(sfc_mesh);
 }
 
 void MeshElementGrid::sortElementsInGridCells(MeshLib::Mesh const& sfc_mesh)
 {
-	for (auto const element : sfc_mesh.getElements()) {
-		if (! sortElementInGridCells(*element)) {
-			ERR("Sorting element (id=%d) into mesh element grid.",
-			    element->getID());
-			std::abort();
-		}
-	}
+    for (auto const element : sfc_mesh.getElements()) {
+        if (! sortElementInGridCells(*element)) {
+            ERR("Sorting element (id=%d) into mesh element grid.",
+                element->getID());
+            std::abort();
+        }
+    }
 }
 
 bool MeshElementGrid::sortElementInGridCells(MeshLib::Element const& element)
 {
-	std::array<std::size_t,3> min;
-	std::array<std::size_t,3> max;
-	std::pair<bool, std::array<std::size_t, 3>> c(
-		getGridCellCoordinates(*(static_cast<MathLib::Point3d const*>(element.getNode(0)))));
-	if (c.first) {
-		min = c.second;
-		max = min;
-	} else {
-		return false;
-	}
-
-	std::vector<std::array<std::size_t,3>> coord_vecs(element.getNNodes());
-	for (std::size_t k(1); k<element.getNNodes(); ++k) {
-		// compute coordinates of the grid for each node of the element
-		c = getGridCellCoordinates(*(static_cast<MathLib::Point3d const*>(element.getNode(k))));
-		if (!c.first)
-			return false;
-		else {
-			for (std::size_t j(0); j<3; ++j) {
-				if (min[j] > c.second[j])
-					min[j] = c.second[j];
-				if (max[j] < c.second[j])
-					max[j] = c.second[j];
-			}
-		}
-	}
-
-	const std::size_t n_plane(_n_steps[0]*_n_steps[1]);
-
-	// insert the element into the grid cells
-	for (std::size_t i(min[0]); i<=max[0]; i++) {
-		for (std::size_t j(min[1]); j<=max[1]; j++) {
-			for (std::size_t k(min[2]); k<=max[2]; k++) {
-				_elements_in_grid_box[i+j*_n_steps[0]+k*n_plane].push_back(&element);
-			}
-		}
-	}
-
-	return true;
+    std::array<std::size_t,3> min;
+    std::array<std::size_t,3> max;
+    std::pair<bool, std::array<std::size_t, 3>> c(
+        getGridCellCoordinates(*(static_cast<MathLib::Point3d const*>(element.getNode(0)))));
+    if (c.first) {
+        min = c.second;
+        max = min;
+    } else {
+        return false;
+    }
+
+    std::vector<std::array<std::size_t,3>> coord_vecs(element.getNNodes());
+    for (std::size_t k(1); k<element.getNNodes(); ++k) {
+        // compute coordinates of the grid for each node of the element
+        c = getGridCellCoordinates(*(static_cast<MathLib::Point3d const*>(element.getNode(k))));
+        if (!c.first)
+            return false;
+        else {
+            for (std::size_t j(0); j<3; ++j) {
+                if (min[j] > c.second[j])
+                    min[j] = c.second[j];
+                if (max[j] < c.second[j])
+                    max[j] = c.second[j];
+            }
+        }
+    }
+
+    const std::size_t n_plane(_n_steps[0]*_n_steps[1]);
+
+    // insert the element into the grid cells
+    for (std::size_t i(min[0]); i<=max[0]; i++) {
+        for (std::size_t j(min[1]); j<=max[1]; j++) {
+            for (std::size_t k(min[2]); k<=max[2]; k++) {
+                _elements_in_grid_box[i+j*_n_steps[0]+k*n_plane].push_back(&element);
+            }
+        }
+    }
+
+    return true;
 }
 
 std::pair<bool, std::array<std::size_t, 3>>
 MeshElementGrid::getGridCellCoordinates(MathLib::Point3d const& p) const
 {
-	bool valid(true);
-	std::array<std::size_t, 3> coords;
-
-	for (std::size_t k(0); k<3; ++k) {
-		const double d(p[k]-_aabb.getMinPoint()[k]);
-		if (d < 0.0) {
-			valid = false;
-			coords[k] = 0;
-		} else if (_aabb.getMaxPoint()[k] <= p[k]) {
-			valid = false;
-			coords[k] = _n_steps[k]-1;
-		} else {
-			coords[k] = static_cast<std::size_t>(d * _inverse_step_sizes[k]);
-		}
-	}
-
-	return std::make_pair(valid, coords);
+    bool valid(true);
+    std::array<std::size_t, 3> coords;
+
+    for (std::size_t k(0); k<3; ++k) {
+        const double d(p[k]-_aabb.getMinPoint()[k]);
+        if (d < 0.0) {
+            valid = false;
+            coords[k] = 0;
+        } else if (_aabb.getMaxPoint()[k] <= p[k]) {
+            valid = false;
+            coords[k] = _n_steps[k]-1;
+        } else {
+            coords[k] = static_cast<std::size_t>(d * _inverse_step_sizes[k]);
+        }
+    }
+
+    return std::make_pair(valid, coords);
 }
 
 #ifndef NDEBUG
@@ -181,81 +181,81 @@ void getGridGeometry(MeshElementGrid const& grid,
                      GeoLib::GEOObjects& geometries,
                      std::string& geometry_name)
 {
-	std::vector<std::string> cell_names;
-
-	auto addPoints = [&geometries](MathLib::Point3d const& p,
-		std::array<double,3> const& d, std::array<std::size_t,3> const& c,
-		std::string & name)
-	{
-		auto pnts = std::unique_ptr<std::vector<GeoLib::Point*>>(
-			new std::vector<GeoLib::Point*>);
-		pnts->push_back(new GeoLib::Point(p[0]+c[0]*d[0], p[1]+c[1]*d[1], p[2]+c[2]*d[2]));
-		pnts->push_back(new GeoLib::Point(p[0]+c[0]*d[0], p[1]+(c[1]+1)*d[1], p[2]+c[2]*d[2]));
-		pnts->push_back(new GeoLib::Point(p[0]+(c[0]+1)*d[0], p[1]+(c[1]+1)*d[1], p[2]+c[2]*d[2]));
-		pnts->push_back(new GeoLib::Point(p[0]+(c[0]+1)*d[0], p[1]+c[1]*d[1], p[2]+c[2]*d[2]));
-		pnts->push_back(new GeoLib::Point(p[0]+c[0]*d[0], p[1]+c[1]*d[1], p[2]+(c[2]+1)*d[2]));
-		pnts->push_back(new GeoLib::Point(p[0]+c[0]*d[0], p[1]+(c[1]+1)*d[1], p[2]+(c[2]+1)*d[2]));
-		pnts->push_back(new GeoLib::Point(p[0]+(c[0]+1)*d[0], p[1]+(c[1]+1)*d[1], p[2]+(c[2]+1)*d[2]));
-		pnts->push_back(new GeoLib::Point(p[0]+(c[0]+1)*d[0], p[1]+c[1]*d[1], p[2]+(c[2]+1)*d[2]));
-		std::array<double,3> ulps; // unit in the last place
-		double const towards(std::numeric_limits<double>::max());
-		ulps[0] = std::nextafter(d[0], towards)-d[0];
-		ulps[1] = std::nextafter(d[1], towards)-d[1];
-		ulps[2] = std::nextafter(d[2], towards)-d[2];
-		double const tolerance(std::min(std::min(ulps[0], ulps[1]), ulps[2]));
-		geometries.addPointVec(std::move(pnts), name, nullptr, tolerance);
-	};
-
-	for (std::size_t i(0); i<grid._n_steps[0]; ++i) {
-		for (std::size_t j(0); j<grid._n_steps[1]; ++j) {
-			for (std::size_t k(0); k<grid._n_steps[2]; ++k) {
-				cell_names.emplace_back("Grid-"+std::to_string(i)+"-"
-					+std::to_string(j)+"-"+std::to_string(k));
-				addPoints(grid._aabb.getMinPoint(), grid._step_sizes,
-				          {{i, j, k}}, cell_names.back());
-				auto plys = std::unique_ptr<std::vector<GeoLib::Polyline*>>(
-				    new std::vector<GeoLib::Polyline*>);
-				auto & points = *geometries.getPointVec(cell_names.back());
-
-				GeoLib::Polyline* ply_bottom(new GeoLib::Polyline(points));
-				for (std::size_t l(0); l < 4; ++l)
-					ply_bottom->addPoint(l);
-				ply_bottom->addPoint(0); // close to bottom surface
-				plys->push_back(ply_bottom);
-
-				GeoLib::Polyline* ply_top(new GeoLib::Polyline(points));
-				for (std::size_t l(4); l<8; ++l)
-					ply_top->addPoint(l);
-				ply_top->addPoint(4); // close to top surface
-				plys->push_back(ply_top);
-
-				GeoLib::Polyline* ply_04(new GeoLib::Polyline(points));
-				ply_04->addPoint(0);
-				ply_04->addPoint(4);
-				plys->push_back(ply_04);
-
-				GeoLib::Polyline* ply_15(new GeoLib::Polyline(points));
-				ply_15->addPoint(1);
-				ply_15->addPoint(5);
-				plys->push_back(ply_15);
-
-				GeoLib::Polyline* ply_26(new GeoLib::Polyline(points));
-				ply_26->addPoint(2);
-				ply_26->addPoint(6);
-				plys->push_back(ply_26);
-
-				GeoLib::Polyline* ply_37(new GeoLib::Polyline(points));
-				ply_37->addPoint(3);
-				ply_37->addPoint(7);
-				plys->push_back(ply_37);
-
-				geometries.addPolylineVec(std::move(plys), cell_names.back(),
-					nullptr);
-			}
-		}
-	}
-	if (geometries.mergeGeometries(cell_names, geometry_name) == 2)
-		geometry_name = cell_names.front();
+    std::vector<std::string> cell_names;
+
+    auto addPoints = [&geometries](MathLib::Point3d const& p,
+        std::array<double,3> const& d, std::array<std::size_t,3> const& c,
+        std::string & name)
+    {
+        auto pnts = std::unique_ptr<std::vector<GeoLib::Point*>>(
+            new std::vector<GeoLib::Point*>);
+        pnts->push_back(new GeoLib::Point(p[0]+c[0]*d[0], p[1]+c[1]*d[1], p[2]+c[2]*d[2]));
+        pnts->push_back(new GeoLib::Point(p[0]+c[0]*d[0], p[1]+(c[1]+1)*d[1], p[2]+c[2]*d[2]));
+        pnts->push_back(new GeoLib::Point(p[0]+(c[0]+1)*d[0], p[1]+(c[1]+1)*d[1], p[2]+c[2]*d[2]));
+        pnts->push_back(new GeoLib::Point(p[0]+(c[0]+1)*d[0], p[1]+c[1]*d[1], p[2]+c[2]*d[2]));
+        pnts->push_back(new GeoLib::Point(p[0]+c[0]*d[0], p[1]+c[1]*d[1], p[2]+(c[2]+1)*d[2]));
+        pnts->push_back(new GeoLib::Point(p[0]+c[0]*d[0], p[1]+(c[1]+1)*d[1], p[2]+(c[2]+1)*d[2]));
+        pnts->push_back(new GeoLib::Point(p[0]+(c[0]+1)*d[0], p[1]+(c[1]+1)*d[1], p[2]+(c[2]+1)*d[2]));
+        pnts->push_back(new GeoLib::Point(p[0]+(c[0]+1)*d[0], p[1]+c[1]*d[1], p[2]+(c[2]+1)*d[2]));
+        std::array<double,3> ulps; // unit in the last place
+        double const towards(std::numeric_limits<double>::max());
+        ulps[0] = std::nextafter(d[0], towards)-d[0];
+        ulps[1] = std::nextafter(d[1], towards)-d[1];
+        ulps[2] = std::nextafter(d[2], towards)-d[2];
+        double const tolerance(std::min(std::min(ulps[0], ulps[1]), ulps[2]));
+        geometries.addPointVec(std::move(pnts), name, nullptr, tolerance);
+    };
+
+    for (std::size_t i(0); i<grid._n_steps[0]; ++i) {
+        for (std::size_t j(0); j<grid._n_steps[1]; ++j) {
+            for (std::size_t k(0); k<grid._n_steps[2]; ++k) {
+                cell_names.emplace_back("Grid-"+std::to_string(i)+"-"
+                    +std::to_string(j)+"-"+std::to_string(k));
+                addPoints(grid._aabb.getMinPoint(), grid._step_sizes,
+                          {{i, j, k}}, cell_names.back());
+                auto plys = std::unique_ptr<std::vector<GeoLib::Polyline*>>(
+                    new std::vector<GeoLib::Polyline*>);
+                auto & points = *geometries.getPointVec(cell_names.back());
+
+                GeoLib::Polyline* ply_bottom(new GeoLib::Polyline(points));
+                for (std::size_t l(0); l < 4; ++l)
+                    ply_bottom->addPoint(l);
+                ply_bottom->addPoint(0); // close to bottom surface
+                plys->push_back(ply_bottom);
+
+                GeoLib::Polyline* ply_top(new GeoLib::Polyline(points));
+                for (std::size_t l(4); l<8; ++l)
+                    ply_top->addPoint(l);
+                ply_top->addPoint(4); // close to top surface
+                plys->push_back(ply_top);
+
+                GeoLib::Polyline* ply_04(new GeoLib::Polyline(points));
+                ply_04->addPoint(0);
+                ply_04->addPoint(4);
+                plys->push_back(ply_04);
+
+                GeoLib::Polyline* ply_15(new GeoLib::Polyline(points));
+                ply_15->addPoint(1);
+                ply_15->addPoint(5);
+                plys->push_back(ply_15);
+
+                GeoLib::Polyline* ply_26(new GeoLib::Polyline(points));
+                ply_26->addPoint(2);
+                ply_26->addPoint(6);
+                plys->push_back(ply_26);
+
+                GeoLib::Polyline* ply_37(new GeoLib::Polyline(points));
+                ply_37->addPoint(3);
+                ply_37->addPoint(7);
+                plys->push_back(ply_37);
+
+                geometries.addPolylineVec(std::move(plys), cell_names.back(),
+                    nullptr);
+            }
+        }
+    }
+    if (geometries.mergeGeometries(cell_names, geometry_name) == 2)
+        geometry_name = cell_names.front();
 }
 #endif // NDEBUG
 
diff --git a/MeshLib/MeshSearch/MeshElementGrid.h b/MeshLib/MeshSearch/MeshElementGrid.h
index 0c2a8880302..3cc0f96f5e2 100644
--- a/MeshLib/MeshSearch/MeshElementGrid.h
+++ b/MeshLib/MeshSearch/MeshElementGrid.h
@@ -35,75 +35,75 @@ class Element;
 /// MeshElementGrid instance lives.
 class MeshElementGrid final {
 #ifndef NDEBUG
-	friend void getGridGeometry(MeshLib::MeshElementGrid const& grid,
-	                            GeoLib::GEOObjects& geometries,
-	                            std::string& geometry_name);
+    friend void getGridGeometry(MeshLib::MeshElementGrid const& grid,
+                                GeoLib::GEOObjects& geometries,
+                                std::string& geometry_name);
 #endif
 public:
-	/// Constructs a grid. Grid cells contains intersecting mesh elements.
-	/// @param mesh the MeshLib::Mesh instance the grid will be constructed from
-	explicit MeshElementGrid(MeshLib::Mesh const& mesh);
+    /// Constructs a grid. Grid cells contains intersecting mesh elements.
+    /// @param mesh the MeshLib::Mesh instance the grid will be constructed from
+    explicit MeshElementGrid(MeshLib::Mesh const& mesh);
 
-	/// Fill and return a vector containing elements of all grid cells that have
-	/// a non-empty intersection with the box that is defined by min and max.
-	/// @param min min point of the box
-	/// @param max max point of the box
-	/// @return a (possible empty) vector of elements
-	template <typename POINT>
-	std::vector<MeshLib::Element const*> getElementsInVolume(
-		POINT const& min, POINT const& max) const
-	{
-		auto const min_coords(getGridCellCoordinates(min));
-		auto const max_coords(getGridCellCoordinates(max));
+    /// Fill and return a vector containing elements of all grid cells that have
+    /// a non-empty intersection with the box that is defined by min and max.
+    /// @param min min point of the box
+    /// @param max max point of the box
+    /// @return a (possible empty) vector of elements
+    template <typename POINT>
+    std::vector<MeshLib::Element const*> getElementsInVolume(
+        POINT const& min, POINT const& max) const
+    {
+        auto const min_coords(getGridCellCoordinates(min));
+        auto const max_coords(getGridCellCoordinates(max));
 
-		if (!min_coords.first) {
-			WARN(
-			    "MeshElementGrid::getElementsInVolume: Min point (%f,%f,%f) "
-			    "outside of MeshElementGrid [%f,%f) x [%f,%f) x [%f,%f).",
-			    min[0], min[1], min[2], _aabb.getMinPoint()[0],
-			    _aabb.getMaxPoint()[0], _aabb.getMinPoint()[1],
-			    _aabb.getMaxPoint()[1], _aabb.getMinPoint()[2],
-			    _aabb.getMaxPoint()[2]);
-		}
-		if (!max_coords.first) {
-			WARN(
-			    "MeshElementGrid::getElementsInVolume: Max point (%f,%f,%f) "
-			    "outside of MeshElementGrid [%f,%f) x [%f,%f) x [%f,%f).",
-			    max[0], max[1], max[2], _aabb.getMinPoint()[0],
-			    _aabb.getMaxPoint()[0], _aabb.getMinPoint()[1],
-			    _aabb.getMaxPoint()[1], _aabb.getMinPoint()[2],
-			    _aabb.getMaxPoint()[2]);
-		}
-		std::vector<MeshLib::Element const*> elements_vec;
+        if (!min_coords.first) {
+            WARN(
+                "MeshElementGrid::getElementsInVolume: Min point (%f,%f,%f) "
+                "outside of MeshElementGrid [%f,%f) x [%f,%f) x [%f,%f).",
+                min[0], min[1], min[2], _aabb.getMinPoint()[0],
+                _aabb.getMaxPoint()[0], _aabb.getMinPoint()[1],
+                _aabb.getMaxPoint()[1], _aabb.getMinPoint()[2],
+                _aabb.getMaxPoint()[2]);
+        }
+        if (!max_coords.first) {
+            WARN(
+                "MeshElementGrid::getElementsInVolume: Max point (%f,%f,%f) "
+                "outside of MeshElementGrid [%f,%f) x [%f,%f) x [%f,%f).",
+                max[0], max[1], max[2], _aabb.getMinPoint()[0],
+                _aabb.getMaxPoint()[0], _aabb.getMinPoint()[1],
+                _aabb.getMaxPoint()[1], _aabb.getMinPoint()[2],
+                _aabb.getMaxPoint()[2]);
+        }
+        std::vector<MeshLib::Element const*> elements_vec;
 
-		const std::size_t n_plane(_n_steps[0]*_n_steps[1]);
-		for (std::size_t i(min_coords.second[0]); i<=max_coords.second[0]; i++) {
-			for (std::size_t j(min_coords.second[1]); j<=max_coords.second[1]; j++) {
-				for (std::size_t k(min_coords.second[2]); k<=max_coords.second[2]; k++) {
-					std::size_t idx(i+j*_n_steps[0]+k*n_plane);
-					std::copy(_elements_in_grid_box[idx].begin(),
-					          _elements_in_grid_box[idx].end(),
-					          std::back_inserter(elements_vec));
-				}
-			}
-		}
-		return elements_vec;
-	}
+        const std::size_t n_plane(_n_steps[0]*_n_steps[1]);
+        for (std::size_t i(min_coords.second[0]); i<=max_coords.second[0]; i++) {
+            for (std::size_t j(min_coords.second[1]); j<=max_coords.second[1]; j++) {
+                for (std::size_t k(min_coords.second[2]); k<=max_coords.second[2]; k++) {
+                    std::size_t idx(i+j*_n_steps[0]+k*n_plane);
+                    std::copy(_elements_in_grid_box[idx].begin(),
+                              _elements_in_grid_box[idx].end(),
+                              std::back_inserter(elements_vec));
+                }
+            }
+        }
+        return elements_vec;
+    }
 
 private:
-	void sortElementsInGridCells(MeshLib::Mesh const& sfc_mesh);
-	bool sortElementInGridCells(MeshLib::Element const& element);
+    void sortElementsInGridCells(MeshLib::Mesh const& sfc_mesh);
+    bool sortElementInGridCells(MeshLib::Element const& element);
 
-	GeoLib::AABB _aabb;
-	/// Computes the grid cell coordinates for given point. The first element of
-	/// the returned pair (bool) is true if the point is within the grid, else
-	/// false.
-	std::pair<bool, std::array<std::size_t,3>>
-		getGridCellCoordinates(MathLib::Point3d const& p) const;
-	std::array<double,3> _step_sizes;
-	std::array<double,3> _inverse_step_sizes;
-	std::array<std::size_t,3> _n_steps;
-	std::vector<std::vector<MeshLib::Element const*>> _elements_in_grid_box;
+    GeoLib::AABB _aabb;
+    /// Computes the grid cell coordinates for given point. The first element of
+    /// the returned pair (bool) is true if the point is within the grid, else
+    /// false.
+    std::pair<bool, std::array<std::size_t,3>>
+        getGridCellCoordinates(MathLib::Point3d const& p) const;
+    std::array<double,3> _step_sizes;
+    std::array<double,3> _inverse_step_sizes;
+    std::array<std::size_t,3> _n_steps;
+    std::vector<std::vector<MeshLib::Element const*>> _elements_in_grid_box;
 };
 
 #ifndef NDEBUG
diff --git a/MeshLib/MeshSearch/NodeSearch.cpp b/MeshLib/MeshSearch/NodeSearch.cpp
index c35b4491909..4cf83a7da40 100644
--- a/MeshLib/MeshSearch/NodeSearch.cpp
+++ b/MeshLib/MeshSearch/NodeSearch.cpp
@@ -20,80 +20,80 @@
 namespace MeshLib {
 
 NodeSearch::NodeSearch(const MeshLib::Mesh &mesh)
-	: _mesh(mesh)
+    : _mesh(mesh)
 {
 }
 
 std::size_t NodeSearch::searchNodesConnectedToOnlyGivenElements(
-		const std::vector<std::size_t> &elements)
+        const std::vector<std::size_t> &elements)
 {
-	// Find out by how many elements a node would be removed.
-	//
-	// Note: If there are only few elements to be removed, using a different
-	// algorithm might be more memory efficient.
-	std::vector<std::size_t> node_marked_counts(_mesh.getNNodes(), 0);
-
-	for(std::size_t eid : elements)
-	{
-		auto* e = _mesh.getElement(eid);
-		for (unsigned i=0; i<e->getNBaseNodes(); i++) {
-			node_marked_counts[e->getNodeIndex(i)]++;
-		}
-	}
-
-
-	// Push back nodes which counts are equal to number of connected elements to
-	// that node.
-	std::vector<std::size_t> connected_nodes;
-	for (std::size_t i=0; i<node_marked_counts.size(); i++)
-	{
-		if (node_marked_counts[i] == _mesh.getNode(i)->getElements().size())
-			connected_nodes.push_back(i);
-	}
-
-	this->updateUnion(connected_nodes);
-	return connected_nodes.size();
+    // Find out by how many elements a node would be removed.
+    //
+    // Note: If there are only few elements to be removed, using a different
+    // algorithm might be more memory efficient.
+    std::vector<std::size_t> node_marked_counts(_mesh.getNNodes(), 0);
+
+    for(std::size_t eid : elements)
+    {
+        auto* e = _mesh.getElement(eid);
+        for (unsigned i=0; i<e->getNBaseNodes(); i++) {
+            node_marked_counts[e->getNodeIndex(i)]++;
+        }
+    }
+
+
+    // Push back nodes which counts are equal to number of connected elements to
+    // that node.
+    std::vector<std::size_t> connected_nodes;
+    for (std::size_t i=0; i<node_marked_counts.size(); i++)
+    {
+        if (node_marked_counts[i] == _mesh.getNode(i)->getElements().size())
+            connected_nodes.push_back(i);
+    }
+
+    this->updateUnion(connected_nodes);
+    return connected_nodes.size();
 }
 
 std::size_t NodeSearch::searchUnused()
 {
-	const std::size_t nNodes (_mesh.getNNodes());
-	const std::vector<MeshLib::Node*> &nodes (_mesh.getNodes());
-	std::vector<std::size_t> del_node_idx;
+    const std::size_t nNodes (_mesh.getNNodes());
+    const std::vector<MeshLib::Node*> &nodes (_mesh.getNodes());
+    std::vector<std::size_t> del_node_idx;
 
-	for (unsigned i=0; i<nNodes; ++i)
-		if (nodes[i]->getNElements() == 0)
-			del_node_idx.push_back(i);
+    for (unsigned i=0; i<nNodes; ++i)
+        if (nodes[i]->getNElements() == 0)
+            del_node_idx.push_back(i);
 
-	this->updateUnion(del_node_idx);
-	return del_node_idx.size();
+    this->updateUnion(del_node_idx);
+    return del_node_idx.size();
 }
 
 void NodeSearch::updateUnion(const std::vector<std::size_t> &vec)
 {
-	std::vector<std::size_t> vec_temp(vec.size() + _marked_nodes.size());
-	auto it = std::set_union(vec.begin(), vec.end(), _marked_nodes.begin(), _marked_nodes.end(), vec_temp.begin());
-	vec_temp.resize(it - vec_temp.begin());
-	_marked_nodes.assign(vec_temp.begin(), vec_temp.end());
+    std::vector<std::size_t> vec_temp(vec.size() + _marked_nodes.size());
+    auto it = std::set_union(vec.begin(), vec.end(), _marked_nodes.begin(), _marked_nodes.end(), vec_temp.begin());
+    vec_temp.resize(it - vec_temp.begin());
+    _marked_nodes.assign(vec_temp.begin(), vec_temp.end());
 }
 
 std::vector<Node*> getUniqueNodes(std::vector<Element*> const& elements)
 {
-	std::set<Node*> nodes_set;
-	for (auto e : elements)
-	{
-		Node* const* nodes = e->getNodes();
-		unsigned const nnodes = e->getNNodes();
-		nodes_set.insert(nodes, nodes + nnodes);
-	}
+    std::set<Node*> nodes_set;
+    for (auto e : elements)
+    {
+        Node* const* nodes = e->getNodes();
+        unsigned const nnodes = e->getNNodes();
+        nodes_set.insert(nodes, nodes + nnodes);
+    }
 
-	std::vector<Node*> nodes;
-	nodes.reserve(nodes_set.size());
+    std::vector<Node*> nodes;
+    nodes.reserve(nodes_set.size());
 
-	std::move(nodes_set.cbegin(), nodes_set.cend(),
-		std::back_inserter(nodes));
+    std::move(nodes_set.cbegin(), nodes_set.cend(),
+        std::back_inserter(nodes));
 
-	return nodes;
+    return nodes;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshSearch/NodeSearch.h b/MeshLib/MeshSearch/NodeSearch.h
index bb5a3686c2c..dfc2d38c655 100644
--- a/MeshLib/MeshSearch/NodeSearch.h
+++ b/MeshLib/MeshSearch/NodeSearch.h
@@ -24,26 +24,26 @@ class Node;
 class NodeSearch final
 {
 public:
-	explicit NodeSearch(const MeshLib::Mesh &mesh);
+    explicit NodeSearch(const MeshLib::Mesh &mesh);
 
-	/// return marked node IDs
-	const std::vector<std::size_t>& getSearchedNodeIDs() const {return _marked_nodes; }
+    /// return marked node IDs
+    const std::vector<std::size_t>& getSearchedNodeIDs() const {return _marked_nodes; }
 
-	/// Marks all nodes connected to any of the given elements ids.
+    /// Marks all nodes connected to any of the given elements ids.
     /// \return number of connected nodes.
-	std::size_t searchNodesConnectedToOnlyGivenElements(const std::vector<std::size_t> &element_ids);
+    std::size_t searchNodesConnectedToOnlyGivenElements(const std::vector<std::size_t> &element_ids);
 
-	/// Marks all unused nodes
-	std::size_t searchUnused();
+    /// Marks all unused nodes
+    std::size_t searchUnused();
 
 private:
-	/// Updates the vector of marked items with values from vec.
-	void updateUnion(const std::vector<std::size_t> &vec);
+    /// Updates the vector of marked items with values from vec.
+    void updateUnion(const std::vector<std::size_t> &vec);
 
-	/// The mesh from which elements should be removed.
-	const MeshLib::Mesh &_mesh;
-	/// The vector of element indices that should be removed.
-	std::vector<std::size_t> _marked_nodes;
+    /// The mesh from which elements should be removed.
+    const MeshLib::Mesh &_mesh;
+    /// The vector of element indices that should be removed.
+    std::vector<std::size_t> _marked_nodes;
 };
 
 /// Create a vector of unique nodes used by given elements.
diff --git a/MeshLib/MeshSurfaceExtraction.cpp b/MeshLib/MeshSurfaceExtraction.cpp
index 4b7807636cf..5050e6602ac 100644
--- a/MeshLib/MeshSurfaceExtraction.cpp
+++ b/MeshLib/MeshSurfaceExtraction.cpp
@@ -33,241 +33,241 @@ namespace MeshLib {
 
 std::vector<double> MeshSurfaceExtraction::getSurfaceAreaForNodes(const MeshLib::Mesh &mesh)
 {
-	std::vector<double> node_area_vec;
-	if (mesh.getDimension() != 2)
-	{
-		ERR ("Error in MeshSurfaceExtraction::getSurfaceAreaForNodes() - Given mesh is no surface mesh (dimension != 2).");
-		return node_area_vec;
-	}
-
-	double total_area (0);
-
-	// for each node, a vector containing all the element idget every element
-	const std::vector<MeshLib::Node*> &nodes = mesh.getNodes();
-	const std::size_t nNodes ( mesh.getNNodes() );
-	for (std::size_t n=0; n<nNodes; ++n)
-	{
-		double node_area (0);
-
-		std::vector<MeshLib::Element*> conn_elems = nodes[n]->getElements();
-		const std::size_t nConnElems (conn_elems.size());
-
-		for (std::size_t i=0; i<nConnElems; ++i)
-		{
-			const MeshLib::Element* elem (conn_elems[i]);
-			const unsigned nElemParts = (elem->getGeomType() == MeshElemType::TRIANGLE) ? 3 : 4;
-			const double area = conn_elems[i]->getContent() / nElemParts;
-			node_area += area;
-			total_area += area;
-		}
-
-		node_area_vec.push_back(node_area);
-	}
-
-	INFO ("Total surface Area: %f", total_area);
-
-	return node_area_vec;
+    std::vector<double> node_area_vec;
+    if (mesh.getDimension() != 2)
+    {
+        ERR ("Error in MeshSurfaceExtraction::getSurfaceAreaForNodes() - Given mesh is no surface mesh (dimension != 2).");
+        return node_area_vec;
+    }
+
+    double total_area (0);
+
+    // for each node, a vector containing all the element idget every element
+    const std::vector<MeshLib::Node*> &nodes = mesh.getNodes();
+    const std::size_t nNodes ( mesh.getNNodes() );
+    for (std::size_t n=0; n<nNodes; ++n)
+    {
+        double node_area (0);
+
+        std::vector<MeshLib::Element*> conn_elems = nodes[n]->getElements();
+        const std::size_t nConnElems (conn_elems.size());
+
+        for (std::size_t i=0; i<nConnElems; ++i)
+        {
+            const MeshLib::Element* elem (conn_elems[i]);
+            const unsigned nElemParts = (elem->getGeomType() == MeshElemType::TRIANGLE) ? 3 : 4;
+            const double area = conn_elems[i]->getContent() / nElemParts;
+            node_area += area;
+            total_area += area;
+        }
+
+        node_area_vec.push_back(node_area);
+    }
+
+    INFO ("Total surface Area: %f", total_area);
+
+    return node_area_vec;
 }
 
 MeshLib::Mesh* MeshSurfaceExtraction::getMeshSurface(
     const MeshLib::Mesh& mesh, const MathLib::Vector3& dir, double angle,
     std::string const& subsfc_node_id_backup_prop_name)
 {
-	if (angle < 0 || angle > 90)
-	{
-		ERR ("Supported angle between 0 and 90 degrees only.");
-		return nullptr;
-	}
-
-	INFO ("Extracting mesh surface...");
-	std::vector<MeshLib::Element*> sfc_elements;
-	get2DSurfaceElements(mesh.getElements(), sfc_elements, dir, angle, mesh.getDimension());
-
-	if (sfc_elements.empty())
-		return nullptr;
-
-	std::vector<MeshLib::Node*> sfc_nodes;
-	std::vector<std::size_t> node_id_map(mesh.getNNodes());
-	get2DSurfaceNodes(sfc_nodes, mesh.getNNodes(), sfc_elements, node_id_map);
-
-	// create new elements vector with newly created nodes
-	std::vector<MeshLib::Element*> new_elements;
-	new_elements.reserve(sfc_elements.size());
-	for (auto elem = sfc_elements.cbegin(); elem != sfc_elements.cend(); ++elem)
-	{
-		unsigned const n_elem_nodes ((*elem)->getNBaseNodes());
-		MeshLib::Node** new_nodes = new MeshLib::Node*[n_elem_nodes];
-		for (unsigned k(0); k<n_elem_nodes; k++)
-			new_nodes[k] = sfc_nodes[node_id_map[(*elem)->getNode(k)->getID()]];
-		if ((*elem)->getGeomType() == MeshElemType::TRIANGLE)
-			new_elements.push_back(new MeshLib::Tri(new_nodes));
-		else {
-			assert((*elem)->getGeomType() == MeshElemType::QUAD);
-			new_elements.push_back(new MeshLib::Quad(new_nodes));
-		}
-		delete *elem;
-	}
-
-	std::vector<std::size_t> id_map;
-	if (!subsfc_node_id_backup_prop_name.empty())
-	{
-		id_map.reserve(sfc_nodes.size());
-		for (auto node = sfc_nodes.cbegin(); node != sfc_nodes.cend(); ++node)
-			id_map.push_back((*node)->getID());
-	}
-	MeshLib::Mesh* result (new Mesh(mesh.getName()+"-Surface", sfc_nodes, new_elements));
-	// transmit the original node ids of the subsurface mesh as a property
-	if (!subsfc_node_id_backup_prop_name.empty()) {
-		boost::optional<MeshLib::PropertyVector<std::size_t>&> orig_node_ids(
-		    result->getProperties().createNewPropertyVector<std::size_t>(
-		        subsfc_node_id_backup_prop_name , MeshLib::MeshItemType::Node, 1));
-		if (orig_node_ids) {
-			orig_node_ids->resize(id_map.size());
-			std::copy(id_map.cbegin(), id_map.cend(), orig_node_ids->begin());
-		}
-	}
-	return result;
+    if (angle < 0 || angle > 90)
+    {
+        ERR ("Supported angle between 0 and 90 degrees only.");
+        return nullptr;
+    }
+
+    INFO ("Extracting mesh surface...");
+    std::vector<MeshLib::Element*> sfc_elements;
+    get2DSurfaceElements(mesh.getElements(), sfc_elements, dir, angle, mesh.getDimension());
+
+    if (sfc_elements.empty())
+        return nullptr;
+
+    std::vector<MeshLib::Node*> sfc_nodes;
+    std::vector<std::size_t> node_id_map(mesh.getNNodes());
+    get2DSurfaceNodes(sfc_nodes, mesh.getNNodes(), sfc_elements, node_id_map);
+
+    // create new elements vector with newly created nodes
+    std::vector<MeshLib::Element*> new_elements;
+    new_elements.reserve(sfc_elements.size());
+    for (auto elem = sfc_elements.cbegin(); elem != sfc_elements.cend(); ++elem)
+    {
+        unsigned const n_elem_nodes ((*elem)->getNBaseNodes());
+        MeshLib::Node** new_nodes = new MeshLib::Node*[n_elem_nodes];
+        for (unsigned k(0); k<n_elem_nodes; k++)
+            new_nodes[k] = sfc_nodes[node_id_map[(*elem)->getNode(k)->getID()]];
+        if ((*elem)->getGeomType() == MeshElemType::TRIANGLE)
+            new_elements.push_back(new MeshLib::Tri(new_nodes));
+        else {
+            assert((*elem)->getGeomType() == MeshElemType::QUAD);
+            new_elements.push_back(new MeshLib::Quad(new_nodes));
+        }
+        delete *elem;
+    }
+
+    std::vector<std::size_t> id_map;
+    if (!subsfc_node_id_backup_prop_name.empty())
+    {
+        id_map.reserve(sfc_nodes.size());
+        for (auto node = sfc_nodes.cbegin(); node != sfc_nodes.cend(); ++node)
+            id_map.push_back((*node)->getID());
+    }
+    MeshLib::Mesh* result (new Mesh(mesh.getName()+"-Surface", sfc_nodes, new_elements));
+    // transmit the original node ids of the subsurface mesh as a property
+    if (!subsfc_node_id_backup_prop_name.empty()) {
+        boost::optional<MeshLib::PropertyVector<std::size_t>&> orig_node_ids(
+            result->getProperties().createNewPropertyVector<std::size_t>(
+                subsfc_node_id_backup_prop_name , MeshLib::MeshItemType::Node, 1));
+        if (orig_node_ids) {
+            orig_node_ids->resize(id_map.size());
+            std::copy(id_map.cbegin(), id_map.cend(), orig_node_ids->begin());
+        }
+    }
+    return result;
 }
 
 MeshLib::Mesh* MeshSurfaceExtraction::getMeshBoundary(const MeshLib::Mesh &mesh)
 {
-	if (mesh.getDimension()==1)
-		return nullptr;
-
-	// For 3D meshes return the 2D surface
-	if (mesh.getDimension()==3)
-	{
-		MathLib::Vector3 dir(0,0,0);
-		return getMeshSurface(mesh, dir, 90);
-	}
-
-	// For 2D meshes return the boundary lines
-	std::vector<MeshLib::Node*> nodes = MeshLib::copyNodeVector(mesh.getNodes());
-	std::vector<MeshLib::Element*> boundary_elements;
-
-	std::vector<MeshLib::Element*> const& org_elems (mesh.getElements());
-	for (auto it=org_elems.begin(); it!=org_elems.end(); ++it)
-	{
-		MeshLib::Element* elem (*it);
-		std::size_t const n_edges (elem->getNEdges());
-		for (std::size_t i=0; i<n_edges; ++i)
-			if (elem->getNeighbor(i) == nullptr)
-			{
-				MeshLib::Element const*const edge (elem->getEdge(i));
-				boundary_elements.push_back(MeshLib::copyElement(edge, nodes));
-				delete edge;
-			}
-	}
-	MeshLib::Mesh* result = new MeshLib::Mesh("Boundary Mesh", nodes, boundary_elements);
-	MeshLib::NodeSearch ns(*result);
-	if (ns.searchUnused() == 0) {
-		return result;
-	} else {
-		auto removed = MeshLib::removeNodes(*result, ns.getSearchedNodeIDs(), result->getName());
-		delete result;
-		return removed;
-	}
+    if (mesh.getDimension()==1)
+        return nullptr;
+
+    // For 3D meshes return the 2D surface
+    if (mesh.getDimension()==3)
+    {
+        MathLib::Vector3 dir(0,0,0);
+        return getMeshSurface(mesh, dir, 90);
+    }
+
+    // For 2D meshes return the boundary lines
+    std::vector<MeshLib::Node*> nodes = MeshLib::copyNodeVector(mesh.getNodes());
+    std::vector<MeshLib::Element*> boundary_elements;
+
+    std::vector<MeshLib::Element*> const& org_elems (mesh.getElements());
+    for (auto it=org_elems.begin(); it!=org_elems.end(); ++it)
+    {
+        MeshLib::Element* elem (*it);
+        std::size_t const n_edges (elem->getNEdges());
+        for (std::size_t i=0; i<n_edges; ++i)
+            if (elem->getNeighbor(i) == nullptr)
+            {
+                MeshLib::Element const*const edge (elem->getEdge(i));
+                boundary_elements.push_back(MeshLib::copyElement(edge, nodes));
+                delete edge;
+            }
+    }
+    MeshLib::Mesh* result = new MeshLib::Mesh("Boundary Mesh", nodes, boundary_elements);
+    MeshLib::NodeSearch ns(*result);
+    if (ns.searchUnused() == 0) {
+        return result;
+    } else {
+        auto removed = MeshLib::removeNodes(*result, ns.getSearchedNodeIDs(), result->getName());
+        delete result;
+        return removed;
+    }
 }
 
 void MeshSurfaceExtraction::get2DSurfaceElements(const std::vector<MeshLib::Element*> &all_elements, std::vector<MeshLib::Element*> &sfc_elements, const MathLib::Vector3 &dir, double angle, unsigned mesh_dimension)
 {
-	if (mesh_dimension<2 || mesh_dimension>3)
-		ERR("Cannot handle meshes of dimension %i", mesh_dimension);
-
-	bool const complete_surface = (MathLib::scalarProduct(dir, dir) == 0);
-
-	double const pi (boost::math::constants::pi<double>());
-	double const cos_theta (std::cos(angle * pi / 180.0));
-	MathLib::Vector3 const norm_dir (dir.getNormalizedVector());
-
-	for (auto elem = all_elements.cbegin(); elem != all_elements.cend(); ++elem)
-	{
-		const unsigned element_dimension ((*elem)->getDimension());
-		if (element_dimension < mesh_dimension)
-			continue;
-
-		if (element_dimension == 2)
-		{
-			if (!complete_surface)
-			{
-				MeshLib::Element* face = *elem;
-				if (MathLib::scalarProduct(FaceRule::getSurfaceNormal(face).getNormalizedVector(), norm_dir) > cos_theta)
-					continue;
-			}
-			sfc_elements.push_back(*elem);
-		}
-		else
-		{
-			if (!(*elem)->isBoundaryElement())
-				continue;
-			const unsigned nFaces ((*elem)->getNFaces());
-			for (unsigned j=0; j<nFaces; ++j)
-			{
-				if ((*elem)->getNeighbor(j) != nullptr)
-					continue;
-
-				auto const face = std::unique_ptr<MeshLib::Element const>{(*elem)->getFace(j)};
-				if (!complete_surface)
-				{
-					if (MathLib::scalarProduct(FaceRule::getSurfaceNormal(face.get()).getNormalizedVector(), norm_dir) < cos_theta)
-					{
-						continue;
-					}
-				}
-				if (face->getGeomType() == MeshElemType::TRIANGLE)
-					sfc_elements.push_back(new MeshLib::Tri(*static_cast<const MeshLib::Tri*>(face.get())));
-				else
-					sfc_elements.push_back(new MeshLib::Quad(*static_cast<const MeshLib::Quad*>(face.get())));
-			}
-		}
-	}
+    if (mesh_dimension<2 || mesh_dimension>3)
+        ERR("Cannot handle meshes of dimension %i", mesh_dimension);
+
+    bool const complete_surface = (MathLib::scalarProduct(dir, dir) == 0);
+
+    double const pi (boost::math::constants::pi<double>());
+    double const cos_theta (std::cos(angle * pi / 180.0));
+    MathLib::Vector3 const norm_dir (dir.getNormalizedVector());
+
+    for (auto elem = all_elements.cbegin(); elem != all_elements.cend(); ++elem)
+    {
+        const unsigned element_dimension ((*elem)->getDimension());
+        if (element_dimension < mesh_dimension)
+            continue;
+
+        if (element_dimension == 2)
+        {
+            if (!complete_surface)
+            {
+                MeshLib::Element* face = *elem;
+                if (MathLib::scalarProduct(FaceRule::getSurfaceNormal(face).getNormalizedVector(), norm_dir) > cos_theta)
+                    continue;
+            }
+            sfc_elements.push_back(*elem);
+        }
+        else
+        {
+            if (!(*elem)->isBoundaryElement())
+                continue;
+            const unsigned nFaces ((*elem)->getNFaces());
+            for (unsigned j=0; j<nFaces; ++j)
+            {
+                if ((*elem)->getNeighbor(j) != nullptr)
+                    continue;
+
+                auto const face = std::unique_ptr<MeshLib::Element const>{(*elem)->getFace(j)};
+                if (!complete_surface)
+                {
+                    if (MathLib::scalarProduct(FaceRule::getSurfaceNormal(face.get()).getNormalizedVector(), norm_dir) < cos_theta)
+                    {
+                        continue;
+                    }
+                }
+                if (face->getGeomType() == MeshElemType::TRIANGLE)
+                    sfc_elements.push_back(new MeshLib::Tri(*static_cast<const MeshLib::Tri*>(face.get())));
+                else
+                    sfc_elements.push_back(new MeshLib::Quad(*static_cast<const MeshLib::Quad*>(face.get())));
+            }
+        }
+    }
 }
 
 void MeshSurfaceExtraction::get2DSurfaceNodes(std::vector<MeshLib::Node*> &sfc_nodes, std::size_t n_all_nodes, const std::vector<MeshLib::Element*> &sfc_elements, std::vector<std::size_t> &node_id_map)
 {
-	const std::size_t nNewElements (sfc_elements.size());
-	std::vector<const MeshLib::Node*> tmp_nodes(n_all_nodes, nullptr);
-	for (std::size_t i=0; i<nNewElements; ++i)
-	{
-		const MeshLib::Element* elem (sfc_elements[i]);
-		for (unsigned j=0; j<elem->getNBaseNodes(); ++j)
-		{
-			const MeshLib::Node* node (elem->getNode(j));
-			tmp_nodes[node->getID()] = node;
-		}
-	}
-	const std::size_t nNodes (tmp_nodes.size());
-	for (unsigned i=0; i<nNodes; ++i)
-	{
-		if (tmp_nodes[i])
-		{
-			node_id_map[i] = sfc_nodes.size();
-			sfc_nodes.push_back(new MeshLib::Node(tmp_nodes[i]->getCoords(), tmp_nodes[i]->getID()));
-		}
-	}
+    const std::size_t nNewElements (sfc_elements.size());
+    std::vector<const MeshLib::Node*> tmp_nodes(n_all_nodes, nullptr);
+    for (std::size_t i=0; i<nNewElements; ++i)
+    {
+        const MeshLib::Element* elem (sfc_elements[i]);
+        for (unsigned j=0; j<elem->getNBaseNodes(); ++j)
+        {
+            const MeshLib::Node* node (elem->getNode(j));
+            tmp_nodes[node->getID()] = node;
+        }
+    }
+    const std::size_t nNodes (tmp_nodes.size());
+    for (unsigned i=0; i<nNodes; ++i)
+    {
+        if (tmp_nodes[i])
+        {
+            node_id_map[i] = sfc_nodes.size();
+            sfc_nodes.push_back(new MeshLib::Node(tmp_nodes[i]->getCoords(), tmp_nodes[i]->getID()));
+        }
+    }
 }
 
 std::vector<GeoLib::Point*> MeshSurfaceExtraction::getSurfaceNodes(const MeshLib::Mesh &mesh, const MathLib::Vector3 &dir, double angle)
 {
-	INFO ("Extracting surface nodes...");
-	std::vector<MeshLib::Element*> sfc_elements;
-	get2DSurfaceElements(mesh.getElements(), sfc_elements, dir, angle, mesh.getDimension());
-
-	std::vector<MeshLib::Node*> sfc_nodes;
-	std::vector<std::size_t> node_id_map(mesh.getNNodes());
-	get2DSurfaceNodes(sfc_nodes, mesh.getNNodes(), sfc_elements, node_id_map);
-
-	for (auto e : sfc_elements)
-		delete e;
-
-	const std::size_t nNodes (sfc_nodes.size());
-	std::vector<GeoLib::Point*> surface_pnts(nNodes);
-	for (std::size_t i=0; i<nNodes; ++i)
-	{
-		surface_pnts[i] = new GeoLib::Point(*(sfc_nodes[i]), sfc_nodes[i]->getID());
-		delete sfc_nodes[i];
-	}
-	return surface_pnts;
+    INFO ("Extracting surface nodes...");
+    std::vector<MeshLib::Element*> sfc_elements;
+    get2DSurfaceElements(mesh.getElements(), sfc_elements, dir, angle, mesh.getDimension());
+
+    std::vector<MeshLib::Node*> sfc_nodes;
+    std::vector<std::size_t> node_id_map(mesh.getNNodes());
+    get2DSurfaceNodes(sfc_nodes, mesh.getNNodes(), sfc_elements, node_id_map);
+
+    for (auto e : sfc_elements)
+        delete e;
+
+    const std::size_t nNodes (sfc_nodes.size());
+    std::vector<GeoLib::Point*> surface_pnts(nNodes);
+    for (std::size_t i=0; i<nNodes; ++i)
+    {
+        surface_pnts[i] = new GeoLib::Point(*(sfc_nodes[i]), sfc_nodes[i]->getID());
+        delete sfc_nodes[i];
+    }
+    return surface_pnts;
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/MeshSurfaceExtraction.h b/MeshLib/MeshSurfaceExtraction.h
index f72789c5efb..3a213a6810c 100644
--- a/MeshLib/MeshSurfaceExtraction.h
+++ b/MeshLib/MeshSurfaceExtraction.h
@@ -21,7 +21,7 @@
 #include "MathLib/Vector3.h"
 
 namespace GeoLib {
-	class Point;
+    class Point;
 }
 
 namespace MeshLib {
@@ -36,46 +36,46 @@ class Node;
 class MeshSurfaceExtraction
 {
 public:
-	/// Returns a vector of the areas assigned to each node on a surface mesh.
-	static std::vector<double> getSurfaceAreaForNodes(const MeshLib::Mesh &mesh);
+    /// Returns a vector of the areas assigned to each node on a surface mesh.
+    static std::vector<double> getSurfaceAreaForNodes(const MeshLib::Mesh &mesh);
 
-	/// Returns the surface nodes of a mesh.
-	static std::vector<GeoLib::Point*> getSurfaceNodes(const MeshLib::Mesh &mesh, const MathLib::Vector3 &dir, double angle);
+    /// Returns the surface nodes of a mesh.
+    static std::vector<GeoLib::Point*> getSurfaceNodes(const MeshLib::Mesh &mesh, const MathLib::Vector3 &dir, double angle);
 
-	/**
-	 * Returns the 2d-element mesh representing the surface of the given mesh.
-	 * \param mesh                The original mesh
-	 * \param dir                 The direction in which face normals have to
-	 * point to be considered surface elements
-	 * \param angle               The angle of the allowed deviation from the
-	 * given direction (0 <= angle <= 90 degrees)
-	 * \param subsfc_node_id_backup_prop_name Name of the property in the
-	 * surface mesh the subsurface node ids are stored to. This is a mapping
-	 * surface node -> subsurface node which is needed from some applications.
-	 * If the string is empty, there isn't a backup created.
-	 * \return A 2D mesh representing the surface in direction dir
-	 */
-	static MeshLib::Mesh* getMeshSurface(
-	    const MeshLib::Mesh& mesh,
-	    const MathLib::Vector3& dir,
-	    double angle,
-	    std::string const& subsfc_node_id_backup_prop_name = "");
+    /**
+     * Returns the 2d-element mesh representing the surface of the given mesh.
+     * \param mesh                The original mesh
+     * \param dir                 The direction in which face normals have to
+     * point to be considered surface elements
+     * \param angle               The angle of the allowed deviation from the
+     * given direction (0 <= angle <= 90 degrees)
+     * \param subsfc_node_id_backup_prop_name Name of the property in the
+     * surface mesh the subsurface node ids are stored to. This is a mapping
+     * surface node -> subsurface node which is needed from some applications.
+     * If the string is empty, there isn't a backup created.
+     * \return A 2D mesh representing the surface in direction dir
+     */
+    static MeshLib::Mesh* getMeshSurface(
+        const MeshLib::Mesh& mesh,
+        const MathLib::Vector3& dir,
+        double angle,
+        std::string const& subsfc_node_id_backup_prop_name = "");
 
-	/**
-	 * Returns the boundary of mesh, i.e. lines for 2D meshes and surfaces for 3D meshes.
-	 * Note, that this method also returns inner boundaries and might give unexpected results
-	 * when the mesh geometry is not strict (e.g. more than two triangles sharing an edge).
-	 * \param mesh The original mesh of dimension d
-	 * \return     A mesh of dimension (d-1) representing the boundary of the mesh.
-	 */
-	static MeshLib::Mesh* getMeshBoundary(const MeshLib::Mesh &mesh);
+    /**
+     * Returns the boundary of mesh, i.e. lines for 2D meshes and surfaces for 3D meshes.
+     * Note, that this method also returns inner boundaries and might give unexpected results
+     * when the mesh geometry is not strict (e.g. more than two triangles sharing an edge).
+     * \param mesh The original mesh of dimension d
+     * \return     A mesh of dimension (d-1) representing the boundary of the mesh.
+     */
+    static MeshLib::Mesh* getMeshBoundary(const MeshLib::Mesh &mesh);
 
 private:
-	/// Functionality needed for getSurfaceNodes() and getMeshSurface()
-	static void get2DSurfaceElements(const std::vector<MeshLib::Element*> &all_elements, std::vector<MeshLib::Element*> &sfc_elements, const MathLib::Vector3 &dir, double angle, unsigned mesh_dimension);
+    /// Functionality needed for getSurfaceNodes() and getMeshSurface()
+    static void get2DSurfaceElements(const std::vector<MeshLib::Element*> &all_elements, std::vector<MeshLib::Element*> &sfc_elements, const MathLib::Vector3 &dir, double angle, unsigned mesh_dimension);
 
-	/// Functionality needed for getSurfaceNodes() and getMeshSurface()
-	static void get2DSurfaceNodes(std::vector<MeshLib::Node*> &sfc_nodes, std::size_t n_all_nodes, const std::vector<MeshLib::Element*> &sfc_elements, std::vector<std::size_t> &node_id_map);
+    /// Functionality needed for getSurfaceNodes() and getMeshSurface()
+    static void get2DSurfaceNodes(std::vector<MeshLib::Node*> &sfc_nodes, std::size_t n_all_nodes, const std::vector<MeshLib::Element*> &sfc_elements, std::vector<std::size_t> &node_id_map);
 };
 
 } // end namespace MeshLib
diff --git a/MeshLib/Node.cpp b/MeshLib/Node.cpp
index bdc43647683..d28d8a7bbee 100644
--- a/MeshLib/Node.cpp
+++ b/MeshLib/Node.cpp
@@ -18,23 +18,23 @@
 namespace MeshLib {
 
 Node::Node(const double coords[3], std::size_t id)
-	: MathLib::Point3dWithID(
-		std::array<double,3>{{coords[0], coords[1], coords[2]}}, id)
+    : MathLib::Point3dWithID(
+        std::array<double,3>{{coords[0], coords[1], coords[2]}}, id)
 {
 }
 
 Node::Node(std::array<double, 3> const& coords, std::size_t id)
-	: MathLib::Point3dWithID(coords, id)
+    : MathLib::Point3dWithID(coords, id)
 {
 }
 
 Node::Node(double x, double y, double z, std::size_t id)
-	: MathLib::Point3dWithID(std::array<double,3>({{x, y, z}}), id)
+    : MathLib::Point3dWithID(std::array<double,3>({{x, y, z}}), id)
 {
 }
 
 Node::Node(const Node &node)
-	: MathLib::Point3dWithID(node._x, node.getID())
+    : MathLib::Point3dWithID(node._x, node.getID())
 {
 }
 
@@ -44,13 +44,13 @@ Node::~Node()
 
 void Node::updateCoordinates(double x, double y, double z)
 {
-	_x[0] = x;
-	_x[1] = y;
-	_x[2] = z;
+    _x[0] = x;
+    _x[1] = y;
+    _x[2] = z;
 
-	const std::size_t nElements (this->_elements.size());
-	for (std::size_t i=0; i<nElements; i++)
-		_elements[i]->computeVolume();
+    const std::size_t nElements (this->_elements.size());
+    for (std::size_t i=0; i<nElements; i++)
+        _elements[i]->computeVolume();
 }
 
 }
diff --git a/MeshLib/Node.h b/MeshLib/Node.h
index 3c457be50f9..889f05af1b4 100644
--- a/MeshLib/Node.h
+++ b/MeshLib/Node.h
@@ -31,72 +31,72 @@ class Element;
  */
 class Node : public MathLib::Point3dWithID
 {
-	/* friend classes: */
-	friend class Mesh;
-	friend class MeshRevision;
-	friend class MeshLayerMapper;
+    /* friend classes: */
+    friend class Mesh;
+    friend class MeshRevision;
+    friend class MeshLayerMapper;
 
 public:
-	/// Constructor using a coordinate array
-	Node(const double coords[3], std::size_t id = std::numeric_limits<std::size_t>::max());
+    /// Constructor using a coordinate array
+    Node(const double coords[3], std::size_t id = std::numeric_limits<std::size_t>::max());
 
-	/// Constructor using a coordinate array
-	Node(std::array<double, 3> const& coords, std::size_t id = std::numeric_limits<std::size_t>::max());
+    /// Constructor using a coordinate array
+    Node(std::array<double, 3> const& coords, std::size_t id = std::numeric_limits<std::size_t>::max());
 
-	/// Constructor using single coordinates
-	Node(double x, double y, double z, std::size_t id = std::numeric_limits<std::size_t>::max());
+    /// Constructor using single coordinates
+    Node(double x, double y, double z, std::size_t id = std::numeric_limits<std::size_t>::max());
 
-	/// Copy constructor
-	Node(const Node &node);
+    /// Copy constructor
+    Node(const Node &node);
 
-	/// Return all the nodes connected to this one
-	const std::vector<MeshLib::Node*>& getConnectedNodes() const { return _connected_nodes; }
+    /// Return all the nodes connected to this one
+    const std::vector<MeshLib::Node*>& getConnectedNodes() const { return _connected_nodes; }
 
-	/// Get an element the node is part of.
-	const Element* getElement(std::size_t idx) const { return _elements[idx]; }
+    /// Get an element the node is part of.
+    const Element* getElement(std::size_t idx) const { return _elements[idx]; }
 
-	/// Get all elements the node is part of.
-	const std::vector<Element*>& getElements() const { return _elements; }
+    /// Get all elements the node is part of.
+    const std::vector<Element*>& getElements() const { return _elements; }
 
-	/// Get number of elements the node is part of.
-	std::size_t getNElements() const { return _elements.size(); }
+    /// Get number of elements the node is part of.
+    std::size_t getNElements() const { return _elements.size(); }
 
-	/// Destructor
-	virtual ~Node();
+    /// Destructor
+    virtual ~Node();
 
-	/// Shift the node according to the displacement vector v.
-	Node operator-(MathLib::Vector3 const& v) const
-	{
-		return Node(_x[0]-v[0], _x[1]-v[1], _x[2]-v[2]);
-	}
+    /// Shift the node according to the displacement vector v.
+    Node operator-(MathLib::Vector3 const& v) const
+    {
+        return Node(_x[0]-v[0], _x[1]-v[1], _x[2]-v[2]);
+    }
 
 protected:
-	/// Update coordinates of a node.
-	/// This method automatically also updates the areas/volumes of all connected elements.
-	virtual void updateCoordinates(double x, double y, double z);
-
-	/**
-	 * Add an element the node is part of.
-	 * This method is called by Mesh::addElement(Element*), see friend definition.
-	 */
-	void addElement(Element* elem) { _elements.push_back(elem); }
-
-	/// clear stored elements connecting to this node
-	void clearElements() { _elements.clear(); }
-
-	/// Resets the connected nodes of this node. The connected nodes are
-	/// generated by Mesh::setNodesConnectedByEdges() and
-	/// Mesh::setNodesConnectedByElements().
-	void setConnectedNodes(std::vector<Node*> &connected_nodes)
-	{
-		_connected_nodes = connected_nodes;
-	}
-
-	/// Sets the ID of a node to the given value.
-	void setID(std::size_t id) { this->_id = id; }
-
-	std::vector<Node*> _connected_nodes;
-	std::vector<Element*> _elements;
+    /// Update coordinates of a node.
+    /// This method automatically also updates the areas/volumes of all connected elements.
+    virtual void updateCoordinates(double x, double y, double z);
+
+    /**
+     * Add an element the node is part of.
+     * This method is called by Mesh::addElement(Element*), see friend definition.
+     */
+    void addElement(Element* elem) { _elements.push_back(elem); }
+
+    /// clear stored elements connecting to this node
+    void clearElements() { _elements.clear(); }
+
+    /// Resets the connected nodes of this node. The connected nodes are
+    /// generated by Mesh::setNodesConnectedByEdges() and
+    /// Mesh::setNodesConnectedByElements().
+    void setConnectedNodes(std::vector<Node*> &connected_nodes)
+    {
+        _connected_nodes = connected_nodes;
+    }
+
+    /// Sets the ID of a node to the given value.
+    void setID(std::size_t id) { this->_id = id; }
+
+    std::vector<Node*> _connected_nodes;
+    std::vector<Element*> _elements;
 }; /* class */
 
 } /* namespace */
diff --git a/MeshLib/Properties-impl.h b/MeshLib/Properties-impl.h
index bacc1b8e511..c760d39e782 100644
--- a/MeshLib/Properties-impl.h
+++ b/MeshLib/Properties-impl.h
@@ -14,108 +14,108 @@
 template <typename T>
 boost::optional<PropertyVector<T> &>
 Properties::createNewPropertyVector(std::string const& name,
-	MeshItemType mesh_item_type,
-	std::size_t n_components)
+    MeshItemType mesh_item_type,
+    std::size_t n_components)
 {
-	std::map<std::string, PropertyVectorBase*>::const_iterator it(
-		_properties.find(name)
-	);
-	if (it != _properties.end()) {
-		ERR("A property of the name \"%s\" is already assigned to the mesh.",
-			name.c_str());
-		return boost::optional<PropertyVector<T> &>();
-	}
-	auto entry_info(
-		_properties.insert(
-			std::make_pair(
-				name, new PropertyVector<T>(name, mesh_item_type, n_components)
-			)
-		)
-	);
-	return boost::optional<PropertyVector<T> &>(*(
-			static_cast<PropertyVector<T>*>((entry_info.first)->second)
-		)
-	);
+    std::map<std::string, PropertyVectorBase*>::const_iterator it(
+        _properties.find(name)
+    );
+    if (it != _properties.end()) {
+        ERR("A property of the name \"%s\" is already assigned to the mesh.",
+            name.c_str());
+        return boost::optional<PropertyVector<T> &>();
+    }
+    auto entry_info(
+        _properties.insert(
+            std::make_pair(
+                name, new PropertyVector<T>(name, mesh_item_type, n_components)
+            )
+        )
+    );
+    return boost::optional<PropertyVector<T> &>(*(
+            static_cast<PropertyVector<T>*>((entry_info.first)->second)
+        )
+    );
 }
 
 template <typename T>
 boost::optional<PropertyVector<T> &>
 Properties::createNewPropertyVector(std::string const& name,
-	std::size_t n_prop_groups,
-	std::vector<std::size_t> const& item2group_mapping,
-	MeshItemType mesh_item_type,
-	std::size_t n_components)
+    std::size_t n_prop_groups,
+    std::vector<std::size_t> const& item2group_mapping,
+    MeshItemType mesh_item_type,
+    std::size_t n_components)
 {
-	// check if there is already a PropertyVector with the same name and
-	// mesh_item_type
-	std::map<std::string, PropertyVectorBase*>::const_iterator it(
-		_properties.find(name)
-	);
-	if (it != _properties.end()) {
-		ERR("A property of the name \"%s\" already assigned to the mesh.",
-			name.c_str());
-		return boost::optional<PropertyVector<T> &>();
-	}
+    // check if there is already a PropertyVector with the same name and
+    // mesh_item_type
+    std::map<std::string, PropertyVectorBase*>::const_iterator it(
+        _properties.find(name)
+    );
+    if (it != _properties.end()) {
+        ERR("A property of the name \"%s\" already assigned to the mesh.",
+            name.c_str());
+        return boost::optional<PropertyVector<T> &>();
+    }
 
-	// check entries of item2group_mapping of consistence
-	for (std::size_t k(0); k<item2group_mapping.size(); k++) {
-		std::size_t const group_id (item2group_mapping[k]);
-		if (group_id >= n_prop_groups) {
-			ERR("The mapping to property %d for item %d is not in the correct range [0,%d).", group_id, k, n_prop_groups);
-			return boost::optional<PropertyVector<T> &>();
-		}
-	}
+    // check entries of item2group_mapping of consistence
+    for (std::size_t k(0); k<item2group_mapping.size(); k++) {
+        std::size_t const group_id (item2group_mapping[k]);
+        if (group_id >= n_prop_groups) {
+            ERR("The mapping to property %d for item %d is not in the correct range [0,%d).", group_id, k, n_prop_groups);
+            return boost::optional<PropertyVector<T> &>();
+        }
+    }
 
-	auto entry_info(
-		_properties.insert(
-			std::pair<std::string, PropertyVectorBase*>(
-				name,
-				new PropertyVector<T>(n_prop_groups,
-					item2group_mapping, name, mesh_item_type, n_components)
-			)
-		)
-	);
-	return boost::optional<PropertyVector<T> &>
-		(*(static_cast<PropertyVector<T>*>((entry_info.first)->second)));
+    auto entry_info(
+        _properties.insert(
+            std::pair<std::string, PropertyVectorBase*>(
+                name,
+                new PropertyVector<T>(n_prop_groups,
+                    item2group_mapping, name, mesh_item_type, n_components)
+            )
+        )
+    );
+    return boost::optional<PropertyVector<T> &>
+        (*(static_cast<PropertyVector<T>*>((entry_info.first)->second)));
 }
 
 template <typename T>
 boost::optional<PropertyVector<T> const&>
 Properties::getPropertyVector(std::string const& name) const
 {
-	std::map<std::string, PropertyVectorBase*>::const_iterator it(
-		_properties.find(name)
-	);
-	if (it == _properties.end()) {
-		ERR("A property with the specified name \"%s\" is not available.",
-			name.c_str());
-		return boost::optional<PropertyVector<T> const&>();
-	}
+    std::map<std::string, PropertyVectorBase*>::const_iterator it(
+        _properties.find(name)
+    );
+    if (it == _properties.end()) {
+        ERR("A property with the specified name \"%s\" is not available.",
+            name.c_str());
+        return boost::optional<PropertyVector<T> const&>();
+    }
 
-	PropertyVector<T> const* t=dynamic_cast<PropertyVector<T>const*>(it->second);
-	if (!t) {
-		return boost::optional<PropertyVector<T> const&>();
-	}
-	return *t;
+    PropertyVector<T> const* t=dynamic_cast<PropertyVector<T>const*>(it->second);
+    if (!t) {
+        return boost::optional<PropertyVector<T> const&>();
+    }
+    return *t;
 }
 
 template <typename T>
 boost::optional<PropertyVector<T>&>
 Properties::getPropertyVector(std::string const& name)
 {
-	std::map<std::string, PropertyVectorBase*>::iterator it(
-		_properties.find(name)
-	);
-	if (it == _properties.end()) {
-		ERR("A property with the specified name \"%s\" is not available.",
-			name.c_str());
-		return boost::optional<PropertyVector<T>&>();
-	}
+    std::map<std::string, PropertyVectorBase*>::iterator it(
+        _properties.find(name)
+    );
+    if (it == _properties.end()) {
+        ERR("A property with the specified name \"%s\" is not available.",
+            name.c_str());
+        return boost::optional<PropertyVector<T>&>();
+    }
 
-	PropertyVector<T> *t=dynamic_cast<PropertyVector<T>*>(it->second);
-	if (!t) {
-		return boost::optional<PropertyVector<T> &>();
-	}
-	return *t;
+    PropertyVector<T> *t=dynamic_cast<PropertyVector<T>*>(it->second);
+    if (!t) {
+        return boost::optional<PropertyVector<T> &>();
+    }
+    return *t;
 }
 
diff --git a/MeshLib/Properties.cpp b/MeshLib/Properties.cpp
index ad0869862bc..0d4c2a24015 100644
--- a/MeshLib/Properties.cpp
+++ b/MeshLib/Properties.cpp
@@ -18,75 +18,75 @@ namespace MeshLib
 
 void Properties::removePropertyVector(std::string const& name)
 {
-	std::map<std::string, PropertyVectorBase*>::const_iterator it(
-		_properties.find(name)
-	);
-	if (it == _properties.end()) {
-		WARN("A property of the name \"%s\" does not exist.",
-			name.c_str());
-		return;
-	}
-	delete it->second;
-	_properties.erase(it);
+    std::map<std::string, PropertyVectorBase*>::const_iterator it(
+        _properties.find(name)
+    );
+    if (it == _properties.end()) {
+        WARN("A property of the name \"%s\" does not exist.",
+            name.c_str());
+        return;
+    }
+    delete it->second;
+    _properties.erase(it);
 }
 
 bool Properties::hasPropertyVector(std::string const& name) const
 {
-	std::map<std::string, PropertyVectorBase*>::const_iterator it(
-		_properties.find(name)
-	);
-	if (it == _properties.end()) {
-		return false;
-	}
-	return true;
+    std::map<std::string, PropertyVectorBase*>::const_iterator it(
+        _properties.find(name)
+    );
+    if (it == _properties.end()) {
+        return false;
+    }
+    return true;
 }
 
 std::vector<std::string> Properties::getPropertyVectorNames() const
 {
-	std::vector<std::string> names;
-	for (auto p : _properties)
-		names.push_back(p.first);
-	return names;
+    std::vector<std::string> names;
+    for (auto p : _properties)
+        names.push_back(p.first);
+    return names;
 }
 
 Properties Properties::excludeCopyProperties(
     std::vector<std::size_t> const& exclude_elem_ids,
     std::vector<std::size_t> const& exclude_node_ids) const
 {
-	Properties exclude_copy;
-	for (auto property_vector : _properties) {
-		if (property_vector.second->getMeshItemType() == MeshItemType::Cell) {
-			exclude_copy._properties.insert(
-				std::make_pair(property_vector.first,
-				property_vector.second->clone(exclude_elem_ids))
-			);
-		}
-		else if (property_vector.second->getMeshItemType() == MeshItemType::Node)
-		{
-			exclude_copy._properties.insert(
-				std::make_pair(property_vector.first,
-				property_vector.second->clone(exclude_node_ids))
-			);
-		}
-	}
-	return exclude_copy;
+    Properties exclude_copy;
+    for (auto property_vector : _properties) {
+        if (property_vector.second->getMeshItemType() == MeshItemType::Cell) {
+            exclude_copy._properties.insert(
+                std::make_pair(property_vector.first,
+                property_vector.second->clone(exclude_elem_ids))
+            );
+        }
+        else if (property_vector.second->getMeshItemType() == MeshItemType::Node)
+        {
+            exclude_copy._properties.insert(
+                std::make_pair(property_vector.first,
+                property_vector.second->clone(exclude_node_ids))
+            );
+        }
+    }
+    return exclude_copy;
 }
 
 Properties::Properties(Properties const& properties)
-	: _properties(properties._properties)
+    : _properties(properties._properties)
 {
-	std::vector<std::size_t> exclude_positions;
-	for (auto it(_properties.begin()); it != _properties.end(); ++it) {
-		PropertyVectorBase *t(it->second->clone(exclude_positions));
-		it->second = t;
-	}
+    std::vector<std::size_t> exclude_positions;
+    for (auto it(_properties.begin()); it != _properties.end(); ++it) {
+        PropertyVectorBase *t(it->second->clone(exclude_positions));
+        it->second = t;
+    }
 }
 
 Properties::~Properties()
 {
-	for (auto property_vector : _properties) {
-		delete property_vector.second;
-	}
+    for (auto property_vector : _properties) {
+        delete property_vector.second;
+    }
 }
 
 } // end namespace MeshLib
diff --git a/MeshLib/Properties.h b/MeshLib/Properties.h
index 8df0bb6edd9..4d7511fca4a 100644
--- a/MeshLib/Properties.h
+++ b/MeshLib/Properties.h
@@ -40,88 +40,88 @@ namespace MeshLib
 class Properties
 {
 public:
-	/// Method creates a PropertyVector if a PropertyVector with the same name
-	/// and the same type T was not already created before. In case there exists
-	/// already such a PropertyVector the returned boost::optional holds an
-	/// invalid/unusable PropertyVector.
-	/// There are two versions of this method. This method is used
-	/// when every mesh item at hand has its own property value, i.e. \f$n\f$
-	/// mesh item and \f$n\f$ different property values.
-	/// The user has to ensure the correct usage of the vector later on.
-	/// @tparam T type of the property value
-	/// @param name the name of the property
-	/// @param mesh_item_type for instance node or element assigned properties
-	/// @param n_components number of components for each tuple
-	/// @return On success a reference to a PropertyVector packed into a
-	///   boost::optional else an empty boost::optional.
-	template <typename T>
-	boost::optional<PropertyVector<T> &>
-	createNewPropertyVector(std::string const& name,
-		MeshItemType mesh_item_type,
-		std::size_t n_components = 1);
-
-	/// Method creates a PropertyVector if a PropertyVector with the same name
-	/// and the same type T was not already created before. In case there exists
-	/// already such a PropertyVector the returned boost::optional holds an
-	/// invalid/unusable PropertyVector.
-	/// This method is used if only a small number of distinct property values
-	/// in a property exist (e.g. mapping property groups to elements).
-	/// In this case a mapping between mesh items and properties (stored
-	/// on the heap), see the parameter item2group_mapping, is required.
-	/// @tparam T type of the property value
-	/// @param name the name of the property
-	/// @param n_prop_groups number of distinct property groups
-	/// @param item2group_mapping the mapping between mesh item and the property
-	/// group
-	/// @param mesh_item_type for instance node or element assigned properties
-	/// @param n_components number of components for each tuple
-	/// @return On success a reference to a PropertyVector packed into a
-	///   boost::optional else an empty boost::optional.
-	template <typename T>
-	boost::optional<PropertyVector<T> &>
-	createNewPropertyVector(std::string const& name,
-		std::size_t n_prop_groups,
-		std::vector<std::size_t> const& item2group_mapping,
-		MeshItemType mesh_item_type,
-		std::size_t n_components = 1);
-
-	/// Method to get a vector of property values.
-	template <typename T>
-	boost::optional<PropertyVector<T> const&>
-	getPropertyVector(std::string const& name) const;
-
-	/// Method to get a vector of property values.
-	template <typename T>
-	boost::optional<PropertyVector<T>&>
-	getPropertyVector(std::string const& name);
-
-	void removePropertyVector(std::string const& name);
-
-	/// Check if a PropertyVector accessible by the name is already
-	/// stored within the Properties object.
-	/// @param name the name of the property (for instance porosity)
-	bool hasPropertyVector(std::string const& name) const;
-
-	std::vector<std::string> getPropertyVectorNames() const;
-
-	/** copy all PropertyVector objects stored in the (internal) map but only
-	 * those nodes/elements of a PropertyVector whose ids are not in the vectors
-	 * exclude_*_ids.
-	 */
-	Properties excludeCopyProperties(
-	    std::vector<std::size_t> const& exclude_elem_ids,
-	    std::vector<std::size_t> const& exclude_node_ids) const;
-
-	Properties() {}
-
-	Properties(Properties const& properties);
-
-	~Properties();
+    /// Method creates a PropertyVector if a PropertyVector with the same name
+    /// and the same type T was not already created before. In case there exists
+    /// already such a PropertyVector the returned boost::optional holds an
+    /// invalid/unusable PropertyVector.
+    /// There are two versions of this method. This method is used
+    /// when every mesh item at hand has its own property value, i.e. \f$n\f$
+    /// mesh item and \f$n\f$ different property values.
+    /// The user has to ensure the correct usage of the vector later on.
+    /// @tparam T type of the property value
+    /// @param name the name of the property
+    /// @param mesh_item_type for instance node or element assigned properties
+    /// @param n_components number of components for each tuple
+    /// @return On success a reference to a PropertyVector packed into a
+    ///   boost::optional else an empty boost::optional.
+    template <typename T>
+    boost::optional<PropertyVector<T> &>
+    createNewPropertyVector(std::string const& name,
+        MeshItemType mesh_item_type,
+        std::size_t n_components = 1);
+
+    /// Method creates a PropertyVector if a PropertyVector with the same name
+    /// and the same type T was not already created before. In case there exists
+    /// already such a PropertyVector the returned boost::optional holds an
+    /// invalid/unusable PropertyVector.
+    /// This method is used if only a small number of distinct property values
+    /// in a property exist (e.g. mapping property groups to elements).
+    /// In this case a mapping between mesh items and properties (stored
+    /// on the heap), see the parameter item2group_mapping, is required.
+    /// @tparam T type of the property value
+    /// @param name the name of the property
+    /// @param n_prop_groups number of distinct property groups
+    /// @param item2group_mapping the mapping between mesh item and the property
+    /// group
+    /// @param mesh_item_type for instance node or element assigned properties
+    /// @param n_components number of components for each tuple
+    /// @return On success a reference to a PropertyVector packed into a
+    ///   boost::optional else an empty boost::optional.
+    template <typename T>
+    boost::optional<PropertyVector<T> &>
+    createNewPropertyVector(std::string const& name,
+        std::size_t n_prop_groups,
+        std::vector<std::size_t> const& item2group_mapping,
+        MeshItemType mesh_item_type,
+        std::size_t n_components = 1);
+
+    /// Method to get a vector of property values.
+    template <typename T>
+    boost::optional<PropertyVector<T> const&>
+    getPropertyVector(std::string const& name) const;
+
+    /// Method to get a vector of property values.
+    template <typename T>
+    boost::optional<PropertyVector<T>&>
+    getPropertyVector(std::string const& name);
+
+    void removePropertyVector(std::string const& name);
+
+    /// Check if a PropertyVector accessible by the name is already
+    /// stored within the Properties object.
+    /// @param name the name of the property (for instance porosity)
+    bool hasPropertyVector(std::string const& name) const;
+
+    std::vector<std::string> getPropertyVectorNames() const;
+
+    /** copy all PropertyVector objects stored in the (internal) map but only
+     * those nodes/elements of a PropertyVector whose ids are not in the vectors
+     * exclude_*_ids.
+     */
+    Properties excludeCopyProperties(
+        std::vector<std::size_t> const& exclude_elem_ids,
+        std::vector<std::size_t> const& exclude_node_ids) const;
+
+    Properties() {}
+
+    Properties(Properties const& properties);
+
+    ~Properties();
 
 private:
-	/// A mapping from property's name to the stored object of any type.
-	/// See addProperty() and getProperty() documentation.
-	std::map<std::string, PropertyVectorBase*> _properties;
+    /// A mapping from property's name to the stored object of any type.
+    /// See addProperty() and getProperty() documentation.
+    std::map<std::string, PropertyVectorBase*> _properties;
 }; // end class
 
 #include "Properties-impl.h"
diff --git a/MeshLib/PropertyVector.h b/MeshLib/PropertyVector.h
index 3eadde1d7db..df9041f205b 100644
--- a/MeshLib/PropertyVector.h
+++ b/MeshLib/PropertyVector.h
@@ -27,27 +27,27 @@ namespace MeshLib
 class PropertyVectorBase
 {
 public:
-	virtual PropertyVectorBase* clone(
-		std::vector<std::size_t> const& exclude_positions
-	) const = 0;
-	virtual ~PropertyVectorBase() = default;
+    virtual PropertyVectorBase* clone(
+        std::vector<std::size_t> const& exclude_positions
+    ) const = 0;
+    virtual ~PropertyVectorBase() = default;
 
-	MeshItemType getMeshItemType() const { return _mesh_item_type; }
-	std::string const& getPropertyName() const { return _property_name; }
-	std::size_t getNumberOfComponents() const { return _n_components; }
+    MeshItemType getMeshItemType() const { return _mesh_item_type; }
+    std::string const& getPropertyName() const { return _property_name; }
+    std::size_t getNumberOfComponents() const { return _n_components; }
 
 protected:
-	PropertyVectorBase(std::string const& property_name,
-	                   MeshItemType mesh_item_type,
-	                   std::size_t n_components)
-	    : _n_components(n_components),
-	      _mesh_item_type(mesh_item_type),
-	      _property_name(property_name)
-	{}
-
-	std::size_t const _n_components;
-	MeshItemType const _mesh_item_type;
-	std::string const _property_name;
+    PropertyVectorBase(std::string const& property_name,
+                       MeshItemType mesh_item_type,
+                       std::size_t n_components)
+        : _n_components(n_components),
+          _mesh_item_type(mesh_item_type),
+          _property_name(property_name)
+    {}
+
+    std::size_t const _n_components;
+    MeshItemType const _mesh_item_type;
+    std::string const _property_name;
 };
 
 /// Class template PropertyVector is a std::vector with template parameter
@@ -56,57 +56,57 @@ protected:
 /// \tparam PROP_VAL_TYPE typical this is a scalar, a vector or a matrix
 template <typename PROP_VAL_TYPE>
 class PropertyVector : public std::vector<PROP_VAL_TYPE>,
-	public PropertyVectorBase
+    public PropertyVectorBase
 {
 friend class Properties;
 
 public:
-	std::size_t getNumberOfTuples() const
-	{
-		return std::vector<PROP_VAL_TYPE>::size() / _n_components;
-	}
-
-	PropertyVectorBase* clone(std::vector<std::size_t> const& exclude_positions) const
-	{
-		PropertyVector<PROP_VAL_TYPE> *t(new PropertyVector<PROP_VAL_TYPE>(_property_name,
-			_mesh_item_type, _n_components));
-		BaseLib::excludeObjectCopy(*this, exclude_positions, *t);
-		return t;
-	}
-
-	/// Method returns the number of tuples times the number of tuple components.
-	std::size_t size() const
-	{
-		return std::vector<PROP_VAL_TYPE>::size();
-	}
+    std::size_t getNumberOfTuples() const
+    {
+        return std::vector<PROP_VAL_TYPE>::size() / _n_components;
+    }
+
+    PropertyVectorBase* clone(std::vector<std::size_t> const& exclude_positions) const
+    {
+        PropertyVector<PROP_VAL_TYPE> *t(new PropertyVector<PROP_VAL_TYPE>(_property_name,
+            _mesh_item_type, _n_components));
+        BaseLib::excludeObjectCopy(*this, exclude_positions, *t);
+        return t;
+    }
+
+    /// Method returns the number of tuples times the number of tuple components.
+    std::size_t size() const
+    {
+        return std::vector<PROP_VAL_TYPE>::size();
+    }
 
 protected:
-	/// @brief The constructor taking meta information for the data.
-	/// @param property_name a string describing the property
-	/// @param mesh_item_type the values of the property are either assigned to
-	/// nodes or cells (see enumeration MeshItemType)
-	/// @param n_components the number of components of a property
-	explicit PropertyVector(std::string const& property_name,
-	                        MeshItemType mesh_item_type,
-	                        std::size_t n_components)
-	    : std::vector<PROP_VAL_TYPE>(),
-	      PropertyVectorBase(property_name, mesh_item_type, n_components)
-	{}
-
-	/// @brief The constructor taking meta information for the data.
-	/// @param n_property_values number of property values (value can be a tuple
-	/// with several entries)
-	/// @param property_name a string describing the property
-	/// @param mesh_item_type the values of the property are either assigned to
-	/// nodes or cells (see enumeration MeshItemType)
-	/// @param n_components the number of components of a property
-	PropertyVector(std::size_t n_property_values,
-	               std::string const& property_name,
-	               MeshItemType mesh_item_type,
-	               std::size_t n_components)
-	    : std::vector<PROP_VAL_TYPE>(n_property_values * n_components),
-	      PropertyVectorBase(property_name, mesh_item_type, n_components)
-	{}
+    /// @brief The constructor taking meta information for the data.
+    /// @param property_name a string describing the property
+    /// @param mesh_item_type the values of the property are either assigned to
+    /// nodes or cells (see enumeration MeshItemType)
+    /// @param n_components the number of components of a property
+    explicit PropertyVector(std::string const& property_name,
+                            MeshItemType mesh_item_type,
+                            std::size_t n_components)
+        : std::vector<PROP_VAL_TYPE>(),
+          PropertyVectorBase(property_name, mesh_item_type, n_components)
+    {}
+
+    /// @brief The constructor taking meta information for the data.
+    /// @param n_property_values number of property values (value can be a tuple
+    /// with several entries)
+    /// @param property_name a string describing the property
+    /// @param mesh_item_type the values of the property are either assigned to
+    /// nodes or cells (see enumeration MeshItemType)
+    /// @param n_components the number of components of a property
+    PropertyVector(std::size_t n_property_values,
+                   std::string const& property_name,
+                   MeshItemType mesh_item_type,
+                   std::size_t n_components)
+        : std::vector<PROP_VAL_TYPE>(n_property_values * n_components),
+          PropertyVectorBase(property_name, mesh_item_type, n_components)
+    {}
 };
 
 /// Class template PropertyVector is a std::vector with template parameter
@@ -120,102 +120,102 @@ protected:
 /// a vector or a matrix type
 template <typename T>
 class PropertyVector<T*> : public std::vector<std::size_t>,
-	public PropertyVectorBase
+    public PropertyVectorBase
 {
 friend class Properties;
 public:
-	/// Destructor ensures the deletion of the heap-constructed objects.
-	~PropertyVector()
-	{
-		for (auto v : _values)
-			delete v;
-	}
-
-	/// The operator[] uses the item to group property map to access to the
-	/// correct property value/object.
-	T* const& operator[](std::size_t id) const
-	{
-		return _values[std::vector<std::size_t>::operator[](id)];
-	}
-
-	T* & operator[](std::size_t id)
-	{
-		return _values[std::vector<std::size_t>::operator[](id)];
-	}
-
-	void initPropertyValue(std::size_t group_id, T const& value)
-	{
-		_values[group_id] = new T(value);
-	}
-
-	std::size_t getNumberOfTuples() const
-	{
-		return std::vector<std::size_t>::size();
-	}
-	/// Method returns the number of tuples times the number of tuple components.
-	std::size_t size() const
-	{
-		return _n_components * std::vector<std::size_t>::size();
-	}
-
-	PropertyVectorBase* clone(std::vector<std::size_t> const& exclude_positions) const
-	{
-		// create new PropertyVector with modified mapping
-		PropertyVector<T*> *t(new PropertyVector<T*>
-			(
-				_values.size()/_n_components,
-				BaseLib::excludeObjectCopy(*this, exclude_positions),
-				_property_name, _mesh_item_type, _n_components
-			)
-		);
-		// copy pointers to property values
-		for (std::size_t j(0); j<_values.size(); j++) {
-			t->initPropertyValue(j, *(_values[j]));
-		}
-		return t;
-	}
+    /// Destructor ensures the deletion of the heap-constructed objects.
+    ~PropertyVector()
+    {
+        for (auto v : _values)
+            delete v;
+    }
+
+    /// The operator[] uses the item to group property map to access to the
+    /// correct property value/object.
+    T* const& operator[](std::size_t id) const
+    {
+        return _values[std::vector<std::size_t>::operator[](id)];
+    }
+
+    T* & operator[](std::size_t id)
+    {
+        return _values[std::vector<std::size_t>::operator[](id)];
+    }
+
+    void initPropertyValue(std::size_t group_id, T const& value)
+    {
+        _values[group_id] = new T(value);
+    }
+
+    std::size_t getNumberOfTuples() const
+    {
+        return std::vector<std::size_t>::size();
+    }
+    /// Method returns the number of tuples times the number of tuple components.
+    std::size_t size() const
+    {
+        return _n_components * std::vector<std::size_t>::size();
+    }
+
+    PropertyVectorBase* clone(std::vector<std::size_t> const& exclude_positions) const
+    {
+        // create new PropertyVector with modified mapping
+        PropertyVector<T*> *t(new PropertyVector<T*>
+            (
+                _values.size()/_n_components,
+                BaseLib::excludeObjectCopy(*this, exclude_positions),
+                _property_name, _mesh_item_type, _n_components
+            )
+        );
+        // copy pointers to property values
+        for (std::size_t j(0); j<_values.size(); j++) {
+            t->initPropertyValue(j, *(_values[j]));
+        }
+        return t;
+    }
 
 #ifndef NDEBUG
-	std::ostream& print(std::ostream &os) const
-	{
-		os << "\nPropertyVector<T*> at address: " << this << ":\n";
-		os << "\tmapping (" << size() <<"):\n";
-		std::copy(this->cbegin(), this->cend(),
-			std::ostream_iterator<std::size_t>(os, " "));
-		os << "\n\tvalues (" << _values.size() << "):\n";
-		for (std::size_t k(0); k<_values.size(); k++) {
-			os << "val: " << *(_values[k]) << ", address: " << _values[k] << "\n";
-		}
-		return os;
-	}
+    std::ostream& print(std::ostream &os) const
+    {
+        os << "\nPropertyVector<T*> at address: " << this << ":\n";
+        os << "\tmapping (" << size() <<"):\n";
+        std::copy(this->cbegin(), this->cend(),
+            std::ostream_iterator<std::size_t>(os, " "));
+        os << "\n\tvalues (" << _values.size() << "):\n";
+        for (std::size_t k(0); k<_values.size(); k++) {
+            os << "val: " << *(_values[k]) << ", address: " << _values[k] << "\n";
+        }
+        return os;
+    }
 #endif
 
 protected:
-	/// @brief The constructor taking meta information for the data.
-	/// @param n_prop_groups number of different property values
-	/// @param item2group_mapping Class Mesh has a mapping from the mesh items
-	/// (Node or Element) to an index (position in the data structure).
-	/// The vector item2group_mapping must have the same number of entries as
-	/// the above mapping and the values have to be in the range
-	/// \f$[0, \text{n_prop_groups})\f$.
-	/// @param property_name a string describing the property
-	/// @param mesh_item_type the values of the property are either assigned to
-	/// nodes or cells (see enumeration MeshItemType)
-	/// @param n_components the number of elements of a tuple
-	PropertyVector(std::size_t n_prop_groups,
-	               std::vector<std::size_t> const& item2group_mapping,
-	               std::string const& property_name,
-	               MeshItemType mesh_item_type,
-	               std::size_t n_components)
-	    : std::vector<std::size_t>(item2group_mapping),
-	      PropertyVectorBase(property_name, mesh_item_type, n_components),
-	      _values(n_prop_groups * n_components)
-	{}
+    /// @brief The constructor taking meta information for the data.
+    /// @param n_prop_groups number of different property values
+    /// @param item2group_mapping Class Mesh has a mapping from the mesh items
+    /// (Node or Element) to an index (position in the data structure).
+    /// The vector item2group_mapping must have the same number of entries as
+    /// the above mapping and the values have to be in the range
+    /// \f$[0, \text{n_prop_groups})\f$.
+    /// @param property_name a string describing the property
+    /// @param mesh_item_type the values of the property are either assigned to
+    /// nodes or cells (see enumeration MeshItemType)
+    /// @param n_components the number of elements of a tuple
+    PropertyVector(std::size_t n_prop_groups,
+                   std::vector<std::size_t> const& item2group_mapping,
+                   std::string const& property_name,
+                   MeshItemType mesh_item_type,
+                   std::size_t n_components)
+        : std::vector<std::size_t>(item2group_mapping),
+          PropertyVectorBase(property_name, mesh_item_type, n_components),
+          _values(n_prop_groups * n_components)
+    {}
 
 private:
-	std::vector<T*> _values;
-	// hide method
-	T* at(std::size_t);
+    std::vector<T*> _values;
+    // hide method
+    T* at(std::size_t);
 };
 
 } // end namespace MeshLib
diff --git a/MeshLib/VtkOGSEnum.cpp b/MeshLib/VtkOGSEnum.cpp
index abc84532276..e95cf4f053b 100644
--- a/MeshLib/VtkOGSEnum.cpp
+++ b/MeshLib/VtkOGSEnum.cpp
@@ -13,90 +13,90 @@
 
 MeshLib::CellType VtkCellTypeToOGS(int type)
 {
-	switch (type)
-	{
-		case VTK_LINE:
-			return MeshLib::CellType::LINE2;
-		case VTK_QUADRATIC_EDGE:
-			return MeshLib::CellType::LINE3;
-		case VTK_TRIANGLE:
-			return MeshLib::CellType::TRI3;
-		case VTK_QUADRATIC_TRIANGLE:
-			return MeshLib::CellType::TRI6;
-		case VTK_QUAD:
-			return MeshLib::CellType::QUAD4;
-		case VTK_QUADRATIC_QUAD:
-			return MeshLib::CellType::QUAD8;
-		case VTK_BIQUADRATIC_QUAD:
-			return MeshLib::CellType::QUAD9;
-		case VTK_HEXAHEDRON:
-			return MeshLib::CellType::HEX8;
-		case VTK_QUADRATIC_HEXAHEDRON:
-			return MeshLib::CellType::HEX20;
-		case VTK_TRIQUADRATIC_HEXAHEDRON:
-			return MeshLib::CellType::HEX27;
-		case VTK_TETRA:
-			return MeshLib::CellType::TET4;
-		case VTK_QUADRATIC_TETRA:
-			return MeshLib::CellType::TET10;
-		case VTK_WEDGE:
-			return MeshLib::CellType::PRISM6;
-		case VTK_QUADRATIC_WEDGE:
-			return MeshLib::CellType::PRISM15;
-		case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
-			return MeshLib::CellType::PRISM18;
-		case VTK_PYRAMID:
-			return MeshLib::CellType::PYRAMID5;
-		case VTK_QUADRATIC_PYRAMID:
-			return MeshLib::CellType::PYRAMID13;
-		default:
-			return MeshLib::CellType::INVALID;
-	}
+    switch (type)
+    {
+        case VTK_LINE:
+            return MeshLib::CellType::LINE2;
+        case VTK_QUADRATIC_EDGE:
+            return MeshLib::CellType::LINE3;
+        case VTK_TRIANGLE:
+            return MeshLib::CellType::TRI3;
+        case VTK_QUADRATIC_TRIANGLE:
+            return MeshLib::CellType::TRI6;
+        case VTK_QUAD:
+            return MeshLib::CellType::QUAD4;
+        case VTK_QUADRATIC_QUAD:
+            return MeshLib::CellType::QUAD8;
+        case VTK_BIQUADRATIC_QUAD:
+            return MeshLib::CellType::QUAD9;
+        case VTK_HEXAHEDRON:
+            return MeshLib::CellType::HEX8;
+        case VTK_QUADRATIC_HEXAHEDRON:
+            return MeshLib::CellType::HEX20;
+        case VTK_TRIQUADRATIC_HEXAHEDRON:
+            return MeshLib::CellType::HEX27;
+        case VTK_TETRA:
+            return MeshLib::CellType::TET4;
+        case VTK_QUADRATIC_TETRA:
+            return MeshLib::CellType::TET10;
+        case VTK_WEDGE:
+            return MeshLib::CellType::PRISM6;
+        case VTK_QUADRATIC_WEDGE:
+            return MeshLib::CellType::PRISM15;
+        case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
+            return MeshLib::CellType::PRISM18;
+        case VTK_PYRAMID:
+            return MeshLib::CellType::PYRAMID5;
+        case VTK_QUADRATIC_PYRAMID:
+            return MeshLib::CellType::PYRAMID13;
+        default:
+            return MeshLib::CellType::INVALID;
+    }
 }
 
 int OGSToVtkCellType(MeshLib::CellType ogs)
 {
-	switch (ogs)
-	{
-		case MeshLib::CellType::LINE2:
-			return VTK_LINE;
-		case MeshLib::CellType::LINE3:
-			return VTK_QUADRATIC_EDGE;
-		case MeshLib::CellType::TRI3:
-			return VTK_TRIANGLE;
-		case MeshLib::CellType::TRI6:
-			return VTK_QUADRATIC_TRIANGLE;
-		case MeshLib::CellType::QUAD4:
-			return VTK_QUAD;
-		case MeshLib::CellType::QUAD8:
-			return VTK_QUADRATIC_QUAD;
-		case MeshLib::CellType::QUAD9:
-			return VTK_BIQUADRATIC_QUAD;
-		case MeshLib::CellType::HEX8:
-			return VTK_HEXAHEDRON;
-		case MeshLib::CellType::HEX20:
-			return VTK_QUADRATIC_HEXAHEDRON;
-		case MeshLib::CellType::HEX27:
-			return VTK_TRIQUADRATIC_HEXAHEDRON;
-		case MeshLib::CellType::TET4:
-			return VTK_TETRA;
-		case MeshLib::CellType::TET10:
-			return VTK_QUADRATIC_TETRA;
-		case MeshLib::CellType::PRISM6:
-			return VTK_WEDGE;
-		case MeshLib::CellType::PRISM15:
-			return VTK_QUADRATIC_WEDGE;
-		case MeshLib::CellType::PRISM18:
-			return VTK_BIQUADRATIC_QUADRATIC_WEDGE;
-		case MeshLib::CellType::PYRAMID5:
-			return VTK_PYRAMID;
-		case MeshLib::CellType::PYRAMID13:
-			return VTK_QUADRATIC_PYRAMID;
-		case MeshLib::CellType::INVALID:
-			return -1;
-		default:
-			return -1;
-	}
+    switch (ogs)
+    {
+        case MeshLib::CellType::LINE2:
+            return VTK_LINE;
+        case MeshLib::CellType::LINE3:
+            return VTK_QUADRATIC_EDGE;
+        case MeshLib::CellType::TRI3:
+            return VTK_TRIANGLE;
+        case MeshLib::CellType::TRI6:
+            return VTK_QUADRATIC_TRIANGLE;
+        case MeshLib::CellType::QUAD4:
+            return VTK_QUAD;
+        case MeshLib::CellType::QUAD8:
+            return VTK_QUADRATIC_QUAD;
+        case MeshLib::CellType::QUAD9:
+            return VTK_BIQUADRATIC_QUAD;
+        case MeshLib::CellType::HEX8:
+            return VTK_HEXAHEDRON;
+        case MeshLib::CellType::HEX20:
+            return VTK_QUADRATIC_HEXAHEDRON;
+        case MeshLib::CellType::HEX27:
+            return VTK_TRIQUADRATIC_HEXAHEDRON;
+        case MeshLib::CellType::TET4:
+            return VTK_TETRA;
+        case MeshLib::CellType::TET10:
+            return VTK_QUADRATIC_TETRA;
+        case MeshLib::CellType::PRISM6:
+            return VTK_WEDGE;
+        case MeshLib::CellType::PRISM15:
+            return VTK_QUADRATIC_WEDGE;
+        case MeshLib::CellType::PRISM18:
+            return VTK_BIQUADRATIC_QUADRATIC_WEDGE;
+        case MeshLib::CellType::PYRAMID5:
+            return VTK_PYRAMID;
+        case MeshLib::CellType::PYRAMID13:
+            return VTK_QUADRATIC_PYRAMID;
+        case MeshLib::CellType::INVALID:
+            return -1;
+        default:
+            return -1;
+    }
 }
 
 
diff --git a/MeshLib/convertMeshToGeo.cpp b/MeshLib/convertMeshToGeo.cpp
index 72670b5179a..5c1a43210a6 100644
--- a/MeshLib/convertMeshToGeo.cpp
+++ b/MeshLib/convertMeshToGeo.cpp
@@ -30,85 +30,85 @@ namespace MeshLib {
 
 bool convertMeshToGeo(const MeshLib::Mesh &mesh, GeoLib::GEOObjects &geo_objects, double eps)
 {
-	if (mesh.getDimension() != 2)
-	{
-		ERR ("Mesh to geometry conversion is only working for 2D meshes.");
-		return false;
-	}
-
-	// nodes to points conversion
-	std::string mesh_name(mesh.getName());
-	{
-		auto points = std::unique_ptr<std::vector<GeoLib::Point*>>(
-			new std::vector<GeoLib::Point*>);
-		points->reserve(mesh.getNNodes());
-
-		for (auto node_ptr : mesh.getNodes())
-			points->push_back(new GeoLib::Point(*node_ptr, node_ptr->getID()));
-
-		geo_objects.addPointVec(std::move(points), mesh_name, nullptr, eps);
-	}
-	const std::vector<std::size_t> id_map (geo_objects.getPointVecObj(mesh_name)->getIDMap());
-
-	// elements to surface triangles conversion
-	std::string const mat_name ("MaterialIDs");
-	auto bounds (MeshInformation::getValueBounds<int>(mesh, mat_name));
-	const unsigned nMatGroups(bounds.second-bounds.first+1);
-	auto sfcs = std::unique_ptr<std::vector<GeoLib::Surface*>>(new std::vector<GeoLib::Surface*>);
-	sfcs->reserve(nMatGroups);
-	auto const& points = *geo_objects.getPointVec(mesh_name);
-	for (unsigned i=0; i<nMatGroups; ++i)
-		sfcs->push_back(new GeoLib::Surface(points));
-
-	const std::vector<MeshLib::Element*> &elements = mesh.getElements();
-	const std::size_t nElems (mesh.getNElements());
-
-	auto materialIds = mesh.getProperties().getPropertyVector<int>(mat_name);
-	auto const materialIdExist = bool(materialIds);
-
-	for (unsigned i=0; i<nElems; ++i)
-	{
-		auto surfaceId = materialIdExist ? (*materialIds)[i]-bounds.first : 0;
-		MeshLib::Element* e (elements[i]);
-		if (e->getGeomType() == MeshElemType::TRIANGLE)
-			(*sfcs)[surfaceId]->addTriangle(id_map[e->getNodeIndex(0)], id_map[e->getNodeIndex(1)], id_map[e->getNodeIndex(2)]);
-		if (e->getGeomType() == MeshElemType::QUAD)
-		{
-			(*sfcs)[surfaceId]->addTriangle(id_map[e->getNodeIndex(0)], id_map[e->getNodeIndex(1)], id_map[e->getNodeIndex(2)]);
-			(*sfcs)[surfaceId]->addTriangle(id_map[e->getNodeIndex(0)], id_map[e->getNodeIndex(2)], id_map[e->getNodeIndex(3)]);
-		}
-		// all other element types are ignored (i.e. lines)
-	}
-
-	std::for_each(sfcs->begin(), sfcs->end(), [](GeoLib::Surface* sfc){ if (sfc->getNTriangles()==0) delete sfc; sfc = nullptr;});
-	auto sfcs_end = std::remove(sfcs->begin(), sfcs->end(), nullptr);
-	sfcs->erase(sfcs_end, sfcs->end());
-
-	geo_objects.addSurfaceVec(std::move(sfcs), mesh_name);
-	return true;
+    if (mesh.getDimension() != 2)
+    {
+        ERR ("Mesh to geometry conversion is only working for 2D meshes.");
+        return false;
+    }
+
+    // nodes to points conversion
+    std::string mesh_name(mesh.getName());
+    {
+        auto points = std::unique_ptr<std::vector<GeoLib::Point*>>(
+            new std::vector<GeoLib::Point*>);
+        points->reserve(mesh.getNNodes());
+
+        for (auto node_ptr : mesh.getNodes())
+            points->push_back(new GeoLib::Point(*node_ptr, node_ptr->getID()));
+
+        geo_objects.addPointVec(std::move(points), mesh_name, nullptr, eps);
+    }
+    const std::vector<std::size_t> id_map (geo_objects.getPointVecObj(mesh_name)->getIDMap());
+
+    // elements to surface triangles conversion
+    std::string const mat_name ("MaterialIDs");
+    auto bounds (MeshInformation::getValueBounds<int>(mesh, mat_name));
+    const unsigned nMatGroups(bounds.second-bounds.first+1);
+    auto sfcs = std::unique_ptr<std::vector<GeoLib::Surface*>>(new std::vector<GeoLib::Surface*>);
+    sfcs->reserve(nMatGroups);
+    auto const& points = *geo_objects.getPointVec(mesh_name);
+    for (unsigned i=0; i<nMatGroups; ++i)
+        sfcs->push_back(new GeoLib::Surface(points));
+
+    const std::vector<MeshLib::Element*> &elements = mesh.getElements();
+    const std::size_t nElems (mesh.getNElements());
+
+    auto materialIds = mesh.getProperties().getPropertyVector<int>(mat_name);
+    auto const materialIdExist = bool(materialIds);
+
+    for (unsigned i=0; i<nElems; ++i)
+    {
+        auto surfaceId = materialIdExist ? (*materialIds)[i]-bounds.first : 0;
+        MeshLib::Element* e (elements[i]);
+        if (e->getGeomType() == MeshElemType::TRIANGLE)
+            (*sfcs)[surfaceId]->addTriangle(id_map[e->getNodeIndex(0)], id_map[e->getNodeIndex(1)], id_map[e->getNodeIndex(2)]);
+        if (e->getGeomType() == MeshElemType::QUAD)
+        {
+            (*sfcs)[surfaceId]->addTriangle(id_map[e->getNodeIndex(0)], id_map[e->getNodeIndex(1)], id_map[e->getNodeIndex(2)]);
+            (*sfcs)[surfaceId]->addTriangle(id_map[e->getNodeIndex(0)], id_map[e->getNodeIndex(2)], id_map[e->getNodeIndex(3)]);
+        }
+        // all other element types are ignored (i.e. lines)
+    }
+
+    std::for_each(sfcs->begin(), sfcs->end(), [](GeoLib::Surface* sfc){ if (sfc->getNTriangles()==0) delete sfc; sfc = nullptr;});
+    auto sfcs_end = std::remove(sfcs->begin(), sfcs->end(), nullptr);
+    sfcs->erase(sfcs_end, sfcs->end());
+
+    geo_objects.addSurfaceVec(std::move(sfcs), mesh_name);
+    return true;
 }
 
 MeshLib::Mesh* convertSurfaceToMesh(const GeoLib::Surface &sfc, const std::string &mesh_name, double eps)
 {
-	// convert to a mesh including duplicated nodes
-	std::vector<MeshLib::Node*> nodes;
-	std::vector<MeshLib::Element*> elements;
-	std::size_t nodeId = 0;
-	for (std::size_t i=0; i<sfc.getNTriangles(); i++)
-	{
-		auto* tri = sfc[i];
-		MeshLib::Node** tri_nodes = new MeshLib::Node*[3];
-		for (unsigned j=0; j<3; j++)
-			tri_nodes[j] = new MeshLib::Node(tri->getPoint(j)->getCoords(), nodeId++);
-		elements.push_back(new MeshLib::Tri(tri_nodes, i));
-		for (unsigned j=0; j<3; j++)
-			nodes.push_back(tri_nodes[j]);
-	}
-	MeshLib::Mesh mesh_with_duplicated_nodes(mesh_name, nodes, elements);
-
-	// remove duplicated nodes
-	MeshLib::MeshRevision rev(mesh_with_duplicated_nodes);
-	return rev.simplifyMesh(mesh_with_duplicated_nodes.getName(), eps);
+    // convert to a mesh including duplicated nodes
+    std::vector<MeshLib::Node*> nodes;
+    std::vector<MeshLib::Element*> elements;
+    std::size_t nodeId = 0;
+    for (std::size_t i=0; i<sfc.getNTriangles(); i++)
+    {
+        auto* tri = sfc[i];
+        MeshLib::Node** tri_nodes = new MeshLib::Node*[3];
+        for (unsigned j=0; j<3; j++)
+            tri_nodes[j] = new MeshLib::Node(tri->getPoint(j)->getCoords(), nodeId++);
+        elements.push_back(new MeshLib::Tri(tri_nodes, i));
+        for (unsigned j=0; j<3; j++)
+            nodes.push_back(tri_nodes[j]);
+    }
+    MeshLib::Mesh mesh_with_duplicated_nodes(mesh_name, nodes, elements);
+
+    // remove duplicated nodes
+    MeshLib::MeshRevision rev(mesh_with_duplicated_nodes);
+    return rev.simplifyMesh(mesh_with_duplicated_nodes.getName(), eps);
 }
 
 }
diff --git a/MeshLib/convertMeshToGeo.h b/MeshLib/convertMeshToGeo.h
index d2d98b68e79..997c4f76401 100644
--- a/MeshLib/convertMeshToGeo.h
+++ b/MeshLib/convertMeshToGeo.h
@@ -27,25 +27,25 @@ class Surface;
 namespace MeshLib
 {
 
-	class Mesh;
-
-	/**
-	 * Converts a 2D mesh into a geometry.
-	 * A new geometry with the name of the mesh will be inserted into geo_objects, consisting
-	 * of points identical with mesh nodes and one surface representing the mesh. Triangles are
-	 * converted to geometric triangles, quads are split into two triangles, all other elements
-	 * are ignored.
-	 */
-	bool convertMeshToGeo(const MeshLib::Mesh &mesh, GeoLib::GEOObjects &geo_objects, double eps = std::numeric_limits<double>::epsilon());
-
-	/**
-	 * Converts a surface into a triangular mesh
-	 * @param sfc         Surface object
-	 * @param mesh_name   New mesh name
-	 * @param eps         Minimum distance for nodes not to be collapsed
-	 * @return a pointer to a converted mesh object. nullptr is returned if the conversion fails.
-	 */
-	MeshLib::Mesh* convertSurfaceToMesh(const GeoLib::Surface &sfc, const std::string &mesh_name, double eps = std::numeric_limits<double>::epsilon());
+    class Mesh;
+
+    /**
+     * Converts a 2D mesh into a geometry.
+     * A new geometry with the name of the mesh will be inserted into geo_objects, consisting
+     * of points identical with mesh nodes and one surface representing the mesh. Triangles are
+     * converted to geometric triangles, quads are split into two triangles, all other elements
+     * are ignored.
+     */
+    bool convertMeshToGeo(const MeshLib::Mesh &mesh, GeoLib::GEOObjects &geo_objects, double eps = std::numeric_limits<double>::epsilon());
+
+    /**
+     * Converts a surface into a triangular mesh
+     * @param sfc         Surface object
+     * @param mesh_name   New mesh name
+     * @param eps         Minimum distance for nodes not to be collapsed
+     * @return a pointer to a converted mesh object. nullptr is returned if the conversion fails.
+     */
+    MeshLib::Mesh* convertSurfaceToMesh(const GeoLib::Surface &sfc, const std::string &mesh_name, double eps = std::numeric_limits<double>::epsilon());
 
 } // namespace
 
-- 
GitLab