diff --git a/FileIO/CMakeLists.txt b/FileIO/CMakeLists.txt
index 0964978b5f879c65d9a42e021446d81c75c277f9..5a3641379545c745d6fd1afdd8f6c92f16c446f9 100644
--- a/FileIO/CMakeLists.txt
+++ b/FileIO/CMakeLists.txt
@@ -1,17 +1,17 @@
 set(SOURCES
-	CsvInterface.h
-	CsvInterface.cpp
-	GMSInterface.h
-	GMSInterface.cpp
-	GMSHInterface.h
-	GMSHInterface.cpp
-	PetrelInterface.h
-	PetrelInterface.cpp
-	TetGenInterface.h
-	TetGenInterface.cpp
+    CsvInterface.h
+    CsvInterface.cpp
+    GMSInterface.h
+    GMSInterface.cpp
+    GMSHInterface.h
+    GMSHInterface.cpp
+    PetrelInterface.h
+    PetrelInterface.cpp
+    TetGenInterface.h
+    TetGenInterface.cpp
 )
 if(Shapelib_FOUND)
-	list(APPEND SOURCES SHPInterface.h SHPInterface.cpp)
+    list(APPEND SOURCES SHPInterface.h SHPInterface.cpp)
 endif()
 
 GET_SOURCE_FILES(SOURCES_LEGACY Legacy)
@@ -25,9 +25,9 @@ set(SOURCES ${SOURCES} ${SOURCES_BASE_XML})
 GET_SOURCE_FILES(SOURCES_BOOST_XML XmlIO/Boost)
 set(SOURCES ${SOURCES} ${SOURCES_BOOST_XML})
 if(QT4_FOUND)
-	set(SOURCES ${SOURCES} FEFLOWInterface.h FEFLOWInterface.cpp)
-	GET_SOURCE_FILES(SOURCES_QT_XML XmlIO/Qt)
-	set(SOURCES ${SOURCES} ${SOURCES_QT_XML})
+    set(SOURCES ${SOURCES} FEFLOWInterface.h FEFLOWInterface.cpp)
+    GET_SOURCE_FILES(SOURCES_QT_XML XmlIO/Qt)
+    set(SOURCES ${SOURCES} ${SOURCES_QT_XML})
 endif()
 
 include(${PROJECT_SOURCE_DIR}/scripts/cmake/OGSEnabledElements.cmake)
@@ -37,20 +37,20 @@ add_library(FileIO ${SOURCES})
 target_link_libraries(FileIO DataHolderLib)
 
 if(QT4_FOUND)
-	target_link_libraries(FileIO Qt4::QtXml Qt4::QtXmlPatterns)
-	if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND)
-		target_link_libraries(FileIO Qt4::QtNetwork ${OPENSSL_LIBRARIES} ws2_32)
-	endif()
+    target_link_libraries(FileIO Qt4::QtXml Qt4::QtXmlPatterns)
+    if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND)
+        target_link_libraries(FileIO Qt4::QtNetwork ${OPENSSL_LIBRARIES} ws2_32)
+    endif()
 endif()
 
 if(Shapelib_FOUND)
-	target_link_libraries(FileIO ${Shapelib_LIBRARIES})
+    target_link_libraries(FileIO ${Shapelib_LIBRARIES})
 endif()
 
 ADD_VTK_DEPENDENCY(FileIO)
 
 if(TARGET Eigen)
-	add_dependencies(FileIO Eigen)
+    add_dependencies(FileIO Eigen)
 endif()
 
 if(TARGET Boost)
@@ -59,7 +59,7 @@ endif()
 
 file(GLOB XSD_FILES . *.xsd)
 if(APPLE AND OGS_BUILD_GUI)
-	install(FILES ${XSD_FILES} DESTINATION ${CMAKE_BINARY_DIR}/_CPack_Packages/Darwin/DragNDrop/${CPACK_PACKAGE_FILE_NAME}/ALL_IN_ONE/DataExplorer.app/Contents/MacOS COMPONENT ogs_gui)
+    install(FILES ${XSD_FILES} DESTINATION ${CMAKE_BINARY_DIR}/_CPack_Packages/Darwin/DragNDrop/${CPACK_PACKAGE_FILE_NAME}/ALL_IN_ONE/DataExplorer.app/Contents/MacOS COMPONENT ogs_gui)
 else()
-	install(FILES ${XSD_FILES} DESTINATION bin COMPONENT ogs_cli)
+    install(FILES ${XSD_FILES} DESTINATION bin COMPONENT ogs_cli)
 endif()
diff --git a/FileIO/CsvInterface.cpp b/FileIO/CsvInterface.cpp
index c33883883ea7bda197377eac701d855566e6ac85..ce2878960cf3a51b5ce117d150be8905acfd5bad 100644
--- a/FileIO/CsvInterface.cpp
+++ b/FileIO/CsvInterface.cpp
@@ -23,42 +23,42 @@ namespace FileIO {
 int CsvInterface::readPoints(std::string const& fname, char delim,
                              std::vector<GeoLib::Point*> &points)
 {
-	std::ifstream in(fname.c_str());
-
-	if (!in.is_open()) {
-		ERR ("CsvInterface::readPoints(): Could not open file %s.", fname.c_str());
-		return -1;
-	}
-
-	std::string line;
-	getline(in, line);
-
-	std::size_t line_count(0);
-	std::size_t error_count(0);
-	std::list<std::string>::const_iterator it;
-	while ( getline(in, line) )
-	{
-		line_count++;
-		std::list<std::string> const fields = BaseLib::splitString(line, delim);
-
-		if (fields.size() < 3)
-		{
-			ERR ("Line %d contains not enough columns of data. Skipping line...", line_count);
-			error_count++;
-			continue;
-		}
-		it = fields.begin();
-		std::array<double, 3> point;
-		try {
-			point[0] = std::stod(*it);
-			point[1] = std::stod(*(++it));
-			point[2] = std::stod(*(++it));
-			points.push_back(new GeoLib::Point(point[0], point[1], point[2]));
-		} catch (const std::invalid_argument&) {
-			ERR ("Error converting data to coordinates in line %d.", line_count);
-		}
-	}
-	return error_count;
+    std::ifstream in(fname.c_str());
+
+    if (!in.is_open()) {
+        ERR ("CsvInterface::readPoints(): Could not open file %s.", fname.c_str());
+        return -1;
+    }
+
+    std::string line;
+    getline(in, line);
+
+    std::size_t line_count(0);
+    std::size_t error_count(0);
+    std::list<std::string>::const_iterator it;
+    while ( getline(in, line) )
+    {
+        line_count++;
+        std::list<std::string> const fields = BaseLib::splitString(line, delim);
+
+        if (fields.size() < 3)
+        {
+            ERR ("Line %d contains not enough columns of data. Skipping line...", line_count);
+            error_count++;
+            continue;
+        }
+        it = fields.begin();
+        std::array<double, 3> point;
+        try {
+            point[0] = std::stod(*it);
+            point[1] = std::stod(*(++it));
+            point[2] = std::stod(*(++it));
+            points.push_back(new GeoLib::Point(point[0], point[1], point[2]));
+        } catch (const std::invalid_argument&) {
+            ERR ("Error converting data to coordinates in line %d.", line_count);
+        }
+    }
+    return error_count;
 }
 
 int CsvInterface::readPoints(std::string const& fname, char delim,
@@ -67,30 +67,30 @@ int CsvInterface::readPoints(std::string const& fname, char delim,
                              std::string const& y_column_name,
                              std::string const& z_column_name)
 {
-	std::ifstream in(fname.c_str());
-	std::array<std::string, 3> const column_names = {{x_column_name, y_column_name, z_column_name}};
-
-	if (!in.is_open()) {
-		ERR ("CsvInterface::readPoints(): Could not open file %s.", fname.c_str());
-		return -1;
-	}
-
-	std::string line;
-	getline(in, line);
-	std::array<std::size_t, 3> const column_idx =
-		{{ CsvInterface::findColumn(line, delim, x_column_name),
-		   CsvInterface::findColumn(line, delim, y_column_name),
-		   (z_column_name.empty()) ?  CsvInterface::findColumn(line, delim, y_column_name) :
-		                              CsvInterface::findColumn(line, delim, z_column_name) }};
-
-	for (std::size_t i=0; i<3; ++i)
-		if (column_idx[i] == std::numeric_limits<std::size_t>::max())
-		{
-			ERR ("Column \"%s\" not found in file header.", column_names[i].c_str());
-			return -1;
-		}
-
-	return readPoints(in, delim, points, column_idx);
+    std::ifstream in(fname.c_str());
+    std::array<std::string, 3> const column_names = {{x_column_name, y_column_name, z_column_name}};
+
+    if (!in.is_open()) {
+        ERR ("CsvInterface::readPoints(): Could not open file %s.", fname.c_str());
+        return -1;
+    }
+
+    std::string line;
+    getline(in, line);
+    std::array<std::size_t, 3> const column_idx =
+        {{ CsvInterface::findColumn(line, delim, x_column_name),
+           CsvInterface::findColumn(line, delim, y_column_name),
+           (z_column_name.empty()) ?  CsvInterface::findColumn(line, delim, y_column_name) :
+                                      CsvInterface::findColumn(line, delim, z_column_name) }};
+
+    for (std::size_t i=0; i<3; ++i)
+        if (column_idx[i] == std::numeric_limits<std::size_t>::max())
+        {
+            ERR ("Column \"%s\" not found in file header.", column_names[i].c_str());
+            return -1;
+        }
+
+    return readPoints(in, delim, points, column_idx);
 }
 
 int CsvInterface::readPoints(std::string const& fname, char delim,
@@ -99,86 +99,86 @@ int CsvInterface::readPoints(std::string const& fname, char delim,
                              std::size_t y_column_idx,
                              std::size_t z_column_idx)
 {
-	std::ifstream in(fname.c_str());
+    std::ifstream in(fname.c_str());
 
-	if (!in.is_open()) {
-		ERR ("CsvInterface::readPoints(): Could not open file %s.", fname.c_str());
-		return -1;
-	}
+    if (!in.is_open()) {
+        ERR ("CsvInterface::readPoints(): Could not open file %s.", fname.c_str());
+        return -1;
+    }
 
-	if (z_column_idx == std::numeric_limits<std::size_t>::max())
-		z_column_idx = y_column_idx;
-	std::array<std::size_t, 3> const column_idx = {{ x_column_idx, y_column_idx, z_column_idx }};
+    if (z_column_idx == std::numeric_limits<std::size_t>::max())
+        z_column_idx = y_column_idx;
+    std::array<std::size_t, 3> const column_idx = {{ x_column_idx, y_column_idx, z_column_idx }};
 
-	return readPoints(in, delim, points, column_idx);
+    return readPoints(in, delim, points, column_idx);
 }
 
 int CsvInterface::readPoints(std::ifstream &in, char delim,
                              std::vector<GeoLib::Point*> &points,
                              std::array<std::size_t, 3> const& column_idx)
 {
-	std::array<std::size_t, 3> order = {{ 0, 1, 2 }};
-	std::sort(order.begin(), order.end(),
-		[&column_idx](std::size_t idx1, std::size_t idx2) {return column_idx[idx1] < column_idx[idx2];});
-	std::array<std::size_t, 3> const column_advance =
-		{{ column_idx[order[0]],
-		   column_idx[order[1]] - column_idx[order[0]],
-		   column_idx[order[2]] - column_idx[order[1]] }};
-
-	std::string line;
-	std::size_t line_count(0);
-	std::size_t error_count(0);
-	std::list<std::string>::const_iterator it;
-
-	while ( getline(in, line) )
-	{
-		line_count++;
-		std::list<std::string> const fields = BaseLib::splitString(line, delim);
-
-		if (fields.size() < column_idx[order[2]]+1)
-		{
-			ERR ("Line %d contains not enough columns of data. Skipping line...", line_count);
-			error_count++;
-			continue;
-		}
-
-		std::array<double, 3> point;
-		it = fields.begin();
-		try {
-			std::advance(it, column_advance[0]);
-			point[order[0]] = std::stod(*it);
-			std::advance(it, column_advance[1]);
-			point[order[1]] = std::stod(*it);
-			std::advance(it, column_advance[2]);
-			point[order[2]] = (column_idx[1] == column_idx[2]) ? 0 : std::stod(*it);
-			points.push_back(new GeoLib::Point(point[0], point[1], point[2]));
-		} catch (const std::invalid_argument&) {
-			ERR ("Error converting data to coordinates in line %d.", line_count);
-			error_count++;
-		}
-	}
-	return error_count;
+    std::array<std::size_t, 3> order = {{ 0, 1, 2 }};
+    std::sort(order.begin(), order.end(),
+        [&column_idx](std::size_t idx1, std::size_t idx2) {return column_idx[idx1] < column_idx[idx2];});
+    std::array<std::size_t, 3> const column_advance =
+        {{ column_idx[order[0]],
+           column_idx[order[1]] - column_idx[order[0]],
+           column_idx[order[2]] - column_idx[order[1]] }};
+
+    std::string line;
+    std::size_t line_count(0);
+    std::size_t error_count(0);
+    std::list<std::string>::const_iterator it;
+
+    while ( getline(in, line) )
+    {
+        line_count++;
+        std::list<std::string> const fields = BaseLib::splitString(line, delim);
+
+        if (fields.size() < column_idx[order[2]]+1)
+        {
+            ERR ("Line %d contains not enough columns of data. Skipping line...", line_count);
+            error_count++;
+            continue;
+        }
+
+        std::array<double, 3> point;
+        it = fields.begin();
+        try {
+            std::advance(it, column_advance[0]);
+            point[order[0]] = std::stod(*it);
+            std::advance(it, column_advance[1]);
+            point[order[1]] = std::stod(*it);
+            std::advance(it, column_advance[2]);
+            point[order[2]] = (column_idx[1] == column_idx[2]) ? 0 : std::stod(*it);
+            points.push_back(new GeoLib::Point(point[0], point[1], point[2]));
+        } catch (const std::invalid_argument&) {
+            ERR ("Error converting data to coordinates in line %d.", line_count);
+            error_count++;
+        }
+    }
+    return error_count;
 }
 
 std::size_t CsvInterface::findColumn(std::string const& line, char delim, std::string const& column_name)
 {
-	std::list<std::string> const fields = BaseLib::splitString(line, delim);
-	if (fields.empty())
-		return std::numeric_limits<std::size_t>::max();
-
-	std::size_t count(0);
-	for (auto it = fields.cbegin(); it != fields.cend(); ++it)
-	{
-		if ((*it).compare(column_name) == 0)
-			break;
-		else
-			count++;
-	}
-
-	if (count == fields.size())
-		return std::numeric_limits<std::size_t>::max();
-
-	return count;
+    std::list<std::string> const fields = BaseLib::splitString(line, delim);
+    if (fields.empty())
+        return std::numeric_limits<std::size_t>::max();
+
+    std::size_t count(0);
+    for (auto it = fields.cbegin(); it != fields.cend(); ++it)
+    {
+        if ((*it).compare(column_name) == 0)
+            break;
+        else
+            count++;
+    }
+
+    if (count == fields.size())
+        return std::numeric_limits<std::size_t>::max();
+
+    return count;
 }
 
 } // end namespace FileIO
diff --git a/FileIO/CsvInterface.h b/FileIO/CsvInterface.h
index 59f718a1a0ed9717be6abb3497be062781343b0e..06c3cdd4a882dad10047306855d618afe62d6782 100644
--- a/FileIO/CsvInterface.h
+++ b/FileIO/CsvInterface.h
@@ -28,7 +28,7 @@
 #include "BaseLib/StringTools.h"
 
 namespace GeoLib {
-	class Point;
+    class Point;
 }
 
 namespace FileIO {
@@ -39,145 +39,145 @@ namespace FileIO {
 class CsvInterface {
 
 public:
-	/**
-	 * Reads 3D points from a CSV file. It is assumed that the file has a header
-	 * specifying a name for each of the columns. The first three columns will be
-	 * interpreted as x-, y- and z-coordinate, respectively.
-	 * \param fname    Name of the file to be read
-	 * \param delim    Deliminator, default is ','
-	 * \param points   A vector containing the 3D points read from the file
-	 * \return An error code (0 = ok, 0<i<max = number of skipped lines, -1 error reading file)
-	 */
-	static int readPoints(std::string const& fname, char delim,
-	                      std::vector<GeoLib::Point*> &points);
-
-	/**
-	 * Reads 3D points from a CSV file. It is assumed that the file has a header
-	 * specifying a name for each of the columns. The columns specified in the
-	 * function call will be used for reading x-, y- and z-coordinates,
-	 * respectively If z_column_name is an empty string or not given at all, all
-	 * z-coordinates will be set to zero.
-	 * \param fname           Name of the file to be read
-	 * \param delim           Deliminator, default is ','
-	 * \param points          A vector containing the 3D points read from the file
-	 * \param x_column_name   Name of the column to be interpreted as x-coordinate
-	 * \param y_column_name   Name of the column to be interpreted as y-coordinate
-	 * \param z_column_name   Name of the column to be interpreted as z-coordinate
-	 * \return An error code (0 = ok, 0<i<max = number of skipped lines, -1 error reading file)
-	 */
-	static int readPoints(std::string const& fname, char delim,
-	                      std::vector<GeoLib::Point*> &points,
-	                      std::string const& x_column_name,
-	                      std::string const& y_column_name,
-	                      std::string const& z_column_name = "");
-
-	/**
-	 * Reads 3D points from a headerless CSV file, so columns for x-, y- and
-	 * z-coordinates have to be specified using indices (starting with 0).
-	 * If z_column_idx is not given (or set to numeric_limits::max()), all
-	 * z-coordinates will be set to zero.
-	 * \param fname          Name of the file to be read
-	 * \param delim          Deliminator, default is ','
-	 * \param points         A vector containing the 3D points read from the file
-	 * \param x_column_idx   Index of the column to be interpreted as x-coordinate
-	 * \param y_column_idx   Index of the column to be interpreted as y-coordinate
-	 * \param z_column_idx   Index of the column to be interpreted as z-coordinate
-	 * \return An error code (0 = ok, 0<i<max = number of skipped lines, -1 error reading file)
-	 */
-	static int readPoints(std::string const& fname, char delim,
-	                      std::vector<GeoLib::Point*> &points,
-	                      std::size_t x_column_idx,
-	                      std::size_t y_column_idx,
-	                      std::size_t z_column_idx = std::numeric_limits<std::size_t>::max());
-
-	/**
-	 * Reads a column of the given name from a CSV file.
-	 * \param fname        Name of the file to be read
-	 * \param delim        Deliminator, default is ','
-	 * \param data_arary   A vector containing the data read from the file
-	 * \return An error code (0 = ok, 0<i<max = number of skipped lines, -1 error reading file)
-	 */
-	template <typename T>
-	static int readColumn(std::string const& fname, char delim,
-	                      std::vector<T> &data_array,
-	                      std::string const& column_name)
-	{
-		std::ifstream in(fname.c_str());
-		if (!in.is_open()) {
-			ERR ("CsvInterface::readColumn(): Could not open file %s.", fname.c_str());
-			return -1;
-		}
-
-		std::string line;
-		getline(in, line);
-		std::size_t const column_idx = CsvInterface::findColumn(line, delim, column_name);
-		if (column_idx == std::numeric_limits<std::size_t>::max())
-		{
-			ERR ("Column \"%s\" not found in file header.", column_name.c_str());
-			return -1;
-		}
-		return readColumn<T>(in, delim, data_array, column_idx);
-	}
-
-	template <typename T>
-	static int readColumn(std::string const& fname, char delim,
-	                          std::vector<T> &data_array,
-	                          std::size_t column_idx)
-	{
-		std::ifstream in(fname.c_str());
-		if (!in.is_open()) {
-			ERR ("CsvInterface::readColumn(): Could not open file %s.", fname.c_str());
-			return -1;
-		}
-		return readColumn<T>(in, delim, data_array, column_idx);
-	}
+    /**
+     * Reads 3D points from a CSV file. It is assumed that the file has a header
+     * specifying a name for each of the columns. The first three columns will be
+     * interpreted as x-, y- and z-coordinate, respectively.
+     * \param fname    Name of the file to be read
+     * \param delim    Deliminator, default is ','
+     * \param points   A vector containing the 3D points read from the file
+     * \return An error code (0 = ok, 0<i<max = number of skipped lines, -1 error reading file)
+     */
+    static int readPoints(std::string const& fname, char delim,
+                          std::vector<GeoLib::Point*> &points);
+
+    /**
+     * Reads 3D points from a CSV file. It is assumed that the file has a header
+     * specifying a name for each of the columns. The columns specified in the
+     * function call will be used for reading x-, y- and z-coordinates,
+     * respectively If z_column_name is an empty string or not given at all, all
+     * z-coordinates will be set to zero.
+     * \param fname           Name of the file to be read
+     * \param delim           Deliminator, default is ','
+     * \param points          A vector containing the 3D points read from the file
+     * \param x_column_name   Name of the column to be interpreted as x-coordinate
+     * \param y_column_name   Name of the column to be interpreted as y-coordinate
+     * \param z_column_name   Name of the column to be interpreted as z-coordinate
+     * \return An error code (0 = ok, 0<i<max = number of skipped lines, -1 error reading file)
+     */
+    static int readPoints(std::string const& fname, char delim,
+                          std::vector<GeoLib::Point*> &points,
+                          std::string const& x_column_name,
+                          std::string const& y_column_name,
+                          std::string const& z_column_name = "");
+
+    /**
+     * Reads 3D points from a headerless CSV file, so columns for x-, y- and
+     * z-coordinates have to be specified using indices (starting with 0).
+     * If z_column_idx is not given (or set to numeric_limits::max()), all
+     * z-coordinates will be set to zero.
+     * \param fname          Name of the file to be read
+     * \param delim          Deliminator, default is ','
+     * \param points         A vector containing the 3D points read from the file
+     * \param x_column_idx   Index of the column to be interpreted as x-coordinate
+     * \param y_column_idx   Index of the column to be interpreted as y-coordinate
+     * \param z_column_idx   Index of the column to be interpreted as z-coordinate
+     * \return An error code (0 = ok, 0<i<max = number of skipped lines, -1 error reading file)
+     */
+    static int readPoints(std::string const& fname, char delim,
+                          std::vector<GeoLib::Point*> &points,
+                          std::size_t x_column_idx,
+                          std::size_t y_column_idx,
+                          std::size_t z_column_idx = std::numeric_limits<std::size_t>::max());
+
+    /**
+     * Reads a column of the given name from a CSV file.
+     * \param fname        Name of the file to be read
+     * \param delim        Deliminator, default is ','
+     * \param data_arary   A vector containing the data read from the file
+     * \return An error code (0 = ok, 0<i<max = number of skipped lines, -1 error reading file)
+     */
+    template <typename T>
+    static int readColumn(std::string const& fname, char delim,
+                          std::vector<T> &data_array,
+                          std::string const& column_name)
+    {
+        std::ifstream in(fname.c_str());
+        if (!in.is_open()) {
+            ERR ("CsvInterface::readColumn(): Could not open file %s.", fname.c_str());
+            return -1;
+        }
+
+        std::string line;
+        getline(in, line);
+        std::size_t const column_idx = CsvInterface::findColumn(line, delim, column_name);
+        if (column_idx == std::numeric_limits<std::size_t>::max())
+        {
+            ERR ("Column \"%s\" not found in file header.", column_name.c_str());
+            return -1;
+        }
+        return readColumn<T>(in, delim, data_array, column_idx);
+    }
+
+    template <typename T>
+    static int readColumn(std::string const& fname, char delim,
+                              std::vector<T> &data_array,
+                              std::size_t column_idx)
+    {
+        std::ifstream in(fname.c_str());
+        if (!in.is_open()) {
+            ERR ("CsvInterface::readColumn(): Could not open file %s.", fname.c_str());
+            return -1;
+        }
+        return readColumn<T>(in, delim, data_array, column_idx);
+    }
 
 private:
-	/// Actual point reader for public methods
-	static int readPoints(std::ifstream &in, char delim,
-	                      std::vector<GeoLib::Point*> &points,
-	                      std::array<std::size_t, 3> const& column_idx);
-
-	/// Actual column reader for public methods
-	template <typename T>
-	static int readColumn(std::ifstream &in, char delim,
-	                   std::vector<T> &data_array,
-	                   std::size_t column_idx)
-	{
-		std::string line;
-		std::size_t line_count(0);
-		std::size_t error_count(0);
-		std::list<std::string>::const_iterator it;
-		while ( getline(in, line) )
-		{
-			line_count++;
-			std::list<std::string> const fields = BaseLib::splitString(line, delim);
-
-			if (fields.size() < column_idx+1)
-			{
-				ERR ("Line %d contains not enough columns of data. Skipping line...", line_count);
-				error_count++;
-				continue;
-			}
-			it = fields.begin();
-			std::advance(it, column_idx);
-
-			std::istringstream stream(*it);
-			T value;
-			if (!(stream >> value))
-			{
-				ERR("Error reading value in line %d.", line_count);
-				error_count++;
-				continue;
-			}
-
-			data_array.push_back(value);
-		}
-		return error_count;
-	}
-
-	/// Returns the number of the column with column_name (or std::numeric_limits::max() if no such column has been found).
-	static std::size_t findColumn(std::string const& line, char delim, std::string const& column_name);
+    /// Actual point reader for public methods
+    static int readPoints(std::ifstream &in, char delim,
+                          std::vector<GeoLib::Point*> &points,
+                          std::array<std::size_t, 3> const& column_idx);
+
+    /// Actual column reader for public methods
+    template <typename T>
+    static int readColumn(std::ifstream &in, char delim,
+                       std::vector<T> &data_array,
+                       std::size_t column_idx)
+    {
+        std::string line;
+        std::size_t line_count(0);
+        std::size_t error_count(0);
+        std::list<std::string>::const_iterator it;
+        while ( getline(in, line) )
+        {
+            line_count++;
+            std::list<std::string> const fields = BaseLib::splitString(line, delim);
+
+            if (fields.size() < column_idx+1)
+            {
+                ERR ("Line %d contains not enough columns of data. Skipping line...", line_count);
+                error_count++;
+                continue;
+            }
+            it = fields.begin();
+            std::advance(it, column_idx);
+
+            std::istringstream stream(*it);
+            T value;
+            if (!(stream >> value))
+            {
+                ERR("Error reading value in line %d.", line_count);
+                error_count++;
+                continue;
+            }
+
+            data_array.push_back(value);
+        }
+        return error_count;
+    }
+
+    /// Returns the number of the column with column_name (or std::numeric_limits::max() if no such column has been found).
+    static std::size_t findColumn(std::string const& line, char delim, std::string const& column_name);
 };
 
 }
diff --git a/FileIO/FEFLOWInterface.cpp b/FileIO/FEFLOWInterface.cpp
index 62771410552b8d68b6e613fb841304e345c44275..ff8d1f286e7705974d3294b9efd3221b0b2e75ed 100644
--- a/FileIO/FEFLOWInterface.cpp
+++ b/FileIO/FEFLOWInterface.cpp
@@ -29,581 +29,581 @@ namespace FileIO
 
 MeshLib::Mesh* FEFLOWInterface::readFEFLOWFile(const std::string &filename)
 {
-	std::ifstream in(filename.c_str());
-	if (!in)
-	{
-		ERR("FEFLOWInterface::readFEFLOWFile(): Could not open file %s.", filename.c_str());
-		return nullptr;
-	}
-
-	FEM_CLASS fem_class;
-	FEM_DIM fem_dim;
-	std::vector<GeoLib::Point*>* points = NULL;
-	std::vector<GeoLib::Polyline*>* lines = NULL;
-
-	bool isXZplane = false;
-
-	std::vector<MeshLib::Node*> vec_nodes;
-	std::vector<MeshLib::Element*> vec_elements;
-
-	std::vector<std::vector<std::size_t>> vec_elementsets;
-
-	std::string line_string;
-	std::stringstream line_stream;
-	while (!in.eof())
-	{
-		getline(in, line_string);
-		//....................................................................
-		// CLASS
-		if (line_string.find("CLASS") != std::string::npos) // the version number follows afterward, e.g. CLASS (v.5.313)
-		{
-			getline(in, line_string);
-			line_stream.str(line_string);
-			// problem class, time mode, problem orientation, dimension, nr. layers for 3D, saturation switch, precision of results, precision of coordinates
-			line_stream >> fem_class.problem_class >> fem_class.time_mode >> fem_class.orientation >> fem_class.dimension >> fem_class.n_layers3d;
-			line_stream.clear();
-		}
-		//....................................................................
-		// DIMENS
-		else if (line_string.compare("DIMENS") == 0)
-		{
-			// DIMENS
-			getline(in, line_string);
-			line_stream.str(line_string);
-			line_stream >> fem_dim.n_nodes >> fem_dim.n_elements >> fem_dim.n_nodes_of_element >> std::ws;
-			// create node pointers with dummy coordinates to create element objects.
-			// True coordinates are set later in COOR and ELEV_I.
-			vec_nodes.resize(fem_dim.n_nodes);
-			std::size_t count = 0;
-			double dummy_coords[3] = {};
-			std::generate(vec_nodes.begin(), vec_nodes.end(), [&]() { return new MeshLib::Node(dummy_coords, count++); });
-			line_stream.clear();
-		}
-		//....................................................................
-		// NODE (node index for elements)
-		else if (line_string.compare("NODE") == 0)
-		{
-			assert(!vec_nodes.empty());
-
-			MeshLib::MeshElemType eleType = MeshLib::MeshElemType::INVALID;
-			if (fem_dim.n_nodes_of_element == 2)
-				eleType = MeshLib::MeshElemType::LINE;
-			else if (fem_dim.n_nodes_of_element == 3)
-				eleType = MeshLib::MeshElemType::TRIANGLE;
-			else if (fem_dim.n_nodes_of_element == 4 && fem_class.dimension == 2)
-				eleType = MeshLib::MeshElemType::QUAD;
-			else if (fem_dim.n_nodes_of_element == 4 && fem_class.dimension == 3)
-				eleType = MeshLib::MeshElemType::TETRAHEDRON;
-			else if (fem_dim.n_nodes_of_element == 6 && fem_class.dimension == 3)
-				eleType = MeshLib::MeshElemType::PRISM;
-			else if (fem_dim.n_nodes_of_element == 8 && fem_class.dimension == 3)
-				eleType = MeshLib::MeshElemType::HEXAHEDRON;
-
-			if (eleType == MeshLib::MeshElemType::INVALID) {
-				ERR("FEFLOWInterface::readFEFLOWFile(): Unsupported element type with the number of node = %d and dim = %d", fem_dim.n_nodes_of_element, fem_class.dimension);
-				std::for_each(vec_nodes.begin(), vec_nodes.end(), [](MeshLib::Node* nod) { delete nod;});
-				vec_nodes.clear();
-				return nullptr;
-			}
-
-			vec_elements.reserve(fem_dim.n_elements);
-			for (std::size_t i=0; i<fem_dim.n_elements; i++)
-			{
-				getline(in, line_string);
-				vec_elements.push_back(readElement(fem_dim, eleType, line_string, vec_nodes));
-			}
-		}
-		//....................................................................
-		// COOR
-		else if (line_string.compare("COOR") == 0)
-		{
-			readNodeCoordinates(in, fem_class, fem_dim, vec_nodes);
-		}
-		//....................................................................
-		// ELEV_I
-		else if (line_string.compare("ELEV_I") == 0)
-		{
-			if (fem_class.dimension == 2)
-				continue;
-			readElevation(in, fem_class, fem_dim, vec_nodes);
-		}
-		//....................................................................
-		// GRAVITY
-		else if (line_string.compare("GRAVITY") == 0)
-		{
-			getline(in, line_string);
-			line_stream.str(line_string);
-			double vec[3] = { };
-			line_stream >> vec[0] >> vec[1] >> vec[2];
-			if (vec[0] == 0.0 && vec[1] == -1.0 && vec[2] == 0.0)
-				// x-z plane
-				isXZplane = true;
-			line_stream.clear();
-		}
-		//....................................................................
-		// ELEMENTALSETS
-		else if (line_string.compare("ELEMENTALSETS") == 0)
-		{
-			readELEMENTALSETS(in, vec_elementsets);
-		}
-		//....................................................................
-		// SUPERMESH
-		else if (line_string.compare("SUPERMESH") == 0)
-		{
-			readSuperMesh(in, fem_class, &points, &lines);
-		}
-		//....................................................................
-	}
-	in.close();
-
-	std::string project_name(
-		BaseLib::extractBaseNameWithoutExtension(filename));
-	if (_geoObjects && points)
-		_geoObjects->addPointVec(
-			std::unique_ptr<std::vector<GeoLib::Point*>>(points), project_name);
-	if (_geoObjects && lines)
-		_geoObjects->addPolylineVec(
-			std::unique_ptr<std::vector<GeoLib::Polyline*>>(lines),
-			project_name);
-
-	INFO("Create mesh");
-	auto mesh(std::unique_ptr<MeshLib::Mesh>(
-		new MeshLib::Mesh(project_name, vec_nodes, vec_elements)));
-	INFO("Set values for material property.");
-	auto 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 {
-		setMaterialIDs(fem_class, fem_dim, lines, vec_elementsets, vec_elements,
-			*opt_material_ids);
-	}
-
-	if (isXZplane)
-	{
-		for (auto* nod : vec_nodes)
-		{
-			(*nod)[2] = (*nod)[1];
-			(*nod)[1] = 0.0;
-		}
-		if (points)
-		{
-			for (auto* pt : *points)
-			{
-				(*pt)[2] = (*pt)[1];
-				(*pt)[1] = .0;
-			}
-		}
-	}
-
-	return mesh.release();
+    std::ifstream in(filename.c_str());
+    if (!in)
+    {
+        ERR("FEFLOWInterface::readFEFLOWFile(): Could not open file %s.", filename.c_str());
+        return nullptr;
+    }
+
+    FEM_CLASS fem_class;
+    FEM_DIM fem_dim;
+    std::vector<GeoLib::Point*>* points = NULL;
+    std::vector<GeoLib::Polyline*>* lines = NULL;
+
+    bool isXZplane = false;
+
+    std::vector<MeshLib::Node*> vec_nodes;
+    std::vector<MeshLib::Element*> vec_elements;
+
+    std::vector<std::vector<std::size_t>> vec_elementsets;
+
+    std::string line_string;
+    std::stringstream line_stream;
+    while (!in.eof())
+    {
+        getline(in, line_string);
+        //....................................................................
+        // CLASS
+        if (line_string.find("CLASS") != std::string::npos) // the version number follows afterward, e.g. CLASS (v.5.313)
+        {
+            getline(in, line_string);
+            line_stream.str(line_string);
+            // problem class, time mode, problem orientation, dimension, nr. layers for 3D, saturation switch, precision of results, precision of coordinates
+            line_stream >> fem_class.problem_class >> fem_class.time_mode >> fem_class.orientation >> fem_class.dimension >> fem_class.n_layers3d;
+            line_stream.clear();
+        }
+        //....................................................................
+        // DIMENS
+        else if (line_string.compare("DIMENS") == 0)
+        {
+            // DIMENS
+            getline(in, line_string);
+            line_stream.str(line_string);
+            line_stream >> fem_dim.n_nodes >> fem_dim.n_elements >> fem_dim.n_nodes_of_element >> std::ws;
+            // create node pointers with dummy coordinates to create element objects.
+            // True coordinates are set later in COOR and ELEV_I.
+            vec_nodes.resize(fem_dim.n_nodes);
+            std::size_t count = 0;
+            double dummy_coords[3] = {};
+            std::generate(vec_nodes.begin(), vec_nodes.end(), [&]() { return new MeshLib::Node(dummy_coords, count++); });
+            line_stream.clear();
+        }
+        //....................................................................
+        // NODE (node index for elements)
+        else if (line_string.compare("NODE") == 0)
+        {
+            assert(!vec_nodes.empty());
+
+            MeshLib::MeshElemType eleType = MeshLib::MeshElemType::INVALID;
+            if (fem_dim.n_nodes_of_element == 2)
+                eleType = MeshLib::MeshElemType::LINE;
+            else if (fem_dim.n_nodes_of_element == 3)
+                eleType = MeshLib::MeshElemType::TRIANGLE;
+            else if (fem_dim.n_nodes_of_element == 4 && fem_class.dimension == 2)
+                eleType = MeshLib::MeshElemType::QUAD;
+            else if (fem_dim.n_nodes_of_element == 4 && fem_class.dimension == 3)
+                eleType = MeshLib::MeshElemType::TETRAHEDRON;
+            else if (fem_dim.n_nodes_of_element == 6 && fem_class.dimension == 3)
+                eleType = MeshLib::MeshElemType::PRISM;
+            else if (fem_dim.n_nodes_of_element == 8 && fem_class.dimension == 3)
+                eleType = MeshLib::MeshElemType::HEXAHEDRON;
+
+            if (eleType == MeshLib::MeshElemType::INVALID) {
+                ERR("FEFLOWInterface::readFEFLOWFile(): Unsupported element type with the number of node = %d and dim = %d", fem_dim.n_nodes_of_element, fem_class.dimension);
+                std::for_each(vec_nodes.begin(), vec_nodes.end(), [](MeshLib::Node* nod) { delete nod;});
+                vec_nodes.clear();
+                return nullptr;
+            }
+
+            vec_elements.reserve(fem_dim.n_elements);
+            for (std::size_t i=0; i<fem_dim.n_elements; i++)
+            {
+                getline(in, line_string);
+                vec_elements.push_back(readElement(fem_dim, eleType, line_string, vec_nodes));
+            }
+        }
+        //....................................................................
+        // COOR
+        else if (line_string.compare("COOR") == 0)
+        {
+            readNodeCoordinates(in, fem_class, fem_dim, vec_nodes);
+        }
+        //....................................................................
+        // ELEV_I
+        else if (line_string.compare("ELEV_I") == 0)
+        {
+            if (fem_class.dimension == 2)
+                continue;
+            readElevation(in, fem_class, fem_dim, vec_nodes);
+        }
+        //....................................................................
+        // GRAVITY
+        else if (line_string.compare("GRAVITY") == 0)
+        {
+            getline(in, line_string);
+            line_stream.str(line_string);
+            double vec[3] = { };
+            line_stream >> vec[0] >> vec[1] >> vec[2];
+            if (vec[0] == 0.0 && vec[1] == -1.0 && vec[2] == 0.0)
+                // x-z plane
+                isXZplane = true;
+            line_stream.clear();
+        }
+        //....................................................................
+        // ELEMENTALSETS
+        else if (line_string.compare("ELEMENTALSETS") == 0)
+        {
+            readELEMENTALSETS(in, vec_elementsets);
+        }
+        //....................................................................
+        // SUPERMESH
+        else if (line_string.compare("SUPERMESH") == 0)
+        {
+            readSuperMesh(in, fem_class, &points, &lines);
+        }
+        //....................................................................
+    }
+    in.close();
+
+    std::string project_name(
+        BaseLib::extractBaseNameWithoutExtension(filename));
+    if (_geoObjects && points)
+        _geoObjects->addPointVec(
+            std::unique_ptr<std::vector<GeoLib::Point*>>(points), project_name);
+    if (_geoObjects && lines)
+        _geoObjects->addPolylineVec(
+            std::unique_ptr<std::vector<GeoLib::Polyline*>>(lines),
+            project_name);
+
+    INFO("Create mesh");
+    auto mesh(std::unique_ptr<MeshLib::Mesh>(
+        new MeshLib::Mesh(project_name, vec_nodes, vec_elements)));
+    INFO("Set values for material property.");
+    auto 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 {
+        setMaterialIDs(fem_class, fem_dim, lines, vec_elementsets, vec_elements,
+            *opt_material_ids);
+    }
+
+    if (isXZplane)
+    {
+        for (auto* nod : vec_nodes)
+        {
+            (*nod)[2] = (*nod)[1];
+            (*nod)[1] = 0.0;
+        }
+        if (points)
+        {
+            for (auto* pt : *points)
+            {
+                (*pt)[2] = (*pt)[1];
+                (*pt)[1] = .0;
+            }
+        }
+    }
+
+    return mesh.release();
 }
 
 
 void FEFLOWInterface::readNodeCoordinates(std::ifstream &in, const FEM_CLASS &fem_class, const FEM_DIM &fem_dim, std::vector<MeshLib::Node*> &vec_nodes)
 {
-	const std::size_t no_nodes_per_layer = (fem_class.dimension == 2) ? fem_dim.n_nodes : fem_dim.n_nodes / (fem_class.n_layers3d + 1);
-	assert(no_nodes_per_layer>0);
-	const std::size_t n_lines = (no_nodes_per_layer-1) / 12 + 1;
-	const std::size_t n_layers = (fem_class.dimension == 3) ? fem_class.n_layers3d + 1 : 1;
-	std::string line_string;
-	std::stringstream line_stream;
-	double x;
-	char dummy_char; // for comma(,)
-	// x, y
-	for (unsigned k = 0; k < 2; k++)
-	{
-		// each line
-		for (std::size_t i = 0; i < n_lines; i++)
-		{
-			getline(in, line_string);
-			line_stream.str(line_string);
-			for (unsigned j = 0; j < 12; j++)
-			{
-				if (i * 12 + j >= no_nodes_per_layer)
-					break;
-				line_stream >> x >> dummy_char;
-				for (std::size_t l = 0; l < n_layers; l++)
-				{
-					const std::size_t n = i * 12 + l * no_nodes_per_layer + j;
-					MeshLib::Node* m_nod = vec_nodes[n];
-					if (k == 0)
-						(*m_nod)[0] = x;
-					else
-						(*m_nod)[1] = x;
-				}
-			}
-			line_stream.clear();
-		}
-	}
+    const std::size_t no_nodes_per_layer = (fem_class.dimension == 2) ? fem_dim.n_nodes : fem_dim.n_nodes / (fem_class.n_layers3d + 1);
+    assert(no_nodes_per_layer>0);
+    const std::size_t n_lines = (no_nodes_per_layer-1) / 12 + 1;
+    const std::size_t n_layers = (fem_class.dimension == 3) ? fem_class.n_layers3d + 1 : 1;
+    std::string line_string;
+    std::stringstream line_stream;
+    double x;
+    char dummy_char; // for comma(,)
+    // x, y
+    for (unsigned k = 0; k < 2; k++)
+    {
+        // each line
+        for (std::size_t i = 0; i < n_lines; i++)
+        {
+            getline(in, line_string);
+            line_stream.str(line_string);
+            for (unsigned j = 0; j < 12; j++)
+            {
+                if (i * 12 + j >= no_nodes_per_layer)
+                    break;
+                line_stream >> x >> dummy_char;
+                for (std::size_t l = 0; l < n_layers; l++)
+                {
+                    const std::size_t n = i * 12 + l * no_nodes_per_layer + j;
+                    MeshLib::Node* m_nod = vec_nodes[n];
+                    if (k == 0)
+                        (*m_nod)[0] = x;
+                    else
+                        (*m_nod)[1] = x;
+                }
+            }
+            line_stream.clear();
+        }
+    }
 }
 
 std::vector<std::size_t> FEFLOWInterface::getIndexList(const std::string &str_ranges)
 {
-	std::vector<std::size_t> vec_node_IDs;
-
-	// insert space before and after minus for splitting
-	std::string str_ranges2(BaseLib::replaceString("-",  " # ", str_ranges));
-	BaseLib::trim(str_ranges2);
-	auto splitted_str = BaseLib::splitString(str_ranges2, ' ');
-	bool is_range = false;
-	for (auto str : splitted_str)
-	{
-		if (str.empty()) continue;
-		if (str[0]=='#') {
-			is_range = true;
-		} else if (is_range) {
-			const std::size_t start = vec_node_IDs.back();
-			const std::size_t end = BaseLib::str2number<std::size_t>(str);
-			for (std::size_t i=start+1; i<end+1; i++)
-				vec_node_IDs.push_back(i);
-			is_range = false;
-		} else {
-			BaseLib::trim(str);
-			vec_node_IDs.push_back(BaseLib::str2number<std::size_t>(str));
-		}
-	}
-
-	return vec_node_IDs;
+    std::vector<std::size_t> vec_node_IDs;
+
+    // insert space before and after minus for splitting
+    std::string str_ranges2(BaseLib::replaceString("-",  " # ", str_ranges));
+    BaseLib::trim(str_ranges2);
+    auto splitted_str = BaseLib::splitString(str_ranges2, ' ');
+    bool is_range = false;
+    for (auto str : splitted_str)
+    {
+        if (str.empty()) continue;
+        if (str[0]=='#') {
+            is_range = true;
+        } else if (is_range) {
+            const std::size_t start = vec_node_IDs.back();
+            const std::size_t end = BaseLib::str2number<std::size_t>(str);
+            for (std::size_t i=start+1; i<end+1; i++)
+                vec_node_IDs.push_back(i);
+            is_range = false;
+        } else {
+            BaseLib::trim(str);
+            vec_node_IDs.push_back(BaseLib::str2number<std::size_t>(str));
+        }
+    }
+
+    return vec_node_IDs;
 }
 
 void FEFLOWInterface::readElevation(std::ifstream &in, const FEM_CLASS &fem_class, const FEM_DIM &fem_dim, std::vector<MeshLib::Node*> &vec_nodes)
 {
-	const std::size_t no_nodes_per_layer = fem_dim.n_nodes / (fem_class.n_layers3d + 1);
-	double z = .0;
-	std::string str_nodeList;
-	std::string line_string;
-	std::stringstream line_stream;
-	std::size_t l = 0;
-	unsigned mode = 0; // 0: exit, 1: slice no, 2: elevation value, 3: continued line of mode 2
-	int pos_prev_line = 0;
-	while (true)
-	{
-		pos_prev_line = in.tellg();
-		getline(in, line_string);
-
-		// check mode
-		auto columns = BaseLib::splitString(line_string, ' ');
-		if (!in || std::isalpha(line_string[0]))
-			mode = 0;
-		else if (line_string.empty())
-			continue;
-		else if (line_string[0]=='\t')
-			mode = 3;
-		else if (columns.size()==1)
-			mode = 1;
-		else // columns.size()>1
-			mode = 2;
-
-		// process stocked data
-		if (mode != 3 && !str_nodeList.empty()) {
-			// process previous lines
-			auto vec_nodeIDs = getIndexList(str_nodeList);
-			for (auto n0 : vec_nodeIDs)
-			{
-				const std::size_t n = n0 - 1 + l * no_nodes_per_layer;
-				(*vec_nodes[n])[2] = z;
-			}
-			str_nodeList.clear();
-		}
-
-		if (mode == 0) {
-			break;
-		} else if (mode == 1) {
-			// slice number
-			l++;
-			assert(l+1==BaseLib::str2number<std::size_t>(columns.front()));
-		} else if (mode == 2) {
-			// parse current line
-			line_stream.str(line_string);
-			line_stream >> z;
-			getline(line_stream, str_nodeList);
-			BaseLib::trim(str_nodeList, '\t');
-			line_stream.clear();
-		} else if (mode == 3) {
-			// continue reading node range
-			BaseLib::trim(line_string, '\t');
-			str_nodeList += " " + line_string;
-		}
-	}
-
-	// move stream position to previous line
-	if (std::isalpha(line_string[0]))
-		in.seekg(pos_prev_line);
+    const std::size_t no_nodes_per_layer = fem_dim.n_nodes / (fem_class.n_layers3d + 1);
+    double z = .0;
+    std::string str_nodeList;
+    std::string line_string;
+    std::stringstream line_stream;
+    std::size_t l = 0;
+    unsigned mode = 0; // 0: exit, 1: slice no, 2: elevation value, 3: continued line of mode 2
+    int pos_prev_line = 0;
+    while (true)
+    {
+        pos_prev_line = in.tellg();
+        getline(in, line_string);
+
+        // check mode
+        auto columns = BaseLib::splitString(line_string, ' ');
+        if (!in || std::isalpha(line_string[0]))
+            mode = 0;
+        else if (line_string.empty())
+            continue;
+        else if (line_string[0]=='\t')
+            mode = 3;
+        else if (columns.size()==1)
+            mode = 1;
+        else // columns.size()>1
+            mode = 2;
+
+        // process stocked data
+        if (mode != 3 && !str_nodeList.empty()) {
+            // process previous lines
+            auto vec_nodeIDs = getIndexList(str_nodeList);
+            for (auto n0 : vec_nodeIDs)
+            {
+                const std::size_t n = n0 - 1 + l * no_nodes_per_layer;
+                (*vec_nodes[n])[2] = z;
+            }
+            str_nodeList.clear();
+        }
+
+        if (mode == 0) {
+            break;
+        } else if (mode == 1) {
+            // slice number
+            l++;
+            assert(l+1==BaseLib::str2number<std::size_t>(columns.front()));
+        } else if (mode == 2) {
+            // parse current line
+            line_stream.str(line_string);
+            line_stream >> z;
+            getline(line_stream, str_nodeList);
+            BaseLib::trim(str_nodeList, '\t');
+            line_stream.clear();
+        } else if (mode == 3) {
+            // continue reading node range
+            BaseLib::trim(line_string, '\t');
+            str_nodeList += " " + line_string;
+        }
+    }
+
+    // move stream position to previous line
+    if (std::isalpha(line_string[0]))
+        in.seekg(pos_prev_line);
 }
 
 MeshLib::Element* FEFLOWInterface::readElement(const FEM_DIM &fem_dim,
-	const MeshLib::MeshElemType elem_type, const std::string& line,
-	const std::vector<MeshLib::Node*> &nodes)
+    const MeshLib::MeshElemType elem_type, const std::string& line,
+    const std::vector<MeshLib::Node*> &nodes)
 {
-	std::stringstream ss(line);
-
-	unsigned idx[8];
-	for (std::size_t i = 0; i < fem_dim.n_nodes_of_element; ++i)
-		ss >> idx[i];
-	MeshLib::Node** ele_nodes = new MeshLib::Node*[fem_dim.n_nodes_of_element];
-
-	switch (elem_type)
-	{
-		default:
-			for (unsigned k(0); k < fem_dim.n_nodes_of_element; ++k)
-				ele_nodes[k] = nodes[idx[k]-1];
-			break;
-		case MeshLib::MeshElemType::HEXAHEDRON:
-		case MeshLib::MeshElemType::PRISM:
-			const unsigned n_half_nodes = fem_dim.n_nodes_of_element/2;
-			for (unsigned k(0); k < n_half_nodes; ++k) {
-				ele_nodes[k] = nodes[idx[k+n_half_nodes]-1];
-				ele_nodes[k+n_half_nodes] = nodes[idx[k]-1];
-			}
-			break;
-	}
-
-	switch (elem_type)
-	{
-		case MeshLib::MeshElemType::LINE:
-			return new MeshLib::Line(ele_nodes);
-		case MeshLib::MeshElemType::TRIANGLE:
-			return new MeshLib::Tri(ele_nodes);
-		case MeshLib::MeshElemType::QUAD:
-			return new MeshLib::Quad(ele_nodes);
-		case MeshLib::MeshElemType::TETRAHEDRON:
-			return new MeshLib::Tet(ele_nodes);
-		case MeshLib::MeshElemType::HEXAHEDRON:
-			return new MeshLib::Hex(ele_nodes);
-		case MeshLib::MeshElemType::PRISM:
-			return new MeshLib::Prism(ele_nodes);
-		default:
-			assert(false);
-			return nullptr;
-	}
+    std::stringstream ss(line);
+
+    unsigned idx[8];
+    for (std::size_t i = 0; i < fem_dim.n_nodes_of_element; ++i)
+        ss >> idx[i];
+    MeshLib::Node** ele_nodes = new MeshLib::Node*[fem_dim.n_nodes_of_element];
+
+    switch (elem_type)
+    {
+        default:
+            for (unsigned k(0); k < fem_dim.n_nodes_of_element; ++k)
+                ele_nodes[k] = nodes[idx[k]-1];
+            break;
+        case MeshLib::MeshElemType::HEXAHEDRON:
+        case MeshLib::MeshElemType::PRISM:
+            const unsigned n_half_nodes = fem_dim.n_nodes_of_element/2;
+            for (unsigned k(0); k < n_half_nodes; ++k) {
+                ele_nodes[k] = nodes[idx[k+n_half_nodes]-1];
+                ele_nodes[k+n_half_nodes] = nodes[idx[k]-1];
+            }
+            break;
+    }
+
+    switch (elem_type)
+    {
+        case MeshLib::MeshElemType::LINE:
+            return new MeshLib::Line(ele_nodes);
+        case MeshLib::MeshElemType::TRIANGLE:
+            return new MeshLib::Tri(ele_nodes);
+        case MeshLib::MeshElemType::QUAD:
+            return new MeshLib::Quad(ele_nodes);
+        case MeshLib::MeshElemType::TETRAHEDRON:
+            return new MeshLib::Tet(ele_nodes);
+        case MeshLib::MeshElemType::HEXAHEDRON:
+            return new MeshLib::Hex(ele_nodes);
+        case MeshLib::MeshElemType::PRISM:
+            return new MeshLib::Prism(ele_nodes);
+        default:
+            assert(false);
+            return nullptr;
+    }
 }
 
 void FEFLOWInterface::readPoints(QDomElement &nodesEle, const std::string &tag, int dim, std::vector<GeoLib::Point*> &points)
 {
-	QDomElement xmlEle = nodesEle.firstChildElement(QString::fromStdString(tag));
-	if (xmlEle.isNull())
-		return;
-	QString str_pt_list1 = xmlEle.text();
-	std::istringstream ss(str_pt_list1.toStdString());
-	std::string line_str;
-	while (!ss.eof())
-	{
-		std::getline(ss, line_str);
-		BaseLib::trim(line_str, ' ');
-		if (line_str.empty()) continue;
-		std::istringstream line_ss(line_str);
-		std::size_t pt_id = 0;
-		std::array<double,3> pt_xyz;
-		line_ss >> pt_id;
-		for (int i = 0; i < dim; i++)
-			line_ss >> pt_xyz[i];
-		points[pt_id - 1] = new GeoLib::Point(pt_xyz, pt_id);
-	}
+    QDomElement xmlEle = nodesEle.firstChildElement(QString::fromStdString(tag));
+    if (xmlEle.isNull())
+        return;
+    QString str_pt_list1 = xmlEle.text();
+    std::istringstream ss(str_pt_list1.toStdString());
+    std::string line_str;
+    while (!ss.eof())
+    {
+        std::getline(ss, line_str);
+        BaseLib::trim(line_str, ' ');
+        if (line_str.empty()) continue;
+        std::istringstream line_ss(line_str);
+        std::size_t pt_id = 0;
+        std::array<double,3> pt_xyz;
+        line_ss >> pt_id;
+        for (int i = 0; i < dim; i++)
+            line_ss >> pt_xyz[i];
+        points[pt_id - 1] = new GeoLib::Point(pt_xyz, pt_id);
+    }
 }
 
 void FEFLOWInterface::readELEMENTALSETS(std::ifstream &in, std::vector<std::vector<std::size_t>> &vec_elementsets)
 {
-	auto compressSpaces = [](std::string const& str) {
-		std::stringstream ss(str);
-		std::string new_str;
-		std::string word;
-		while (ss) {
-			ss >> word;
-			new_str += " " + word;
-		}
-		return new_str;
-	};
-
-	std::string line_string;
-	std::string str_idList;
-	std::streampos pos_prev_line = 0;
-	while (true)
-	{
-		pos_prev_line = in.tellg();
-		getline(in, line_string);
-
-		unsigned mode = 0;
-		if (!in)
-			mode = 0; // reached the end of the file
-		else if (line_string.empty())
-			continue; // skip and see what comes next
-		else if (std::isalpha(line_string[0]))
-			mode = 0; // reached the next section
-		else if (line_string[0] == ' ')
-			mode = 1; // start of the element set definition
-		else if (line_string[0] == '\t')
-			mode = 2; // continue the definition
-		else
-		{
-			ERR("Failed during parsing of an ELEMENTALSETS section in a FEFLOW file");
-			break;
-		}
-
-		if (mode!=2 && !str_idList.empty()) {
-			vec_elementsets.push_back(getIndexList(str_idList));
-			str_idList.clear();
-		}
-
-		if (mode == 0) {
-			break;
-		} else if (mode == 1) {
-			// starting a new set
-			std::string set_name;
-			std::string ids;
-			BaseLib::trim(line_string, ' ');
-			if (line_string[0]=='"') { // multiple words
-				auto pos = line_string.find_last_of('"');
-				set_name = line_string.substr(1, pos-1); // without quotation
-				ids = line_string.substr(pos+1);
-			} else { // single word
-				auto pos = line_string.find_first_of(' ');
-				set_name = line_string.substr(0, pos);
-				ids = line_string.substr(pos+1);
-			}
-			INFO("Found an element group - %s", set_name.data());
-			str_idList += compressSpaces(ids);
-		} else {
-			// continue reading a element ids
-			BaseLib::trim(line_string, '\t');
-			str_idList += compressSpaces(line_string);
-		}
-	}
-	// move stream position to previous line
-	if (std::isalpha(line_string[0]))
-		in.seekg(pos_prev_line);
+    auto compressSpaces = [](std::string const& str) {
+        std::stringstream ss(str);
+        std::string new_str;
+        std::string word;
+        while (ss) {
+            ss >> word;
+            new_str += " " + word;
+        }
+        return new_str;
+    };
+
+    std::string line_string;
+    std::string str_idList;
+    std::streampos pos_prev_line = 0;
+    while (true)
+    {
+        pos_prev_line = in.tellg();
+        getline(in, line_string);
+
+        unsigned mode = 0;
+        if (!in)
+            mode = 0; // reached the end of the file
+        else if (line_string.empty())
+            continue; // skip and see what comes next
+        else if (std::isalpha(line_string[0]))
+            mode = 0; // reached the next section
+        else if (line_string[0] == ' ')
+            mode = 1; // start of the element set definition
+        else if (line_string[0] == '\t')
+            mode = 2; // continue the definition
+        else
+        {
+            ERR("Failed during parsing of an ELEMENTALSETS section in a FEFLOW file");
+            break;
+        }
+
+        if (mode!=2 && !str_idList.empty()) {
+            vec_elementsets.push_back(getIndexList(str_idList));
+            str_idList.clear();
+        }
+
+        if (mode == 0) {
+            break;
+        } else if (mode == 1) {
+            // starting a new set
+            std::string set_name;
+            std::string ids;
+            BaseLib::trim(line_string, ' ');
+            if (line_string[0]=='"') { // multiple words
+                auto pos = line_string.find_last_of('"');
+                set_name = line_string.substr(1, pos-1); // without quotation
+                ids = line_string.substr(pos+1);
+            } else { // single word
+                auto pos = line_string.find_first_of(' ');
+                set_name = line_string.substr(0, pos);
+                ids = line_string.substr(pos+1);
+            }
+            INFO("Found an element group - %s", set_name.data());
+            str_idList += compressSpaces(ids);
+        } else {
+            // continue reading a element ids
+            BaseLib::trim(line_string, '\t');
+            str_idList += compressSpaces(line_string);
+        }
+    }
+    // move stream position to previous line
+    if (std::isalpha(line_string[0]))
+        in.seekg(pos_prev_line);
 
 }
 
 //
 void FEFLOWInterface::readSuperMesh(std::ifstream &in, const FEM_CLASS &fem_class, std::vector<GeoLib::Point*>** p_points, std::vector<GeoLib::Polyline*>** p_lines)
 {
-	// get XML strings
-	std::ostringstream oss;
-	std::string line_string;
-	while (true)
-	{
-		getline(in, line_string);
-		BaseLib::trim(line_string);
-		oss << line_string << "\n";
-		if (line_string.find("</supermesh>") != std::string::npos)
-			break;
-	}
-	const QString strXML(oss.str().c_str());
-
-	// convert string to XML
-	QDomDocument doc;
-	if (!doc.setContent(strXML))
-	{
-		ERR("FEFLOWInterface::readSuperMesh(): Illegal XML format error");
-		return;
-	}
-
-	// get geometry data from XML
-	QDomElement docElem = doc.documentElement(); // #supermesh
-	// #nodes
-	*p_points = new std::vector<GeoLib::Point*>();
-	std::vector<GeoLib::Point*>* points = *p_points;
-	QDomElement nodesEle = docElem.firstChildElement("nodes");
-	if (nodesEle.isNull())
-		return;
-
-	{
-		const QString str = nodesEle.attribute("count");
-		const long n_points = str.toLong();
-		points->resize(n_points);
-		//fixed
-		readPoints(nodesEle, "fixed", fem_class.dimension, *points);
-		readPoints(nodesEle, "linear", fem_class.dimension, *points);
-		readPoints(nodesEle, "parabolic", fem_class.dimension, *points);
-	}
-
-	// #polygons
-	*p_lines = new std::vector<GeoLib::Polyline*>();
-	std::vector<GeoLib::Polyline*>* lines = *p_lines;
-	QDomElement polygonsEle = docElem.firstChildElement("polygons");
-	if (polygonsEle.isNull())
-		return;
-
-	{
-		QDomNode child = polygonsEle.firstChild();
-		while (!child.isNull())
-		{
-			if (child.nodeName() != "polygon")
-			{
-				child = child.nextSibling();
-				continue;
-			}
-			QDomElement xmlEle = child.firstChildElement("nodes");
-			if (xmlEle.isNull())
-				continue;
-			const QString str = xmlEle.attribute("count");
-			const std::size_t n_points = str.toLong();
-			QString str_ptId_list = xmlEle.text().simplified();
-			{
-				GeoLib::Polyline* line = new GeoLib::Polyline(*points);
-				lines->push_back(line);
-				std::istringstream ss(str_ptId_list.toStdString());
-				for (std::size_t i = 0; i < n_points; i++)
-				{
-					int pt_id = 0;
-					ss >> pt_id;
-					line->addPoint(pt_id - 1);
-				}
-				line->addPoint(line->getPointID(0));
-			}
-			child = child.nextSibling();
-		}
-	}
+    // get XML strings
+    std::ostringstream oss;
+    std::string line_string;
+    while (true)
+    {
+        getline(in, line_string);
+        BaseLib::trim(line_string);
+        oss << line_string << "\n";
+        if (line_string.find("</supermesh>") != std::string::npos)
+            break;
+    }
+    const QString strXML(oss.str().c_str());
+
+    // convert string to XML
+    QDomDocument doc;
+    if (!doc.setContent(strXML))
+    {
+        ERR("FEFLOWInterface::readSuperMesh(): Illegal XML format error");
+        return;
+    }
+
+    // get geometry data from XML
+    QDomElement docElem = doc.documentElement(); // #supermesh
+    // #nodes
+    *p_points = new std::vector<GeoLib::Point*>();
+    std::vector<GeoLib::Point*>* points = *p_points;
+    QDomElement nodesEle = docElem.firstChildElement("nodes");
+    if (nodesEle.isNull())
+        return;
+
+    {
+        const QString str = nodesEle.attribute("count");
+        const long n_points = str.toLong();
+        points->resize(n_points);
+        //fixed
+        readPoints(nodesEle, "fixed", fem_class.dimension, *points);
+        readPoints(nodesEle, "linear", fem_class.dimension, *points);
+        readPoints(nodesEle, "parabolic", fem_class.dimension, *points);
+    }
+
+    // #polygons
+    *p_lines = new std::vector<GeoLib::Polyline*>();
+    std::vector<GeoLib::Polyline*>* lines = *p_lines;
+    QDomElement polygonsEle = docElem.firstChildElement("polygons");
+    if (polygonsEle.isNull())
+        return;
+
+    {
+        QDomNode child = polygonsEle.firstChild();
+        while (!child.isNull())
+        {
+            if (child.nodeName() != "polygon")
+            {
+                child = child.nextSibling();
+                continue;
+            }
+            QDomElement xmlEle = child.firstChildElement("nodes");
+            if (xmlEle.isNull())
+                continue;
+            const QString str = xmlEle.attribute("count");
+            const std::size_t n_points = str.toLong();
+            QString str_ptId_list = xmlEle.text().simplified();
+            {
+                GeoLib::Polyline* line = new GeoLib::Polyline(*points);
+                lines->push_back(line);
+                std::istringstream ss(str_ptId_list.toStdString());
+                for (std::size_t i = 0; i < n_points; i++)
+                {
+                    int pt_id = 0;
+                    ss >> pt_id;
+                    line->addPoint(pt_id - 1);
+                }
+                line->addPoint(line->getPointID(0));
+            }
+            child = child.nextSibling();
+        }
+    }
 }
 
 void FEFLOWInterface::setMaterialIDs(FEM_CLASS const& fem_class,
-	FEM_DIM const& fem_dim,
-	std::vector<GeoLib::Polyline*>* const& lines,
-	std::vector<std::vector<std::size_t>> const& vec_elementsets,
-	std::vector<MeshLib::Element*> const& vec_elements,
-	std::vector<int> & material_ids)
+    FEM_DIM const& fem_dim,
+    std::vector<GeoLib::Polyline*>* const& lines,
+    std::vector<std::vector<std::size_t>> const& vec_elementsets,
+    std::vector<MeshLib::Element*> const& vec_elements,
+    std::vector<int> & material_ids)
 {
-	if (!vec_elementsets.empty()) {
-		for (std::size_t matid=0; matid<vec_elementsets.size(); ++matid) {
-			auto &eids = vec_elementsets[matid];
-			for (auto eid : eids)
-				material_ids[eid-1] = matid; // Element IDs given by FEFLOW starts from one!
-		}
-	} else if (lines && !lines->empty()) {
-		for (std::size_t i = 0; i < vec_elements.size(); ++i)
-		{
-			MeshLib::Element const* e = vec_elements[i];
-			MeshLib::Node const gpt = e->getCenterOfGravity();
-			std::size_t matId = 0;
-			for (std::size_t j = 0; j < lines->size(); j++)
-			{
-				GeoLib::Polyline* poly = (*lines)[j];
-				if (!poly->isClosed())
-					continue;
-
-				GeoLib::Polygon polygon(*poly, true);
-				if (polygon.isPntInPolygon(gpt[0], gpt[1], gpt[2]))
-				{
-					matId = j;
-					break;
-				}
-			}
-			material_ids[i] = matId;
-		}
-	} else if (fem_class.n_layers3d>0) {
-		const std::size_t no_nodes_per_layer = fem_dim.n_nodes / (fem_class.n_layers3d + 1);
-		for (std::size_t i = 0; i < vec_elements.size(); i++)
-		{
-			MeshLib::Element* e = vec_elements[i];
-			unsigned e_min_nodeID = std::numeric_limits<unsigned>::max();
-			for (std::size_t j=0; j<e->getNBaseNodes(); j++)
-				e_min_nodeID = std::min(e_min_nodeID, e->getNodeIndex(j));
-			std::size_t layer_id = e_min_nodeID / no_nodes_per_layer;
-			material_ids[i] = layer_id;
-		}
-	}
+    if (!vec_elementsets.empty()) {
+        for (std::size_t matid=0; matid<vec_elementsets.size(); ++matid) {
+            auto &eids = vec_elementsets[matid];
+            for (auto eid : eids)
+                material_ids[eid-1] = matid; // Element IDs given by FEFLOW starts from one!
+        }
+    } else if (lines && !lines->empty()) {
+        for (std::size_t i = 0; i < vec_elements.size(); ++i)
+        {
+            MeshLib::Element const* e = vec_elements[i];
+            MeshLib::Node const gpt = e->getCenterOfGravity();
+            std::size_t matId = 0;
+            for (std::size_t j = 0; j < lines->size(); j++)
+            {
+                GeoLib::Polyline* poly = (*lines)[j];
+                if (!poly->isClosed())
+                    continue;
+
+                GeoLib::Polygon polygon(*poly, true);
+                if (polygon.isPntInPolygon(gpt[0], gpt[1], gpt[2]))
+                {
+                    matId = j;
+                    break;
+                }
+            }
+            material_ids[i] = matId;
+        }
+    } else if (fem_class.n_layers3d>0) {
+        const std::size_t no_nodes_per_layer = fem_dim.n_nodes / (fem_class.n_layers3d + 1);
+        for (std::size_t i = 0; i < vec_elements.size(); i++)
+        {
+            MeshLib::Element* e = vec_elements[i];
+            unsigned e_min_nodeID = std::numeric_limits<unsigned>::max();
+            for (std::size_t j=0; j<e->getNBaseNodes(); j++)
+                e_min_nodeID = std::min(e_min_nodeID, e->getNodeIndex(j));
+            std::size_t layer_id = e_min_nodeID / no_nodes_per_layer;
+            material_ids[i] = layer_id;
+        }
+    }
 }
 
 } // end namespace FileIO
diff --git a/FileIO/FEFLOWInterface.h b/FileIO/FEFLOWInterface.h
index 987e3b405c472357b6c3f864898a52f7e183d80a..c924c51f752fa051304f48a8d186076f0c2b5b1d 100644
--- a/FileIO/FEFLOWInterface.h
+++ b/FileIO/FEFLOWInterface.h
@@ -44,122 +44,122 @@ namespace FileIO
 class FEFLOWInterface
 {
 public:
-	/// Constructor
-	explicit FEFLOWInterface(GeoLib::GEOObjects* obj = nullptr)
-			: _geoObjects(obj)
-	{
-	}
-
-	/**
-	 * read a FEFLOW Model file (*.fem) in ASCII format (Version 5.4)
-	 *
-	 * This function reads mesh data in addition to geometry data given in Supermesh.
-	 *
-	 * @param filename  FEFLOW file name
-	 * @return a pointer to a created OGS mesh
-	 */
-	MeshLib::Mesh* readFEFLOWFile(const std::string &filename);
+    /// Constructor
+    explicit FEFLOWInterface(GeoLib::GEOObjects* obj = nullptr)
+            : _geoObjects(obj)
+    {
+    }
+
+    /**
+     * read a FEFLOW Model file (*.fem) in ASCII format (Version 5.4)
+     *
+     * This function reads mesh data in addition to geometry data given in Supermesh.
+     *
+     * @param filename  FEFLOW file name
+     * @return a pointer to a created OGS mesh
+     */
+    MeshLib::Mesh* readFEFLOWFile(const std::string &filename);
 
 private:
-	// CLASS
-	struct FEM_CLASS
-	{
-		unsigned problem_class;
-		unsigned time_mode;
-		unsigned orientation;
-		unsigned dimension;
-		unsigned n_layers3d;
-		unsigned saturation_flag;
-		unsigned save_fsize_rreal;
-		unsigned save_fsize_creal;
-
-		FEM_CLASS()
-		{
-			problem_class = 0;
-			time_mode = 0;
-			orientation = 0;
-			dimension = 0;
-			n_layers3d = 0;
-			saturation_flag = 0;
-			save_fsize_rreal = 0;
-			save_fsize_creal = 0;
-		}
-	};
-
-	// DIMENSION
-	struct FEM_DIM
-	{
-		std::size_t n_nodes;
-		std::size_t n_elements;
-		std::size_t obs;
-		std::size_t np_cor;
-		unsigned n_nodes_of_element;
-		unsigned n_steps;
-		unsigned icrank;
-		unsigned upwind;
-		unsigned optim;
-		unsigned aquifer_type;
-		unsigned nwca;
-		unsigned adaptive_mesh;
-		unsigned sp_fem_pcs_id;
-		unsigned sorption_type;
-		unsigned reaction_type;
-		unsigned dispersion_type;
-
-		FEM_DIM()
-		{
-			n_nodes = 0;
-			n_elements = 0;
-			n_nodes_of_element = 0;
-			n_steps = 0;
-			icrank = 0;
-			upwind = 0;
-			obs = 0;
-			optim = 0;
-			aquifer_type = 0;
-			nwca = 0;
-			np_cor = 0;
-			adaptive_mesh = 0;
-			sp_fem_pcs_id = 0;
-			sorption_type = 0;
-			reaction_type = 0;
-			dispersion_type = 0;
-		}
-	};
-
-	/// read node indices and create a mesh element
-	MeshLib::Element* readElement(const FEM_DIM &fem_dim, const MeshLib::MeshElemType elem_type, const std::string& line, const std::vector<MeshLib::Node*> &nodes);
-
-	/// read node coordinates
-	void readNodeCoordinates(std::ifstream &in, const FEM_CLASS &fem_class, const FEM_DIM &fem_dim, std::vector<MeshLib::Node*> &nodes);
-
-	/// read elevation data
-	void readElevation(std::ifstream &in, const FEM_CLASS &fem_class, const FEM_DIM &fem_dim, std::vector<MeshLib::Node*> &vec_nodes);
-
-	//// parse node lists
-	std::vector<std::size_t> getIndexList(const std::string &str_ranges);
-
-	/// parse ELEMENTALSETS
-	void readELEMENTALSETS(std::ifstream &in, std::vector<std::vector<std::size_t>> &vec_elementsets);
-
-	/// read Supermesh data
-	///
-	/// A super mesh is a collection of polygons, lines and points in the 2D plane
-	/// and will be used for mesh generation and to define the modeling region
-	void readSuperMesh(std::ifstream &feflow_file, const FEM_CLASS &fem_class, std::vector<GeoLib::Point*>** points, std::vector<GeoLib::Polyline*>** lines);
-
-	//// read point data in Supermesh
-	void readPoints(QDomElement &nodesEle, const std::string &tag, int dim, std::vector<GeoLib::Point*> &points);
-
-	void setMaterialIDs(FEM_CLASS const& fem_class,
-		FEM_DIM const& fem_dim,
-		std::vector<GeoLib::Polyline*>* const& lines,
-		std::vector<std::vector<std::size_t>> const& vec_elementsets,
-		std::vector<MeshLib::Element*> const& vec_elements,
-		std::vector<int> & material_ids);
-
-	//// Geometric objects
-	GeoLib::GEOObjects* _geoObjects;
+    // CLASS
+    struct FEM_CLASS
+    {
+        unsigned problem_class;
+        unsigned time_mode;
+        unsigned orientation;
+        unsigned dimension;
+        unsigned n_layers3d;
+        unsigned saturation_flag;
+        unsigned save_fsize_rreal;
+        unsigned save_fsize_creal;
+
+        FEM_CLASS()
+        {
+            problem_class = 0;
+            time_mode = 0;
+            orientation = 0;
+            dimension = 0;
+            n_layers3d = 0;
+            saturation_flag = 0;
+            save_fsize_rreal = 0;
+            save_fsize_creal = 0;
+        }
+    };
+
+    // DIMENSION
+    struct FEM_DIM
+    {
+        std::size_t n_nodes;
+        std::size_t n_elements;
+        std::size_t obs;
+        std::size_t np_cor;
+        unsigned n_nodes_of_element;
+        unsigned n_steps;
+        unsigned icrank;
+        unsigned upwind;
+        unsigned optim;
+        unsigned aquifer_type;
+        unsigned nwca;
+        unsigned adaptive_mesh;
+        unsigned sp_fem_pcs_id;
+        unsigned sorption_type;
+        unsigned reaction_type;
+        unsigned dispersion_type;
+
+        FEM_DIM()
+        {
+            n_nodes = 0;
+            n_elements = 0;
+            n_nodes_of_element = 0;
+            n_steps = 0;
+            icrank = 0;
+            upwind = 0;
+            obs = 0;
+            optim = 0;
+            aquifer_type = 0;
+            nwca = 0;
+            np_cor = 0;
+            adaptive_mesh = 0;
+            sp_fem_pcs_id = 0;
+            sorption_type = 0;
+            reaction_type = 0;
+            dispersion_type = 0;
+        }
+    };
+
+    /// read node indices and create a mesh element
+    MeshLib::Element* readElement(const FEM_DIM &fem_dim, const MeshLib::MeshElemType elem_type, const std::string& line, const std::vector<MeshLib::Node*> &nodes);
+
+    /// read node coordinates
+    void readNodeCoordinates(std::ifstream &in, const FEM_CLASS &fem_class, const FEM_DIM &fem_dim, std::vector<MeshLib::Node*> &nodes);
+
+    /// read elevation data
+    void readElevation(std::ifstream &in, const FEM_CLASS &fem_class, const FEM_DIM &fem_dim, std::vector<MeshLib::Node*> &vec_nodes);
+
+    //// parse node lists
+    std::vector<std::size_t> getIndexList(const std::string &str_ranges);
+
+    /// parse ELEMENTALSETS
+    void readELEMENTALSETS(std::ifstream &in, std::vector<std::vector<std::size_t>> &vec_elementsets);
+
+    /// read Supermesh data
+    ///
+    /// A super mesh is a collection of polygons, lines and points in the 2D plane
+    /// and will be used for mesh generation and to define the modeling region
+    void readSuperMesh(std::ifstream &feflow_file, const FEM_CLASS &fem_class, std::vector<GeoLib::Point*>** points, std::vector<GeoLib::Polyline*>** lines);
+
+    //// read point data in Supermesh
+    void readPoints(QDomElement &nodesEle, const std::string &tag, int dim, std::vector<GeoLib::Point*> &points);
+
+    void setMaterialIDs(FEM_CLASS const& fem_class,
+        FEM_DIM const& fem_dim,
+        std::vector<GeoLib::Polyline*>* const& lines,
+        std::vector<std::vector<std::size_t>> const& vec_elementsets,
+        std::vector<MeshLib::Element*> const& vec_elements,
+        std::vector<int> & material_ids);
+
+    //// Geometric objects
+    GeoLib::GEOObjects* _geoObjects;
 };
 } // end namespace FileIO
 
diff --git a/FileIO/GMSHInterface.cpp b/FileIO/GMSHInterface.cpp
index b113896c1c9e5bbcf912c1255ced235ff4653787..05b3780424654f35ed073c071e192227db67d122 100644
--- a/FileIO/GMSHInterface.cpp
+++ b/FileIO/GMSHInterface.cpp
@@ -53,206 +53,206 @@ GMSHInterface::GMSHInterface(GeoLib::GEOObjects & geo_objs,
                              double param2,
                              std::size_t param3,
                              std::vector<std::string>& selected_geometries) :
-	_n_lines(0), _n_plane_sfc(0), _geo_objs(geo_objs), _selected_geometries(selected_geometries)
+    _n_lines(0), _n_plane_sfc(0), _geo_objs(geo_objs), _selected_geometries(selected_geometries)
 {
-	switch (mesh_density_algorithm) {
-	case GMSH::MeshDensityAlgorithm::FixedMeshDensity:
-		_mesh_density_strategy = new GMSH::GMSHFixedMeshDensity(param1);
-		break;
-	case GMSH::MeshDensityAlgorithm::AdaptiveMeshDensity:
-		_mesh_density_strategy = new GMSH::GMSHAdaptiveMeshDensity(param1, param2, param3);
-		break;
-	}
+    switch (mesh_density_algorithm) {
+    case GMSH::MeshDensityAlgorithm::FixedMeshDensity:
+        _mesh_density_strategy = new GMSH::GMSHFixedMeshDensity(param1);
+        break;
+    case GMSH::MeshDensityAlgorithm::AdaptiveMeshDensity:
+        _mesh_density_strategy = new GMSH::GMSHAdaptiveMeshDensity(param1, param2, param3);
+        break;
+    }
 }
 
 GMSHInterface::~GMSHInterface()
 {
-	for (auto * gmsh_pnt : _gmsh_pnts)
-		delete gmsh_pnt;
-	delete _mesh_density_strategy;
-	for (auto * polygon_tree : _polygon_tree_list)
-		delete polygon_tree;
+    for (auto * gmsh_pnt : _gmsh_pnts)
+        delete gmsh_pnt;
+    delete _mesh_density_strategy;
+    for (auto * polygon_tree : _polygon_tree_list)
+        delete polygon_tree;
 }
 
 int GMSHInterface::writeGeoFile(GeoLib::GEOObjects &geo_objects, std::string const& file_name)
 {
-	std::vector<std::string> names;
-	geo_objects.getGeometryNames(names);
-
-	if (names.empty())
-	{
-		ERR ("No geometry information available.");
-		return 1;
-	}
-
-	bool const multiple_geometries = (names.size() > 1);
-	std::string merge_name("MergedGeometry");
-	if (multiple_geometries)
-	{
-		if (geo_objects.mergeGeometries (names, merge_name) != 1)
-			return 2;
-		names.clear();
-		names.push_back(merge_name);
-	}
-	else
-		merge_name = names[0];
-
-	// default parameters for GMSH interface
-	double param1(0.5);    // mesh density scaling on normal points
-	double param2(0.05);   // mesh density scaling on station points
-	std::size_t param3(2); // points per leaf
-	GMSHInterface gmsh_io(geo_objects, true, FileIO::GMSH::MeshDensityAlgorithm::AdaptiveMeshDensity, param1, param2, param3, names);
-	int const writer_return_val = gmsh_io.writeToFile(file_name);
-
-	if (multiple_geometries)
-	{
-		geo_objects.removeSurfaceVec(merge_name);
-		geo_objects.removePolylineVec(merge_name);
-		geo_objects.removePointVec(merge_name);
-	}
-	return (writer_return_val==1) ? 0 : 3;
+    std::vector<std::string> names;
+    geo_objects.getGeometryNames(names);
+
+    if (names.empty())
+    {
+        ERR ("No geometry information available.");
+        return 1;
+    }
+
+    bool const multiple_geometries = (names.size() > 1);
+    std::string merge_name("MergedGeometry");
+    if (multiple_geometries)
+    {
+        if (geo_objects.mergeGeometries (names, merge_name) != 1)
+            return 2;
+        names.clear();
+        names.push_back(merge_name);
+    }
+    else
+        merge_name = names[0];
+
+    // default parameters for GMSH interface
+    double param1(0.5);    // mesh density scaling on normal points
+    double param2(0.05);   // mesh density scaling on station points
+    std::size_t param3(2); // points per leaf
+    GMSHInterface gmsh_io(geo_objects, true, FileIO::GMSH::MeshDensityAlgorithm::AdaptiveMeshDensity, param1, param2, param3, names);
+    int const writer_return_val = gmsh_io.writeToFile(file_name);
+
+    if (multiple_geometries)
+    {
+        geo_objects.removeSurfaceVec(merge_name);
+        geo_objects.removePolylineVec(merge_name);
+        geo_objects.removePointVec(merge_name);
+    }
+    return (writer_return_val==1) ? 0 : 3;
 }
 
 bool GMSHInterface::isGMSHMeshFile(const std::string& fname)
 {
-	std::ifstream input(fname.c_str());
-
-	if (!input) {
-		ERR("GMSHInterface::isGMSHMeshFile(): Could not open file %s.", fname.c_str());
-		return false;
-	}
-
-	std::string header_first_line;
-	input >> header_first_line;
-	if (header_first_line.find("$MeshFormat") != std::string::npos) {
-		// read version
-		std::string version;
-		getline(input, version);
-		getline(input, version);
-		INFO("GMSHInterface::isGMSHMeshFile(): Found GMSH mesh file version: %s.",
-		     version.c_str());
-		input.close();
-		return true;
-	}
-
-	return false;
+    std::ifstream input(fname.c_str());
+
+    if (!input) {
+        ERR("GMSHInterface::isGMSHMeshFile(): Could not open file %s.", fname.c_str());
+        return false;
+    }
+
+    std::string header_first_line;
+    input >> header_first_line;
+    if (header_first_line.find("$MeshFormat") != std::string::npos) {
+        // read version
+        std::string version;
+        getline(input, version);
+        getline(input, version);
+        INFO("GMSHInterface::isGMSHMeshFile(): Found GMSH mesh file version: %s.",
+             version.c_str());
+        input.close();
+        return true;
+    }
+
+    return false;
 }
 
 MeshLib::Mesh* GMSHInterface::readGMSHMesh(std::string const& fname)
 {
-	std::string line;
-	std::ifstream in(fname.c_str(), std::ios::in);
-	if (!in.is_open())
-	{
-		WARN ("GMSHInterface::readGMSHMesh() - Could not open file %s.", fname.c_str());
-		return nullptr;
-	}
-
-	getline(in, line); // $MeshFormat keyword
-	if (line.find("$MeshFormat") == std::string::npos)
-	{
-		in.close();
-		WARN ("No GMSH file format recognized.");
-		return nullptr;
-	}
-
-	getline(in, line); // version-number file-type data-size
-	if (line.substr(0,3).compare("2.2") != 0) {
-		WARN("Wrong gmsh file format version.");
-		return nullptr;
-	}
-
-	if (line.substr(4,1).compare("0") != 0) {
-		WARN("Currently reading gmsh binary file type is not supported.");
-		return nullptr;
-	}
-	getline(in, line); //$EndMeshFormat
-
-	std::vector<MeshLib::Node*> nodes;
-	std::vector<MeshLib::Element*> elements;
-	std::vector<int> materials;
-	std::map<unsigned, unsigned> id_map;
-	while (line.find("$EndElements") == std::string::npos)
-	{
-		// Node data
-		getline(in, line); //$Nodes Keywords
-		if (line.find("$Nodes") != std::string::npos)
-		{
-			std::size_t n_nodes(0);
-			long id;
-			double x, y, z;
-			in >> n_nodes >> std::ws;
-			nodes.resize(n_nodes);
-			for (std::size_t i = 0; i < n_nodes; i++) {
-				in >> id >> x >> y >> z >> std::ws;
-				id_map.insert(std::map<unsigned, unsigned>::value_type(id, i));
-				nodes[i] = new MeshLib::Node(x,y,z,id);
-			}
-			getline(in, line); // End Node keyword $EndNodes
-		}
-
-		// Element data
-		if (line.find("$Elements") != std::string::npos)
-		{
-			std::size_t n_elements(0);
-			if (! (in >> n_elements >> std::ws)) { // number-of-elements
-				ERR("Read GMSH mesh does not contain any elements");
-			}
-			elements.reserve(n_elements);
-			materials.reserve(n_elements);
-			for (std::size_t i = 0; i < n_elements; i++)
-			{
-				MeshLib::Element* elem(nullptr);
-				int mat_id(0);
-				std::tie(elem, mat_id) = readElement(in, nodes, id_map);
-
-				if (elem) {
-					elements.push_back(elem);
-					materials.push_back(mat_id);
-				}
-			}
-			getline(in, line); // END keyword
-		}
-
-		if (line.find("PhysicalNames") != std::string::npos)
-		{
-			std::size_t n_lines(0);
-			in >> n_lines >> std::ws; // number-of-lines
-			for (std::size_t i = 0; i < n_lines; i++)
-				getline(in, line);
-			getline(in, line); // END keyword
-		}
-	}
-	in.close();
-	if (elements.empty()) {
-		for (auto it(nodes.begin()); it != nodes.end(); ++it) {
-			delete *it;
-		}
-		return nullptr;
-	}
-
-	MeshLib::Mesh * mesh(new MeshLib::Mesh(
-		BaseLib::extractBaseNameWithoutExtension(fname), 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());
-	}
-
-	MeshLib::ElementValueModification::condense(*mesh);
-
-	INFO("\t... finished.");
-	INFO("Nr. Nodes: %d.", nodes.size());
-	INFO("Nr. Elements: %d.", elements.size());
-
-	return mesh;
+    std::string line;
+    std::ifstream in(fname.c_str(), std::ios::in);
+    if (!in.is_open())
+    {
+        WARN ("GMSHInterface::readGMSHMesh() - Could not open file %s.", fname.c_str());
+        return nullptr;
+    }
+
+    getline(in, line); // $MeshFormat keyword
+    if (line.find("$MeshFormat") == std::string::npos)
+    {
+        in.close();
+        WARN ("No GMSH file format recognized.");
+        return nullptr;
+    }
+
+    getline(in, line); // version-number file-type data-size
+    if (line.substr(0,3).compare("2.2") != 0) {
+        WARN("Wrong gmsh file format version.");
+        return nullptr;
+    }
+
+    if (line.substr(4,1).compare("0") != 0) {
+        WARN("Currently reading gmsh binary file type is not supported.");
+        return nullptr;
+    }
+    getline(in, line); //$EndMeshFormat
+
+    std::vector<MeshLib::Node*> nodes;
+    std::vector<MeshLib::Element*> elements;
+    std::vector<int> materials;
+    std::map<unsigned, unsigned> id_map;
+    while (line.find("$EndElements") == std::string::npos)
+    {
+        // Node data
+        getline(in, line); //$Nodes Keywords
+        if (line.find("$Nodes") != std::string::npos)
+        {
+            std::size_t n_nodes(0);
+            long id;
+            double x, y, z;
+            in >> n_nodes >> std::ws;
+            nodes.resize(n_nodes);
+            for (std::size_t i = 0; i < n_nodes; i++) {
+                in >> id >> x >> y >> z >> std::ws;
+                id_map.insert(std::map<unsigned, unsigned>::value_type(id, i));
+                nodes[i] = new MeshLib::Node(x,y,z,id);
+            }
+            getline(in, line); // End Node keyword $EndNodes
+        }
+
+        // Element data
+        if (line.find("$Elements") != std::string::npos)
+        {
+            std::size_t n_elements(0);
+            if (! (in >> n_elements >> std::ws)) { // number-of-elements
+                ERR("Read GMSH mesh does not contain any elements");
+            }
+            elements.reserve(n_elements);
+            materials.reserve(n_elements);
+            for (std::size_t i = 0; i < n_elements; i++)
+            {
+                MeshLib::Element* elem(nullptr);
+                int mat_id(0);
+                std::tie(elem, mat_id) = readElement(in, nodes, id_map);
+
+                if (elem) {
+                    elements.push_back(elem);
+                    materials.push_back(mat_id);
+                }
+            }
+            getline(in, line); // END keyword
+        }
+
+        if (line.find("PhysicalNames") != std::string::npos)
+        {
+            std::size_t n_lines(0);
+            in >> n_lines >> std::ws; // number-of-lines
+            for (std::size_t i = 0; i < n_lines; i++)
+                getline(in, line);
+            getline(in, line); // END keyword
+        }
+    }
+    in.close();
+    if (elements.empty()) {
+        for (auto it(nodes.begin()); it != nodes.end(); ++it) {
+            delete *it;
+        }
+        return nullptr;
+    }
+
+    MeshLib::Mesh * mesh(new MeshLib::Mesh(
+        BaseLib::extractBaseNameWithoutExtension(fname), 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());
+    }
+
+    MeshLib::ElementValueModification::condense(*mesh);
+
+    INFO("\t... finished.");
+    INFO("Nr. Nodes: %d.", nodes.size());
+    INFO("Nr. Elements: %d.", elements.size());
+
+    return mesh;
 }
 
 void GMSHInterface::readNodeIDs(std::ifstream &in,
@@ -260,239 +260,239 @@ void GMSHInterface::readNodeIDs(std::ifstream &in,
                                 std::vector<unsigned> &node_ids,
                                 std::map<unsigned, unsigned> const& id_map)
 {
-	unsigned idx;
-	for (unsigned i = 0; i < n_nodes; i++)
-	{
-		in >> idx;
-		node_ids.push_back(id_map.at(idx));
-	}
+    unsigned idx;
+    for (unsigned i = 0; i < n_nodes; i++)
+    {
+        in >> idx;
+        node_ids.push_back(id_map.at(idx));
+    }
 }
 
 std::pair<MeshLib::Element*, int>
 GMSHInterface::readElement(std::ifstream &in,
-	std::vector<MeshLib::Node*> const& nodes,
-	std::map<unsigned, unsigned> const& id_map)
+    std::vector<MeshLib::Node*> const& nodes,
+    std::map<unsigned, unsigned> const& id_map)
 {
-	unsigned idx, type, n_tags, dummy;
-	int mat_id;
-	std::vector<unsigned> node_ids;
-	std::vector<MeshLib::Node*> elem_nodes;
-	in >> idx >> type >> n_tags >> mat_id >> dummy;
-
-	// skip tags
-	for (std::size_t j = 2; j < n_tags; j++)
-		in >> dummy;
-
-	switch (type)
-	{
-	case 1: {
-		readNodeIDs(in, 2, node_ids, id_map);
-		// edge_nodes array will be deleted from Line object
-		MeshLib::Node** edge_nodes = new MeshLib::Node*[2];
-		edge_nodes[0] = nodes[node_ids[0]];
-		edge_nodes[1] = nodes[node_ids[1]];
-		return std::make_pair(new MeshLib::Line(edge_nodes), mat_id);
-	}
-	case 2: {
-		readNodeIDs(in, 3, node_ids, id_map);
-		MeshLib::Node** tri_nodes = new MeshLib::Node*[3];
-		tri_nodes[0] = nodes[node_ids[2]];
-		tri_nodes[1] = nodes[node_ids[1]];
-		tri_nodes[2] = nodes[node_ids[0]];
-		return std::make_pair(new MeshLib::Tri(tri_nodes), mat_id);
-	}
-	case 3: {
-		readNodeIDs(in, 4, node_ids, id_map);
-		MeshLib::Node** quad_nodes = new MeshLib::Node*[4];
-		for (unsigned k(0); k < 4; k++)
-			quad_nodes[k] = nodes[node_ids[k]];
-		return std::make_pair(new MeshLib::Quad(quad_nodes), mat_id);
-	}
-	case 4: {
-		readNodeIDs(in, 4, node_ids, id_map);
-		MeshLib::Node** tet_nodes = new MeshLib::Node*[5];
-		for (unsigned k(0); k < 4; k++)
-			tet_nodes[k] = nodes[node_ids[k]];
-		return std::make_pair(new MeshLib::Tet(tet_nodes), mat_id);
-	}
-	case 5: {
-		readNodeIDs(in, 8, node_ids, id_map);
-		MeshLib::Node** hex_nodes = new MeshLib::Node*[8];
-		for (unsigned k(0); k < 8; k++)
-			hex_nodes[k] = nodes[node_ids[k]];
-		return std::make_pair(new MeshLib::Hex(hex_nodes), mat_id);
-	}
-	case 6: {
-		readNodeIDs(in, 6, node_ids, id_map);
-		MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
-		for (unsigned k(0); k < 6; k++)
-			prism_nodes[k] = nodes[node_ids[k]];
-		return std::make_pair(new MeshLib::Prism(prism_nodes), mat_id);
-	}
-	case 7: {
-		readNodeIDs(in, 5, node_ids, id_map);
-		MeshLib::Node** pyramid_nodes = new MeshLib::Node*[5];
-		for (unsigned k(0); k < 5; k++)
-			pyramid_nodes[k] = nodes[node_ids[k]];
-		return std::make_pair(new MeshLib::Pyramid(pyramid_nodes), mat_id);
-	}
-	case 15:
-		in >> dummy; // skip rest of line
-		break;
-	default:
-		WARN("GMSHInterface::readGMSHMesh(): Unknown element type %d.", type);
-		break;
-	}
-	return std::make_pair(nullptr, -1);
+    unsigned idx, type, n_tags, dummy;
+    int mat_id;
+    std::vector<unsigned> node_ids;
+    std::vector<MeshLib::Node*> elem_nodes;
+    in >> idx >> type >> n_tags >> mat_id >> dummy;
+
+    // skip tags
+    for (std::size_t j = 2; j < n_tags; j++)
+        in >> dummy;
+
+    switch (type)
+    {
+    case 1: {
+        readNodeIDs(in, 2, node_ids, id_map);
+        // edge_nodes array will be deleted from Line object
+        MeshLib::Node** edge_nodes = new MeshLib::Node*[2];
+        edge_nodes[0] = nodes[node_ids[0]];
+        edge_nodes[1] = nodes[node_ids[1]];
+        return std::make_pair(new MeshLib::Line(edge_nodes), mat_id);
+    }
+    case 2: {
+        readNodeIDs(in, 3, node_ids, id_map);
+        MeshLib::Node** tri_nodes = new MeshLib::Node*[3];
+        tri_nodes[0] = nodes[node_ids[2]];
+        tri_nodes[1] = nodes[node_ids[1]];
+        tri_nodes[2] = nodes[node_ids[0]];
+        return std::make_pair(new MeshLib::Tri(tri_nodes), mat_id);
+    }
+    case 3: {
+        readNodeIDs(in, 4, node_ids, id_map);
+        MeshLib::Node** quad_nodes = new MeshLib::Node*[4];
+        for (unsigned k(0); k < 4; k++)
+            quad_nodes[k] = nodes[node_ids[k]];
+        return std::make_pair(new MeshLib::Quad(quad_nodes), mat_id);
+    }
+    case 4: {
+        readNodeIDs(in, 4, node_ids, id_map);
+        MeshLib::Node** tet_nodes = new MeshLib::Node*[5];
+        for (unsigned k(0); k < 4; k++)
+            tet_nodes[k] = nodes[node_ids[k]];
+        return std::make_pair(new MeshLib::Tet(tet_nodes), mat_id);
+    }
+    case 5: {
+        readNodeIDs(in, 8, node_ids, id_map);
+        MeshLib::Node** hex_nodes = new MeshLib::Node*[8];
+        for (unsigned k(0); k < 8; k++)
+            hex_nodes[k] = nodes[node_ids[k]];
+        return std::make_pair(new MeshLib::Hex(hex_nodes), mat_id);
+    }
+    case 6: {
+        readNodeIDs(in, 6, node_ids, id_map);
+        MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
+        for (unsigned k(0); k < 6; k++)
+            prism_nodes[k] = nodes[node_ids[k]];
+        return std::make_pair(new MeshLib::Prism(prism_nodes), mat_id);
+    }
+    case 7: {
+        readNodeIDs(in, 5, node_ids, id_map);
+        MeshLib::Node** pyramid_nodes = new MeshLib::Node*[5];
+        for (unsigned k(0); k < 5; k++)
+            pyramid_nodes[k] = nodes[node_ids[k]];
+        return std::make_pair(new MeshLib::Pyramid(pyramid_nodes), mat_id);
+    }
+    case 15:
+        in >> dummy; // skip rest of line
+        break;
+    default:
+        WARN("GMSHInterface::readGMSHMesh(): Unknown element type %d.", type);
+        break;
+    }
+    return std::make_pair(nullptr, -1);
 }
 
 
 bool GMSHInterface::write()
 {
-	_out << "// GMSH input file created by OpenGeoSys " << BaseLib::BuildInfo::git_describe;
+    _out << "// GMSH input file created by OpenGeoSys " << BaseLib::BuildInfo::git_describe;
 #ifdef BUILD_TIMESTAMP
-	_out << " built on " << BaseLib::BuildInfo::build_timestamp;
+    _out << " built on " << BaseLib::BuildInfo::build_timestamp;
 #endif
-	_out << "\n\n";
+    _out << "\n\n";
 
-	writeGMSHInputFile(_out);
-	return true;
+    writeGMSHInputFile(_out);
+    return true;
 }
 
 void GMSHInterface::writeGMSHInputFile(std::ostream& out)
 {
-	DBUG("GMSHInterface::writeGMSHInputFile(): get data from GEOObjects.");
-
-	if (_selected_geometries.empty())
-		return;
-
-	bool remove_geometry(false);
-	// *** get and merge data from _geo_objs
-	if (_selected_geometries.size() > 1) {
-		_gmsh_geo_name = "GMSHGeometry";
-		remove_geometry = true;
-		_geo_objs.mergeGeometries(_selected_geometries, _gmsh_geo_name);
-	} else {
-		_gmsh_geo_name = _selected_geometries[0];
-		remove_geometry = false;
-	}
-	std::vector<GeoLib::Point*> * merged_pnts(const_cast<std::vector<GeoLib::Point*> *>(_geo_objs.getPointVec(_gmsh_geo_name)));
-	if (! merged_pnts) {
-		ERR("GMSHInterface::writeGMSHInputFile(): Did not found any points.");
-		return;
-	}
-
-	// Rotate points to the x-y-plane.
-	_inverse_rot_mat = GeoLib::rotatePointsToXY(*merged_pnts);
-	// Compute inverse rotation matrix to reverse the rotation later on.
-	_inverse_rot_mat.transposeInPlace();
-
-	std::vector<GeoLib::Polyline*> const* merged_plys(_geo_objs.getPolylineVec(_gmsh_geo_name));
-	DBUG("GMSHInterface::writeGMSHInputFile(): \t ok.");
-
-	// *** compute topological hierarchy of polygons
-	if (merged_plys) {
-		for (std::vector<GeoLib::Polyline*>::const_iterator it(merged_plys->begin());
-			it!=merged_plys->end(); ++it) {
-			if ((*it)->isClosed()) {
-				_polygon_tree_list.push_back(new GMSH::GMSHPolygonTree(new GeoLib::Polygon(*(*it), true), NULL, _geo_objs, _gmsh_geo_name, _mesh_density_strategy));
-			}
-		}
-		DBUG("GMSHInterface::writeGMSHInputFile(): Compute topological hierarchy - detected %d polygons.", _polygon_tree_list.size());
-		GeoLib::createPolygonTrees<GMSH::GMSHPolygonTree>(_polygon_tree_list);
-		DBUG("GMSHInterface::writeGMSHInputFile(): Compute topological hierarchy - calculated %d polygon trees.", _polygon_tree_list.size());
-	} else {
-		return;
-	}
-
-	// *** insert stations and polylines (except polygons) in the appropriate object of
-	//     class GMSHPolygonTree
-	// *** insert stations
-	auto gmsh_stations = std::unique_ptr<std::vector<GeoLib::Point*>>(
-	    new std::vector<GeoLib::Point*>);
-	for (auto const& geometry_name : _selected_geometries) {
-		auto const* stations(_geo_objs.getStationVec(geometry_name));
-		if (stations) {
-			for (auto * station : *stations) {
-				bool found(false);
-				for (auto it(_polygon_tree_list.begin());
-					it != _polygon_tree_list.end() && !found; ++it) {
-					gmsh_stations->emplace_back(new GeoLib::Station(
-					    *static_cast<GeoLib::Station*>(station)));
-					if ((*it)->insertStation(gmsh_stations->back())) {
-						found = true;
-					}
-				}
-			}
-		}
-	}
-
-	std::string gmsh_stations_name(_gmsh_geo_name+"-Stations");
-	if (! gmsh_stations->empty()) {
-		_geo_objs.addStationVec(std::move(gmsh_stations), gmsh_stations_name);
-	}
-
-	// *** insert polylines
-	const std::size_t n_plys(merged_plys->size());
-	for (std::size_t k(0); k<n_plys; k++) {
-		if (! (*merged_plys)[k]->isClosed()) {
-			for (std::list<GMSH::GMSHPolygonTree*>::iterator it(_polygon_tree_list.begin());
-				it != _polygon_tree_list.end(); ++it) {
-				(*it)->insertPolyline(new GeoLib::PolylineWithSegmentMarker(*(*merged_plys)[k]));
-			}
-		}
-	}
-
-	// *** init mesh density strategies
-	for (std::list<GMSH::GMSHPolygonTree*>::iterator it(_polygon_tree_list.begin());
-		it != _polygon_tree_list.end(); ++it) {
-		(*it)->initMeshDensityStrategy();
-	}
-
-	// *** create GMSH data structures
-	const std::size_t n_merged_pnts(merged_pnts->size());
-	_gmsh_pnts.resize(n_merged_pnts);
-	for (std::size_t k(0); k<n_merged_pnts; k++) {
-		_gmsh_pnts[k] = NULL;
-	}
-	for (std::list<GMSH::GMSHPolygonTree*>::iterator it(_polygon_tree_list.begin());
-		it != _polygon_tree_list.end(); ++it) {
-		(*it)->createGMSHPoints(_gmsh_pnts);
-	}
-
-	// *** finally write data :-)
-	writePoints(out);
-	std::size_t pnt_id_offset(_gmsh_pnts.size());
-	for (std::list<GMSH::GMSHPolygonTree*>::iterator it(_polygon_tree_list.begin());
-		it != _polygon_tree_list.end(); ++it) {
-		(*it)->writeLineLoop(_n_lines, _n_plane_sfc, out);
-		(*it)->writeSubPolygonsAsLineConstraints(_n_lines, _n_plane_sfc-1, out);
-		(*it)->writeLineConstraints(_n_lines, _n_plane_sfc-1, out);
-		(*it)->writeStations(pnt_id_offset, _n_plane_sfc-1, out);
-		(*it)->writeAdditionalPointData(pnt_id_offset, _n_plane_sfc-1, out);
-	}
-
-	if (remove_geometry) {
-		_geo_objs.removeSurfaceVec(_gmsh_geo_name);
-		_geo_objs.removePolylineVec(_gmsh_geo_name);
-		_geo_objs.removePointVec(_gmsh_geo_name);
-		_geo_objs.removeStationVec(gmsh_stations_name);
-	}
+    DBUG("GMSHInterface::writeGMSHInputFile(): get data from GEOObjects.");
+
+    if (_selected_geometries.empty())
+        return;
+
+    bool remove_geometry(false);
+    // *** get and merge data from _geo_objs
+    if (_selected_geometries.size() > 1) {
+        _gmsh_geo_name = "GMSHGeometry";
+        remove_geometry = true;
+        _geo_objs.mergeGeometries(_selected_geometries, _gmsh_geo_name);
+    } else {
+        _gmsh_geo_name = _selected_geometries[0];
+        remove_geometry = false;
+    }
+    std::vector<GeoLib::Point*> * merged_pnts(const_cast<std::vector<GeoLib::Point*> *>(_geo_objs.getPointVec(_gmsh_geo_name)));
+    if (! merged_pnts) {
+        ERR("GMSHInterface::writeGMSHInputFile(): Did not found any points.");
+        return;
+    }
+
+    // Rotate points to the x-y-plane.
+    _inverse_rot_mat = GeoLib::rotatePointsToXY(*merged_pnts);
+    // Compute inverse rotation matrix to reverse the rotation later on.
+    _inverse_rot_mat.transposeInPlace();
+
+    std::vector<GeoLib::Polyline*> const* merged_plys(_geo_objs.getPolylineVec(_gmsh_geo_name));
+    DBUG("GMSHInterface::writeGMSHInputFile(): \t ok.");
+
+    // *** compute topological hierarchy of polygons
+    if (merged_plys) {
+        for (std::vector<GeoLib::Polyline*>::const_iterator it(merged_plys->begin());
+            it!=merged_plys->end(); ++it) {
+            if ((*it)->isClosed()) {
+                _polygon_tree_list.push_back(new GMSH::GMSHPolygonTree(new GeoLib::Polygon(*(*it), true), NULL, _geo_objs, _gmsh_geo_name, _mesh_density_strategy));
+            }
+        }
+        DBUG("GMSHInterface::writeGMSHInputFile(): Compute topological hierarchy - detected %d polygons.", _polygon_tree_list.size());
+        GeoLib::createPolygonTrees<GMSH::GMSHPolygonTree>(_polygon_tree_list);
+        DBUG("GMSHInterface::writeGMSHInputFile(): Compute topological hierarchy - calculated %d polygon trees.", _polygon_tree_list.size());
+    } else {
+        return;
+    }
+
+    // *** insert stations and polylines (except polygons) in the appropriate object of
+    //     class GMSHPolygonTree
+    // *** insert stations
+    auto gmsh_stations = std::unique_ptr<std::vector<GeoLib::Point*>>(
+        new std::vector<GeoLib::Point*>);
+    for (auto const& geometry_name : _selected_geometries) {
+        auto const* stations(_geo_objs.getStationVec(geometry_name));
+        if (stations) {
+            for (auto * station : *stations) {
+                bool found(false);
+                for (auto it(_polygon_tree_list.begin());
+                    it != _polygon_tree_list.end() && !found; ++it) {
+                    gmsh_stations->emplace_back(new GeoLib::Station(
+                        *static_cast<GeoLib::Station*>(station)));
+                    if ((*it)->insertStation(gmsh_stations->back())) {
+                        found = true;
+                    }
+                }
+            }
+        }
+    }
+
+    std::string gmsh_stations_name(_gmsh_geo_name+"-Stations");
+    if (! gmsh_stations->empty()) {
+        _geo_objs.addStationVec(std::move(gmsh_stations), gmsh_stations_name);
+    }
+
+    // *** insert polylines
+    const std::size_t n_plys(merged_plys->size());
+    for (std::size_t k(0); k<n_plys; k++) {
+        if (! (*merged_plys)[k]->isClosed()) {
+            for (std::list<GMSH::GMSHPolygonTree*>::iterator it(_polygon_tree_list.begin());
+                it != _polygon_tree_list.end(); ++it) {
+                (*it)->insertPolyline(new GeoLib::PolylineWithSegmentMarker(*(*merged_plys)[k]));
+            }
+        }
+    }
+
+    // *** init mesh density strategies
+    for (std::list<GMSH::GMSHPolygonTree*>::iterator it(_polygon_tree_list.begin());
+        it != _polygon_tree_list.end(); ++it) {
+        (*it)->initMeshDensityStrategy();
+    }
+
+    // *** create GMSH data structures
+    const std::size_t n_merged_pnts(merged_pnts->size());
+    _gmsh_pnts.resize(n_merged_pnts);
+    for (std::size_t k(0); k<n_merged_pnts; k++) {
+        _gmsh_pnts[k] = NULL;
+    }
+    for (std::list<GMSH::GMSHPolygonTree*>::iterator it(_polygon_tree_list.begin());
+        it != _polygon_tree_list.end(); ++it) {
+        (*it)->createGMSHPoints(_gmsh_pnts);
+    }
+
+    // *** finally write data :-)
+    writePoints(out);
+    std::size_t pnt_id_offset(_gmsh_pnts.size());
+    for (std::list<GMSH::GMSHPolygonTree*>::iterator it(_polygon_tree_list.begin());
+        it != _polygon_tree_list.end(); ++it) {
+        (*it)->writeLineLoop(_n_lines, _n_plane_sfc, out);
+        (*it)->writeSubPolygonsAsLineConstraints(_n_lines, _n_plane_sfc-1, out);
+        (*it)->writeLineConstraints(_n_lines, _n_plane_sfc-1, out);
+        (*it)->writeStations(pnt_id_offset, _n_plane_sfc-1, out);
+        (*it)->writeAdditionalPointData(pnt_id_offset, _n_plane_sfc-1, out);
+    }
+
+    if (remove_geometry) {
+        _geo_objs.removeSurfaceVec(_gmsh_geo_name);
+        _geo_objs.removePolylineVec(_gmsh_geo_name);
+        _geo_objs.removePointVec(_gmsh_geo_name);
+        _geo_objs.removeStationVec(gmsh_stations_name);
+    }
 }
 
 void GMSHInterface::writePoints(std::ostream& out) const
 {
-	for (auto & gmsh_pnt : _gmsh_pnts) {
-		// reverse rotation
-		if (gmsh_pnt) {
-			double* tmp = _inverse_rot_mat * gmsh_pnt->getCoords();
-			(*gmsh_pnt)[0] = tmp[0];
-			(*gmsh_pnt)[1] = tmp[1];
-			(*gmsh_pnt)[2] = tmp[2];
-			delete [] tmp;
-			out << *gmsh_pnt << "\n";
-		}
-	}
+    for (auto & gmsh_pnt : _gmsh_pnts) {
+        // reverse rotation
+        if (gmsh_pnt) {
+            double* tmp = _inverse_rot_mat * gmsh_pnt->getCoords();
+            (*gmsh_pnt)[0] = tmp[0];
+            (*gmsh_pnt)[1] = tmp[1];
+            (*gmsh_pnt)[2] = tmp[2];
+            delete [] tmp;
+            out << *gmsh_pnt << "\n";
+        }
+    }
 }
 
 } // end namespace FileIO
diff --git a/FileIO/GMSHInterface.h b/FileIO/GMSHInterface.h
index 5971665cf1cfee1c3f94e5aa5f8520eb54a7f9bd..f6132ff89a0abec6d700363d3f3663bc61970469 100644
--- a/FileIO/GMSHInterface.h
+++ b/FileIO/GMSHInterface.h
@@ -28,15 +28,15 @@
 
 namespace GeoLib
 {
-	class GEOObjects;
-	class Polygon;
+    class GEOObjects;
+    class Polygon;
 }
 
 namespace MeshLib
 {
-	class Mesh;
-	class Element;
-	class Node;
+    class Mesh;
+    class Element;
+    class Node;
 }
 
 namespace FileIO
@@ -45,8 +45,8 @@ namespace FileIO
 namespace GMSH {
 
 enum class MeshDensityAlgorithm {
-	FixedMeshDensity, //!< set the parameter with a fixed value
-	AdaptiveMeshDensity //!< computing the mesh density employing a QuadTree
+    FixedMeshDensity, //!< set the parameter with a fixed value
+    AdaptiveMeshDensity //!< computing the mesh density employing a QuadTree
 };
 
 }
@@ -58,81 +58,81 @@ class GMSHInterface : public BaseLib::IO::Writer
 {
 public:
 
-	/**
-	 *
-	 * @param geo_objs reference tp instance of class GEOObject that maintains the geometries.
-	 * 	The instance is used for preparation geometries for writing them to the gmsh file format.
-	 * @param include_stations_as_constraints switch to enable writing stations as constraints
-	 * @param mesh_density_algorithm one of the mesh density algorithms (\@see enum MeshDensityAlgorithm)
-	 * @param param1 parameter that can be used for the mesh density algorithm
-	 * @param param2 parameter that can be used for the mesh density algorithm
-	 * @param param3 parameter that can be used for the mesh density algorithm
-	 * @param selected_geometries vector of names of geometries, that should be employed for mesh generation.
-	 * @return
-	 */
-	GMSHInterface (GeoLib::GEOObjects & geo_objs,
-					bool include_stations_as_constraints,
-					GMSH::MeshDensityAlgorithm mesh_density_algorithm,
-					double param1, double param2, std::size_t param3,
-					std::vector<std::string> & selected_geometries);
-
-	~GMSHInterface();
-
-	/**
-	 * checks if there is a GMSH mesh file header
-	 * @param fname the file name of the mesh (including the path)
-	 * @return true, if the file seems to be a valid GMSH file, else false
-	 */
-	static bool isGMSHMeshFile (const std::string& fname);
-	/**
-	 * reads a mesh created by GMSH - this implementation is based on the former function GMSH2MSH
-	 * @param fname the file name of the mesh (including the path)
-	 * @return
-	 */
-	static MeshLib::Mesh* readGMSHMesh (std::string const& fname);
-
-	/**
-	 * Export script for writing geo files.
-	 * To do this, all geometries currently loaded are merged, the merged result is written to a
-	 * file and then the merged geometry is removed again.
-	 * @return error code, i.e. 0 = okay, 1 = geo_objects is empty, 2 = error while merging, 3 = error writing file
-	 */
-	static int writeGeoFile(GeoLib::GEOObjects &geo_objects, std::string const& file_name);
+    /**
+     *
+     * @param geo_objs reference tp instance of class GEOObject that maintains the geometries.
+     *     The instance is used for preparation geometries for writing them to the gmsh file format.
+     * @param include_stations_as_constraints switch to enable writing stations as constraints
+     * @param mesh_density_algorithm one of the mesh density algorithms (\@see enum MeshDensityAlgorithm)
+     * @param param1 parameter that can be used for the mesh density algorithm
+     * @param param2 parameter that can be used for the mesh density algorithm
+     * @param param3 parameter that can be used for the mesh density algorithm
+     * @param selected_geometries vector of names of geometries, that should be employed for mesh generation.
+     * @return
+     */
+    GMSHInterface (GeoLib::GEOObjects & geo_objs,
+                    bool include_stations_as_constraints,
+                    GMSH::MeshDensityAlgorithm mesh_density_algorithm,
+                    double param1, double param2, std::size_t param3,
+                    std::vector<std::string> & selected_geometries);
+
+    ~GMSHInterface();
+
+    /**
+     * checks if there is a GMSH mesh file header
+     * @param fname the file name of the mesh (including the path)
+     * @return true, if the file seems to be a valid GMSH file, else false
+     */
+    static bool isGMSHMeshFile (const std::string& fname);
+    /**
+     * reads a mesh created by GMSH - this implementation is based on the former function GMSH2MSH
+     * @param fname the file name of the mesh (including the path)
+     * @return
+     */
+    static MeshLib::Mesh* readGMSHMesh (std::string const& fname);
+
+    /**
+     * Export script for writing geo files.
+     * To do this, all geometries currently loaded are merged, the merged result is written to a
+     * file and then the merged geometry is removed again.
+     * @return error code, i.e. 0 = okay, 1 = geo_objects is empty, 2 = error while merging, 3 = error writing file
+     */
+    static int writeGeoFile(GeoLib::GEOObjects &geo_objects, std::string const& file_name);
 
 protected:
-	bool write();
+    bool write();
 
 private:
-	/// Reads a mesh element from the input stream
-	static std::pair<MeshLib::Element*, int> readElement(std::ifstream &in,
-		std::vector<MeshLib::Node*> const& nodes,
-		std::map<unsigned, unsigned> const& id_map);
+    /// Reads a mesh element from the input stream
+    static std::pair<MeshLib::Element*, int> readElement(std::ifstream &in,
+        std::vector<MeshLib::Node*> const& nodes,
+        std::map<unsigned, unsigned> const& id_map);
 
-	/**
-	 * 1. get and merge data from _geo_objs
-	 * 2. compute topological hierarchy
-	 * @param out
-	 */
-	void writeGMSHInputFile(std::ostream & out);
+    /**
+     * 1. get and merge data from _geo_objs
+     * 2. compute topological hierarchy
+     * @param out
+     */
+    void writeGMSHInputFile(std::ostream & out);
 
-	static void readNodeIDs(std::ifstream &in, unsigned n_nodes, std::vector<unsigned> &node_ids, std::map<unsigned, unsigned> const& id_map);
+    static void readNodeIDs(std::ifstream &in, unsigned n_nodes, std::vector<unsigned> &node_ids, std::map<unsigned, unsigned> const& id_map);
 
-	void writePoints(std::ostream& out) const;
+    void writePoints(std::ostream& out) const;
 
-	std::size_t _n_lines;
-	std::size_t _n_plane_sfc;
+    std::size_t _n_lines;
+    std::size_t _n_plane_sfc;
 
-	GeoLib::GEOObjects & _geo_objs;
-	std::vector<std::string>& _selected_geometries;
-	std::string _gmsh_geo_name;
-	std::list<GMSH::GMSHPolygonTree*> _polygon_tree_list;
+    GeoLib::GEOObjects & _geo_objs;
+    std::vector<std::string>& _selected_geometries;
+    std::string _gmsh_geo_name;
+    std::list<GMSH::GMSHPolygonTree*> _polygon_tree_list;
 
-	std::vector<FileIO::GMSH::GMSHPoint*> _gmsh_pnts;
+    std::vector<FileIO::GMSH::GMSHPoint*> _gmsh_pnts;
 
-	GMSH::GMSHMeshDensityStrategy *_mesh_density_strategy;
-	/// Holds the inverse rotation matrix. The matrix is used in writePoints() to
-	/// revert the rotation done in writeGMSHInputFile().
-	MathLib::DenseMatrix<double> _inverse_rot_mat = MathLib::DenseMatrix<double>(3,3);
+    GMSH::GMSHMeshDensityStrategy *_mesh_density_strategy;
+    /// Holds the inverse rotation matrix. The matrix is used in writePoints() to
+    /// revert the rotation done in writeGMSHInputFile().
+    MathLib::DenseMatrix<double> _inverse_rot_mat = MathLib::DenseMatrix<double>(3,3);
 };
 }
 
diff --git a/FileIO/GMSInterface.cpp b/FileIO/GMSInterface.cpp
index 524a6d9262d00113d4c7025f22e4d83a4231da3f..63164b69c933769305bc673eb16d63ce18d3f1fd 100644
--- a/FileIO/GMSInterface.cpp
+++ b/FileIO/GMSInterface.cpp
@@ -38,85 +38,85 @@ namespace FileIO
 int GMSInterface::readBoreholesFromGMS(std::vector<GeoLib::Point*>* boreholes,
                                        const std::string &filename)
 {
-	double depth(-9999.0);
-	std::string line(""), cName(""), sName("");
-	std::list<std::string>::const_iterator it;
-	GeoLib::Point* pnt = new GeoLib::Point();
-	GeoLib::StationBorehole* newBorehole = NULL;
-	std::ifstream in( filename.c_str() );
-
-	if (!in.is_open())
-	{
-		ERR("GMSInterface::readBoreholeFromGMS(): Could not open file %s.", filename.c_str());
-		return 0;
-	}
-
-	/* skipping first line because it contains field names */
-	getline(in, line);
-
-	/* read all stations */
-	while ( getline(in, line) )
-	{
-		std::list<std::string> fields = BaseLib::splitString(line, '\t');
-
-		if (fields.size() >= 5)
-		{
-			if (fields.begin()->compare(cName) == 0) // add new layer
-			{
-				it = fields.begin();
-				(*pnt)[0] = strtod((++it)->c_str(), 0);
-				(*pnt)[1] = strtod((++it)->c_str(), 0);
-				(*pnt)[2] = strtod((++it)->c_str(), 0);
-
-				// check if current layer has a thickness of 0.0.
-				// if so skip it since it will mess with the vtk-visualisation later on!
-				if ((*pnt)[2] != depth)
-				{
-					newBorehole->addSoilLayer((*pnt)[0],
-					                          (*pnt)[1],
-					                          (*pnt)[2],
-					                          sName);
-					sName = (*(++it));
-					depth = (*pnt)[2];
-				}
-				else
-					WARN("GMSInterface::readBoreholeFromGMS(): Skipped layer \"%s\" in borehole \"%s\" because of thickness 0.0.",
-				         sName.c_str(), cName.c_str());
-			}
-			else // add new borehole
-			{
-				if (newBorehole != NULL)
-				{
-					newBorehole->setDepth((*newBorehole)[2] - depth);
-					boreholes->push_back(newBorehole);
-				}
-				cName = *fields.begin();
-				it = fields.begin();
-				(*pnt)[0] = strtod((++it)->c_str(), 0);
-				(*pnt)[1] = strtod((++it)->c_str(), 0);
-				(*pnt)[2] = strtod((++it)->c_str(), 0);
-				sName = (*(++it));
-				newBorehole =
-				        GeoLib::StationBorehole::createStation(cName, (*pnt)[0],
-				                                               (*pnt)[1],
-				                                               (*pnt)[2], 0);
-				depth = (*pnt)[2];
-			}
-		}
-		else
-			ERR("GMSInterface::readBoreholeFromGMS(): Error reading format.");
-	}
-	// write the last borehole from the file
-	if (newBorehole != NULL)
-	{
-		newBorehole->setDepth((*newBorehole)[2] - depth);
-		boreholes->push_back(newBorehole);
-	}
-	in.close();
-
-	if (boreholes->empty())
-		return 0;
-	return 1;
+    double depth(-9999.0);
+    std::string line(""), cName(""), sName("");
+    std::list<std::string>::const_iterator it;
+    GeoLib::Point* pnt = new GeoLib::Point();
+    GeoLib::StationBorehole* newBorehole = NULL;
+    std::ifstream in( filename.c_str() );
+
+    if (!in.is_open())
+    {
+        ERR("GMSInterface::readBoreholeFromGMS(): Could not open file %s.", filename.c_str());
+        return 0;
+    }
+
+    /* skipping first line because it contains field names */
+    getline(in, line);
+
+    /* read all stations */
+    while ( getline(in, line) )
+    {
+        std::list<std::string> fields = BaseLib::splitString(line, '\t');
+
+        if (fields.size() >= 5)
+        {
+            if (fields.begin()->compare(cName) == 0) // add new layer
+            {
+                it = fields.begin();
+                (*pnt)[0] = strtod((++it)->c_str(), 0);
+                (*pnt)[1] = strtod((++it)->c_str(), 0);
+                (*pnt)[2] = strtod((++it)->c_str(), 0);
+
+                // check if current layer has a thickness of 0.0.
+                // if so skip it since it will mess with the vtk-visualisation later on!
+                if ((*pnt)[2] != depth)
+                {
+                    newBorehole->addSoilLayer((*pnt)[0],
+                                              (*pnt)[1],
+                                              (*pnt)[2],
+                                              sName);
+                    sName = (*(++it));
+                    depth = (*pnt)[2];
+                }
+                else
+                    WARN("GMSInterface::readBoreholeFromGMS(): Skipped layer \"%s\" in borehole \"%s\" because of thickness 0.0.",
+                         sName.c_str(), cName.c_str());
+            }
+            else // add new borehole
+            {
+                if (newBorehole != NULL)
+                {
+                    newBorehole->setDepth((*newBorehole)[2] - depth);
+                    boreholes->push_back(newBorehole);
+                }
+                cName = *fields.begin();
+                it = fields.begin();
+                (*pnt)[0] = strtod((++it)->c_str(), 0);
+                (*pnt)[1] = strtod((++it)->c_str(), 0);
+                (*pnt)[2] = strtod((++it)->c_str(), 0);
+                sName = (*(++it));
+                newBorehole =
+                        GeoLib::StationBorehole::createStation(cName, (*pnt)[0],
+                                                               (*pnt)[1],
+                                                               (*pnt)[2], 0);
+                depth = (*pnt)[2];
+            }
+        }
+        else
+            ERR("GMSInterface::readBoreholeFromGMS(): Error reading format.");
+    }
+    // write the last borehole from the file
+    if (newBorehole != NULL)
+    {
+        newBorehole->setDepth((*newBorehole)[2] - depth);
+        boreholes->push_back(newBorehole);
+    }
+    in.close();
+
+    if (boreholes->empty())
+        return 0;
+    return 1;
 }
 
 /*
@@ -133,217 +133,217 @@ int GMSInterface::readBoreholesFromGMS(std::vector<GeoLib::Point*>* boreholes,
 void GMSInterface::writeBoreholesToGMS(const std::vector<GeoLib::Point*>* stations,
                                        const std::string &filename)
 {
-	std::ofstream out( filename.c_str(), std::ios::out );
-	//std::vector<std::string> soilID = readSoilIDfromFile("d:/BodeTimeline.txt");
-
-	// write header
-	out << "name" << "\t" << std::fixed << "X" << "\t" << "Y"  << "\t" << "Z" <<  "\t" <<
-	"soilID" << "\n";
-
-	for (std::size_t j = 0; j < stations->size(); j++)
-	{
-		GeoLib::StationBorehole* station =
-		        static_cast<GeoLib::StationBorehole*>((*stations)[j]);
-		std::vector<GeoLib::Point*> profile = station->getProfile();
-		std::vector<std::string> soilNames  = station->getSoilNames();
-		//std::size_t idx = 0;
-		std::string current_soil_name("");
-
-		std::size_t nLayers = profile.size();
-		for (std::size_t i = 1; i < nLayers; i++)
-		{
-			if ( (i > 1) && (soilNames[i].compare(soilNames[i - 1]) == 0) )
-				continue;
-			//idx = getSoilID(soilID, soilNames[i]);
-			current_soil_name = soilNames[i];
-
-			out << station->getName() << "\t" << std::fixed
-				<< (*(profile[i - 1]))[0] << "\t"
-			    << (*(profile[i - 1]))[1]  << "\t"
-				<< (*(profile[i - 1]))[2] <<  "\t"
-			    << current_soil_name/*idx*/ << "\n";
-		}
-		out << station->getName() << "\t" << std::fixed <<
-		(*(profile[nLayers - 1]))[0] << "\t"
-		    << (*(profile[nLayers - 1]))[1]  << "\t"
-			<< (*(profile[nLayers - 1]))[2] <<  "\t"
-		    << current_soil_name << "\n"; // this line marks the end of the borehole
-	}
-
-	out.close();
-	//GMSInterface::writeSoilIDTable(soilID, "d:/SoilIDReference.txt");
+    std::ofstream out( filename.c_str(), std::ios::out );
+    //std::vector<std::string> soilID = readSoilIDfromFile("d:/BodeTimeline.txt");
+
+    // write header
+    out << "name" << "\t" << std::fixed << "X" << "\t" << "Y"  << "\t" << "Z" <<  "\t" <<
+    "soilID" << "\n";
+
+    for (std::size_t j = 0; j < stations->size(); j++)
+    {
+        GeoLib::StationBorehole* station =
+                static_cast<GeoLib::StationBorehole*>((*stations)[j]);
+        std::vector<GeoLib::Point*> profile = station->getProfile();
+        std::vector<std::string> soilNames  = station->getSoilNames();
+        //std::size_t idx = 0;
+        std::string current_soil_name("");
+
+        std::size_t nLayers = profile.size();
+        for (std::size_t i = 1; i < nLayers; i++)
+        {
+            if ( (i > 1) && (soilNames[i].compare(soilNames[i - 1]) == 0) )
+                continue;
+            //idx = getSoilID(soilID, soilNames[i]);
+            current_soil_name = soilNames[i];
+
+            out << station->getName() << "\t" << std::fixed
+                << (*(profile[i - 1]))[0] << "\t"
+                << (*(profile[i - 1]))[1]  << "\t"
+                << (*(profile[i - 1]))[2] <<  "\t"
+                << current_soil_name/*idx*/ << "\n";
+        }
+        out << station->getName() << "\t" << std::fixed <<
+        (*(profile[nLayers - 1]))[0] << "\t"
+            << (*(profile[nLayers - 1]))[1]  << "\t"
+            << (*(profile[nLayers - 1]))[2] <<  "\t"
+            << current_soil_name << "\n"; // this line marks the end of the borehole
+    }
+
+    out.close();
+    //GMSInterface::writeSoilIDTable(soilID, "d:/SoilIDReference.txt");
 }
 
 std::size_t GMSInterface::getSoilID(std::vector<std::string> &soilID, std::string &soilName)
 {
-	for (std::size_t j = 0; j < soilID.size(); j++)
-		if (soilID[j].compare(soilName) == 0)
-			return j;
-	soilID.push_back(soilName);
-	return soilID.size() - 1;
+    for (std::size_t j = 0; j < soilID.size(); j++)
+        if (soilID[j].compare(soilName) == 0)
+            return j;
+    soilID.push_back(soilName);
+    return soilID.size() - 1;
 }
 
 int GMSInterface::writeSoilIDTable(const std::vector<std::string> &soilID,
                                    const std::string &filename)
 {
-	std::ofstream out( filename.c_str(), std::ios::out );
+    std::ofstream out( filename.c_str(), std::ios::out );
 
-	// write header
-	out << "ID" << "\t" << std::fixed << "Soil name" << "\n";
+    // write header
+    out << "ID" << "\t" << std::fixed << "Soil name" << "\n";
 
-	// write table
-	std::size_t nIDs = soilID.size();
-	for (std::size_t i = 0; i < nIDs; i++)
-		out << i << "\t" << std::fixed << soilID[i] << "\t" << "\n";
-	out.close();
+    // write table
+    std::size_t nIDs = soilID.size();
+    for (std::size_t i = 0; i < nIDs; i++)
+        out << i << "\t" << std::fixed << soilID[i] << "\t" << "\n";
+    out.close();
 
-	return 1;
+    return 1;
 }
 
 std::vector<std::string> GMSInterface::readSoilIDfromFile(const std::string &filename)
 {
-	std::vector<std::string> soilID;
-	std::string line;
+    std::vector<std::string> soilID;
+    std::string line;
 
-	std::ifstream in( filename.c_str() );
+    std::ifstream in( filename.c_str() );
 
-	if (in.is_open())
-		while ( getline(in, line) )
-		{
-			BaseLib::trim(line);
-			soilID.push_back(line);
-		}
-	in.close();
+    if (in.is_open())
+        while ( getline(in, line) )
+        {
+            BaseLib::trim(line);
+            soilID.push_back(line);
+        }
+    in.close();
 
-	return soilID;
+    return soilID;
 }
 
 MeshLib::Mesh* GMSInterface::readGMS3DMMesh(const std::string &filename)
 {
-	std::string line("");
-
-	std::ifstream in(filename.c_str());
-	if (!in.is_open())
-	{
-		ERR("GMSInterface::readGMS3DMMesh(): Could not open file %s.", filename.c_str());
-		return NULL;
-	}
-
-	// Read data from file
-	getline(in, line); // "MESH3D"
-	if (line.compare("MESH3D") != 0)
-	{
-		ERR("GMSInterface::readGMS3DMMesh(): Could not read expected file header.");
-		return NULL;
-	}
-
-	INFO("GMSInterface::readGMS3DMMesh(): Read GMS-3DM mesh.");
-	std::vector<MeshLib::Node*> nodes;
-	std::vector<MeshLib::Element*> elements;
-	std::vector<int> mat_ids;
-	std::map<unsigned, unsigned> id_map;
-
-	// elements are listed before nodes in 3dm-format, therefore
-	// traverse file twice and read first nodes and then elements
-	std::string dummy;
-	unsigned id(0), count(0);
-	double x[3];
-	// read nodes
-	while ( getline(in, line) )
-	{
-		if (line[0] == 'N') // "ND" for Node
-		{
-			std::stringstream str(line);
-			str >> dummy >> id >> x[0] >> x[1] >> x[2];
-			MeshLib::Node* node = new MeshLib::Node(x, id);
-			id_map.insert(std::pair<unsigned, unsigned>(id,count++));
-			nodes.push_back(node);
-		}
-	}
-	in.close();
-
-	// NOTE: Element types E8H (Hex), E4Q (Quad), E3T (Tri) are not implemented yet
-	// read elements
-	in.open(filename.c_str());
-	getline(in, line); // "MESH3D"
-	unsigned node_idx[6];
-	int mat_id(0);
-	while ( getline(in, line) )
-	{
-		std::string element_id(line.substr(0,3));
-		std::stringstream str(line);
-
-		if (element_id.compare("E6W") == 0) // Prism
-		{
-			str >> dummy >> id >> node_idx[0] >> node_idx[1] >> node_idx[2] >>
-			node_idx[3]
-			>> node_idx[4] >> node_idx[5] >> mat_id;
-			MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
-			for (unsigned k(0); k<6; k++) {
-				prism_nodes[k] = nodes[id_map.find(node_idx[k])->second];
-			}
-			elements.push_back(new MeshLib::Prism(prism_nodes));
-			mat_ids.push_back(mat_id);
-		}
-		else if (element_id.compare("E4T") == 0) // Tet
-		{
-			str >> dummy >> id >> node_idx[0] >> node_idx[1] >> node_idx[2] >>
-			node_idx[3] >> mat_id;
-			MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
-			for (unsigned k(0); k<4; k++) {
-				tet_nodes[k] = nodes[id_map.find(node_idx[k])->second];
-			}
-			elements.push_back(new MeshLib::Tet(tet_nodes));
-			mat_ids.push_back(mat_id);
-		}
-		else if ((element_id.compare("E4P") == 0) || (element_id.compare("E5P") == 0)) // Pyramid (both do exist for some reason)
-		{
-			str >> dummy >> id >> node_idx[0] >> node_idx[1] >> node_idx[2] >>
-			node_idx[3] >> node_idx[4] >> mat_id;
-			MeshLib::Node** pyramid_nodes = new MeshLib::Node*[5];
-			for (unsigned k(0); k<5; k++) {
-				pyramid_nodes[k] = nodes[id_map.find(node_idx[k])->second];
-			}
-			elements.push_back(new MeshLib::Pyramid(pyramid_nodes));
-			mat_ids.push_back(mat_id);
-		}
-		else if (element_id.compare("ND ") == 0) // Node
-
-			continue; // skip because nodes have already been read
-		else //default
-		{
-			WARN("GMSInterface::readGMS3DMMesh() - Element type \"%s\" not recognised.",
-			     element_id.c_str());
-			return NULL;
-		}
-	}
-
-	in.close();
-	INFO("GMSInterface::readGMS3DMMesh(): finished.");
-
-	const std::string mesh_name = BaseLib::extractBaseNameWithoutExtension(filename);
-	MeshLib::Properties properties;
-	if (mat_ids.size() == elements.size())
-	{
-		boost::optional<MeshLib::PropertyVector<int> &> opt_pv
-			= properties.createNewPropertyVector<int>(
-			"MaterialIDs", MeshLib::MeshItemType::Cell);
-		if (!opt_pv)
-		{
-			ERR("Could not create PropertyVector for material ids.");
-			for (auto element : elements)
-				delete element;
-			for (auto node : nodes)
-				delete node;
-			return nullptr;
-		}
-		opt_pv->reserve(mat_ids.size());
-		std::copy(mat_ids.cbegin(), mat_ids.cend(),
-		          std::back_inserter(*opt_pv));
-	}
-	else
-		ERR ("Ignoring Material IDs information (does not match number of elements).");
-	return new MeshLib::Mesh(mesh_name, nodes, elements, properties);
+    std::string line("");
+
+    std::ifstream in(filename.c_str());
+    if (!in.is_open())
+    {
+        ERR("GMSInterface::readGMS3DMMesh(): Could not open file %s.", filename.c_str());
+        return NULL;
+    }
+
+    // Read data from file
+    getline(in, line); // "MESH3D"
+    if (line.compare("MESH3D") != 0)
+    {
+        ERR("GMSInterface::readGMS3DMMesh(): Could not read expected file header.");
+        return NULL;
+    }
+
+    INFO("GMSInterface::readGMS3DMMesh(): Read GMS-3DM mesh.");
+    std::vector<MeshLib::Node*> nodes;
+    std::vector<MeshLib::Element*> elements;
+    std::vector<int> mat_ids;
+    std::map<unsigned, unsigned> id_map;
+
+    // elements are listed before nodes in 3dm-format, therefore
+    // traverse file twice and read first nodes and then elements
+    std::string dummy;
+    unsigned id(0), count(0);
+    double x[3];
+    // read nodes
+    while ( getline(in, line) )
+    {
+        if (line[0] == 'N') // "ND" for Node
+        {
+            std::stringstream str(line);
+            str >> dummy >> id >> x[0] >> x[1] >> x[2];
+            MeshLib::Node* node = new MeshLib::Node(x, id);
+            id_map.insert(std::pair<unsigned, unsigned>(id,count++));
+            nodes.push_back(node);
+        }
+    }
+    in.close();
+
+    // NOTE: Element types E8H (Hex), E4Q (Quad), E3T (Tri) are not implemented yet
+    // read elements
+    in.open(filename.c_str());
+    getline(in, line); // "MESH3D"
+    unsigned node_idx[6];
+    int mat_id(0);
+    while ( getline(in, line) )
+    {
+        std::string element_id(line.substr(0,3));
+        std::stringstream str(line);
+
+        if (element_id.compare("E6W") == 0) // Prism
+        {
+            str >> dummy >> id >> node_idx[0] >> node_idx[1] >> node_idx[2] >>
+            node_idx[3]
+            >> node_idx[4] >> node_idx[5] >> mat_id;
+            MeshLib::Node** prism_nodes = new MeshLib::Node*[6];
+            for (unsigned k(0); k<6; k++) {
+                prism_nodes[k] = nodes[id_map.find(node_idx[k])->second];
+            }
+            elements.push_back(new MeshLib::Prism(prism_nodes));
+            mat_ids.push_back(mat_id);
+        }
+        else if (element_id.compare("E4T") == 0) // Tet
+        {
+            str >> dummy >> id >> node_idx[0] >> node_idx[1] >> node_idx[2] >>
+            node_idx[3] >> mat_id;
+            MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
+            for (unsigned k(0); k<4; k++) {
+                tet_nodes[k] = nodes[id_map.find(node_idx[k])->second];
+            }
+            elements.push_back(new MeshLib::Tet(tet_nodes));
+            mat_ids.push_back(mat_id);
+        }
+        else if ((element_id.compare("E4P") == 0) || (element_id.compare("E5P") == 0)) // Pyramid (both do exist for some reason)
+        {
+            str >> dummy >> id >> node_idx[0] >> node_idx[1] >> node_idx[2] >>
+            node_idx[3] >> node_idx[4] >> mat_id;
+            MeshLib::Node** pyramid_nodes = new MeshLib::Node*[5];
+            for (unsigned k(0); k<5; k++) {
+                pyramid_nodes[k] = nodes[id_map.find(node_idx[k])->second];
+            }
+            elements.push_back(new MeshLib::Pyramid(pyramid_nodes));
+            mat_ids.push_back(mat_id);
+        }
+        else if (element_id.compare("ND ") == 0) // Node
+
+            continue; // skip because nodes have already been read
+        else //default
+        {
+            WARN("GMSInterface::readGMS3DMMesh() - Element type \"%s\" not recognised.",
+                 element_id.c_str());
+            return NULL;
+        }
+    }
+
+    in.close();
+    INFO("GMSInterface::readGMS3DMMesh(): finished.");
+
+    const std::string mesh_name = BaseLib::extractBaseNameWithoutExtension(filename);
+    MeshLib::Properties properties;
+    if (mat_ids.size() == elements.size())
+    {
+        boost::optional<MeshLib::PropertyVector<int> &> opt_pv
+            = properties.createNewPropertyVector<int>(
+            "MaterialIDs", MeshLib::MeshItemType::Cell);
+        if (!opt_pv)
+        {
+            ERR("Could not create PropertyVector for material ids.");
+            for (auto element : elements)
+                delete element;
+            for (auto node : nodes)
+                delete node;
+            return nullptr;
+        }
+        opt_pv->reserve(mat_ids.size());
+        std::copy(mat_ids.cbegin(), mat_ids.cend(),
+                  std::back_inserter(*opt_pv));
+    }
+    else
+        ERR ("Ignoring Material IDs information (does not match number of elements).");
+    return new MeshLib::Mesh(mesh_name, nodes, elements, properties);
 }
 
 }
diff --git a/FileIO/GMSInterface.h b/FileIO/GMSInterface.h
index 611a1e803278a0e7b17a88c8dcade47eb94b3308..11abf4ffe4177e53a752ea87c6be1062079c07eb 100644
--- a/FileIO/GMSInterface.h
+++ b/FileIO/GMSInterface.h
@@ -50,33 +50,33 @@ namespace FileIO
 class GMSInterface
 {
 public:
-	/// Exports borehole data from all boreholes in a list to a file in GMS-format. (Note: there are some hardcoded tmp-files in the method that you might need to change!)
-	static void writeBoreholesToGMS(const std::vector<GeoLib::Point*>* stations,
-	                                const std::string &filename);
+    /// Exports borehole data from all boreholes in a list to a file in GMS-format. (Note: there are some hardcoded tmp-files in the method that you might need to change!)
+    static void writeBoreholesToGMS(const std::vector<GeoLib::Point*>* stations,
+                                    const std::string &filename);
 
-	/// Imports borehole data from a file in GMS-format.
-	static int readBoreholesFromGMS(std::vector<GeoLib::Point*>* boreholes,
-	                                const std::string &filename);
+    /// Imports borehole data from a file in GMS-format.
+    static int readBoreholesFromGMS(std::vector<GeoLib::Point*>* boreholes,
+                                    const std::string &filename);
 
-	/// Writes a file that assigns each soilID-index in the GMS export file a name.
-	static int writeSoilIDTable(const std::vector<std::string> &soilID,
-	                            const std::string &filename);
+    /// Writes a file that assigns each soilID-index in the GMS export file a name.
+    static int writeSoilIDTable(const std::vector<std::string> &soilID,
+                                const std::string &filename);
 
-	/// Reads a GMS *.3dm file and converts it to an CFEMesh.
-	static MeshLib::Mesh* readGMS3DMMesh(const std::string &file_name);
+    /// Reads a GMS *.3dm file and converts it to an CFEMesh.
+    static MeshLib::Mesh* readGMS3DMMesh(const std::string &file_name);
 
 private:
-	/**
-	 * \brief Reads SoilIDs for Borehole export from an external file
-	 *
-	 * The method expects a file with the name of one stratigraphic layer at each line. These layers are assigned
-	 * ascending IDs, i.e. the first name gets index 0, the second line gets index 1, etc.
-	 * \return An array with the names of the stratigraphic layers in which the index for each string equals its ID.
-	 */
-	static std::vector<std::string> readSoilIDfromFile(const std::string &filename);
+    /**
+     * \brief Reads SoilIDs for Borehole export from an external file
+     *
+     * The method expects a file with the name of one stratigraphic layer at each line. These layers are assigned
+     * ascending IDs, i.e. the first name gets index 0, the second line gets index 1, etc.
+     * \return An array with the names of the stratigraphic layers in which the index for each string equals its ID.
+     */
+    static std::vector<std::string> readSoilIDfromFile(const std::string &filename);
 
-	/// Finds the ID assigned to soilName or creates a new one ( this method is called from writeBoreholeToGMS() )
-	static std::size_t getSoilID(std::vector<std::string> &soilID, std::string &soilName);
+    /// Finds the ID assigned to soilName or creates a new one ( this method is called from writeBoreholeToGMS() )
+    static std::size_t getSoilID(std::vector<std::string> &soilID, std::string &soilName);
 };
 
 }
diff --git a/FileIO/GmshIO/GMSHAdaptiveMeshDensity.cpp b/FileIO/GmshIO/GMSHAdaptiveMeshDensity.cpp
index b04ed1282d51406b964f062105a226ac492f1202..21cdc00dde2dad9bf1ec6e6feff6a75e7abffcc3 100644
--- a/FileIO/GmshIO/GMSHAdaptiveMeshDensity.cpp
+++ b/FileIO/GmshIO/GMSHAdaptiveMeshDensity.cpp
@@ -37,126 +37,126 @@ namespace GMSH {
 
 GMSHAdaptiveMeshDensity::GMSHAdaptiveMeshDensity(double pnt_density, double station_density,
                                                  std::size_t max_pnts_per_leaf) :
-	_pnt_density(pnt_density), _station_density(station_density),
-	_max_pnts_per_leaf(max_pnts_per_leaf), _quad_tree(NULL)
+    _pnt_density(pnt_density), _station_density(station_density),
+    _max_pnts_per_leaf(max_pnts_per_leaf), _quad_tree(NULL)
 {
 }
 
 GMSHAdaptiveMeshDensity::~GMSHAdaptiveMeshDensity()
 {
-	delete _quad_tree;
+    delete _quad_tree;
 }
 
 void GMSHAdaptiveMeshDensity::init(std::vector<GeoLib::Point const*> const& pnts)
 {
-	// *** QuadTree - determining bounding box
-	DBUG("GMSHAdaptiveMeshDensity::init(): computing axis aligned bounding box (2D) for quadtree.");
-
-	GeoLib::Point min(*pnts[0]), max(*pnts[0]);
-	std::size_t n_pnts(pnts.size());
-	for (std::size_t k(1); k<n_pnts; k++) {
-		for (std::size_t j(0); j < 2; j++)
-			if ((*(pnts[k]))[j] < min[j])
-				min[j] = (*(pnts[k]))[j];
-		for (std::size_t j(0); j < 2; j++)
-			if ((*(pnts[k]))[j] > max[j])
-				max[j] = (*(pnts[k]))[j];
-	}
-	min[2] = 0.0;
-	max[2] = 0.0;
-	DBUG("GMSHAdaptiveMeshDensity::init(): \tok");
-
-	// *** QuadTree - create object
-	DBUG("GMSHAdaptiveMeshDensity::init(): Creating quadtree.");
-	_quad_tree = new GeoLib::QuadTree<GeoLib::Point> (min, max, _max_pnts_per_leaf);
-	DBUG("GMSHAdaptiveMeshDensity::init(): \tok.");
-
-	// *** QuadTree - insert points
-	addPoints(pnts);
+    // *** QuadTree - determining bounding box
+    DBUG("GMSHAdaptiveMeshDensity::init(): computing axis aligned bounding box (2D) for quadtree.");
+
+    GeoLib::Point min(*pnts[0]), max(*pnts[0]);
+    std::size_t n_pnts(pnts.size());
+    for (std::size_t k(1); k<n_pnts; k++) {
+        for (std::size_t j(0); j < 2; j++)
+            if ((*(pnts[k]))[j] < min[j])
+                min[j] = (*(pnts[k]))[j];
+        for (std::size_t j(0); j < 2; j++)
+            if ((*(pnts[k]))[j] > max[j])
+                max[j] = (*(pnts[k]))[j];
+    }
+    min[2] = 0.0;
+    max[2] = 0.0;
+    DBUG("GMSHAdaptiveMeshDensity::init(): \tok");
+
+    // *** QuadTree - create object
+    DBUG("GMSHAdaptiveMeshDensity::init(): Creating quadtree.");
+    _quad_tree = new GeoLib::QuadTree<GeoLib::Point> (min, max, _max_pnts_per_leaf);
+    DBUG("GMSHAdaptiveMeshDensity::init(): \tok.");
+
+    // *** QuadTree - insert points
+    addPoints(pnts);
 }
 
 void GMSHAdaptiveMeshDensity::addPoints(std::vector<GeoLib::Point const*> const& pnts)
 {
-	// *** QuadTree - insert points
-	const std::size_t n_pnts(pnts.size());
-	DBUG("GMSHAdaptiveMeshDensity::addPoints(): Inserting %d points into quadtree.", n_pnts);
-	for (std::size_t k(0); k < n_pnts; k++)
-		_quad_tree->addPoint(pnts[k]);
-	DBUG("GMSHAdaptiveMeshDensity::addPoints(): \tok.");
-	_quad_tree->balance();
+    // *** QuadTree - insert points
+    const std::size_t n_pnts(pnts.size());
+    DBUG("GMSHAdaptiveMeshDensity::addPoints(): Inserting %d points into quadtree.", n_pnts);
+    for (std::size_t k(0); k < n_pnts; k++)
+        _quad_tree->addPoint(pnts[k]);
+    DBUG("GMSHAdaptiveMeshDensity::addPoints(): \tok.");
+    _quad_tree->balance();
 }
 
 double GMSHAdaptiveMeshDensity::getMeshDensityAtPoint(GeoLib::Point const* const pnt) const
 {
-	GeoLib::Point ll, ur;
-	_quad_tree->getLeaf(*pnt, ll, ur);
-	return _pnt_density * (ur[0] - ll[0]);
+    GeoLib::Point ll, ur;
+    _quad_tree->getLeaf(*pnt, ll, ur);
+    return _pnt_density * (ur[0] - ll[0]);
 }
 
 double GMSHAdaptiveMeshDensity::getMeshDensityAtStation(GeoLib::Point const* const pnt) const
 {
-	GeoLib::Point ll, ur;
-	_quad_tree->getLeaf(*pnt, ll, ur);
-	return _station_density * (ur[0] - ll[0]);
+    GeoLib::Point ll, ur;
+    _quad_tree->getLeaf(*pnt, ll, ur);
+    return _station_density * (ur[0] - ll[0]);
 }
 
 void GMSHAdaptiveMeshDensity::getSteinerPoints (std::vector<GeoLib::Point*> & pnts,
                                                 std::size_t additional_levels) const
 {
-	// get Steiner points
-	std::size_t max_depth(0);
-	_quad_tree->getMaxDepth(max_depth);
-
-	std::list<GeoLib::QuadTree<GeoLib::Point>*> leaf_list;
-	_quad_tree->getLeafs(leaf_list);
-
-	for (std::list<GeoLib::QuadTree<GeoLib::Point>*>::const_iterator it(leaf_list.begin()); it
-					!= leaf_list.end(); ++it) {
-		if ((*it)->getPoints().empty()) {
-			// compute point from square
-			GeoLib::Point ll, ur;
-			(*it)->getSquarePoints(ll, ur);
-			if ((*it)->getDepth() + additional_levels > max_depth) {
-				additional_levels = max_depth - (*it)->getDepth();
-			}
-			const std::size_t n_pnts_per_quad_dim = 1 << additional_levels;
-			const double delta ((ur[0] - ll[0]) / (2 * n_pnts_per_quad_dim));
-			for (std::size_t i(0); i<n_pnts_per_quad_dim; i++) {
-				for (std::size_t j(0); j<n_pnts_per_quad_dim; j++) {
-					pnts.push_back(new GeoLib::Point(
-					    ll[0] + (2 * i + 1) * delta,
-					    ll[1] + (2 * j + 1) * delta, 0.0, pnts.size()));
-				}
-			}
-
-		}
-	}
+    // get Steiner points
+    std::size_t max_depth(0);
+    _quad_tree->getMaxDepth(max_depth);
+
+    std::list<GeoLib::QuadTree<GeoLib::Point>*> leaf_list;
+    _quad_tree->getLeafs(leaf_list);
+
+    for (std::list<GeoLib::QuadTree<GeoLib::Point>*>::const_iterator it(leaf_list.begin()); it
+                    != leaf_list.end(); ++it) {
+        if ((*it)->getPoints().empty()) {
+            // compute point from square
+            GeoLib::Point ll, ur;
+            (*it)->getSquarePoints(ll, ur);
+            if ((*it)->getDepth() + additional_levels > max_depth) {
+                additional_levels = max_depth - (*it)->getDepth();
+            }
+            const std::size_t n_pnts_per_quad_dim = 1 << additional_levels;
+            const double delta ((ur[0] - ll[0]) / (2 * n_pnts_per_quad_dim));
+            for (std::size_t i(0); i<n_pnts_per_quad_dim; i++) {
+                for (std::size_t j(0); j<n_pnts_per_quad_dim; j++) {
+                    pnts.push_back(new GeoLib::Point(
+                        ll[0] + (2 * i + 1) * delta,
+                        ll[1] + (2 * j + 1) * delta, 0.0, pnts.size()));
+                }
+            }
+
+        }
+    }
 }
 
 #ifndef NDEBUG
 void GMSHAdaptiveMeshDensity::getQuadTreeGeometry(std::vector<GeoLib::Point*> &pnts,
                                                   std::vector<GeoLib::Polyline*> &plys) const
 {
-	std::list<GeoLib::QuadTree<GeoLib::Point>*> leaf_list;
-	_quad_tree->getLeafs(leaf_list);
-
-	for (std::list<GeoLib::QuadTree<GeoLib::Point>*>::const_iterator it(leaf_list.begin()); it
-		!= leaf_list.end(); ++it) {
-		// fetch corner points from leaf
-		GeoLib::Point ll, ur;
-		(*it)->getSquarePoints(ll, ur);
-		std::size_t const pnt_offset (pnts.size());
-		pnts.push_back(new GeoLib::Point(ll, pnt_offset));
-		pnts.push_back(new GeoLib::Point(ur[0], ll[1], 0.0, pnt_offset+1));
-		pnts.push_back(new GeoLib::Point(ur, pnt_offset+2));
-		pnts.push_back(new GeoLib::Point(ll[0], ur[1], 0.0, pnt_offset+3));
-		plys.push_back(new GeoLib::Polyline(pnts));
-		plys[plys.size() - 1]->addPoint(pnt_offset);
-		plys[plys.size() - 1]->addPoint(pnt_offset + 1);
-		plys[plys.size() - 1]->addPoint(pnt_offset + 2);
-		plys[plys.size() - 1]->addPoint(pnt_offset + 3);
-		plys[plys.size() - 1]->addPoint(pnt_offset);
-	}
+    std::list<GeoLib::QuadTree<GeoLib::Point>*> leaf_list;
+    _quad_tree->getLeafs(leaf_list);
+
+    for (std::list<GeoLib::QuadTree<GeoLib::Point>*>::const_iterator it(leaf_list.begin()); it
+        != leaf_list.end(); ++it) {
+        // fetch corner points from leaf
+        GeoLib::Point ll, ur;
+        (*it)->getSquarePoints(ll, ur);
+        std::size_t const pnt_offset (pnts.size());
+        pnts.push_back(new GeoLib::Point(ll, pnt_offset));
+        pnts.push_back(new GeoLib::Point(ur[0], ll[1], 0.0, pnt_offset+1));
+        pnts.push_back(new GeoLib::Point(ur, pnt_offset+2));
+        pnts.push_back(new GeoLib::Point(ll[0], ur[1], 0.0, pnt_offset+3));
+        plys.push_back(new GeoLib::Polyline(pnts));
+        plys[plys.size() - 1]->addPoint(pnt_offset);
+        plys[plys.size() - 1]->addPoint(pnt_offset + 1);
+        plys[plys.size() - 1]->addPoint(pnt_offset + 2);
+        plys[plys.size() - 1]->addPoint(pnt_offset + 3);
+        plys[plys.size() - 1]->addPoint(pnt_offset);
+    }
 }
 #endif
 }
diff --git a/FileIO/GmshIO/GMSHAdaptiveMeshDensity.h b/FileIO/GmshIO/GMSHAdaptiveMeshDensity.h
index 7429628fb2a78ba697bd8c146797d39b79ee3335..d2d878a006189f5547e6322fbf9e7497ede0a706 100644
--- a/FileIO/GmshIO/GMSHAdaptiveMeshDensity.h
+++ b/FileIO/GmshIO/GMSHAdaptiveMeshDensity.h
@@ -35,26 +35,26 @@ namespace GMSH {
 class GMSHAdaptiveMeshDensity : public GMSHMeshDensityStrategy
 {
 public:
-	GMSHAdaptiveMeshDensity(double pnt_density,
-	                        double station_density,
-	                        std::size_t max_pnts_per_leaf);
-	virtual ~GMSHAdaptiveMeshDensity();
-	void init(std::vector<GeoLib::Point const*> const& pnts);
-	double getMeshDensityAtPoint(GeoLib::Point const* const pnt) const;
-	void addPoints(std::vector<GeoLib::Point const*> const& pnts);
-	double getMeshDensityAtStation(GeoLib::Point const* const) const;
-	void getSteinerPoints (std::vector<GeoLib::Point*> & pnts,
-	                       std::size_t additional_levels = 0) const;
+    GMSHAdaptiveMeshDensity(double pnt_density,
+                            double station_density,
+                            std::size_t max_pnts_per_leaf);
+    virtual ~GMSHAdaptiveMeshDensity();
+    void init(std::vector<GeoLib::Point const*> const& pnts);
+    double getMeshDensityAtPoint(GeoLib::Point const* const pnt) const;
+    void addPoints(std::vector<GeoLib::Point const*> const& pnts);
+    double getMeshDensityAtStation(GeoLib::Point const* const) const;
+    void getSteinerPoints (std::vector<GeoLib::Point*> & pnts,
+                           std::size_t additional_levels = 0) const;
 #ifndef NDEBUG
-	void getQuadTreeGeometry(std::vector<GeoLib::Point*> &pnts,
-	                         std::vector<GeoLib::Polyline*> &plys) const;
+    void getQuadTreeGeometry(std::vector<GeoLib::Point*> &pnts,
+                             std::vector<GeoLib::Polyline*> &plys) const;
 #endif
 
 private:
-	double _pnt_density;
-	double _station_density;
-	std::size_t _max_pnts_per_leaf;
-	GeoLib::QuadTree<GeoLib::Point> *_quad_tree;
+    double _pnt_density;
+    double _station_density;
+    std::size_t _max_pnts_per_leaf;
+    GeoLib::QuadTree<GeoLib::Point> *_quad_tree;
 };
 
 }
diff --git a/FileIO/GmshIO/GMSHFixedMeshDensity.cpp b/FileIO/GmshIO/GMSHFixedMeshDensity.cpp
index 720f103819d66abc07fd860fc9c8ec780c24edf6..59d6fbc682a79218389d407bdcf321f87d73ee47 100644
--- a/FileIO/GmshIO/GMSHFixedMeshDensity.cpp
+++ b/FileIO/GmshIO/GMSHFixedMeshDensity.cpp
@@ -19,24 +19,24 @@ namespace FileIO
 namespace GMSH {
 
 GMSHFixedMeshDensity::GMSHFixedMeshDensity(double mesh_density) :
-	_mesh_density(mesh_density)
+    _mesh_density(mesh_density)
 {
 }
 
 void GMSHFixedMeshDensity::init(std::vector<GeoLib::Point const*> const& vec)
 {
-	// to avoid a warning here:
-	(void)(vec);
+    // to avoid a warning here:
+    (void)(vec);
 }
 
 double GMSHFixedMeshDensity::getMeshDensityAtPoint(GeoLib::Point const*const) const
 {
-	return _mesh_density;
+    return _mesh_density;
 }
 
 double GMSHFixedMeshDensity::getMeshDensityAtStation(GeoLib::Point const*const) const
 {
-	return _mesh_density;
+    return _mesh_density;
 }
 
 }
diff --git a/FileIO/GmshIO/GMSHFixedMeshDensity.h b/FileIO/GmshIO/GMSHFixedMeshDensity.h
index 7f7c82751dc9e981179163281312d6f63313ee09..8644b636fe14bc44b0196a61636e6e1854ecdd1a 100644
--- a/FileIO/GmshIO/GMSHFixedMeshDensity.h
+++ b/FileIO/GmshIO/GMSHFixedMeshDensity.h
@@ -24,14 +24,14 @@ namespace GMSH {
 class GMSHFixedMeshDensity : public GMSHMeshDensityStrategy
 {
 public:
-	GMSHFixedMeshDensity(double mesh_density);
-	void init(std::vector<GeoLib::Point const*> const& vec);
-	double getMeshDensityAtPoint(GeoLib::Point const*const) const;
-	double getMeshDensityAtStation(GeoLib::Point const*const) const;
-	virtual ~GMSHFixedMeshDensity() {}
+    GMSHFixedMeshDensity(double mesh_density);
+    void init(std::vector<GeoLib::Point const*> const& vec);
+    double getMeshDensityAtPoint(GeoLib::Point const*const) const;
+    double getMeshDensityAtStation(GeoLib::Point const*const) const;
+    virtual ~GMSHFixedMeshDensity() {}
 
 private:
-	double _mesh_density;
+    double _mesh_density;
 };
 
 }
diff --git a/FileIO/GmshIO/GMSHLine.cpp b/FileIO/GmshIO/GMSHLine.cpp
index 9c94f4f701f6f8eb179ef80d6faa36a1000369a2..59b0e0bc46b211072079f1ed99a258ea93513916 100644
--- a/FileIO/GmshIO/GMSHLine.cpp
+++ b/FileIO/GmshIO/GMSHLine.cpp
@@ -20,7 +20,7 @@ namespace FileIO
 namespace GMSH {
 
 GMSHLine::GMSHLine(std::size_t start_point_id, std::size_t end_point_id) :
-	_start_pnt_id(start_point_id), _end_pnt_id(end_point_id)
+    _start_pnt_id(start_point_id), _end_pnt_id(end_point_id)
 {}
 
 GMSHLine::~GMSHLine()
@@ -28,13 +28,13 @@ GMSHLine::~GMSHLine()
 
 void GMSHLine::write(std::ostream &os, std::size_t id) const
 {
-	os << "Line(" << id << ") = {" << _start_pnt_id << "," << _end_pnt_id << "};\n";
+    os << "Line(" << id << ") = {" << _start_pnt_id << "," << _end_pnt_id << "};\n";
 }
 
 void GMSHLine::resetLineData(std::size_t start_point_id, std::size_t end_point_id)
 {
-	_start_pnt_id = start_point_id;
-	_end_pnt_id = end_point_id;
+    _start_pnt_id = start_point_id;
+    _end_pnt_id = end_point_id;
 }
 
 }
diff --git a/FileIO/GmshIO/GMSHLine.h b/FileIO/GmshIO/GMSHLine.h
index 45e783ff0f8e1dac222a479a47a596d4130744da..939ea4b93523078bdd2f423cccc87a12a8cf3462 100644
--- a/FileIO/GmshIO/GMSHLine.h
+++ b/FileIO/GmshIO/GMSHLine.h
@@ -23,14 +23,14 @@ namespace GMSH {
 
 class GMSHLine {
 public:
-	GMSHLine(std::size_t start_point_id, std::size_t end_point_id);
-	virtual ~GMSHLine();
-	void write(std::ostream &os, std::size_t id) const;
-	void resetLineData(std::size_t start_point_id, std::size_t end_point_id);
+    GMSHLine(std::size_t start_point_id, std::size_t end_point_id);
+    virtual ~GMSHLine();
+    void write(std::ostream &os, std::size_t id) const;
+    void resetLineData(std::size_t start_point_id, std::size_t end_point_id);
 
 private:
-	std::size_t _start_pnt_id;
-	std::size_t _end_pnt_id;
+    std::size_t _start_pnt_id;
+    std::size_t _end_pnt_id;
 };
 
 }
diff --git a/FileIO/GmshIO/GMSHLineLoop.cpp b/FileIO/GmshIO/GMSHLineLoop.cpp
index 7b1a146cdb8e2343a9e4c2b4bf53e45b22c20f7d..5a5d803c477bc1171850d27d3c644ea8d2691792 100644
--- a/FileIO/GmshIO/GMSHLineLoop.cpp
+++ b/FileIO/GmshIO/GMSHLineLoop.cpp
@@ -22,37 +22,37 @@ namespace FileIO
 namespace GMSH {
 
 GMSHLineLoop::GMSHLineLoop(bool is_sfc) :
-	_is_sfc(is_sfc)
+    _is_sfc(is_sfc)
 {}
 
 GMSHLineLoop::~GMSHLineLoop()
 {
-	const std::size_t n_lines (_lines.size());
-	for (std::size_t k(0); k<n_lines; k++) {
-		delete _lines[k];
-	}
+    const std::size_t n_lines (_lines.size());
+    for (std::size_t k(0); k<n_lines; k++) {
+        delete _lines[k];
+    }
 }
 
 void GMSHLineLoop::addLine(GMSHLine* line)
 {
-	_lines.push_back(line);
+    _lines.push_back(line);
 }
 
 void GMSHLineLoop::write(std::ostream &os, std::size_t line_offset, std::size_t sfc_offset) const
 {
-	const std::size_t n_lines (_lines.size());
-	for (std::size_t k(0); k<n_lines; k++) {
-		(_lines[k])->write(os, line_offset+k);
-	}
-	os << "Line Loop(" << line_offset+n_lines << ") = {";
-	for (std::size_t k(0); k < n_lines - 1; k++)
-		os << line_offset + k << ",";
-	os << line_offset + n_lines - 1 << "};\n";
-
-	if (_is_sfc) {
-		// write plane surface
-		os << "Plane Surface (" << sfc_offset << ") = {" << line_offset+n_lines << "};\n";
-	}
+    const std::size_t n_lines (_lines.size());
+    for (std::size_t k(0); k<n_lines; k++) {
+        (_lines[k])->write(os, line_offset+k);
+    }
+    os << "Line Loop(" << line_offset+n_lines << ") = {";
+    for (std::size_t k(0); k < n_lines - 1; k++)
+        os << line_offset + k << ",";
+    os << line_offset + n_lines - 1 << "};\n";
+
+    if (_is_sfc) {
+        // write plane surface
+        os << "Plane Surface (" << sfc_offset << ") = {" << line_offset+n_lines << "};\n";
+    }
 
 }
 
diff --git a/FileIO/GmshIO/GMSHLineLoop.h b/FileIO/GmshIO/GMSHLineLoop.h
index 4a00c3a89fea651f0e9f0201e9f8fbf58caafe2d..b1cad96d57966726d35e2ba1d56d55fa611aa9f3 100644
--- a/FileIO/GmshIO/GMSHLineLoop.h
+++ b/FileIO/GmshIO/GMSHLineLoop.h
@@ -27,16 +27,16 @@ class GMSHLine;
 
 class GMSHLineLoop {
 public:
-	GMSHLineLoop(bool is_sfc=false);
-	virtual ~GMSHLineLoop();
-	void addLine(GMSHLine* line);
-	bool isSurface() const { return _is_sfc; }
-	void setSurface(bool is_sfc) { _is_sfc = is_sfc; }
-	void write(std::ostream &os, std::size_t offset, std::size_t sfc_offset = 0) const;
+    GMSHLineLoop(bool is_sfc=false);
+    virtual ~GMSHLineLoop();
+    void addLine(GMSHLine* line);
+    bool isSurface() const { return _is_sfc; }
+    void setSurface(bool is_sfc) { _is_sfc = is_sfc; }
+    void write(std::ostream &os, std::size_t offset, std::size_t sfc_offset = 0) const;
 
 private:
-	std::vector<GMSHLine*> _lines;
-	bool _is_sfc;
+    std::vector<GMSHLine*> _lines;
+    bool _is_sfc;
 };
 
 }
diff --git a/FileIO/GmshIO/GMSHMeshDensityStrategy.h b/FileIO/GmshIO/GMSHMeshDensityStrategy.h
index 27c730390f90a69dbbdb026eeacbf94940b41938..ff908199926e116917801c09497b558a43b04da5 100644
--- a/FileIO/GmshIO/GMSHMeshDensityStrategy.h
+++ b/FileIO/GmshIO/GMSHMeshDensityStrategy.h
@@ -33,10 +33,10 @@ namespace GMSH {
 class GMSHMeshDensityStrategy
 {
 public:
-	virtual ~GMSHMeshDensityStrategy() {}
-	virtual void init(std::vector<GeoLib::Point const*> const&) = 0;
-	virtual double getMeshDensityAtPoint(GeoLib::Point const*const) const = 0;
-	virtual double getMeshDensityAtStation(GeoLib::Point const*const) const = 0;
+    virtual ~GMSHMeshDensityStrategy() {}
+    virtual void init(std::vector<GeoLib::Point const*> const&) = 0;
+    virtual double getMeshDensityAtPoint(GeoLib::Point const*const) const = 0;
+    virtual double getMeshDensityAtStation(GeoLib::Point const*const) const = 0;
 };
 
 }
diff --git a/FileIO/GmshIO/GMSHPoint.cpp b/FileIO/GmshIO/GMSHPoint.cpp
index afb54305cf7a523179f21f4b885988d66dfe806d..1e0d13d6c47574ee36ba8a35d5031d656166bdf8 100644
--- a/FileIO/GmshIO/GMSHPoint.cpp
+++ b/FileIO/GmshIO/GMSHPoint.cpp
@@ -22,17 +22,17 @@ namespace FileIO
 namespace GMSH {
 
 GMSHPoint::GMSHPoint(GeoLib::Point const& pnt, std::size_t id, double mesh_density) :
-	GeoLib::Point(pnt, id), _mesh_density(mesh_density)
+    GeoLib::Point(pnt, id), _mesh_density(mesh_density)
 {}
 
 void GMSHPoint::write(std::ostream &os) const
 {
-	os << "Point(" << _id << ") = {" << _x[0] << ", " << _x[1] << ", " << _x[2];
-	if (fabs(_mesh_density) > std::numeric_limits<double>::epsilon()) {
-		os << ", " << _mesh_density << "};";
-	} else {
-		os << "};";
-	}
+    os << "Point(" << _id << ") = {" << _x[0] << ", " << _x[1] << ", " << _x[2];
+    if (fabs(_mesh_density) > std::numeric_limits<double>::epsilon()) {
+        os << ", " << _mesh_density << "};";
+    } else {
+        os << "};";
+    }
 }
 
 GMSHPoint::~GMSHPoint()
@@ -40,8 +40,8 @@ GMSHPoint::~GMSHPoint()
 
 std::ostream& operator<< (std::ostream &os, GMSHPoint const& p)
 {
-	p.write (os);
-	return os;
+    p.write (os);
+    return os;
 }
 
 }
diff --git a/FileIO/GmshIO/GMSHPoint.h b/FileIO/GmshIO/GMSHPoint.h
index f9d79f49bb16d87686f0d2b5df9ab131a4bb3bc2..b2788802e8615b183079f55811115cec2c4000ff 100644
--- a/FileIO/GmshIO/GMSHPoint.h
+++ b/FileIO/GmshIO/GMSHPoint.h
@@ -24,11 +24,11 @@ namespace GMSH {
 
 class GMSHPoint : public GeoLib::Point {
 public:
-	GMSHPoint(GeoLib::Point const& pnt, std::size_t id, double mesh_density);
-	virtual ~GMSHPoint();
-	void write(std::ostream &os) const;
+    GMSHPoint(GeoLib::Point const& pnt, std::size_t id, double mesh_density);
+    virtual ~GMSHPoint();
+    void write(std::ostream &os) const;
 private:
-	double _mesh_density;
+    double _mesh_density;
 };
 
 /** overload the output operator for class GMSHPoint */
diff --git a/FileIO/GmshIO/GMSHPolygonTree.cpp b/FileIO/GmshIO/GMSHPolygonTree.cpp
index cb213881dd779d6289b6e6329d085e0acfc1d408..8f3a92f966a5b32e37fbef9fe9b7340dc2d96fcc 100644
--- a/FileIO/GmshIO/GMSHPolygonTree.cpp
+++ b/FileIO/GmshIO/GMSHPolygonTree.cpp
@@ -27,312 +27,312 @@ namespace FileIO
 namespace GMSH {
 
 GMSHPolygonTree::GMSHPolygonTree(GeoLib::Polygon* polygon, GMSHPolygonTree* parent,
-				GeoLib::GEOObjects &geo_objs, std::string const& geo_name,
-				GMSHMeshDensityStrategy * mesh_density_strategy) :
-	GeoLib::SimplePolygonTree(polygon, parent), _geo_objs(geo_objs), _geo_name(geo_name),
-	_mesh_density_strategy(mesh_density_strategy)
+                GeoLib::GEOObjects &geo_objs, std::string const& geo_name,
+                GMSHMeshDensityStrategy * mesh_density_strategy) :
+    GeoLib::SimplePolygonTree(polygon, parent), _geo_objs(geo_objs), _geo_name(geo_name),
+    _mesh_density_strategy(mesh_density_strategy)
 {}
 
 GMSHPolygonTree::~GMSHPolygonTree()
 {
-	// the polylines are processed also by the children, but the root is
-	// responsible to cleanup up
-	if (_parent == nullptr) { // root
-		for (auto * polyline : _plys)
-			delete polyline;
-	}
-	// member of GeoLib::SimplePolygonTree, but the ownership is not transmitted
-	delete _node_polygon;
+    // the polylines are processed also by the children, but the root is
+    // responsible to cleanup up
+    if (_parent == nullptr) { // root
+        for (auto * polyline : _plys)
+            delete polyline;
+    }
+    // member of GeoLib::SimplePolygonTree, but the ownership is not transmitted
+    delete _node_polygon;
 }
 
 bool GMSHPolygonTree::insertStation(GeoLib::Point const* station)
 {
-	if (_node_polygon->isPntInPolygon(*station)) {
-		// try to insert station into the child nodes
-		for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin());
-			 it != _children.end(); ++it) {
-			if (((*it)->getPolygon())->isPntInPolygon (*station)) {
-				bool rval(dynamic_cast<GMSHPolygonTree*>((*it))->insertStation (station));
-				// stop recursion if sub SimplePolygonTree is a leaf
-				if (rval && (*it)->getNChildren() == 0)
-					_stations.push_back (station);
-				return rval;
-			}
-		}
-		// station did not fit into child nodes -> insert the station into this node
-		_stations.push_back (station);
-		return true;
-	} else {
-		return false;
-	}
+    if (_node_polygon->isPntInPolygon(*station)) {
+        // try to insert station into the child nodes
+        for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin());
+             it != _children.end(); ++it) {
+            if (((*it)->getPolygon())->isPntInPolygon (*station)) {
+                bool rval(dynamic_cast<GMSHPolygonTree*>((*it))->insertStation (station));
+                // stop recursion if sub SimplePolygonTree is a leaf
+                if (rval && (*it)->getNChildren() == 0)
+                    _stations.push_back (station);
+                return rval;
+            }
+        }
+        // station did not fit into child nodes -> insert the station into this node
+        _stations.push_back (station);
+        return true;
+    } else {
+        return false;
+    }
 }
 
 void GMSHPolygonTree::insertPolyline (GeoLib::PolylineWithSegmentMarker * ply)
 {
-	if (_node_polygon->isPartOfPolylineInPolygon(*ply)) {
-		// check children
-		for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin());
-			it != _children.end(); ++it) {
-			dynamic_cast<GMSHPolygonTree*>((*it))->insertPolyline (ply);
-		}
-		_plys.push_back(ply);
+    if (_node_polygon->isPartOfPolylineInPolygon(*ply)) {
+        // check children
+        for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin());
+            it != _children.end(); ++it) {
+            dynamic_cast<GMSHPolygonTree*>((*it))->insertPolyline (ply);
+        }
+        _plys.push_back(ply);
 
-		// calculate possible intersection points
-		// pay attention: loop bound is not fix!
-		std::size_t n_segments (ply->getNumberOfPoints()-1);
-		GeoLib::Point tmp_pnt;
-		GeoLib::PointVec & pnt_vec(*(_geo_objs.getPointVecObj(_geo_name)));
-		for (std::size_t k(0); k<n_segments; k++) {
-			if (! ply->isSegmentMarked(k)) {
-				std::size_t seg_num(0);
-				GeoLib::Point *intersection_pnt(new GeoLib::Point);
-				while (_node_polygon->getNextIntersectionPointPolygonLine(
-				    {const_cast<GeoLib::Point*>(ply->getPoint(k)),
-				     const_cast<GeoLib::Point*>(ply->getPoint(k + 1))},
-				    *intersection_pnt, seg_num))
-				{
-					// insert the intersection point to point vector of GEOObjects instance
-					const std::size_t pnt_vec_size(pnt_vec.size());
-					// appendPoints deletes an already existing point
-					const std::size_t pnt_id(pnt_vec.push_back(intersection_pnt));
-					if (pnt_vec_size < pnt_vec.size()) { // case: new point
-						// modify the polygon
-						_node_polygon->insertPoint(seg_num+1, pnt_id);
-						// modify the polyline
-						ply->insertPoint(k+1, pnt_id);
-						n_segments++;
-					} else { // case: existing point
-						// check if point id is within the polygon
-						if (! _node_polygon->isPointIDInPolyline(pnt_id)) {
-							_node_polygon->insertPoint(seg_num+1, pnt_id);
-						}
-						// check if point id is in polyline
-						if (! ply->isPointIDInPolyline(pnt_id)) {
-							ply->insertPoint(k+1, pnt_id);
-							n_segments++;
-						}
-					}
+        // calculate possible intersection points
+        // pay attention: loop bound is not fix!
+        std::size_t n_segments (ply->getNumberOfPoints()-1);
+        GeoLib::Point tmp_pnt;
+        GeoLib::PointVec & pnt_vec(*(_geo_objs.getPointVecObj(_geo_name)));
+        for (std::size_t k(0); k<n_segments; k++) {
+            if (! ply->isSegmentMarked(k)) {
+                std::size_t seg_num(0);
+                GeoLib::Point *intersection_pnt(new GeoLib::Point);
+                while (_node_polygon->getNextIntersectionPointPolygonLine(
+                    {const_cast<GeoLib::Point*>(ply->getPoint(k)),
+                     const_cast<GeoLib::Point*>(ply->getPoint(k + 1))},
+                    *intersection_pnt, seg_num))
+                {
+                    // insert the intersection point to point vector of GEOObjects instance
+                    const std::size_t pnt_vec_size(pnt_vec.size());
+                    // appendPoints deletes an already existing point
+                    const std::size_t pnt_id(pnt_vec.push_back(intersection_pnt));
+                    if (pnt_vec_size < pnt_vec.size()) { // case: new point
+                        // modify the polygon
+                        _node_polygon->insertPoint(seg_num+1, pnt_id);
+                        // modify the polyline
+                        ply->insertPoint(k+1, pnt_id);
+                        n_segments++;
+                    } else { // case: existing point
+                        // check if point id is within the polygon
+                        if (! _node_polygon->isPointIDInPolyline(pnt_id)) {
+                            _node_polygon->insertPoint(seg_num+1, pnt_id);
+                        }
+                        // check if point id is in polyline
+                        if (! ply->isPointIDInPolyline(pnt_id)) {
+                            ply->insertPoint(k+1, pnt_id);
+                            n_segments++;
+                        }
+                    }
 
-					std::size_t tmp_seg_num(seg_num+1);
-					if (!_node_polygon->getNextIntersectionPointPolygonLine(
-					        {const_cast<GeoLib::Point*>(ply->getPoint(k)),
-					         const_cast<GeoLib::Point*>(ply->getPoint(k + 1))},
-					        tmp_pnt, tmp_seg_num))
-					{
-						// check a point of the segment except the end points
-						for (std::size_t i(0); i<3; i++) {
-							tmp_pnt[i] = ((*(ply->getPoint(k)))[i] + (*(ply->getPoint(k+1)))[i]) / 2;
-						}
-						if (_node_polygon->isPntInPolygon(tmp_pnt)) {
-							ply->markSegment(k, true);
-							// insert line segment as constraint
-							_gmsh_lines_for_constraints.push_back(new GMSHLine(ply->getPointID(k), ply->getPointID(k+1)));
-						}
-					}
-					intersection_pnt = new GeoLib::Point;
-					seg_num++;
-				}
+                    std::size_t tmp_seg_num(seg_num+1);
+                    if (!_node_polygon->getNextIntersectionPointPolygonLine(
+                            {const_cast<GeoLib::Point*>(ply->getPoint(k)),
+                             const_cast<GeoLib::Point*>(ply->getPoint(k + 1))},
+                            tmp_pnt, tmp_seg_num))
+                    {
+                        // check a point of the segment except the end points
+                        for (std::size_t i(0); i<3; i++) {
+                            tmp_pnt[i] = ((*(ply->getPoint(k)))[i] + (*(ply->getPoint(k+1)))[i]) / 2;
+                        }
+                        if (_node_polygon->isPntInPolygon(tmp_pnt)) {
+                            ply->markSegment(k, true);
+                            // insert line segment as constraint
+                            _gmsh_lines_for_constraints.push_back(new GMSHLine(ply->getPointID(k), ply->getPointID(k+1)));
+                        }
+                    }
+                    intersection_pnt = new GeoLib::Point;
+                    seg_num++;
+                }
 
-				// check a point of the segment except the end points
-				for (std::size_t i(0); i<3; i++) {
-					tmp_pnt[i] = ((*(ply->getPoint(k)))[i] + (*(ply->getPoint(k+1)))[i]) / 2;
-				}
-				if (_node_polygon->isPntInPolygon(tmp_pnt)) {
-					ply->markSegment(k, true);
-					// insert line segment as constraint
-					_gmsh_lines_for_constraints.push_back(new GMSHLine(ply->getPointID(k), ply->getPointID(k+1)));
-				}
-			}
-		}
-	}
+                // check a point of the segment except the end points
+                for (std::size_t i(0); i<3; i++) {
+                    tmp_pnt[i] = ((*(ply->getPoint(k)))[i] + (*(ply->getPoint(k+1)))[i]) / 2;
+                }
+                if (_node_polygon->isPntInPolygon(tmp_pnt)) {
+                    ply->markSegment(k, true);
+                    // insert line segment as constraint
+                    _gmsh_lines_for_constraints.push_back(new GMSHLine(ply->getPointID(k), ply->getPointID(k+1)));
+                }
+            }
+        }
+    }
 }
 
 void GMSHPolygonTree::initMeshDensityStrategy()
 {
-	if (dynamic_cast<GMSHAdaptiveMeshDensity*> (_mesh_density_strategy)) {
-		// collect points
-		std::vector<GeoLib::Point const*> pnts;
-		const std::size_t n_pnts_polygon (_node_polygon->getNumberOfPoints());
-		for (std::size_t k(0); k<n_pnts_polygon; k++) {
-			pnts.push_back(_node_polygon->getPoint(k));
-		}
-		getPointsFromSubPolygons(pnts);
+    if (dynamic_cast<GMSHAdaptiveMeshDensity*> (_mesh_density_strategy)) {
+        // collect points
+        std::vector<GeoLib::Point const*> pnts;
+        const std::size_t n_pnts_polygon (_node_polygon->getNumberOfPoints());
+        for (std::size_t k(0); k<n_pnts_polygon; k++) {
+            pnts.push_back(_node_polygon->getPoint(k));
+        }
+        getPointsFromSubPolygons(pnts);
 
-		const std::size_t n_plys (_plys.size());
-		for (std::size_t k(0); k<n_plys; k++) {
-			const std::size_t n_pnts_in_kth_ply(_plys[k]->getNumberOfPoints());
-			for (std::size_t j(0); j<n_pnts_in_kth_ply; j++) {
-				pnts.push_back(_plys[k]->getPoint(j));
-			}
-		}
+        const std::size_t n_plys (_plys.size());
+        for (std::size_t k(0); k<n_plys; k++) {
+            const std::size_t n_pnts_in_kth_ply(_plys[k]->getNumberOfPoints());
+            for (std::size_t j(0); j<n_pnts_in_kth_ply; j++) {
+                pnts.push_back(_plys[k]->getPoint(j));
+            }
+        }
 
-		// give collected points to the mesh density strategy
-		_mesh_density_strategy->init(pnts);
-		// insert constraints
-		dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)->addPoints(_stations);
-		std::vector<GeoLib::Point const*> stations;
-		getStationsInsideSubPolygons(stations);
-		dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)->addPoints(stations);
-	}
+        // give collected points to the mesh density strategy
+        _mesh_density_strategy->init(pnts);
+        // insert constraints
+        dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)->addPoints(_stations);
+        std::vector<GeoLib::Point const*> stations;
+        getStationsInsideSubPolygons(stations);
+        dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)->addPoints(stations);
+    }
 }
 
 void GMSHPolygonTree::createGMSHPoints(std::vector<FileIO::GMSH::GMSHPoint*> & gmsh_pnts) const
 {
-	const std::size_t n_pnts_polygon (_node_polygon->getNumberOfPoints());
-	for (std::size_t k(0); k<n_pnts_polygon; k++) {
-		const std::size_t id (_node_polygon->getPointID(k));
-		GeoLib::Point const*const pnt(_node_polygon->getPoint(k));
-		gmsh_pnts[id] = new GMSHPoint(*pnt, id, _mesh_density_strategy->getMeshDensityAtPoint(pnt));
-	}
+    const std::size_t n_pnts_polygon (_node_polygon->getNumberOfPoints());
+    for (std::size_t k(0); k<n_pnts_polygon; k++) {
+        const std::size_t id (_node_polygon->getPointID(k));
+        GeoLib::Point const*const pnt(_node_polygon->getPoint(k));
+        gmsh_pnts[id] = new GMSHPoint(*pnt, id, _mesh_density_strategy->getMeshDensityAtPoint(pnt));
+    }
 
-	const std::size_t n_plys(_plys.size());
-	for (std::size_t k(0); k<n_plys; k++) {
-		const std::size_t n_pnts_in_ply(_plys[k]->getNumberOfPoints());
-		for (std::size_t j(0); j<n_pnts_in_ply; j++) {
-			if (_node_polygon->isPntInPolygon(*(_plys[k]->getPoint(j)))) {
-				const std::size_t id (_plys[k]->getPointID(j));
-				GeoLib::Point const*const pnt(_plys[k]->getPoint(j));
-				gmsh_pnts[id] = new GMSHPoint(*pnt, id, _mesh_density_strategy->getMeshDensityAtPoint(pnt));
-			}
-		}
-	}
+    const std::size_t n_plys(_plys.size());
+    for (std::size_t k(0); k<n_plys; k++) {
+        const std::size_t n_pnts_in_ply(_plys[k]->getNumberOfPoints());
+        for (std::size_t j(0); j<n_pnts_in_ply; j++) {
+            if (_node_polygon->isPntInPolygon(*(_plys[k]->getPoint(j)))) {
+                const std::size_t id (_plys[k]->getPointID(j));
+                GeoLib::Point const*const pnt(_plys[k]->getPoint(j));
+                gmsh_pnts[id] = new GMSHPoint(*pnt, id, _mesh_density_strategy->getMeshDensityAtPoint(pnt));
+            }
+        }
+    }
 
-	// walk through children
-	for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin()); it != _children.end(); ++it) {
-		dynamic_cast<GMSHPolygonTree*>((*it))->createGMSHPoints(gmsh_pnts);
-	}
+    // walk through children
+    for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin()); it != _children.end(); ++it) {
+        dynamic_cast<GMSHPolygonTree*>((*it))->createGMSHPoints(gmsh_pnts);
+    }
 }
 
 void GMSHPolygonTree::writeLineLoop(std::size_t &line_offset, std::size_t &sfc_offset, std::ostream& out) const
 {
-	const std::size_t n_pnts (_node_polygon->getNumberOfPoints());
-	std::size_t first_pnt_id(_node_polygon->getPointID(0)), second_pnt_id;
-	for (std::size_t k(1); k<n_pnts; k++) {
-		second_pnt_id = _node_polygon->getPointID(k);
-		out << "Line(" << line_offset + k-1 << ") = {" << first_pnt_id << "," << second_pnt_id << "};\n";
-		first_pnt_id = second_pnt_id;
-	}
-	out << "Line Loop(" << line_offset + n_pnts-1 << ") = {";
-	for (std::size_t k(0); k<n_pnts - 2; k++) {
-		out << line_offset+k << ",";
-	}
-	out << line_offset+n_pnts-2 << "};\n";
-	out << "Plane Surface(" << sfc_offset << ") = {" << line_offset+n_pnts-1 << "};\n";
-	line_offset += n_pnts;
-	sfc_offset++;
+    const std::size_t n_pnts (_node_polygon->getNumberOfPoints());
+    std::size_t first_pnt_id(_node_polygon->getPointID(0)), second_pnt_id;
+    for (std::size_t k(1); k<n_pnts; k++) {
+        second_pnt_id = _node_polygon->getPointID(k);
+        out << "Line(" << line_offset + k-1 << ") = {" << first_pnt_id << "," << second_pnt_id << "};\n";
+        first_pnt_id = second_pnt_id;
+    }
+    out << "Line Loop(" << line_offset + n_pnts-1 << ") = {";
+    for (std::size_t k(0); k<n_pnts - 2; k++) {
+        out << line_offset+k << ",";
+    }
+    out << line_offset+n_pnts-2 << "};\n";
+    out << "Plane Surface(" << sfc_offset << ") = {" << line_offset+n_pnts-1 << "};\n";
+    line_offset += n_pnts;
+    sfc_offset++;
 }
 
 void GMSHPolygonTree::writeLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const
 {
-	const std::size_t n_plys (_plys.size());
-	for (std::size_t j(0); j<n_plys; j++) {
-		const std::size_t n_pnts(_plys[j]->getNumberOfPoints());
-		std::size_t first_pnt_id(_plys[j]->getPointID(0)), second_pnt_id;
-		for (std::size_t k(1); k<n_pnts; k++) {
-			second_pnt_id = _plys[j]->getPointID(k);
-			if (_plys[j]->isSegmentMarked(k-1) && _node_polygon->isPntInPolygon(*(_plys[j]->getPoint(k)))) {
-				out << "Line(" << line_offset + k-1 << ") = {" << first_pnt_id << "," << second_pnt_id << "};\n";
-				out << "Line { " << line_offset+k-1 << " } In Surface { " << sfc_number << " };\n";
-			}
-			first_pnt_id = second_pnt_id;
-		}
-		line_offset += n_pnts;
-	}
+    const std::size_t n_plys (_plys.size());
+    for (std::size_t j(0); j<n_plys; j++) {
+        const std::size_t n_pnts(_plys[j]->getNumberOfPoints());
+        std::size_t first_pnt_id(_plys[j]->getPointID(0)), second_pnt_id;
+        for (std::size_t k(1); k<n_pnts; k++) {
+            second_pnt_id = _plys[j]->getPointID(k);
+            if (_plys[j]->isSegmentMarked(k-1) && _node_polygon->isPntInPolygon(*(_plys[j]->getPoint(k)))) {
+                out << "Line(" << line_offset + k-1 << ") = {" << first_pnt_id << "," << second_pnt_id << "};\n";
+                out << "Line { " << line_offset+k-1 << " } In Surface { " << sfc_number << " };\n";
+            }
+            first_pnt_id = second_pnt_id;
+        }
+        line_offset += n_pnts;
+    }
 }
 
 void GMSHPolygonTree::writeSubPolygonsAsLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const
 {
-	for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin()); it != _children.end(); ++it) {
-		dynamic_cast<GMSHPolygonTree*>((*it))->writeSubPolygonsAsLineConstraints(line_offset, sfc_number, out);
-	}
+    for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin()); it != _children.end(); ++it) {
+        dynamic_cast<GMSHPolygonTree*>((*it))->writeSubPolygonsAsLineConstraints(line_offset, sfc_number, out);
+    }
 
-	if (_parent != NULL) {
-		const std::size_t n_pnts(_node_polygon->getNumberOfPoints());
-		std::size_t first_pnt_id(_node_polygon->getPointID(0)), second_pnt_id;
-		for (std::size_t k(1); k<n_pnts; k++) {
-			second_pnt_id = _node_polygon->getPointID(k);
-			out << "Line(" << line_offset + k-1 << ") = {" << first_pnt_id << "," << second_pnt_id << "};\n";
-			first_pnt_id = second_pnt_id;
-			out << "Line { " << line_offset+k-1 << " } In Surface { " << sfc_number << " };\n";
-		}
-		line_offset += n_pnts;
-	}
+    if (_parent != NULL) {
+        const std::size_t n_pnts(_node_polygon->getNumberOfPoints());
+        std::size_t first_pnt_id(_node_polygon->getPointID(0)), second_pnt_id;
+        for (std::size_t k(1); k<n_pnts; k++) {
+            second_pnt_id = _node_polygon->getPointID(k);
+            out << "Line(" << line_offset + k-1 << ") = {" << first_pnt_id << "," << second_pnt_id << "};\n";
+            first_pnt_id = second_pnt_id;
+            out << "Line { " << line_offset+k-1 << " } In Surface { " << sfc_number << " };\n";
+        }
+        line_offset += n_pnts;
+    }
 
 }
 
 void GMSHPolygonTree::writeStations(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const
 {
-	for (auto const* station : _stations) {
-		out << "Point(" << pnt_id_offset << ") = {" << (*station)[0] << ", "
-		    << (*station)[1] << ", 0.0, "
-		    << _mesh_density_strategy->getMeshDensityAtStation(station)
-		    << "}; // Station "
-		    << static_cast<GeoLib::Station const*>(station)->getName() << " \n";
-		out << "Point { " << pnt_id_offset << " } In Surface { " << sfc_number << " };\n";
-		++pnt_id_offset;
-	}
+    for (auto const* station : _stations) {
+        out << "Point(" << pnt_id_offset << ") = {" << (*station)[0] << ", "
+            << (*station)[1] << ", 0.0, "
+            << _mesh_density_strategy->getMeshDensityAtStation(station)
+            << "}; // Station "
+            << static_cast<GeoLib::Station const*>(station)->getName() << " \n";
+        out << "Point { " << pnt_id_offset << " } In Surface { " << sfc_number << " };\n";
+        ++pnt_id_offset;
+    }
 }
 
 void GMSHPolygonTree::writeAdditionalPointData(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const
 {
-	if (dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)) {
-		std::vector<GeoLib::Point*> steiner_pnts;
-		dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)->getSteinerPoints(steiner_pnts, 0);
-		const std::size_t n(steiner_pnts.size());
-		for (std::size_t k(0); k<n; k++) {
-			if (_node_polygon->isPntInPolygon(*(steiner_pnts[k]))) {
-				out << "Point(" << pnt_id_offset + k << ") = {" << (*(steiner_pnts[k]))[0] << "," << (*(steiner_pnts[k]))[1] << ", 0.0, ";
-				out << _mesh_density_strategy->getMeshDensityAtPoint(steiner_pnts[k]) << "};\n";
-				out << "Point { " << pnt_id_offset + k << " } In Surface { " << sfc_number << " };\n";
-			}
-			delete steiner_pnts[k];
-		}
-		pnt_id_offset += n;
-	}
+    if (dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)) {
+        std::vector<GeoLib::Point*> steiner_pnts;
+        dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)->getSteinerPoints(steiner_pnts, 0);
+        const std::size_t n(steiner_pnts.size());
+        for (std::size_t k(0); k<n; k++) {
+            if (_node_polygon->isPntInPolygon(*(steiner_pnts[k]))) {
+                out << "Point(" << pnt_id_offset + k << ") = {" << (*(steiner_pnts[k]))[0] << "," << (*(steiner_pnts[k]))[1] << ", 0.0, ";
+                out << _mesh_density_strategy->getMeshDensityAtPoint(steiner_pnts[k]) << "};\n";
+                out << "Point { " << pnt_id_offset + k << " } In Surface { " << sfc_number << " };\n";
+            }
+            delete steiner_pnts[k];
+        }
+        pnt_id_offset += n;
+    }
 
 #ifndef NDEBUG
-	if (dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)) {
-		auto pnts = std::unique_ptr<std::vector<GeoLib::Point*>>(
-		    new std::vector<GeoLib::Point*>);
-		auto plys = std::unique_ptr<std::vector<GeoLib::Polyline*>>(
-		    new std::vector<GeoLib::Polyline*>);
-		dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)->getQuadTreeGeometry(*pnts, *plys);
-		std::string quad_tree_geo("QuadTree");
-		_geo_objs.addPointVec(std::move(pnts), quad_tree_geo);
-		std::vector<std::size_t> const& id_map ((_geo_objs.getPointVecObj(quad_tree_geo))->getIDMap());
-		for (std::size_t k(0); k<plys->size(); k++) {
-			for (std::size_t j(0); j<(*plys)[k]->getNumberOfPoints(); j++) {
-				((*plys)[k])->setPointID(j, id_map[((*plys)[k])->getPointID(j)]);
-			}
-		}
-		_geo_objs.addPolylineVec(std::move(plys), quad_tree_geo);
-	}
+    if (dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)) {
+        auto pnts = std::unique_ptr<std::vector<GeoLib::Point*>>(
+            new std::vector<GeoLib::Point*>);
+        auto plys = std::unique_ptr<std::vector<GeoLib::Polyline*>>(
+            new std::vector<GeoLib::Polyline*>);
+        dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)->getQuadTreeGeometry(*pnts, *plys);
+        std::string quad_tree_geo("QuadTree");
+        _geo_objs.addPointVec(std::move(pnts), quad_tree_geo);
+        std::vector<std::size_t> const& id_map ((_geo_objs.getPointVecObj(quad_tree_geo))->getIDMap());
+        for (std::size_t k(0); k<plys->size(); k++) {
+            for (std::size_t j(0); j<(*plys)[k]->getNumberOfPoints(); j++) {
+                ((*plys)[k])->setPointID(j, id_map[((*plys)[k])->getPointID(j)]);
+            }
+        }
+        _geo_objs.addPolylineVec(std::move(plys), quad_tree_geo);
+    }
 #endif
 
 }
 
 void GMSHPolygonTree::getPointsFromSubPolygons(std::vector<GeoLib::Point const*>& pnts)
 {
-	const std::size_t n_pnts_polygon (_node_polygon->getNumberOfPoints());
-	for (std::size_t k(0); k<n_pnts_polygon; k++) {
-		pnts.push_back(_node_polygon->getPoint(k));
-	}
+    const std::size_t n_pnts_polygon (_node_polygon->getNumberOfPoints());
+    for (std::size_t k(0); k<n_pnts_polygon; k++) {
+        pnts.push_back(_node_polygon->getPoint(k));
+    }
 
-	for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin()); it != _children.end(); ++it) {
-		dynamic_cast<GMSHPolygonTree*>((*it))->getPointsFromSubPolygons(pnts);
-	}
+    for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin()); it != _children.end(); ++it) {
+        dynamic_cast<GMSHPolygonTree*>((*it))->getPointsFromSubPolygons(pnts);
+    }
 }
 
 void GMSHPolygonTree::getStationsInsideSubPolygons(std::vector<GeoLib::Point const*>& stations)
 {
-	const std::size_t n_stations(_stations.size());
-	for (std::size_t k(0); k<n_stations; k++) {
-		stations.push_back(_stations[k]);
-	}
+    const std::size_t n_stations(_stations.size());
+    for (std::size_t k(0); k<n_stations; k++) {
+        stations.push_back(_stations[k]);
+    }
 
-	for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin()); it != _children.end(); ++it) {
-		dynamic_cast<GMSHPolygonTree*>((*it))->getStationsInsideSubPolygons(stations);
-	}
+    for (std::list<SimplePolygonTree*>::const_iterator it (_children.begin()); it != _children.end(); ++it) {
+        dynamic_cast<GMSHPolygonTree*>((*it))->getStationsInsideSubPolygons(stations);
+    }
 }
 
 }
diff --git a/FileIO/GmshIO/GMSHPolygonTree.h b/FileIO/GmshIO/GMSHPolygonTree.h
index bc33d49bafe260d37daa0258cef78d594d9f08c3..b66d3a54e1bb2f0b26065a3dc445232aaadc5873 100644
--- a/FileIO/GmshIO/GMSHPolygonTree.h
+++ b/FileIO/GmshIO/GMSHPolygonTree.h
@@ -37,63 +37,63 @@ namespace GMSH {
 
 class GMSHPolygonTree: public GeoLib::SimplePolygonTree {
 public:
-	GMSHPolygonTree(GeoLib::Polygon* polygon, GMSHPolygonTree * parent,
-					GeoLib::GEOObjects &geo_objs, std::string const& geo_name,
-					GMSHMeshDensityStrategy * mesh_density_strategy);
-	virtual ~GMSHPolygonTree();
-
-	/**
-	 * If the station point is inside the polygon, the method inserts the station into
-	 * the internal vector of stations. This method works recursive!
-	 * @param pnt the station point
-	 * @return true if the station is inside the polygon
-	 */
-	bool insertStation(GeoLib::Point const* pnt);
-	/**
-	 * If at least one (end) point (of a line segment) of the polyline is inside the polygon
-	 * the polyline is inserted to the internal vector of polylines.
-	 *
-	 * Intersection points are inserted into the points vector the polygon and the polyline
-	 * are based on. The id of the intersection point is inserted in both the polygon and the
-	 * polyline, i.e. the two intersecting line segments are splitt into four line segment.
-	 *
-	 * Line segments of the polyline that are completely within the polygon are inserted into
-	 * the internal vector _gmsh_lines_for_constraints. The children of this GMSHPolygonTree node
-	 * are checked recursively.
-	 * @param ply the polyline that should be inserted
-	 */
-	void insertPolyline(GeoLib::PolylineWithSegmentMarker * ply);
-
-	/**
-	 * Initialize the mesh density strategy with data. In case of GMSHAdaptiveMeshDensity
-	 * an instance of class QuadTree will be set up with the points within the top
-	 * level bounding polygon.
-	 */
-	void initMeshDensityStrategy();
-
-	/**
-	 * Method creates the gmsh point data structures - including the mesh density.
-	 * @param gmsh_pnts a vector of pointers to instances of class GMSHPoint
-	 */
-	void createGMSHPoints(std::vector<FileIO::GMSH::GMSHPoint*> & gmsh_pnts) const;
-
-	virtual void writeLineLoop(std::size_t &line_offset, std::size_t &sfc_offset, std::ostream& out) const;
-	void writeSubPolygonsAsLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const;
-	virtual void writeLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const;
-	void writeStations(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const;
-	void writeAdditionalPointData(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const;
+    GMSHPolygonTree(GeoLib::Polygon* polygon, GMSHPolygonTree * parent,
+                    GeoLib::GEOObjects &geo_objs, std::string const& geo_name,
+                    GMSHMeshDensityStrategy * mesh_density_strategy);
+    virtual ~GMSHPolygonTree();
+
+    /**
+     * If the station point is inside the polygon, the method inserts the station into
+     * the internal vector of stations. This method works recursive!
+     * @param pnt the station point
+     * @return true if the station is inside the polygon
+     */
+    bool insertStation(GeoLib::Point const* pnt);
+    /**
+     * If at least one (end) point (of a line segment) of the polyline is inside the polygon
+     * the polyline is inserted to the internal vector of polylines.
+     *
+     * Intersection points are inserted into the points vector the polygon and the polyline
+     * are based on. The id of the intersection point is inserted in both the polygon and the
+     * polyline, i.e. the two intersecting line segments are splitt into four line segment.
+     *
+     * Line segments of the polyline that are completely within the polygon are inserted into
+     * the internal vector _gmsh_lines_for_constraints. The children of this GMSHPolygonTree node
+     * are checked recursively.
+     * @param ply the polyline that should be inserted
+     */
+    void insertPolyline(GeoLib::PolylineWithSegmentMarker * ply);
+
+    /**
+     * Initialize the mesh density strategy with data. In case of GMSHAdaptiveMeshDensity
+     * an instance of class QuadTree will be set up with the points within the top
+     * level bounding polygon.
+     */
+    void initMeshDensityStrategy();
+
+    /**
+     * Method creates the gmsh point data structures - including the mesh density.
+     * @param gmsh_pnts a vector of pointers to instances of class GMSHPoint
+     */
+    void createGMSHPoints(std::vector<FileIO::GMSH::GMSHPoint*> & gmsh_pnts) const;
+
+    virtual void writeLineLoop(std::size_t &line_offset, std::size_t &sfc_offset, std::ostream& out) const;
+    void writeSubPolygonsAsLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const;
+    virtual void writeLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const;
+    void writeStations(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const;
+    void writeAdditionalPointData(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const;
 
 private:
-	void getPointsFromSubPolygons(std::vector<GeoLib::Point const*>& pnts);
-	void getStationsInsideSubPolygons(std::vector<GeoLib::Point const*>& stations);
+    void getPointsFromSubPolygons(std::vector<GeoLib::Point const*>& pnts);
+    void getStationsInsideSubPolygons(std::vector<GeoLib::Point const*>& stations);
 
-	GeoLib::GEOObjects & _geo_objs;
-	std::string const& _geo_name;
-	std::vector<GeoLib::Point const*> _stations;
-	std::vector<GeoLib::PolylineWithSegmentMarker*> _plys;
-	std::vector<FileIO::GMSH::GMSHLine*> _gmsh_lines_for_constraints;
+    GeoLib::GEOObjects & _geo_objs;
+    std::string const& _geo_name;
+    std::vector<GeoLib::Point const*> _stations;
+    std::vector<GeoLib::PolylineWithSegmentMarker*> _plys;
+    std::vector<FileIO::GMSH::GMSHLine*> _gmsh_lines_for_constraints;
 
-	GMSHMeshDensityStrategy * _mesh_density_strategy;
+    GMSHMeshDensityStrategy * _mesh_density_strategy;
 };
 
 }
diff --git a/FileIO/ImportFileTypes.h b/FileIO/ImportFileTypes.h
index 37a88ce8cf0693323c38eaab1c7a5b2c4eb663f8..96479f7362fba9bd29b6e5497bd36ef8fd3a0835 100644
--- a/FileIO/ImportFileTypes.h
+++ b/FileIO/ImportFileTypes.h
@@ -24,70 +24,70 @@ class ImportFileType
 {
 public:
 
-	enum type {
-		OGS = 0,
-		OGS_GEO,
-		OGS_STN,
-		OGS_MSH,
-		FEFLOW,
-		GMS,
-		GMSH,
-		NETCDF,
-		PETREL,
-		POLYRASTER,
-		RASTER,
-		SHAPE,
-		TETGEN,
-		VTK
-	};
+    enum type {
+        OGS = 0,
+        OGS_GEO,
+        OGS_STN,
+        OGS_MSH,
+        FEFLOW,
+        GMS,
+        GMSH,
+        NETCDF,
+        PETREL,
+        POLYRASTER,
+        RASTER,
+        SHAPE,
+        TETGEN,
+        VTK
+    };
 
-	static std::string convertImportFileTypeToString(ImportFileType::type t)
-	{
-		if (t==ImportFileType::FEFLOW) return "FEFLOW";
-		else if (t==ImportFileType::GMS) return "GMS";
-		else if (t==ImportFileType::GMSH) return "GMSH";
-		else if (t==ImportFileType::NETCDF) return "NetCDF";
-		else if (t==ImportFileType::OGS) return "OGS";
-		else if (t==ImportFileType::OGS_GEO) return "OGS geometry";
-		else if (t==ImportFileType::OGS_STN) return "OGS station list";
-		else if (t==ImportFileType::OGS_MSH) return "OGS mesh";
-		else if (t==ImportFileType::PETREL) return "Petrel";
-		else if((t==ImportFileType::RASTER) || (t==ImportFileType::POLYRASTER)) return "Raster";
-		else if (t==ImportFileType::SHAPE) return "Shape";
-		else if (t==ImportFileType::TETGEN) return "TetGen node";
-		else if (t==ImportFileType::VTK) return "VTK";
-		else return "";
-	}
+    static std::string convertImportFileTypeToString(ImportFileType::type t)
+    {
+        if (t==ImportFileType::FEFLOW) return "FEFLOW";
+        else if (t==ImportFileType::GMS) return "GMS";
+        else if (t==ImportFileType::GMSH) return "GMSH";
+        else if (t==ImportFileType::NETCDF) return "NetCDF";
+        else if (t==ImportFileType::OGS) return "OGS";
+        else if (t==ImportFileType::OGS_GEO) return "OGS geometry";
+        else if (t==ImportFileType::OGS_STN) return "OGS station list";
+        else if (t==ImportFileType::OGS_MSH) return "OGS mesh";
+        else if (t==ImportFileType::PETREL) return "Petrel";
+        else if((t==ImportFileType::RASTER) || (t==ImportFileType::POLYRASTER)) return "Raster";
+        else if (t==ImportFileType::SHAPE) return "Shape";
+        else if (t==ImportFileType::TETGEN) return "TetGen node";
+        else if (t==ImportFileType::VTK) return "VTK";
+        else return "";
+    }
 
-	static std::string getFileSuffixString(ImportFileType::type t)
-	{
-		if (t==ImportFileType::FEFLOW)
-			return "FEFLOW files (*.fem)";
-		else if (t==ImportFileType::GMS)
-			return "GMS files (*.txt *.3dm)";
-		else if (t==ImportFileType::GMSH)
-			return "GMSH mesh files (*.msh)";
-		else if (t==ImportFileType::NETCDF)
-			return "NetCDF files (*.nc)";
-		else if (t==ImportFileType::OGS)
-			return "OpenGeosys files (*.gsp *.gml *.vtu *.stn);;GeoSys legacy files (*.gli *.msh);;All files (* *.*)";
-		else if (t==ImportFileType::OGS_GEO)
-			return "OpenGeosys files (*.gml *.gli)";
-		else if (t==ImportFileType::OGS_STN)
-			return "OpenGeosys files (*.stn)";
-		else if (t==ImportFileType::OGS_MSH)
-			return "OpenGeosys files (*.vtu *.msh)";
-		else if (t==ImportFileType::PETREL)
-			return "Petrel files (*)";
-		else if (t==ImportFileType::RASTER)
-			return "Raster files (*.asc *.grd *.bmp *.jpg *.png *.tif)";
-		else if (t==ImportFileType::SHAPE)
-			return "ESRI Shape files (*.shp)";
-		else if (t==ImportFileType::TETGEN)
-			return "TetGen node files (*.node *.poly *.smesh)";
-		else if (t==ImportFileType::VTK)
-			return "VTK files (*.vtk *.vti *.vtr *.vts *.vtp *.vtu)";
-		else return "All files (*.*)";
+    static std::string getFileSuffixString(ImportFileType::type t)
+    {
+        if (t==ImportFileType::FEFLOW)
+            return "FEFLOW files (*.fem)";
+        else if (t==ImportFileType::GMS)
+            return "GMS files (*.txt *.3dm)";
+        else if (t==ImportFileType::GMSH)
+            return "GMSH mesh files (*.msh)";
+        else if (t==ImportFileType::NETCDF)
+            return "NetCDF files (*.nc)";
+        else if (t==ImportFileType::OGS)
+            return "OpenGeosys files (*.gsp *.gml *.vtu *.stn);;GeoSys legacy files (*.gli *.msh);;All files (* *.*)";
+        else if (t==ImportFileType::OGS_GEO)
+            return "OpenGeosys files (*.gml *.gli)";
+        else if (t==ImportFileType::OGS_STN)
+            return "OpenGeosys files (*.stn)";
+        else if (t==ImportFileType::OGS_MSH)
+            return "OpenGeosys files (*.vtu *.msh)";
+        else if (t==ImportFileType::PETREL)
+            return "Petrel files (*)";
+        else if (t==ImportFileType::RASTER)
+            return "Raster files (*.asc *.grd *.bmp *.jpg *.png *.tif)";
+        else if (t==ImportFileType::SHAPE)
+            return "ESRI Shape files (*.shp)";
+        else if (t==ImportFileType::TETGEN)
+            return "TetGen node files (*.node *.poly *.smesh)";
+        else if (t==ImportFileType::VTK)
+            return "VTK files (*.vtk *.vti *.vtr *.vts *.vtp *.vtu)";
+        else return "All files (*.*)";
 }
 
 };
diff --git a/FileIO/OpenGeoSysCND.xsd b/FileIO/OpenGeoSysCND.xsd
index f7c00c2fd4163e883e1432d1d569377555be6a4a..074100087e2144bb579e8c1db6f4cedb44a13f65 100644
--- a/FileIO/OpenGeoSysCND.xsd
+++ b/FileIO/OpenGeoSysCND.xsd
@@ -18,14 +18,14 @@
           <xs:all>
             <xs:element name="Type" maxOccurs="1" >
               <xs:simpleType>
-	        <xs:restriction base="xs:string">
-	          <xs:enumeration value="POINT"/>
-	          <xs:enumeration value="POLYLINE"/>
-	          <xs:enumeration value="SURFACE"/>
-	          <xs:enumeration value="VOLUME"/>
-	          <xs:enumeration value="DOMAIN"/>
-	          <xs:enumeration value="INVALID"/>
-	        </xs:restriction>
+            <xs:restriction base="xs:string">
+              <xs:enumeration value="POINT"/>
+              <xs:enumeration value="POLYLINE"/>
+              <xs:enumeration value="SURFACE"/>
+              <xs:enumeration value="VOLUME"/>
+              <xs:enumeration value="DOMAIN"/>
+              <xs:enumeration value="INVALID"/>
+            </xs:restriction>
               </xs:simpleType>
             </xs:element>
             <xs:element name="Name" type="xs:string" maxOccurs="1" />
@@ -50,7 +50,7 @@
     <xs:complexContent>
       <xs:extension base="CondType">
         <xs:sequence>
-          <xs:element name="FunctionType" type="xs:string"  minOccurs="0" maxOccurs="1"/>	 <!-- is optional -->
+          <xs:element name="FunctionType" type="xs:string"  minOccurs="0" maxOccurs="1"/>     <!-- is optional -->
           <xs:element name="TimeType" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1"/> <!-- is optional -->
         </xs:sequence>
       </xs:extension>
@@ -62,10 +62,10 @@
   <xs:element name="OpenGeoSysCond">
     <xs:complexType>
       <xs:sequence>
-	<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1" />
+    <xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1" />
 
         <!-- definition of initial conditions -->
-	<xs:element name="InitialConditions" minOccurs="0" maxOccurs="1">
+    <xs:element name="InitialConditions" minOccurs="0" maxOccurs="1">
           <xs:complexType>
             <xs:sequence>
               <xs:element name="IC" type="CondType" maxOccurs="unbounded" />
@@ -94,5 +94,5 @@
       </xs:sequence>
     </xs:complexType>
   </xs:element>
-	
+    
 </xs:schema>
diff --git a/FileIO/OpenGeoSysGLI.xsd b/FileIO/OpenGeoSysGLI.xsd
index 408ba353d90a3eed4e6c29e6c1297489cf14c12e..b4937b83ab43027cbce15899567d3dc27925d43e 100644
--- a/FileIO/OpenGeoSysGLI.xsd
+++ b/FileIO/OpenGeoSysGLI.xsd
@@ -51,10 +51,10 @@
   <xs:element name="OpenGeoSysGLI">
     <xs:complexType>
       <xs:sequence>
-	<xs:element name="name" type="xs:string" maxOccurs="1" />
+    <xs:element name="name" type="xs:string" maxOccurs="1" />
 
         <!-- definition of points -->
-	<xs:element name="points" maxOccurs="1">
+    <xs:element name="points" maxOccurs="1">
           <xs:complexType>
             <xs:sequence>
               <xs:element name="point" type="pointType" maxOccurs="unbounded" />
@@ -92,5 +92,5 @@
       </xs:sequence>
     </xs:complexType>
   </xs:element>
-	
+    
 </xs:schema>
diff --git a/FileIO/OpenGeoSysNum.xsd b/FileIO/OpenGeoSysNum.xsd
index f68adf3607f98f2b28b9d969fbb9d7d3f160167f..f1436d7c8a924b37fd2ca572d19f54b018b4eb19 100644
--- a/FileIO/OpenGeoSysNum.xsd
+++ b/FileIO/OpenGeoSysNum.xsd
@@ -25,7 +25,7 @@
         <xs:element name="Type" type="NonLinearType" maxOccurs="1" />
 
         <!-- definition of linear solver -->
-	<xs:element name="LinearSolver" maxOccurs="1">
+    <xs:element name="LinearSolver" maxOccurs="1">
           <xs:complexType>
             <xs:sequence>
               <xs:element name="Type" type="xs:string" maxOccurs="1" />
@@ -49,7 +49,7 @@
         
         <!-- definition of convergence criteria -->
         <xs:element name="Convergence" minOccurs="0" maxOccurs="1">
-	  <xs:complexType>
+      <xs:complexType>
             <xs:sequence>
               <xs:element name="Method" type="xs:string" minOccurs="0" maxOccurs="1" />
               <xs:element name="ErrorThreshold" type="xs:double" minOccurs="0" maxOccurs="1" />
@@ -61,5 +61,5 @@
       </xs:sequence>
     </xs:complexType>
   </xs:element>
-	
+    
 </xs:schema>
diff --git a/FileIO/OpenGeoSysProject.xsd b/FileIO/OpenGeoSysProject.xsd
index d7316b71471f5ac55885e2509a3ffa3e336a9d2f..a44745ae80dcd14c37e599fcd61086f499cbed71 100644
--- a/FileIO/OpenGeoSysProject.xsd
+++ b/FileIO/OpenGeoSysProject.xsd
@@ -6,7 +6,7 @@
   <!-- object containing just a source file definition -->
   <xs:complexType name="projectElement">
     <xs:sequence>
-	<xs:element name="file" type="xs:string" minOccurs="1" maxOccurs="1" />
+    <xs:element name="file" type="xs:string" minOccurs="1" maxOccurs="1" />
     </xs:sequence>
   </xs:complexType>
 
@@ -40,17 +40,17 @@
       <xs:sequence>
         <xs:element name="geo" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
         <xs:element name="msh" type="mshElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="cnd" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="mfp" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="mmp" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="msp" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="np"  type="projectElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="out" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="pcs" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="sim" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="tim" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="fct" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
-	<xs:element name="stn" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="cnd" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="mfp" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="mmp" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="msp" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="np"  type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="out" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="pcs" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="sim" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="tim" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="fct" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
+    <xs:element name="stn" type="projectElement" minOccurs="0" maxOccurs="unbounded" />
       </xs:sequence>
     </xs:complexType>  
   </xs:element> 
diff --git a/FileIO/OpenGeoSysSTN.xsd b/FileIO/OpenGeoSysSTN.xsd
index c8399ad540a28c8f84eec61da1734668938cb1fa..2d839edfa3f57aa068c8aea65e8a7139b3d44e1d 100644
--- a/FileIO/OpenGeoSysSTN.xsd
+++ b/FileIO/OpenGeoSysSTN.xsd
@@ -19,8 +19,8 @@
   <xs:complexType name="stationType">
     <xs:sequence>
       <xs:element ref="name" />
-      <xs:element ref="value"  minOccurs="0" />				<!-- value is optional -->
-      <xs:element name="sensordata" minOccurs="0" />			<!-- time series data (optional) -->
+      <xs:element ref="value"  minOccurs="0" />                <!-- value is optional -->
+      <xs:element name="sensordata" minOccurs="0" />            <!-- time series data (optional) -->
       <!-- other station features can be inserted here -->
     </xs:sequence>
     <xs:attribute ref="id" use="required" />
@@ -36,8 +36,8 @@
       <xs:extension base="stationType">
         <xs:sequence>
           <xs:element name="bdepth" type="xs:decimal" />
-          <xs:element name="bdate" type="xs:date" minOccurs="0" />	<!-- date is optional -->
-          <xs:element name="strat" type="stratType" minOccurs="0" />	<!-- stratigraphy is optional, e.g. wells have none -->
+          <xs:element name="bdate" type="xs:date" minOccurs="0" />    <!-- date is optional -->
+          <xs:element name="strat" type="stratType" minOccurs="0" />    <!-- stratigraphy is optional, e.g. wells have none -->
           <!-- other borehole features can be inserted here -->
         </xs:sequence>
       </xs:extension>
@@ -100,7 +100,7 @@
           <xs:complexType>
             <xs:sequence>
               <xs:element ref="name" />
-              <xs:element name="type" type="xs:string" minOccurs="0" />		<!-- type is optional -->
+              <xs:element name="type" type="xs:string" minOccurs="0" />        <!-- type is optional -->
               <xs:group ref="stationSelection" />
               <!-- other list features can be inserted here -->
             </xs:sequence>
diff --git a/FileIO/PetrelInterface.cpp b/FileIO/PetrelInterface.cpp
index 548b493f7bbd6ae4a18a78ac9e1b987c1ce0bfa2..6bea9a22d79727ab13df58a62c2096d2444bd147 100644
--- a/FileIO/PetrelInterface.cpp
+++ b/FileIO/PetrelInterface.cpp
@@ -30,51 +30,51 @@ namespace FileIO
 PetrelInterface::PetrelInterface(std::list<std::string> &sfc_fnames,
                                  std::list<std::string> &well_path_fnames,
                                  std::string &unique_model_name, GeoLib::GEOObjects* geo_obj) :
-	_unique_name(unique_model_name), pnt_vec(new std::vector<GeoLib::Point*>),
-	well_vec(new std::vector<GeoLib::Point*>), ply_vec(new std::vector<GeoLib::Polyline*>)
+    _unique_name(unique_model_name), pnt_vec(new std::vector<GeoLib::Point*>),
+    well_vec(new std::vector<GeoLib::Point*>), ply_vec(new std::vector<GeoLib::Polyline*>)
 {
-	for (std::list<std::string>::const_iterator it(sfc_fnames.begin()); it
-	     != sfc_fnames.end(); ++it)
-	{
-		INFO("PetrelInterface::PetrelInterface(): open surface file.");
-		std::ifstream in((*it).c_str());
-		if (in)
-		{
-			INFO("PetrelInterface::PetrelInterface(): \tdone.");
-			readPetrelSurface(in);
-			in.close();
-		}
-		else
-			WARN("PetrelInterface::PetrelInterface(): \tCould not open file %s.",
-			     it->c_str());
-	}
-
-	for (std::list<std::string>::const_iterator it(well_path_fnames.begin()); it
-	     != well_path_fnames.end(); ++it)
-	{
-		INFO("PetrelInterface::PetrelInterface(): open well path file.");
-		std::ifstream in((*it).c_str());
-		if (in)
-		{
-			INFO("PetrelInterface::PetrelInterface(): \tdone.");
-			readPetrelWellTrace(in);
-			in.close();
-		}
-		else
-			WARN("PetrelInterface::PetrelInterface(): \tCould not open well path file %s.", it->c_str());
-	}
-
-	// store data in GEOObject
-	geo_obj->addPointVec(std::unique_ptr<std::vector<GeoLib::Point*>>(pnt_vec),
-	                     _unique_name);
-	if (well_vec->size() > 0)
-		geo_obj->addStationVec(
-		    std::unique_ptr<std::vector<GeoLib::Point*>>(well_vec),
-		    _unique_name);
-	if (ply_vec->size() > 0)
-		geo_obj->addPolylineVec(
-		    std::unique_ptr<std::vector<GeoLib::Polyline*>>(ply_vec),
-		    _unique_name);
+    for (std::list<std::string>::const_iterator it(sfc_fnames.begin()); it
+         != sfc_fnames.end(); ++it)
+    {
+        INFO("PetrelInterface::PetrelInterface(): open surface file.");
+        std::ifstream in((*it).c_str());
+        if (in)
+        {
+            INFO("PetrelInterface::PetrelInterface(): \tdone.");
+            readPetrelSurface(in);
+            in.close();
+        }
+        else
+            WARN("PetrelInterface::PetrelInterface(): \tCould not open file %s.",
+                 it->c_str());
+    }
+
+    for (std::list<std::string>::const_iterator it(well_path_fnames.begin()); it
+         != well_path_fnames.end(); ++it)
+    {
+        INFO("PetrelInterface::PetrelInterface(): open well path file.");
+        std::ifstream in((*it).c_str());
+        if (in)
+        {
+            INFO("PetrelInterface::PetrelInterface(): \tdone.");
+            readPetrelWellTrace(in);
+            in.close();
+        }
+        else
+            WARN("PetrelInterface::PetrelInterface(): \tCould not open well path file %s.", it->c_str());
+    }
+
+    // store data in GEOObject
+    geo_obj->addPointVec(std::unique_ptr<std::vector<GeoLib::Point*>>(pnt_vec),
+                         _unique_name);
+    if (well_vec->size() > 0)
+        geo_obj->addStationVec(
+            std::unique_ptr<std::vector<GeoLib::Point*>>(well_vec),
+            _unique_name);
+    if (ply_vec->size() > 0)
+        geo_obj->addPolylineVec(
+            std::unique_ptr<std::vector<GeoLib::Polyline*>>(ply_vec),
+            _unique_name);
 }
 
 PetrelInterface::~PetrelInterface()
@@ -82,161 +82,161 @@ PetrelInterface::~PetrelInterface()
 
 void PetrelInterface::readPetrelSurface(std::istream &in)
 {
-	char buffer[MAX_COLS_PER_ROW];
-	in.getline(buffer, MAX_COLS_PER_ROW);
-	std::string line(buffer);
-
-	if (line.find("# Petrel Points with attributes") != std::string::npos)
-	{
-		// read header
-		// read Version string
-		in.getline(buffer, MAX_COLS_PER_ROW);
-		line = buffer;
-		// read string BEGIN HEADER
-		in.getline(buffer, MAX_COLS_PER_ROW);
-		line = buffer;
-
-		in.getline(buffer, MAX_COLS_PER_ROW);
-		line = buffer;
-		while (line.find("END HEADER") == std::string::npos)
-		{
-			in.getline(buffer, MAX_COLS_PER_ROW);
-			line = buffer;
-		}
-
-		// read points
-		std::size_t idx(pnt_vec->size());
-		while (in)
-		{
-			pnt_vec->push_back(new GeoLib::Point);
-			in >> *((*pnt_vec)[idx]);
-			if (!in)
-			{
-				delete (*pnt_vec)[idx];
-				pnt_vec->pop_back();
-			}
-			else
-				idx++;
-		}
-	} else
-		WARN("PetrelInterface::readPetrelSurface(): problem reading petrel points from line\n\"%s\".",
-						line.c_str());
+    char buffer[MAX_COLS_PER_ROW];
+    in.getline(buffer, MAX_COLS_PER_ROW);
+    std::string line(buffer);
+
+    if (line.find("# Petrel Points with attributes") != std::string::npos)
+    {
+        // read header
+        // read Version string
+        in.getline(buffer, MAX_COLS_PER_ROW);
+        line = buffer;
+        // read string BEGIN HEADER
+        in.getline(buffer, MAX_COLS_PER_ROW);
+        line = buffer;
+
+        in.getline(buffer, MAX_COLS_PER_ROW);
+        line = buffer;
+        while (line.find("END HEADER") == std::string::npos)
+        {
+            in.getline(buffer, MAX_COLS_PER_ROW);
+            line = buffer;
+        }
+
+        // read points
+        std::size_t idx(pnt_vec->size());
+        while (in)
+        {
+            pnt_vec->push_back(new GeoLib::Point);
+            in >> *((*pnt_vec)[idx]);
+            if (!in)
+            {
+                delete (*pnt_vec)[idx];
+                pnt_vec->pop_back();
+            }
+            else
+                idx++;
+        }
+    } else
+        WARN("PetrelInterface::readPetrelSurface(): problem reading petrel points from line\n\"%s\".",
+                        line.c_str());
 }
 
 void PetrelInterface::readPetrelWellTrace(std::istream &in)
 {
-	char buffer[MAX_COLS_PER_ROW];
-	in.getline(buffer, MAX_COLS_PER_ROW);
-	std::string line(buffer);
-
-	if (line.find("# WELL TRACE FROM PETREL") != std::string::npos)
-	{
-		// read header
-		// read well name
-		in.getline(buffer, MAX_COLS_PER_ROW);
-		line = buffer;
-		std::list<std::string> str_list(BaseLib::splitString(line, ' '));
-		std::list<std::string>::const_iterator it(str_list.begin());
-		while (it != str_list.end()) {
-			INFO("PetrelInterface::readPetrelWellTrace(): well name: %s.", it->c_str());
-			++it;
-		}
-
-		// read well head x coordinate
-		in.getline(buffer, MAX_COLS_PER_ROW);
-		line = buffer;
-		str_list = BaseLib::splitString(line, ' ');
-		it = str_list.begin();
-		while (it != str_list.end()) {
-			INFO("PetrelInterface::readPetrelWellTrace(): well head x coord: %s.", it->c_str());
-			++it;
-		}
-		it = (str_list.end())--;
-		--it;
-		char* buf;
-		double well_head_x(strtod((*it).c_str(), &buf));
-
-		// read well head y coordinate
-		in.getline(buffer, MAX_COLS_PER_ROW);
-		line = buffer;
-		str_list = BaseLib::splitString(line, ' ');
-		it = str_list.begin();
-		while (it != str_list.end()) {
-			INFO("PetrelInterface::readPetrelWellTrace(): well head y coord: %s.", it->c_str());
-			++it;
-		}
-		it = (str_list.end())--;
-		--it;
-		double well_head_y(strtod((*it).c_str(), &buf));
-
-		// read well KB
-		in.getline(buffer, MAX_COLS_PER_ROW);
-		line = buffer;
-		str_list = BaseLib::splitString(line, ' ');
-		it = str_list.begin();
-		while (it != str_list.end()) {
-			INFO("PetrelInterface::readPetrelWellTrace(): well kb entry: %s.", it->c_str());
-			++it;
-		}
-		it = (str_list.end())--;
-		--it;
-		double well_kb(strtod((*it).c_str(), &buf));
-
-		INFO("PetrelInterface::readPetrelWellTrace(): %f, %f, %f.",
-		     well_head_x,
-		     well_head_y,
-		     well_kb);
-		well_vec->push_back(new GeoLib::StationBorehole(well_head_x, well_head_y, well_kb));
-
-		// read well type
-		in.getline(buffer, MAX_COLS_PER_ROW);
-//		std::string type(*((str_list.end())--));
-
-		readPetrelWellTraceData(in);
-	}
+    char buffer[MAX_COLS_PER_ROW];
+    in.getline(buffer, MAX_COLS_PER_ROW);
+    std::string line(buffer);
+
+    if (line.find("# WELL TRACE FROM PETREL") != std::string::npos)
+    {
+        // read header
+        // read well name
+        in.getline(buffer, MAX_COLS_PER_ROW);
+        line = buffer;
+        std::list<std::string> str_list(BaseLib::splitString(line, ' '));
+        std::list<std::string>::const_iterator it(str_list.begin());
+        while (it != str_list.end()) {
+            INFO("PetrelInterface::readPetrelWellTrace(): well name: %s.", it->c_str());
+            ++it;
+        }
+
+        // read well head x coordinate
+        in.getline(buffer, MAX_COLS_PER_ROW);
+        line = buffer;
+        str_list = BaseLib::splitString(line, ' ');
+        it = str_list.begin();
+        while (it != str_list.end()) {
+            INFO("PetrelInterface::readPetrelWellTrace(): well head x coord: %s.", it->c_str());
+            ++it;
+        }
+        it = (str_list.end())--;
+        --it;
+        char* buf;
+        double well_head_x(strtod((*it).c_str(), &buf));
+
+        // read well head y coordinate
+        in.getline(buffer, MAX_COLS_PER_ROW);
+        line = buffer;
+        str_list = BaseLib::splitString(line, ' ');
+        it = str_list.begin();
+        while (it != str_list.end()) {
+            INFO("PetrelInterface::readPetrelWellTrace(): well head y coord: %s.", it->c_str());
+            ++it;
+        }
+        it = (str_list.end())--;
+        --it;
+        double well_head_y(strtod((*it).c_str(), &buf));
+
+        // read well KB
+        in.getline(buffer, MAX_COLS_PER_ROW);
+        line = buffer;
+        str_list = BaseLib::splitString(line, ' ');
+        it = str_list.begin();
+        while (it != str_list.end()) {
+            INFO("PetrelInterface::readPetrelWellTrace(): well kb entry: %s.", it->c_str());
+            ++it;
+        }
+        it = (str_list.end())--;
+        --it;
+        double well_kb(strtod((*it).c_str(), &buf));
+
+        INFO("PetrelInterface::readPetrelWellTrace(): %f, %f, %f.",
+             well_head_x,
+             well_head_y,
+             well_kb);
+        well_vec->push_back(new GeoLib::StationBorehole(well_head_x, well_head_y, well_kb));
+
+        // read well type
+        in.getline(buffer, MAX_COLS_PER_ROW);
+//        std::string type(*((str_list.end())--));
+
+        readPetrelWellTraceData(in);
+    }
 }
 
 void PetrelInterface::readPetrelWellTraceData(std::istream &in)
 {
-	char buffer[MAX_COLS_PER_ROW];
-	in.getline(buffer, MAX_COLS_PER_ROW);
-	std::string line(buffer);
-
-	// read yet another header line
-	in.getline(buffer, MAX_COLS_PER_ROW);
-	line = buffer;
-	while (line.substr(0, 1).compare("#") == 0)
-	{
-		in.getline(buffer, MAX_COLS_PER_ROW);
-		line = buffer;
-	}
-
-	// read column information
-	std::list<std::string> str_list = BaseLib::splitString(line, ' ');
-	std::list<std::string>::const_iterator it = str_list.begin();
-	while (it != str_list.end()) {
-		INFO("PetrelInterface::readPetrelWellTraceData(): column information: %s.", it->c_str());
-		++it;
-	}
-
-	// read points
-	double md, x, y, z, tvd, dx, dy, azim, incl, dls;
-	in.getline(buffer, MAX_COLS_PER_ROW);
-	line = buffer;
-	while (in)
-	{
-		if (line.size() > 1 && line.substr(0, 1).compare("#") != 0)
-		{
-			std::stringstream stream(line);
-			stream >> md;
-			stream >> x >> y >> z;
-			//			pnt_vec->push_back (new GeoLib::Point (x,y,z));
-			static_cast<GeoLib::StationBorehole*> ((*well_vec)[well_vec->size() - 1])->addSoilLayer(
-							x, y, z, "unknown");
-			stream >> tvd >> dx >> dy >> azim >> incl >> dls;
-		}
-		in.getline(buffer, MAX_COLS_PER_ROW);
-		line = buffer;
-	}
+    char buffer[MAX_COLS_PER_ROW];
+    in.getline(buffer, MAX_COLS_PER_ROW);
+    std::string line(buffer);
+
+    // read yet another header line
+    in.getline(buffer, MAX_COLS_PER_ROW);
+    line = buffer;
+    while (line.substr(0, 1).compare("#") == 0)
+    {
+        in.getline(buffer, MAX_COLS_PER_ROW);
+        line = buffer;
+    }
+
+    // read column information
+    std::list<std::string> str_list = BaseLib::splitString(line, ' ');
+    std::list<std::string>::const_iterator it = str_list.begin();
+    while (it != str_list.end()) {
+        INFO("PetrelInterface::readPetrelWellTraceData(): column information: %s.", it->c_str());
+        ++it;
+    }
+
+    // read points
+    double md, x, y, z, tvd, dx, dy, azim, incl, dls;
+    in.getline(buffer, MAX_COLS_PER_ROW);
+    line = buffer;
+    while (in)
+    {
+        if (line.size() > 1 && line.substr(0, 1).compare("#") != 0)
+        {
+            std::stringstream stream(line);
+            stream >> md;
+            stream >> x >> y >> z;
+            //            pnt_vec->push_back (new GeoLib::Point (x,y,z));
+            static_cast<GeoLib::StationBorehole*> ((*well_vec)[well_vec->size() - 1])->addSoilLayer(
+                            x, y, z, "unknown");
+            stream >> tvd >> dx >> dy >> azim >> incl >> dls;
+        }
+        in.getline(buffer, MAX_COLS_PER_ROW);
+        line = buffer;
+    }
 }
 } // end namespace FileIO
diff --git a/FileIO/PetrelInterface.h b/FileIO/PetrelInterface.h
index bfd41dd3d4160a08803944b94602a6b3a442b0bd..b7b357404f2e89d3a153a026d95a247a81378710 100644
--- a/FileIO/PetrelInterface.h
+++ b/FileIO/PetrelInterface.h
@@ -35,21 +35,21 @@ namespace FileIO
 class PetrelInterface
 {
 public:
-	PetrelInterface(std::list<std::string> &sfc_fnames,
-	                std::list<std::string> &well_path_fnames,
-	                std::string &unique_model_name,
-	                GeoLib::GEOObjects* obj);
-	virtual ~PetrelInterface();
+    PetrelInterface(std::list<std::string> &sfc_fnames,
+                    std::list<std::string> &well_path_fnames,
+                    std::string &unique_model_name,
+                    GeoLib::GEOObjects* obj);
+    virtual ~PetrelInterface();
 
 private:
-	void readPetrelSurface (std::istream &in);
-	void readPetrelWellTrace (std::istream &in);
-	void readPetrelWellTraceData (std::istream &in);
-	std::string _unique_name;
-	std::vector<GeoLib::Point*>* pnt_vec;
-	std::vector<GeoLib::Point*>* well_vec;
-	std::vector<GeoLib::Polyline*>* ply_vec;
-	static const std::size_t MAX_COLS_PER_ROW = 256;
+    void readPetrelSurface (std::istream &in);
+    void readPetrelWellTrace (std::istream &in);
+    void readPetrelWellTraceData (std::istream &in);
+    std::string _unique_name;
+    std::vector<GeoLib::Point*>* pnt_vec;
+    std::vector<GeoLib::Point*>* well_vec;
+    std::vector<GeoLib::Polyline*>* ply_vec;
+    static const std::size_t MAX_COLS_PER_ROW = 256;
 };
 } // end namespace FileIO
 
diff --git a/FileIO/RapidXmlIO/RapidStnInterface.cpp b/FileIO/RapidXmlIO/RapidStnInterface.cpp
index d6c6de188ab44242730dbd210c62cc93ea776dd0..019fe2be7a0f4864dcc010c6254bd7f8b4a49fcf 100644
--- a/FileIO/RapidXmlIO/RapidStnInterface.cpp
+++ b/FileIO/RapidXmlIO/RapidStnInterface.cpp
@@ -27,207 +27,207 @@ namespace FileIO
 
 std::vector<GeoLib::Point*> *RapidStnInterface::readStationFile(const std::string &fileName)
 {
-	std::vector<GeoLib::Point*> *stations = new std::vector<GeoLib::Point*>;
-	std::ifstream in(fileName.c_str());
-	if (in.fail())
-	{
-		std::cout << "XmlStnInterface::rapidReadFile() - Can't open xml-file." << std::endl;
-		return NULL;
-	}
-
-	// buffer file
-	in.seekg(0, std::ios::end);
-	std::size_t length = in.tellg();
-	in.seekg(0, std::ios::beg);
-	char* buffer = new char[length+1];
-	in.read(buffer, length);
-	buffer[in.gcount()] = '\0';
-	in.close();
-
-	// build DOM tree
-	rapidxml::xml_document<> doc;
-	doc.parse<0>(buffer);
-
-	// parse content
-	if (std::string(doc.first_node()->name()).compare("OpenGeoSysSTN") != 0)
-	{
-		std::cout << "XmlStnInterface::readFile() - Unexpected XML root." << std::endl;
-		return NULL;
-	}
-
-	// iterate over all station lists
-	for (rapidxml::xml_node<>* station_list = doc.first_node()->first_node(); station_list; station_list = station_list->next_sibling())
-	{
-		std::string stnName("[NN]");
-
-		stnName = station_list->first_node("name")->value();
-		for (rapidxml::xml_node<>* list_item = station_list->first_node(); list_item; list_item = list_item->next_sibling())
-		{
-			std::string b(list_item->name());
-			if (b.compare("stations") == 0)
-				RapidStnInterface::readStations(list_item, stations, fileName);
-			if (b.compare("boreholes") == 0)
-				RapidStnInterface::readStations(list_item, stations, fileName);
-		}
-	}
-
-	doc.clear();
-	delete [] buffer;
-
-	return stations;
+    std::vector<GeoLib::Point*> *stations = new std::vector<GeoLib::Point*>;
+    std::ifstream in(fileName.c_str());
+    if (in.fail())
+    {
+        std::cout << "XmlStnInterface::rapidReadFile() - Can't open xml-file." << std::endl;
+        return NULL;
+    }
+
+    // buffer file
+    in.seekg(0, std::ios::end);
+    std::size_t length = in.tellg();
+    in.seekg(0, std::ios::beg);
+    char* buffer = new char[length+1];
+    in.read(buffer, length);
+    buffer[in.gcount()] = '\0';
+    in.close();
+
+    // build DOM tree
+    rapidxml::xml_document<> doc;
+    doc.parse<0>(buffer);
+
+    // parse content
+    if (std::string(doc.first_node()->name()).compare("OpenGeoSysSTN") != 0)
+    {
+        std::cout << "XmlStnInterface::readFile() - Unexpected XML root." << std::endl;
+        return NULL;
+    }
+
+    // iterate over all station lists
+    for (rapidxml::xml_node<>* station_list = doc.first_node()->first_node(); station_list; station_list = station_list->next_sibling())
+    {
+        std::string stnName("[NN]");
+
+        stnName = station_list->first_node("name")->value();
+        for (rapidxml::xml_node<>* list_item = station_list->first_node(); list_item; list_item = list_item->next_sibling())
+        {
+            std::string b(list_item->name());
+            if (b.compare("stations") == 0)
+                RapidStnInterface::readStations(list_item, stations, fileName);
+            if (b.compare("boreholes") == 0)
+                RapidStnInterface::readStations(list_item, stations, fileName);
+        }
+    }
+
+    doc.clear();
+    delete [] buffer;
+
+    return stations;
 }
 /*
 int RapidStnInterface::rapidReadFile(const std::string &fileName)
 {
-	GEOLIB::GEOObjects* geoObjects = _project->getGEOObjects();
-
-	std::ifstream in(fileName.c_str());
-	if (in.fail())
-	{
-		std::cout << "XmlStnInterface::rapidReadFile() - Can't open xml-file." << std::endl;
-		return 0;
-	}
-
-	// buffer file
-	in.seekg(0, std::ios::end);
-	std::size_t length = in.tellg();
-	in.seekg(0, std::ios::beg);
-	char* buffer = new char[length+1];
-	in.read(buffer, length);
-	buffer[in.gcount()] = '\0';
-	in.close();
-
-	// build DOM tree
-	rapidxml::xml_document<> doc;
-	doc.parse<0>(buffer);
-
-	// parse content
-	if (std::string(doc.first_node()->name()).compare("OpenGeoSysSTN"))
-	{
-		std::cout << "XmlStnInterface::readFile() - Unexpected XML root." << std::endl;
-		return 0;
-	}
-
-	// iterate over all station lists
-	for (rapidxml::xml_node<>* station_list = doc.first_node()->first_node(); station_list; station_list = station_list->next_sibling())
-	{
-		std::vector<GEOLIB::Point*>* stations = new std::vector<GEOLIB::Point*>;
-		std::string stnName("[NN]");
-
-		stnName = station_list->first_node("name")->value();
-		for (rapidxml::xml_node<>* list_item = station_list->first_node(); list_item; list_item = list_item->next_sibling())
-		{
-			std::string b(list_item->name());
-			if (std::string(list_item->name()).compare("stations") == 0)
-				XmlStnInterface::rapidReadStations(list_item, stations, fileName);
-			if (std::string(list_item->name()).compare("boreholes") == 0)
-				XmlStnInterface::rapidReadStations(list_item, stations, fileName);
-		}
-
-		if (!stations->empty())
-			geoObjects->addStationVec(stations, stnName);
-		else
-			delete stations;
-	}
-
-	doc.clear();
-	delete [] buffer;
-
-	return 1;
+    GEOLIB::GEOObjects* geoObjects = _project->getGEOObjects();
+
+    std::ifstream in(fileName.c_str());
+    if (in.fail())
+    {
+        std::cout << "XmlStnInterface::rapidReadFile() - Can't open xml-file." << std::endl;
+        return 0;
+    }
+
+    // buffer file
+    in.seekg(0, std::ios::end);
+    std::size_t length = in.tellg();
+    in.seekg(0, std::ios::beg);
+    char* buffer = new char[length+1];
+    in.read(buffer, length);
+    buffer[in.gcount()] = '\0';
+    in.close();
+
+    // build DOM tree
+    rapidxml::xml_document<> doc;
+    doc.parse<0>(buffer);
+
+    // parse content
+    if (std::string(doc.first_node()->name()).compare("OpenGeoSysSTN"))
+    {
+        std::cout << "XmlStnInterface::readFile() - Unexpected XML root." << std::endl;
+        return 0;
+    }
+
+    // iterate over all station lists
+    for (rapidxml::xml_node<>* station_list = doc.first_node()->first_node(); station_list; station_list = station_list->next_sibling())
+    {
+        std::vector<GEOLIB::Point*>* stations = new std::vector<GEOLIB::Point*>;
+        std::string stnName("[NN]");
+
+        stnName = station_list->first_node("name")->value();
+        for (rapidxml::xml_node<>* list_item = station_list->first_node(); list_item; list_item = list_item->next_sibling())
+        {
+            std::string b(list_item->name());
+            if (std::string(list_item->name()).compare("stations") == 0)
+                XmlStnInterface::rapidReadStations(list_item, stations, fileName);
+            if (std::string(list_item->name()).compare("boreholes") == 0)
+                XmlStnInterface::rapidReadStations(list_item, stations, fileName);
+        }
+
+        if (!stations->empty())
+            geoObjects->addStationVec(stations, stnName);
+        else
+            delete stations;
+    }
+
+    doc.clear();
+    delete [] buffer;
+
+    return 1;
 }
 */
 void RapidStnInterface::readStations(const rapidxml::xml_node<>* station_root, std::vector<GeoLib::Point*> *stations, const std::string &file_name)
 {
-	for (rapidxml::xml_node<>* station_node = station_root->first_node(); station_node; station_node = station_node->next_sibling())
-	{
-		if (station_node->first_attribute("id") && station_node->first_attribute("x") && station_node->first_attribute("y"))
-		{
-			double zVal(0.0);
-			if (station_node->first_attribute("z"))
-				zVal = strtod(station_node->first_attribute("z")->value(), 0);
-
-			std::string station_name(""), sensor_data_file_name(""), bdate_str("0000-00-00");
-			double station_value(0.0), borehole_depth(0.0);
-			if (station_node->first_node("name"))
-				station_name = station_node->first_node("name")->value();
-			if (station_node->first_node("sensordata"))
-				sensor_data_file_name = station_node->first_node("sensordata")->value();
-			if (station_node->first_node("value"))
-				station_value = strtod(station_node->first_node("value")->value(), 0);
-			/* add other station features here */
-
-			if (std::string(station_node->name()).compare("station") == 0)
-			{
-				GeoLib::Station* s = new GeoLib::Station(
-							strtod(station_node->first_attribute("x")->value(), 0),
-				            strtod(station_node->first_attribute("y")->value(), 0),
-				            zVal,
-							station_name);
-				s->setStationValue(station_value);
-				if (!sensor_data_file_name.empty())
-					s->addSensorDataFromCSV(BaseLib::copyPathToFileName(sensor_data_file_name, file_name));
-				stations->push_back(s);
-			}
-			else if (std::string(station_node->name()).compare("borehole") == 0)
-			{
-				if (station_node->first_node("bdepth"))
-					borehole_depth = strtod(station_node->first_node("bdepth")->value(), 0);
-				if (station_node->first_node("bdate"))
-					bdate_str = station_node->first_node("bdate")->value();
-				/* add other borehole features here */
-
-				GeoLib::StationBorehole* s = GeoLib::StationBorehole::createStation(
-				        station_name,
-				        strtod(station_node->first_attribute("x")->value(), 0),
-				        strtod(station_node->first_attribute("y")->value(), 0),
-				        zVal,
-				        borehole_depth,
-				        bdate_str);
-				s->setStationValue(station_value);
-
-				if (station_node->first_node("strat"))
-					RapidStnInterface::readStratigraphy(station_node->first_node("strat"), s);
-
-				stations->push_back(s);
-
-			}
-		}
-		else
-			std::cout << "XmlStnInterface::rapidReadStations() - Attribute missing in <station> tag ..." << std::endl;
-	}
+    for (rapidxml::xml_node<>* station_node = station_root->first_node(); station_node; station_node = station_node->next_sibling())
+    {
+        if (station_node->first_attribute("id") && station_node->first_attribute("x") && station_node->first_attribute("y"))
+        {
+            double zVal(0.0);
+            if (station_node->first_attribute("z"))
+                zVal = strtod(station_node->first_attribute("z")->value(), 0);
+
+            std::string station_name(""), sensor_data_file_name(""), bdate_str("0000-00-00");
+            double station_value(0.0), borehole_depth(0.0);
+            if (station_node->first_node("name"))
+                station_name = station_node->first_node("name")->value();
+            if (station_node->first_node("sensordata"))
+                sensor_data_file_name = station_node->first_node("sensordata")->value();
+            if (station_node->first_node("value"))
+                station_value = strtod(station_node->first_node("value")->value(), 0);
+            /* add other station features here */
+
+            if (std::string(station_node->name()).compare("station") == 0)
+            {
+                GeoLib::Station* s = new GeoLib::Station(
+                            strtod(station_node->first_attribute("x")->value(), 0),
+                            strtod(station_node->first_attribute("y")->value(), 0),
+                            zVal,
+                            station_name);
+                s->setStationValue(station_value);
+                if (!sensor_data_file_name.empty())
+                    s->addSensorDataFromCSV(BaseLib::copyPathToFileName(sensor_data_file_name, file_name));
+                stations->push_back(s);
+            }
+            else if (std::string(station_node->name()).compare("borehole") == 0)
+            {
+                if (station_node->first_node("bdepth"))
+                    borehole_depth = strtod(station_node->first_node("bdepth")->value(), 0);
+                if (station_node->first_node("bdate"))
+                    bdate_str = station_node->first_node("bdate")->value();
+                /* add other borehole features here */
+
+                GeoLib::StationBorehole* s = GeoLib::StationBorehole::createStation(
+                        station_name,
+                        strtod(station_node->first_attribute("x")->value(), 0),
+                        strtod(station_node->first_attribute("y")->value(), 0),
+                        zVal,
+                        borehole_depth,
+                        bdate_str);
+                s->setStationValue(station_value);
+
+                if (station_node->first_node("strat"))
+                    RapidStnInterface::readStratigraphy(station_node->first_node("strat"), s);
+
+                stations->push_back(s);
+
+            }
+        }
+        else
+            std::cout << "XmlStnInterface::rapidReadStations() - Attribute missing in <station> tag ..." << std::endl;
+    }
 }
 
 void RapidStnInterface::readStratigraphy( const rapidxml::xml_node<>* strat_root, GeoLib::StationBorehole* borehole )
 {
-	double depth_check((*borehole)[2]);
-
-	for (rapidxml::xml_node<>* horizon_node = strat_root->first_node("horizon"); horizon_node; horizon_node = horizon_node->next_sibling())
-	{
-		if (horizon_node->first_attribute("id") && horizon_node->first_attribute("x") &&
-		    horizon_node->first_attribute("y")  && horizon_node->first_attribute("z"))
-		{
-			std::string horizon_name("[NN]");
-			if (horizon_node->first_node("name"))
-				horizon_name = horizon_node->first_node("name")->value();
-			/* add other horizon features here */
-
-			double depth (strtod(horizon_node->first_attribute("z")->value(), 0));
-			if (fabs(depth - depth_check) > std::numeric_limits<double>::epsilon()) // skip soil-layer if its thickness is zero
-			{
-				borehole->addSoilLayer(strtod(horizon_node->first_attribute("x")->value(), 0),
-									   strtod(horizon_node->first_attribute("y")->value(), 0),
-									   depth,
-									   horizon_name);
-				depth_check = depth;
-			}
-			else
-				std::cout << "Warning: Skipped layer \"" << horizon_name << "\" in borehole \""
-					      << borehole->getName() << "\" because of thickness 0.0." << std::endl;
-		}
-		else
-			std::cout <<
-			"XmlStnInterface::rapidReadStratigraphy() - Attribute missing in <horizon> tag ..." << std::endl;
-	}
+    double depth_check((*borehole)[2]);
+
+    for (rapidxml::xml_node<>* horizon_node = strat_root->first_node("horizon"); horizon_node; horizon_node = horizon_node->next_sibling())
+    {
+        if (horizon_node->first_attribute("id") && horizon_node->first_attribute("x") &&
+            horizon_node->first_attribute("y")  && horizon_node->first_attribute("z"))
+        {
+            std::string horizon_name("[NN]");
+            if (horizon_node->first_node("name"))
+                horizon_name = horizon_node->first_node("name")->value();
+            /* add other horizon features here */
+
+            double depth (strtod(horizon_node->first_attribute("z")->value(), 0));
+            if (fabs(depth - depth_check) > std::numeric_limits<double>::epsilon()) // skip soil-layer if its thickness is zero
+            {
+                borehole->addSoilLayer(strtod(horizon_node->first_attribute("x")->value(), 0),
+                                       strtod(horizon_node->first_attribute("y")->value(), 0),
+                                       depth,
+                                       horizon_name);
+                depth_check = depth;
+            }
+            else
+                std::cout << "Warning: Skipped layer \"" << horizon_name << "\" in borehole \""
+                          << borehole->getName() << "\" because of thickness 0.0." << std::endl;
+        }
+        else
+            std::cout <<
+            "XmlStnInterface::rapidReadStratigraphy() - Attribute missing in <horizon> tag ..." << std::endl;
+    }
 }
 
 }
diff --git a/FileIO/RapidXmlIO/RapidStnInterface.h b/FileIO/RapidXmlIO/RapidStnInterface.h
index 75840b2198c9baa767296137aac9d6aae9e3168e..797688a471d7bf3441ec5e834c421d916921c698 100644
--- a/FileIO/RapidXmlIO/RapidStnInterface.h
+++ b/FileIO/RapidXmlIO/RapidStnInterface.h
@@ -23,7 +23,7 @@
 
 namespace GeoLib {
     class Point;
-	class StationBorehole;
+    class StationBorehole;
 }
 
 namespace FileIO
@@ -35,16 +35,16 @@ namespace FileIO
 class RapidStnInterface
 {
 public:
-	/// Reads an xml-file using the RapidXML parser integrated in the source code (i.e. this function is usable without Qt)
-	//int rapidReadFile(const std::string &fileName);
-	static std::vector<GeoLib::Point*> *readStationFile(const std::string &fileName);
+    /// Reads an xml-file using the RapidXML parser integrated in the source code (i.e. this function is usable without Qt)
+    //int rapidReadFile(const std::string &fileName);
+    static std::vector<GeoLib::Point*> *readStationFile(const std::string &fileName);
 
 private:
-	/// Reads GEOLIB::Station- or StationBorehole-objects from an xml-file using the RapidXML parser
-	static void readStations(const rapidxml::xml_node<>* station_root, std::vector<GeoLib::Point*> *stations, const std::string &file_name);
+    /// Reads GEOLIB::Station- or StationBorehole-objects from an xml-file using the RapidXML parser
+    static void readStations(const rapidxml::xml_node<>* station_root, std::vector<GeoLib::Point*> *stations, const std::string &file_name);
 
-	/// Reads the stratigraphy of a borehole from an xml-file using the RapidXML parser
-	static void readStratigraphy(const rapidxml::xml_node<>* strat_root, GeoLib::StationBorehole* borehole);
+    /// Reads the stratigraphy of a borehole from an xml-file using the RapidXML parser
+    static void readStratigraphy(const rapidxml::xml_node<>* strat_root, GeoLib::StationBorehole* borehole);
 };
 
 }
diff --git a/FileIO/SHPInterface.cpp b/FileIO/SHPInterface.cpp
index 6075c0b81d9bf467d36fc60d0cb9e21cd517ccdd..662091ece3aafcae28307a1c05d6c0c9417ba5df 100644
--- a/FileIO/SHPInterface.cpp
+++ b/FileIO/SHPInterface.cpp
@@ -35,244 +35,244 @@ namespace FileIO
 
 bool SHPInterface::readSHPInfo(const std::string &filename, int &shapeType, int &numberOfEntities)
 {
-	SHPHandle hSHP = SHPOpen(filename.c_str(), "rb");
-	if (!hSHP)
-		return false;
+    SHPHandle hSHP = SHPOpen(filename.c_str(), "rb");
+    if (!hSHP)
+        return false;
 
-	double padfMinBound[4], padfMaxBound[4];
+    double padfMinBound[4], padfMaxBound[4];
 
-	// The SHPGetInfo() function retrieves various information about shapefile as a whole.
-	// The bounds are read from the file header, and may be inaccurate if the file was improperly generated.
-	SHPGetInfo(hSHP, &numberOfEntities, &shapeType, padfMinBound, padfMaxBound);
+    // The SHPGetInfo() function retrieves various information about shapefile as a whole.
+    // The bounds are read from the file header, and may be inaccurate if the file was improperly generated.
+    SHPGetInfo(hSHP, &numberOfEntities, &shapeType, padfMinBound, padfMaxBound);
 
-	SHPClose(hSHP);
-	return true;
+    SHPClose(hSHP);
+    return true;
 }
 
 void SHPInterface::readSHPFile(const std::string &filename, OGSType choice, const std::string &listName)
 {
-	int shapeType, numberOfElements;
-	double padfMinBound[4], padfMaxBound[4];
-
-	SHPHandle hSHP = SHPOpen(filename.c_str(), "rb");
-	SHPGetInfo(hSHP, &numberOfElements, &shapeType, padfMinBound, padfMaxBound);
-
-	if (((shapeType - 1) % 10 == 0) && (choice == SHPInterface::OGSType::POINT))
-		readPoints(hSHP, numberOfElements, listName);
-	if (((shapeType - 1) % 10 == 0) && (choice == SHPInterface::OGSType::STATION))
-		readStations(hSHP, numberOfElements, listName);
-	if (((shapeType - 3) % 10 == 0 || (shapeType - 5) % 10 == 0) && (choice
-	                == SHPInterface::OGSType::POLYLINE))
-		readPolylines(hSHP, numberOfElements, listName);
-	if (((shapeType - 3) % 10 == 0 || (shapeType - 5) % 10 == 0) && (choice
-	                == SHPInterface::OGSType::POLYGON))
-		readPolygons(hSHP, numberOfElements, listName);
+    int shapeType, numberOfElements;
+    double padfMinBound[4], padfMaxBound[4];
+
+    SHPHandle hSHP = SHPOpen(filename.c_str(), "rb");
+    SHPGetInfo(hSHP, &numberOfElements, &shapeType, padfMinBound, padfMaxBound);
+
+    if (((shapeType - 1) % 10 == 0) && (choice == SHPInterface::OGSType::POINT))
+        readPoints(hSHP, numberOfElements, listName);
+    if (((shapeType - 1) % 10 == 0) && (choice == SHPInterface::OGSType::STATION))
+        readStations(hSHP, numberOfElements, listName);
+    if (((shapeType - 3) % 10 == 0 || (shapeType - 5) % 10 == 0) && (choice
+                    == SHPInterface::OGSType::POLYLINE))
+        readPolylines(hSHP, numberOfElements, listName);
+    if (((shapeType - 3) % 10 == 0 || (shapeType - 5) % 10 == 0) && (choice
+                    == SHPInterface::OGSType::POLYGON))
+        readPolygons(hSHP, numberOfElements, listName);
 }
 
 void SHPInterface::readPoints(const SHPHandle &hSHP, int numberOfElements, std::string listName)
 {
-	if (numberOfElements > 0) {
-		auto points = std::unique_ptr<std::vector<GeoLib::Point*>>(
-		    new std::vector<GeoLib::Point*>);
-		SHPObject* hSHPObject;
-
-		for (int i = 0; i < numberOfElements; i++) {
-			hSHPObject = SHPReadObject(hSHP, i);
-
-			GeoLib::Point* pnt =
-			        new GeoLib::Point(*(hSHPObject->padfX), *(hSHPObject->padfY),
-			                          *(hSHPObject->padfZ));
-			points->push_back(pnt);
-		}
-
-		_geoObjects.addPointVec(std::move(points), listName);
-		SHPDestroyObject(hSHPObject); // de-allocate SHPObject
-	}
+    if (numberOfElements > 0) {
+        auto points = std::unique_ptr<std::vector<GeoLib::Point*>>(
+            new std::vector<GeoLib::Point*>);
+        SHPObject* hSHPObject;
+
+        for (int i = 0; i < numberOfElements; i++) {
+            hSHPObject = SHPReadObject(hSHP, i);
+
+            GeoLib::Point* pnt =
+                    new GeoLib::Point(*(hSHPObject->padfX), *(hSHPObject->padfY),
+                                      *(hSHPObject->padfZ));
+            points->push_back(pnt);
+        }
+
+        _geoObjects.addPointVec(std::move(points), listName);
+        SHPDestroyObject(hSHPObject); // de-allocate SHPObject
+    }
 }
 
 void SHPInterface::readStations(const SHPHandle &hSHP, int numberOfElements, std::string listName)
 {
-	if (numberOfElements > 0) {
-		auto stations = std::unique_ptr<std::vector<GeoLib::Point*>>(
-		    new std::vector<GeoLib::Point*>);
-		stations->reserve(numberOfElements);
-		SHPObject* hSHPObject;
-
-		for (int i = 0; i < numberOfElements; i++) {
-			hSHPObject = SHPReadObject(hSHP, i);
-			GeoLib::Station* stn = GeoLib::Station::createStation(std::to_string(i),
-			                                                      *(hSHPObject->padfX),
-			                                                      *(hSHPObject->padfY),
-			                                                      *(hSHPObject->padfZ));
-			stations->push_back(stn);
-		}
-
-		_geoObjects.addStationVec(std::move(stations), listName);
-		SHPDestroyObject(hSHPObject); // de-allocate SHPObject
-	}
+    if (numberOfElements > 0) {
+        auto stations = std::unique_ptr<std::vector<GeoLib::Point*>>(
+            new std::vector<GeoLib::Point*>);
+        stations->reserve(numberOfElements);
+        SHPObject* hSHPObject;
+
+        for (int i = 0; i < numberOfElements; i++) {
+            hSHPObject = SHPReadObject(hSHP, i);
+            GeoLib::Station* stn = GeoLib::Station::createStation(std::to_string(i),
+                                                                  *(hSHPObject->padfX),
+                                                                  *(hSHPObject->padfY),
+                                                                  *(hSHPObject->padfZ));
+            stations->push_back(stn);
+        }
+
+        _geoObjects.addStationVec(std::move(stations), listName);
+        SHPDestroyObject(hSHPObject); // de-allocate SHPObject
+    }
 }
 
 void SHPInterface::readPolylines(const SHPHandle &hSHP, int numberOfElements, std::string listName)
 {
-	if (numberOfElements <= 0)
-		return;
-	auto pnts = std::unique_ptr<std::vector<GeoLib::Point*>>(
-	    new std::vector<GeoLib::Point*>);
-	auto lines = std::unique_ptr<std::vector<GeoLib::Polyline*>>(
-	    new std::vector<GeoLib::Polyline*>);
-
-	std::size_t pnt_id(0);
-	// for each polyline
-	for (int i = 0; i < numberOfElements; ++i) {
-		SHPObject *hSHPObject = SHPReadObject(hSHP, i);
-		int const noOfPoints = hSHPObject->nVertices;
-		int const noOfParts = hSHPObject->nParts;
-
-		for (int p = 0; p < noOfParts; ++p) {
-			int const firstPnt = *(hSHPObject->panPartStart + p);
-			int const lastPnt = (p<(noOfParts - 1)) ?
-				*(hSHPObject->panPartStart + p + 1) : noOfPoints;
-
-			// for each point in that polyline
-			for (int j = firstPnt; j < lastPnt; ++j) {
-				pnts->push_back(new GeoLib::Point(*(hSHPObject->padfX+j),
-					*(hSHPObject->padfY+j), *(hSHPObject->padfZ+j), pnt_id));
-				pnt_id++;
-			}
-		}
-		SHPDestroyObject(hSHPObject); // de-allocate SHPObject
-	}
-
-	_geoObjects.addPointVec(std::move(pnts), listName);
-	GeoLib::PointVec const& points(*(_geoObjects.getPointVecObj(listName)));
-	std::vector<std::size_t> const& pnt_id_map(points.getIDMap());
-
-	pnt_id = 0;
-	for (int i = 0; i < numberOfElements; ++i) {
-		SHPObject* hSHPObject = SHPReadObject(hSHP, i);
-		int const noOfPoints = hSHPObject->nVertices;
-		int const noOfParts = hSHPObject->nParts;
-
-		for (int p = 0; p < noOfParts; ++p) {
-			int const firstPnt = *(hSHPObject->panPartStart + p);
-			int const lastPnt = (p<(noOfParts - 1)) ?
-				*(hSHPObject->panPartStart + p + 1) : noOfPoints;
-
-			GeoLib::Polyline* line = new GeoLib::Polyline(*points.getVector());
-
-			// create polyline
-			for (int j = firstPnt; j < lastPnt; ++j) {
-				line->addPoint(pnt_id_map[pnt_id]);
-				pnt_id++;
-			}
-			// add polyline to polyline vector
-			lines->push_back(line);
-		}
-		SHPDestroyObject(hSHPObject); // de-allocate SHPObject
-	}
-	_geoObjects.addPolylineVec(std::move(lines), listName);
+    if (numberOfElements <= 0)
+        return;
+    auto pnts = std::unique_ptr<std::vector<GeoLib::Point*>>(
+        new std::vector<GeoLib::Point*>);
+    auto lines = std::unique_ptr<std::vector<GeoLib::Polyline*>>(
+        new std::vector<GeoLib::Polyline*>);
+
+    std::size_t pnt_id(0);
+    // for each polyline
+    for (int i = 0; i < numberOfElements; ++i) {
+        SHPObject *hSHPObject = SHPReadObject(hSHP, i);
+        int const noOfPoints = hSHPObject->nVertices;
+        int const noOfParts = hSHPObject->nParts;
+
+        for (int p = 0; p < noOfParts; ++p) {
+            int const firstPnt = *(hSHPObject->panPartStart + p);
+            int const lastPnt = (p<(noOfParts - 1)) ?
+                *(hSHPObject->panPartStart + p + 1) : noOfPoints;
+
+            // for each point in that polyline
+            for (int j = firstPnt; j < lastPnt; ++j) {
+                pnts->push_back(new GeoLib::Point(*(hSHPObject->padfX+j),
+                    *(hSHPObject->padfY+j), *(hSHPObject->padfZ+j), pnt_id));
+                pnt_id++;
+            }
+        }
+        SHPDestroyObject(hSHPObject); // de-allocate SHPObject
+    }
+
+    _geoObjects.addPointVec(std::move(pnts), listName);
+    GeoLib::PointVec const& points(*(_geoObjects.getPointVecObj(listName)));
+    std::vector<std::size_t> const& pnt_id_map(points.getIDMap());
+
+    pnt_id = 0;
+    for (int i = 0; i < numberOfElements; ++i) {
+        SHPObject* hSHPObject = SHPReadObject(hSHP, i);
+        int const noOfPoints = hSHPObject->nVertices;
+        int const noOfParts = hSHPObject->nParts;
+
+        for (int p = 0; p < noOfParts; ++p) {
+            int const firstPnt = *(hSHPObject->panPartStart + p);
+            int const lastPnt = (p<(noOfParts - 1)) ?
+                *(hSHPObject->panPartStart + p + 1) : noOfPoints;
+
+            GeoLib::Polyline* line = new GeoLib::Polyline(*points.getVector());
+
+            // create polyline
+            for (int j = firstPnt; j < lastPnt; ++j) {
+                line->addPoint(pnt_id_map[pnt_id]);
+                pnt_id++;
+            }
+            // add polyline to polyline vector
+            lines->push_back(line);
+        }
+        SHPDestroyObject(hSHPObject); // de-allocate SHPObject
+    }
+    _geoObjects.addPolylineVec(std::move(lines), listName);
 }
 
 void SHPInterface::readPolygons(const SHPHandle &hSHP, int numberOfElements, const std::string &listName)
 {
-	readPolylines(hSHP, numberOfElements, listName);
-
-	auto const polylines = _geoObjects.getPolylineVec(listName);
-	auto sfc_vec = std::unique_ptr<std::vector<GeoLib::Surface*>>(
-	    new std::vector<GeoLib::Surface*>);
-
-	for (auto const* polyline : *polylines) {
-		GeoLib::Surface* sfc(GeoLib::Surface::createSurface(*polyline));
-		if (sfc)
-			sfc_vec->push_back(sfc);
-		else {
-			WARN("SHPInterface::readPolygons(): Could not triangulate polygon.")
-		}
-	}
-
-	if (!sfc_vec->empty())
-		_geoObjects.addSurfaceVec(std::move(sfc_vec), listName);
+    readPolylines(hSHP, numberOfElements, listName);
+
+    auto const polylines = _geoObjects.getPolylineVec(listName);
+    auto sfc_vec = std::unique_ptr<std::vector<GeoLib::Surface*>>(
+        new std::vector<GeoLib::Surface*>);
+
+    for (auto const* polyline : *polylines) {
+        GeoLib::Surface* sfc(GeoLib::Surface::createSurface(*polyline));
+        if (sfc)
+            sfc_vec->push_back(sfc);
+        else {
+            WARN("SHPInterface::readPolygons(): Could not triangulate polygon.")
+        }
+    }
+
+    if (!sfc_vec->empty())
+        _geoObjects.addSurfaceVec(std::move(sfc_vec), listName);
 }
 
 bool SHPInterface::write2dMeshToSHP(const std::string &file_name, const MeshLib::Mesh &mesh)
 {
-	if (mesh.getDimension()!=2)
-	{
-		ERR ("SHPInterface::write2dMeshToSHP(): Mesh to Shape conversion is only working for 2D Meshes.");
-		return false;
-	}
-
-	unsigned nElements (mesh.getNElements());
-	if (nElements<1)
-	{
-		ERR ("SHPInterface::write2dMeshToSHP(): Mesh contains no elements.");
-		return false;
-	}
-
-	if (nElements>10E+7) // DBF-export requires a limit, 10 mio seems good for now
-	{
-		ERR ("SHPInterface::write2dMeshToSHP(): Mesh contains too many elements for currently implemented DBF-boundaries.");
-		return false;
-	}
-
-	SHPHandle hSHP = SHPCreate(file_name.c_str(), SHPT_POLYGON);
-	DBFHandle hDBF = DBFCreate(file_name.c_str());
-	int elem_id_field = DBFAddField(hDBF, "Elem_ID", FTInteger, 7, 0); // allows integers of length "7", i.e. 10mio-1 elements
-	int mat_field = DBFAddField(hDBF, "Material", FTInteger, 7, 0);
-	int node0_field = DBFAddField(hDBF, "Node0", FTInteger, 7, 0);
-	int node1_field = DBFAddField(hDBF, "Node1", FTInteger, 7, 0);
-	int node2_field = DBFAddField(hDBF, "Node2", FTInteger, 7, 0);
-
-	unsigned polygon_id (0);
-	double* padfX;
-	double* padfY;
-	double* padfZ;
-	for (unsigned i=0; i<nElements; ++i)
-	{
-		const MeshLib::Element* e (mesh.getElement(i));
-
-		// ignore all elements except triangles and quads
-		if ((e->getGeomType() == MeshLib::MeshElemType::TRIANGLE) ||
-			(e->getGeomType() == MeshLib::MeshElemType::QUAD))
-		{
-			// write element ID and material group to DBF-file
-			DBFWriteIntegerAttribute(hDBF, polygon_id, elem_id_field, i);
-			auto materialIds = mesh.getProperties().getPropertyVector<int>("MaterialIDs");
-			if (materialIds)
-				DBFWriteIntegerAttribute(hDBF, polygon_id, mat_field, (*materialIds)[i]);
-
-			unsigned nNodes (e->getNBaseNodes());
-			padfX = new double[nNodes+1];
-			padfY = new double[nNodes+1];
-			padfZ = new double[nNodes+1];
-			for (unsigned j=0; j<nNodes; ++j)
-			{
-				padfX[j]=(*e->getNode(j))[0];
-				padfY[j]=(*e->getNode(j))[1];
-				padfZ[j]=(*e->getNode(j))[2];
-			}
-			// Last node == first node to close the polygon
-			padfX[nNodes]=(*e->getNode(0))[0];
-			padfY[nNodes]=(*e->getNode(0))[1];
-			padfZ[nNodes]=(*e->getNode(0))[2];
-			// write the first three node ids to the dbf-file (this also specifies a QUAD uniquely)
-			DBFWriteIntegerAttribute(hDBF, polygon_id, node0_field, e->getNode(0)->getID());
-			DBFWriteIntegerAttribute(hDBF, polygon_id, node1_field, e->getNode(1)->getID());
-			DBFWriteIntegerAttribute(hDBF, polygon_id, node2_field, e->getNode(2)->getID());
-
-			SHPObject *object = SHPCreateObject(SHPT_POLYGON, polygon_id++, 0, 0, NULL, ++nNodes, padfX, padfY, padfZ, NULL);
-			SHPWriteObject(hSHP, -1, object);
-
-			// Note: cleaning up the coordinate arrays padfX, -Y, -Z results in a crash, I assume that shapelib removes them
-			delete object;
-		}
-	}
-
-	SHPClose(hSHP);
-	DBFClose(hDBF);
-	INFO ("Shape export of 2D mesh \"%s\" successful.", mesh.getName().c_str());
-
-	return true;
+    if (mesh.getDimension()!=2)
+    {
+        ERR ("SHPInterface::write2dMeshToSHP(): Mesh to Shape conversion is only working for 2D Meshes.");
+        return false;
+    }
+
+    unsigned nElements (mesh.getNElements());
+    if (nElements<1)
+    {
+        ERR ("SHPInterface::write2dMeshToSHP(): Mesh contains no elements.");
+        return false;
+    }
+
+    if (nElements>10E+7) // DBF-export requires a limit, 10 mio seems good for now
+    {
+        ERR ("SHPInterface::write2dMeshToSHP(): Mesh contains too many elements for currently implemented DBF-boundaries.");
+        return false;
+    }
+
+    SHPHandle hSHP = SHPCreate(file_name.c_str(), SHPT_POLYGON);
+    DBFHandle hDBF = DBFCreate(file_name.c_str());
+    int elem_id_field = DBFAddField(hDBF, "Elem_ID", FTInteger, 7, 0); // allows integers of length "7", i.e. 10mio-1 elements
+    int mat_field = DBFAddField(hDBF, "Material", FTInteger, 7, 0);
+    int node0_field = DBFAddField(hDBF, "Node0", FTInteger, 7, 0);
+    int node1_field = DBFAddField(hDBF, "Node1", FTInteger, 7, 0);
+    int node2_field = DBFAddField(hDBF, "Node2", FTInteger, 7, 0);
+
+    unsigned polygon_id (0);
+    double* padfX;
+    double* padfY;
+    double* padfZ;
+    for (unsigned i=0; i<nElements; ++i)
+    {
+        const MeshLib::Element* e (mesh.getElement(i));
+
+        // ignore all elements except triangles and quads
+        if ((e->getGeomType() == MeshLib::MeshElemType::TRIANGLE) ||
+            (e->getGeomType() == MeshLib::MeshElemType::QUAD))
+        {
+            // write element ID and material group to DBF-file
+            DBFWriteIntegerAttribute(hDBF, polygon_id, elem_id_field, i);
+            auto materialIds = mesh.getProperties().getPropertyVector<int>("MaterialIDs");
+            if (materialIds)
+                DBFWriteIntegerAttribute(hDBF, polygon_id, mat_field, (*materialIds)[i]);
+
+            unsigned nNodes (e->getNBaseNodes());
+            padfX = new double[nNodes+1];
+            padfY = new double[nNodes+1];
+            padfZ = new double[nNodes+1];
+            for (unsigned j=0; j<nNodes; ++j)
+            {
+                padfX[j]=(*e->getNode(j))[0];
+                padfY[j]=(*e->getNode(j))[1];
+                padfZ[j]=(*e->getNode(j))[2];
+            }
+            // Last node == first node to close the polygon
+            padfX[nNodes]=(*e->getNode(0))[0];
+            padfY[nNodes]=(*e->getNode(0))[1];
+            padfZ[nNodes]=(*e->getNode(0))[2];
+            // write the first three node ids to the dbf-file (this also specifies a QUAD uniquely)
+            DBFWriteIntegerAttribute(hDBF, polygon_id, node0_field, e->getNode(0)->getID());
+            DBFWriteIntegerAttribute(hDBF, polygon_id, node1_field, e->getNode(1)->getID());
+            DBFWriteIntegerAttribute(hDBF, polygon_id, node2_field, e->getNode(2)->getID());
+
+            SHPObject *object = SHPCreateObject(SHPT_POLYGON, polygon_id++, 0, 0, NULL, ++nNodes, padfX, padfY, padfZ, NULL);
+            SHPWriteObject(hSHP, -1, object);
+
+            // Note: cleaning up the coordinate arrays padfX, -Y, -Z results in a crash, I assume that shapelib removes them
+            delete object;
+        }
+    }
+
+    SHPClose(hSHP);
+    DBFClose(hDBF);
+    INFO ("Shape export of 2D mesh \"%s\" successful.", mesh.getName().c_str());
+
+    return true;
 }
 
 }
diff --git a/FileIO/SHPInterface.h b/FileIO/SHPInterface.h
index be7b3647d4094586ad0cec5e41021154c0c44490..40db0eaa834453f746fda548010dfb7f3b24dc3d 100644
--- a/FileIO/SHPInterface.h
+++ b/FileIO/SHPInterface.h
@@ -26,12 +26,12 @@
 
 
 namespace GeoLib {
-	class GEOObjects;
-	class Polyline;
+    class GEOObjects;
+    class Polyline;
 }
 
 namespace MeshLib {
-	class Mesh;
+    class Mesh;
 }
 
 
@@ -44,44 +44,44 @@ namespace FileIO
 class SHPInterface
 {
 public:
-	/// Connection between ESRI type system for shape files and OGS GeoLib.
-	enum class OGSType
-	{
-		UNDEFINED   = 0,
-		POINT       = 1,
-		STATION     = 2,
-		POLYLINE    = 3,
-		POLYGON     = 4
-	};
+    /// Connection between ESRI type system for shape files and OGS GeoLib.
+    enum class OGSType
+    {
+        UNDEFINED   = 0,
+        POINT       = 1,
+        STATION     = 2,
+        POLYLINE    = 3,
+        POLYGON     = 4
+    };
 
-	/// Constructor
-	SHPInterface(GeoLib::GEOObjects& geoObjects) : _geoObjects(geoObjects) {}
+    /// Constructor
+    SHPInterface(GeoLib::GEOObjects& geoObjects) : _geoObjects(geoObjects) {}
 
-	/// Reads the header of the shape file.
-	bool readSHPInfo(const std::string &filename, int &shapeType, int &numberOfEntities);
+    /// Reads the header of the shape file.
+    bool readSHPInfo(const std::string &filename, int &shapeType, int &numberOfEntities);
 
-	/// Reads data from the shape file.
-	void readSHPFile(const std::string &filename, OGSType choice, const std::string &listName);
+    /// Reads data from the shape file.
+    void readSHPFile(const std::string &filename, OGSType choice, const std::string &listName);
 
-	/// Writes a 2D mesh into a shapefile using one polygon for every element
-	/// (based on request by AS, open for discussion)
-	static bool write2dMeshToSHP(const std::string &file_name, const MeshLib::Mesh &mesh);
+    /// Writes a 2D mesh into a shapefile using one polygon for every element
+    /// (based on request by AS, open for discussion)
+    static bool write2dMeshToSHP(const std::string &file_name, const MeshLib::Mesh &mesh);
 
 
 private:
-	/// Reads points into a vector of Point objects.
-	void readPoints    (const SHPHandle &hSHP, int numberOfElements, std::string listName);
+    /// Reads points into a vector of Point objects.
+    void readPoints    (const SHPHandle &hSHP, int numberOfElements, std::string listName);
 
-	/// Reads points into a vector of Point objects and marks them as Station.
-	void readStations  (const SHPHandle &hSHP, int numberOfElements, std::string listName);
+    /// Reads points into a vector of Point objects and marks them as Station.
+    void readStations  (const SHPHandle &hSHP, int numberOfElements, std::string listName);
 
-	/// Reads lines into a vector of Polyline objects.
-	void readPolylines (const SHPHandle &hSHP, int numberOfElements, std::string listName);
+    /// Reads lines into a vector of Polyline objects.
+    void readPolylines (const SHPHandle &hSHP, int numberOfElements, std::string listName);
 
-	/// Reads lines into a vector of Polyline and Surface objects.
-	void readPolygons  (const SHPHandle &hSHP, int numberOfElements, const std::string& listName);
+    /// Reads lines into a vector of Polyline and Surface objects.
+    void readPolygons  (const SHPHandle &hSHP, int numberOfElements, const std::string& listName);
 
-	GeoLib::GEOObjects& _geoObjects;
+    GeoLib::GEOObjects& _geoObjects;
 };
 
 }
diff --git a/FileIO/TetGenInterface.cpp b/FileIO/TetGenInterface.cpp
index e0c383a1c39735e3deead65e116ead2dc6877192..e8153fe9c301dadf5a4f439db09aa1a3c1a00920 100644
--- a/FileIO/TetGenInterface.cpp
+++ b/FileIO/TetGenInterface.cpp
@@ -34,7 +34,7 @@
 namespace FileIO
 {
 TetGenInterface::TetGenInterface() :
-	_zero_based_idx (false), _boundary_markers (false)
+    _zero_based_idx (false), _boundary_markers (false)
 {
 }
 
@@ -43,80 +43,80 @@ TetGenInterface::~TetGenInterface()
 }
 
 bool TetGenInterface::readTetGenGeometry (std::string const& geo_fname,
-	                                      GeoLib::GEOObjects &geo_objects)
+                                          GeoLib::GEOObjects &geo_objects)
 {
-	std::ifstream poly_stream (geo_fname.c_str());
-
-	if (!poly_stream)
-	{
-		ERR ("TetGenInterface::readTetGenGeometry() failed to open %s", geo_fname.c_str());
-		return false;
-	}
-	std::string ext (BaseLib::getFileExtension(geo_fname));
-	if (ext.compare("smesh") != 0)
-	{
-		ERR ("TetGenInterface::readTetGenGeometry() - unknown file type (only *.smesh is supported).");
-		return false;
-	}
-
-	std::vector<MeshLib::Node*> nodes;
-	if (!readNodesFromStream (poly_stream, nodes))
-	{
-		// remove nodes read until now
-		for (std::size_t k(0); k<nodes.size(); ++k)
-			delete nodes[k];
-		return false;
-	}
-	const std::size_t nNodes (nodes.size());
-	auto points = std::unique_ptr<std::vector<GeoLib::Point*>>(
-	    new std::vector<GeoLib::Point*>);
-	points->reserve(nNodes);
-	for (std::size_t k(0); k<nNodes; ++k)
-	{
-		points->push_back(new GeoLib::Point(*(nodes[k]), nodes[k]->getID()));
-		delete nodes[k];
-	}
-	std::string geo_name (BaseLib::extractBaseNameWithoutExtension(geo_fname));
-	geo_objects.addPointVec(std::move(points), geo_name);
-	const std::vector<std::size_t> &id_map (geo_objects.getPointVecObj(geo_name)->getIDMap());
-
-	auto surfaces = std::unique_ptr<std::vector<GeoLib::Surface*>>(
-		new std::vector<GeoLib::Surface*>);
-	if (!parseSmeshFacets(poly_stream, *surfaces, *geo_objects.getPointVec(geo_name), id_map))
-	{
-		// remove surfaces read until now but keep the points
-		for (std::size_t k=0; k<surfaces->size(); k++)
-			delete (*surfaces)[k];
-	}
-	geo_objects.addSurfaceVec(std::move(surfaces), geo_name);
-
-	return true;
+    std::ifstream poly_stream (geo_fname.c_str());
+
+    if (!poly_stream)
+    {
+        ERR ("TetGenInterface::readTetGenGeometry() failed to open %s", geo_fname.c_str());
+        return false;
+    }
+    std::string ext (BaseLib::getFileExtension(geo_fname));
+    if (ext.compare("smesh") != 0)
+    {
+        ERR ("TetGenInterface::readTetGenGeometry() - unknown file type (only *.smesh is supported).");
+        return false;
+    }
+
+    std::vector<MeshLib::Node*> nodes;
+    if (!readNodesFromStream (poly_stream, nodes))
+    {
+        // remove nodes read until now
+        for (std::size_t k(0); k<nodes.size(); ++k)
+            delete nodes[k];
+        return false;
+    }
+    const std::size_t nNodes (nodes.size());
+    auto points = std::unique_ptr<std::vector<GeoLib::Point*>>(
+        new std::vector<GeoLib::Point*>);
+    points->reserve(nNodes);
+    for (std::size_t k(0); k<nNodes; ++k)
+    {
+        points->push_back(new GeoLib::Point(*(nodes[k]), nodes[k]->getID()));
+        delete nodes[k];
+    }
+    std::string geo_name (BaseLib::extractBaseNameWithoutExtension(geo_fname));
+    geo_objects.addPointVec(std::move(points), geo_name);
+    const std::vector<std::size_t> &id_map (geo_objects.getPointVecObj(geo_name)->getIDMap());
+
+    auto surfaces = std::unique_ptr<std::vector<GeoLib::Surface*>>(
+        new std::vector<GeoLib::Surface*>);
+    if (!parseSmeshFacets(poly_stream, *surfaces, *geo_objects.getPointVec(geo_name), id_map))
+    {
+        // remove surfaces read until now but keep the points
+        for (std::size_t k=0; k<surfaces->size(); k++)
+            delete (*surfaces)[k];
+    }
+    geo_objects.addSurfaceVec(std::move(surfaces), geo_name);
+
+    return true;
 }
 
 std::size_t TetGenInterface::getNFacets(std::ifstream &input)
 {
-	std::string line;
-	while (!input.fail())
-	{
-		getline (input, line);
-		if (input.fail())
-		{
-			ERR("TetGenInterface::getNFacets(): Error reading number of facets.");
-			return 0;
-		}
-
-		BaseLib::simplify(line);
-		if (line.empty() || line.compare(0,1,"#") == 0)
-			continue;
-
-		const std::list<std::string> fields = BaseLib::splitString(line, ' ');
-		std::list<std::string>::const_iterator it = fields.begin();
-		const std::size_t nFacets (BaseLib::str2number<std::size_t> (*it));
-		if (fields.size() > 1)
-			_boundary_markers = (BaseLib::str2number<std::size_t> (*(++it)) == 0) ? false : true;
-		return nFacets;
-	}
-	return 0;
+    std::string line;
+    while (!input.fail())
+    {
+        getline (input, line);
+        if (input.fail())
+        {
+            ERR("TetGenInterface::getNFacets(): Error reading number of facets.");
+            return 0;
+        }
+
+        BaseLib::simplify(line);
+        if (line.empty() || line.compare(0,1,"#") == 0)
+            continue;
+
+        const std::list<std::string> fields = BaseLib::splitString(line, ' ');
+        std::list<std::string>::const_iterator it = fields.begin();
+        const std::size_t nFacets (BaseLib::str2number<std::size_t> (*it));
+        if (fields.size() > 1)
+            _boundary_markers = (BaseLib::str2number<std::size_t> (*(++it)) == 0) ? false : true;
+        return nFacets;
+    }
+    return 0;
 }
 
 bool TetGenInterface::parseSmeshFacets(std::ifstream &input,
@@ -124,156 +124,156 @@ bool TetGenInterface::parseSmeshFacets(std::ifstream &input,
                                        const std::vector<GeoLib::Point*> &points,
                                        const std::vector<std::size_t> &pnt_id_map)
 {
-	const std::size_t nFacets (this->getNFacets(input));
-	std::string line;
-	surfaces.reserve(nFacets);
-	std::list<std::string>::const_iterator it;
-
-	const unsigned offset = (_zero_based_idx) ? 0 : 1;
-	std::vector<std::size_t> idx_map;
-
-	std::size_t k(0);
-	while (k<nFacets && !input.fail())
-	{
-		getline (input, line);
-		if (input.fail())
-		{
-			ERR("TetGenInterface::parseFacets(): Error reading facet %d.", k);
-			return false;
-		}
-
-		BaseLib::simplify(line);
-		if (line.empty() || line.compare(0,1,"#") == 0)
-		{
-			continue;
-		}
-
-		// read facets
-		const std::list<std::string> point_fields = BaseLib::splitString(line, ' ');
-		it = point_fields.begin();
-		const std::size_t nPoints = BaseLib::str2number<std::size_t>(*it);
-		if (nPoints != 3)
-		{
-			ERR ("Smesh-files are currently only supported for triangle meshes.");
-			return false;
-		}
-		std::vector<std::size_t> point_ids;
-		const std::size_t point_field_size = (_boundary_markers) ? nPoints+1 : nPoints;
-		if (point_fields.size() > point_field_size)
-		{
-			for (std::size_t j(0); j<nPoints; ++j)
-				point_ids.push_back(pnt_id_map[BaseLib::str2number<std::size_t>(*(++it))-offset]);
-
-			const std::size_t sfc_marker = (_boundary_markers) ? BaseLib::str2number<std::size_t>(*(++it)) : 0;
-			const std::size_t idx = std::find(idx_map.begin(), idx_map.end(), sfc_marker) - idx_map.begin();
-			if (idx >= surfaces.size())
-			{
-				idx_map.push_back(sfc_marker);
-				surfaces.push_back(new GeoLib::Surface(points));
-			}
-			surfaces[idx]->addTriangle(point_ids[0], point_ids[1], point_ids[2]);
-		}
-		else
-		{
-			ERR("TetGenInterface::parseFacets(): Error reading points for facet %d.", k);
-			return false;
-		}
-		++k;
-	}
-	// here the poly-file potentially defines a number of points to mark holes within the volumes defined by the facets, these are ignored for now
-	// here the poly-file potentially defines a number of region attributes, these are ignored for now
-
-	std::size_t nTotalTriangles (0);
-	for (std::size_t i=0; i<surfaces.size(); ++i)
-		nTotalTriangles += surfaces[i]->getNTriangles();
-	if (nTotalTriangles == nFacets)
-		return true;
-
-	ERR ("TetGenInterface::parseFacets(): Number of expected total triangles (%d) does not match number of found triangles (%d).", surfaces.size(), nTotalTriangles);
-	return false;
+    const std::size_t nFacets (this->getNFacets(input));
+    std::string line;
+    surfaces.reserve(nFacets);
+    std::list<std::string>::const_iterator it;
+
+    const unsigned offset = (_zero_based_idx) ? 0 : 1;
+    std::vector<std::size_t> idx_map;
+
+    std::size_t k(0);
+    while (k<nFacets && !input.fail())
+    {
+        getline (input, line);
+        if (input.fail())
+        {
+            ERR("TetGenInterface::parseFacets(): Error reading facet %d.", k);
+            return false;
+        }
+
+        BaseLib::simplify(line);
+        if (line.empty() || line.compare(0,1,"#") == 0)
+        {
+            continue;
+        }
+
+        // read facets
+        const std::list<std::string> point_fields = BaseLib::splitString(line, ' ');
+        it = point_fields.begin();
+        const std::size_t nPoints = BaseLib::str2number<std::size_t>(*it);
+        if (nPoints != 3)
+        {
+            ERR ("Smesh-files are currently only supported for triangle meshes.");
+            return false;
+        }
+        std::vector<std::size_t> point_ids;
+        const std::size_t point_field_size = (_boundary_markers) ? nPoints+1 : nPoints;
+        if (point_fields.size() > point_field_size)
+        {
+            for (std::size_t j(0); j<nPoints; ++j)
+                point_ids.push_back(pnt_id_map[BaseLib::str2number<std::size_t>(*(++it))-offset]);
+
+            const std::size_t sfc_marker = (_boundary_markers) ? BaseLib::str2number<std::size_t>(*(++it)) : 0;
+            const std::size_t idx = std::find(idx_map.begin(), idx_map.end(), sfc_marker) - idx_map.begin();
+            if (idx >= surfaces.size())
+            {
+                idx_map.push_back(sfc_marker);
+                surfaces.push_back(new GeoLib::Surface(points));
+            }
+            surfaces[idx]->addTriangle(point_ids[0], point_ids[1], point_ids[2]);
+        }
+        else
+        {
+            ERR("TetGenInterface::parseFacets(): Error reading points for facet %d.", k);
+            return false;
+        }
+        ++k;
+    }
+    // here the poly-file potentially defines a number of points to mark holes within the volumes defined by the facets, these are ignored for now
+    // here the poly-file potentially defines a number of region attributes, these are ignored for now
+
+    std::size_t nTotalTriangles (0);
+    for (std::size_t i=0; i<surfaces.size(); ++i)
+        nTotalTriangles += surfaces[i]->getNTriangles();
+    if (nTotalTriangles == nFacets)
+        return true;
+
+    ERR ("TetGenInterface::parseFacets(): Number of expected total triangles (%d) does not match number of found triangles (%d).", surfaces.size(), nTotalTriangles);
+    return false;
 }
 
 MeshLib::Mesh* TetGenInterface::readTetGenMesh (std::string const& nodes_fname,
                                                 std::string const& ele_fname)
 {
-	std::ifstream ins_nodes (nodes_fname.c_str());
-	std::ifstream ins_ele (ele_fname.c_str());
-
-	if (!ins_nodes || !ins_ele)
-	{
-		if (!ins_nodes)
-			ERR ("TetGenInterface::readTetGenMesh failed to open %s", nodes_fname.c_str());
-		if (!ins_ele)
-			ERR ("TetGenInterface::readTetGenMesh failed to open %s", ele_fname.c_str());
-		return nullptr;
-	}
-
-	std::vector<MeshLib::Node*> nodes;
-	if (!readNodesFromStream (ins_nodes, nodes)) {
-		// remove nodes read until now
-		for (std::size_t k(0); k<nodes.size(); k++) {
-			delete nodes[k];
-		}
-		return nullptr;
-	}
-
-	std::vector<MeshLib::Element*> elements;
-	std::vector<int> materials;
-	if (!readElementsFromStream (ins_ele, elements, materials, nodes)) {
-		// remove elements read until now
-		for (std::size_t k(0); k<elements.size(); k++) {
-			delete elements[k];
-		}
-		// remove nodes
-		for (std::size_t k(0); k<nodes.size(); k++) {
-			delete nodes[k];
-		}
-		return nullptr;
-	}
-
-	MeshLib::Properties properties;
-	// Transmit material values if there is any material value != 0
-	if (std::any_of(materials.cbegin(), materials.cend(), [](int m){ return m != 0; }))
-	{
-		boost::optional<MeshLib::PropertyVector<int>&> mat_props =
-		    properties.createNewPropertyVector<int>(
-		        "MaterialIDs", MeshLib::MeshItemType::Cell);
-		mat_props->reserve(elements.size());
-		std::copy(materials.cbegin(),
-		          materials.cend(),
-		          std::back_inserter(*mat_props));
-	}
-
-	const std::string mesh_name (BaseLib::extractBaseNameWithoutExtension(nodes_fname));
-	return new MeshLib::Mesh(mesh_name, nodes, elements, properties);
+    std::ifstream ins_nodes (nodes_fname.c_str());
+    std::ifstream ins_ele (ele_fname.c_str());
+
+    if (!ins_nodes || !ins_ele)
+    {
+        if (!ins_nodes)
+            ERR ("TetGenInterface::readTetGenMesh failed to open %s", nodes_fname.c_str());
+        if (!ins_ele)
+            ERR ("TetGenInterface::readTetGenMesh failed to open %s", ele_fname.c_str());
+        return nullptr;
+    }
+
+    std::vector<MeshLib::Node*> nodes;
+    if (!readNodesFromStream (ins_nodes, nodes)) {
+        // remove nodes read until now
+        for (std::size_t k(0); k<nodes.size(); k++) {
+            delete nodes[k];
+        }
+        return nullptr;
+    }
+
+    std::vector<MeshLib::Element*> elements;
+    std::vector<int> materials;
+    if (!readElementsFromStream (ins_ele, elements, materials, nodes)) {
+        // remove elements read until now
+        for (std::size_t k(0); k<elements.size(); k++) {
+            delete elements[k];
+        }
+        // remove nodes
+        for (std::size_t k(0); k<nodes.size(); k++) {
+            delete nodes[k];
+        }
+        return nullptr;
+    }
+
+    MeshLib::Properties properties;
+    // Transmit material values if there is any material value != 0
+    if (std::any_of(materials.cbegin(), materials.cend(), [](int m){ return m != 0; }))
+    {
+        boost::optional<MeshLib::PropertyVector<int>&> mat_props =
+            properties.createNewPropertyVector<int>(
+                "MaterialIDs", MeshLib::MeshItemType::Cell);
+        mat_props->reserve(elements.size());
+        std::copy(materials.cbegin(),
+                  materials.cend(),
+                  std::back_inserter(*mat_props));
+    }
+
+    const std::string mesh_name (BaseLib::extractBaseNameWithoutExtension(nodes_fname));
+    return new MeshLib::Mesh(mesh_name, nodes, elements, properties);
 }
 
 bool TetGenInterface::readNodesFromStream (std::ifstream &ins,
                                            std::vector<MeshLib::Node*> &nodes)
 {
-	std::string line;
-	getline (ins, line);
-	std::size_t n_nodes, dim, n_attributes;
-	bool boundary_markers;
-
-	while (!ins.fail())
-	{
-		BaseLib::simplify(line);
-		if (line.empty() || line.compare(0,1,"#") == 0)
-		{
-			// this line is a comment - skip
-			getline (ins, line);
-			continue;
-		}
-		// read header line
-		bool header_okay = parseNodesFileHeader(line, n_nodes, dim, n_attributes, boundary_markers);
-		if (!header_okay)
-			return false;
-		if (!parseNodes(ins, nodes, n_nodes, dim))
-			return false;
-		return true;
-	}
-	return false;
+    std::string line;
+    getline (ins, line);
+    std::size_t n_nodes, dim, n_attributes;
+    bool boundary_markers;
+
+    while (!ins.fail())
+    {
+        BaseLib::simplify(line);
+        if (line.empty() || line.compare(0,1,"#") == 0)
+        {
+            // this line is a comment - skip
+            getline (ins, line);
+            continue;
+        }
+        // read header line
+        bool header_okay = parseNodesFileHeader(line, n_nodes, dim, n_attributes, boundary_markers);
+        if (!header_okay)
+            return false;
+        if (!parseNodes(ins, nodes, n_nodes, dim))
+            return false;
+        return true;
+    }
+    return false;
 }
 
 bool TetGenInterface::parseNodesFileHeader(std::string &line,
@@ -282,27 +282,27 @@ bool TetGenInterface::parseNodesFileHeader(std::string &line,
                                            std::size_t &n_attributes,
                                            bool &boundary_markers) const
 {
-	std::list<std::string> pnt_header = BaseLib::splitString(line, ' ');
-	if (pnt_header.empty())
-	{
-		ERR("TetGenInterface::parseNodesFileHeader(): could not read number of nodes specified in header.");
-		return false;
-	}
-	auto it = pnt_header.begin();
-	n_nodes = BaseLib::str2number<std::size_t> (*it);
-	dim = (pnt_header.size()==1) ? 3 : BaseLib::str2number<std::size_t> (*(++it));
-
-	if (pnt_header.size()<4)
-	{
-		n_attributes = 0;
-		boundary_markers = false;
-		return true;
-	}
-
-	n_attributes = BaseLib::str2number<std::size_t> (*(++it));
-	boundary_markers = ((++it)->compare("1") == 0) ? true : false;
-
-	return true;
+    std::list<std::string> pnt_header = BaseLib::splitString(line, ' ');
+    if (pnt_header.empty())
+    {
+        ERR("TetGenInterface::parseNodesFileHeader(): could not read number of nodes specified in header.");
+        return false;
+    }
+    auto it = pnt_header.begin();
+    n_nodes = BaseLib::str2number<std::size_t> (*it);
+    dim = (pnt_header.size()==1) ? 3 : BaseLib::str2number<std::size_t> (*(++it));
+
+    if (pnt_header.size()<4)
+    {
+        n_attributes = 0;
+        boundary_markers = false;
+        return true;
+    }
+
+    n_attributes = BaseLib::str2number<std::size_t> (*(++it));
+    boundary_markers = ((++it)->compare("1") == 0) ? true : false;
+
+    return true;
 }
 
 bool TetGenInterface::parseNodes(std::ifstream &ins,
@@ -310,61 +310,61 @@ bool TetGenInterface::parseNodes(std::ifstream &ins,
                                  std::size_t n_nodes,
                                  std::size_t dim)
 {
-	std::string line;
-	double* coordinates (new double[dim]);
-	nodes.reserve(n_nodes);
-
-	std::size_t k(0);
-	while (k < n_nodes && !ins.fail())
-	{
-		getline(ins, line);
-		if (ins.fail())
-		{
-			ERR("TetGenInterface::parseNodes(): Error reading node %d.", k);
-			return false;
-		}
-
-		std::size_t id;
-		std::size_t pos_end = 0;
-		std::size_t pos_beg = line.find_first_not_of(" ", pos_end);
-		pos_end = line.find_first_of(" \n", pos_beg);
-
-		if (line.empty() || pos_beg==pos_end || line.compare(pos_beg,1,"#") == 0)
-		{
-			continue;
-		}
-
-		if (pos_beg != std::string::npos && pos_end != std::string::npos) {
-			id = BaseLib::str2number<std::size_t> (line.substr(pos_beg, pos_end - pos_beg));
-			if (k == 0 && id == 0)
-				_zero_based_idx = true;
-		} else {
-			ERR("TetGenInterface::parseNodes(): Error reading ID of node %d.", k);
-			delete [] coordinates;
-			return false;
-		}
-		// read coordinates
-		const unsigned offset = (_zero_based_idx) ? 0 : 1;
-		for (std::size_t i(0); i < dim; i++) {
-			pos_beg = line.find_first_not_of(" ", pos_end);
-			pos_end = line.find_first_of(" \n", pos_beg);
-			if (pos_end == std::string::npos) pos_end = line.size();
-			if (pos_beg != std::string::npos)
-				coordinates[i] = BaseLib::str2number<double>(line.substr(pos_beg, pos_end-pos_beg));
-			else {
-				ERR("TetGenInterface::parseNodes(): error reading coordinate %d of node %d.", i, k);
-				delete [] coordinates;
-				return false;
-			}
-		}
-
-		nodes.push_back(new MeshLib::Node(coordinates, id-offset));
-		// read attributes and boundary markers ... - at the moment we do not use this information
-		++k;
-	}
-
-	delete [] coordinates;
-	return true;
+    std::string line;
+    double* coordinates (new double[dim]);
+    nodes.reserve(n_nodes);
+
+    std::size_t k(0);
+    while (k < n_nodes && !ins.fail())
+    {
+        getline(ins, line);
+        if (ins.fail())
+        {
+            ERR("TetGenInterface::parseNodes(): Error reading node %d.", k);
+            return false;
+        }
+
+        std::size_t id;
+        std::size_t pos_end = 0;
+        std::size_t pos_beg = line.find_first_not_of(" ", pos_end);
+        pos_end = line.find_first_of(" \n", pos_beg);
+
+        if (line.empty() || pos_beg==pos_end || line.compare(pos_beg,1,"#") == 0)
+        {
+            continue;
+        }
+
+        if (pos_beg != std::string::npos && pos_end != std::string::npos) {
+            id = BaseLib::str2number<std::size_t> (line.substr(pos_beg, pos_end - pos_beg));
+            if (k == 0 && id == 0)
+                _zero_based_idx = true;
+        } else {
+            ERR("TetGenInterface::parseNodes(): Error reading ID of node %d.", k);
+            delete [] coordinates;
+            return false;
+        }
+        // read coordinates
+        const unsigned offset = (_zero_based_idx) ? 0 : 1;
+        for (std::size_t i(0); i < dim; i++) {
+            pos_beg = line.find_first_not_of(" ", pos_end);
+            pos_end = line.find_first_of(" \n", pos_beg);
+            if (pos_end == std::string::npos) pos_end = line.size();
+            if (pos_beg != std::string::npos)
+                coordinates[i] = BaseLib::str2number<double>(line.substr(pos_beg, pos_end-pos_beg));
+            else {
+                ERR("TetGenInterface::parseNodes(): error reading coordinate %d of node %d.", i, k);
+                delete [] coordinates;
+                return false;
+            }
+        }
+
+        nodes.push_back(new MeshLib::Node(coordinates, id-offset));
+        // read attributes and boundary markers ... - at the moment we do not use this information
+        ++k;
+    }
+
+    delete [] coordinates;
+    return true;
 }
 
 bool TetGenInterface::readElementsFromStream(std::ifstream &ins,
@@ -372,30 +372,30 @@ bool TetGenInterface::readElementsFromStream(std::ifstream &ins,
                                              std::vector<int> &materials,
                                              const std::vector<MeshLib::Node*> &nodes) const
 {
-	std::string line;
-	getline (ins, line);
-	std::size_t n_tets, n_nodes_per_tet;
-	bool region_attributes;
-
-	while (!ins.fail())
-	{
-		BaseLib::simplify(line);
-		if (line.empty() || line.compare(0,1,"#") == 0)
-		{
-			// this line is a comment - skip
-			getline (ins, line);
-			continue;
-		}
-
-		// read header line
-		bool header_okay = parseElementsFileHeader(line, n_tets, n_nodes_per_tet, region_attributes);
-		if (!header_okay)
-			return false;
-		if (!parseElements(ins, elements, materials, nodes, n_tets, n_nodes_per_tet, region_attributes))
-			return false;
-		return true;
-	}
-	return false;
+    std::string line;
+    getline (ins, line);
+    std::size_t n_tets, n_nodes_per_tet;
+    bool region_attributes;
+
+    while (!ins.fail())
+    {
+        BaseLib::simplify(line);
+        if (line.empty() || line.compare(0,1,"#") == 0)
+        {
+            // this line is a comment - skip
+            getline (ins, line);
+            continue;
+        }
+
+        // read header line
+        bool header_okay = parseElementsFileHeader(line, n_tets, n_nodes_per_tet, region_attributes);
+        if (!header_okay)
+            return false;
+        if (!parseElements(ins, elements, materials, nodes, n_tets, n_nodes_per_tet, region_attributes))
+            return false;
+        return true;
+    }
+    return false;
 }
 
 bool TetGenInterface::parseElementsFileHeader(std::string &line,
@@ -403,32 +403,32 @@ bool TetGenInterface::parseElementsFileHeader(std::string &line,
                                               std::size_t& n_nodes_per_tet,
                                               bool& region_attribute) const
 {
-	std::size_t pos_beg, pos_end;
-
-	// number of tetrahedras
-	pos_beg = line.find_first_not_of (" ");
-	pos_end = line.find_first_of(" ", pos_beg);
-	if (pos_beg != std::string::npos && pos_end != std::string::npos)
-		n_tets = BaseLib::str2number<std::size_t> (line.substr(pos_beg, pos_end - pos_beg));
-	else {
-		ERR("TetGenInterface::parseElementsFileHeader(): Could not read number of tetrahedra specified in header.");
-		return false;
-	}
-	// nodes per tet - either 4 or 10
-	pos_beg = line.find_first_not_of (" \t", pos_end);
-	pos_end = line.find_first_of(" \t", pos_beg);
-	n_nodes_per_tet = BaseLib::str2number<std::size_t> (line.substr(pos_beg, pos_end - pos_beg));
-	// region attribute at tetrahedra?
-	pos_beg = line.find_first_not_of (" \t", pos_end);
-	pos_end = line.find_first_of(" \t\n", pos_beg);
-	if (pos_end == std::string::npos)
-		pos_end = line.size();
-	if ((line.substr(pos_beg, pos_end - pos_beg)).compare("1") == 0)
-		region_attribute = true;
-	else
-		region_attribute = false;
-
-	return true;
+    std::size_t pos_beg, pos_end;
+
+    // number of tetrahedras
+    pos_beg = line.find_first_not_of (" ");
+    pos_end = line.find_first_of(" ", pos_beg);
+    if (pos_beg != std::string::npos && pos_end != std::string::npos)
+        n_tets = BaseLib::str2number<std::size_t> (line.substr(pos_beg, pos_end - pos_beg));
+    else {
+        ERR("TetGenInterface::parseElementsFileHeader(): Could not read number of tetrahedra specified in header.");
+        return false;
+    }
+    // nodes per tet - either 4 or 10
+    pos_beg = line.find_first_not_of (" \t", pos_end);
+    pos_end = line.find_first_of(" \t", pos_beg);
+    n_nodes_per_tet = BaseLib::str2number<std::size_t> (line.substr(pos_beg, pos_end - pos_beg));
+    // region attribute at tetrahedra?
+    pos_beg = line.find_first_not_of (" \t", pos_end);
+    pos_end = line.find_first_of(" \t\n", pos_beg);
+    if (pos_end == std::string::npos)
+        pos_end = line.size();
+    if ((line.substr(pos_beg, pos_end - pos_beg)).compare("1") == 0)
+        region_attribute = true;
+    else
+        region_attribute = false;
+
+    return true;
 }
 
 bool TetGenInterface::parseElements(std::ifstream& ins,
@@ -439,76 +439,76 @@ bool TetGenInterface::parseElements(std::ifstream& ins,
                                     std::size_t n_nodes_per_tet,
                                     bool region_attribute) const
 {
-	std::string line;
-	std::size_t* ids (static_cast<std::size_t*>(alloca (sizeof (std::size_t) * n_nodes_per_tet)));
-	elements.reserve(n_tets);
-	materials.reserve(n_tets);
-
-	const unsigned offset = (_zero_based_idx) ? 0 : 1;
-	for (std::size_t k(0); k < n_tets && !ins.fail(); k++)
-	{
-		getline (ins, line);
-		if (ins.fail())
-		{
-			ERR("TetGenInterface::parseElements(): Error reading tetrahedron %d.", k);
-			return false;
-		}
-
-		std::size_t pos_end = 0;
-		std::size_t pos_beg = line.find_first_not_of(" ", pos_end);
-		pos_end = line.find_first_of(" \n", pos_beg);
-
-		if (line.empty() || pos_beg==pos_end || line.compare(pos_beg,1,"#") == 0)
-		{
-			k--;
-			continue;
-		}
-
-		if (pos_beg == std::string::npos || pos_end == std::string::npos)
-		{
-			ERR("TetGenInterface::parseElements(): Error reading id of tetrahedron %d.", k);
-			return false;
-		}
-
-		// read node ids
-		for (std::size_t i(0); i < n_nodes_per_tet; i++)
-		{
-			pos_beg = line.find_first_not_of(" ", pos_end);
-			pos_end = line.find_first_of(" ", pos_beg);
-			if (pos_end == std::string::npos)
-				pos_end = line.size();
-			if (pos_beg != std::string::npos && pos_end != std::string::npos)
-				ids[i] = BaseLib::str2number<std::size_t>(line.substr(pos_beg, pos_end - pos_beg)) - offset;
-			else
-			{
-				ERR("TetGenInterface::parseElements(): Error reading node %d of tetrahedron %d.", i, k);
-				return false;
-			}
-		}
-
-		// read region attribute - this is something like material group
-		int region (0);
-		if (region_attribute) {
-			pos_beg = line.find_first_not_of(" ", pos_end);
-			pos_end = line.find_first_of(" ", pos_beg);
-			if (pos_end == std::string::npos) pos_end = line.size();
-			if (pos_beg != std::string::npos && pos_end != std::string::npos)
-				region = BaseLib::str2number<int> (line.substr(pos_beg, pos_end - pos_beg));
-			else {
-				ERR("TetGenInterface::parseElements(): Error reading region attribute of tetrahedron %d.", k);
-				return false;
-			}
-		}
-		// insert new element into vector
-		MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
-		for (unsigned k(0); k<4; k++) {
-			tet_nodes[k] = nodes[ids[k]];
-		}
-		elements.push_back (new MeshLib::Tet(tet_nodes));
-		materials.push_back(region);
-	}
-
-	return true;
+    std::string line;
+    std::size_t* ids (static_cast<std::size_t*>(alloca (sizeof (std::size_t) * n_nodes_per_tet)));
+    elements.reserve(n_tets);
+    materials.reserve(n_tets);
+
+    const unsigned offset = (_zero_based_idx) ? 0 : 1;
+    for (std::size_t k(0); k < n_tets && !ins.fail(); k++)
+    {
+        getline (ins, line);
+        if (ins.fail())
+        {
+            ERR("TetGenInterface::parseElements(): Error reading tetrahedron %d.", k);
+            return false;
+        }
+
+        std::size_t pos_end = 0;
+        std::size_t pos_beg = line.find_first_not_of(" ", pos_end);
+        pos_end = line.find_first_of(" \n", pos_beg);
+
+        if (line.empty() || pos_beg==pos_end || line.compare(pos_beg,1,"#") == 0)
+        {
+            k--;
+            continue;
+        }
+
+        if (pos_beg == std::string::npos || pos_end == std::string::npos)
+        {
+            ERR("TetGenInterface::parseElements(): Error reading id of tetrahedron %d.", k);
+            return false;
+        }
+
+        // read node ids
+        for (std::size_t i(0); i < n_nodes_per_tet; i++)
+        {
+            pos_beg = line.find_first_not_of(" ", pos_end);
+            pos_end = line.find_first_of(" ", pos_beg);
+            if (pos_end == std::string::npos)
+                pos_end = line.size();
+            if (pos_beg != std::string::npos && pos_end != std::string::npos)
+                ids[i] = BaseLib::str2number<std::size_t>(line.substr(pos_beg, pos_end - pos_beg)) - offset;
+            else
+            {
+                ERR("TetGenInterface::parseElements(): Error reading node %d of tetrahedron %d.", i, k);
+                return false;
+            }
+        }
+
+        // read region attribute - this is something like material group
+        int region (0);
+        if (region_attribute) {
+            pos_beg = line.find_first_not_of(" ", pos_end);
+            pos_end = line.find_first_of(" ", pos_beg);
+            if (pos_end == std::string::npos) pos_end = line.size();
+            if (pos_beg != std::string::npos && pos_end != std::string::npos)
+                region = BaseLib::str2number<int> (line.substr(pos_beg, pos_end - pos_beg));
+            else {
+                ERR("TetGenInterface::parseElements(): Error reading region attribute of tetrahedron %d.", k);
+                return false;
+            }
+        }
+        // insert new element into vector
+        MeshLib::Node** tet_nodes = new MeshLib::Node*[4];
+        for (unsigned k(0); k<4; k++) {
+            tet_nodes[k] = nodes[ids[k]];
+        }
+        elements.push_back (new MeshLib::Tet(tet_nodes));
+        materials.push_back(region);
+    }
+
+    return true;
 }
 
 bool TetGenInterface::writeTetGenSmesh(const std::string &file_name,
@@ -516,172 +516,172 @@ bool TetGenInterface::writeTetGenSmesh(const std::string &file_name,
                                        const std::string &geo_name,
                                        const std::vector<GeoLib::Point> &attribute_points) const
 {
-	std::vector<GeoLib::Point*> const*const points = geo_objects.getPointVec(geo_name);
-	std::vector<GeoLib::Surface*> const*const surfaces = geo_objects.getSurfaceVec(geo_name);
-
-	if (points==nullptr)
-	{
-		ERR ("Geometry %s not found.", geo_name.c_str());
-		return false;
-	}
-	if (surfaces==nullptr)
-		WARN ("No surfaces found for geometry %s. Writing points only.", geo_name.c_str());
-
-	std::ofstream out( file_name.c_str(), std::ios::out );
-	out.precision(std::numeric_limits<double>::digits10);
-	// the points header
-	const std::size_t nPoints (points->size());
-	out << nPoints << " 3\n";
-	// the point list
-	for (std::size_t i=0; i<nPoints; ++i)
-		out << i << "  " << (*(*points)[i])[0] << " " << (*(*points)[i])[1] << " " << (*(*points)[i])[2] << "\n";
-	// the surfaces header
-	const std::size_t nSurfaces = (surfaces) ? surfaces->size() : 0;
-	std::size_t nTotalTriangles (0);
-	for (std::size_t i=0; i<nSurfaces; ++i)
-		nTotalTriangles += (*surfaces)[i]->getNTriangles();
-	out << nTotalTriangles << " 1\n";
-
-	for (std::size_t i=0; i<nSurfaces; ++i)
-	{
-		const std::size_t nTriangles ((*surfaces)[i]->getNTriangles());
-		const std::size_t marker (i+1); // must NOT be 0!
-		// the poly list
-		for (std::size_t j=0; j<nTriangles; ++j)
-		{
-			const GeoLib::Triangle &tri = *(*(*surfaces)[i])[j];
-			out << "3  " << tri[0] << " " << tri[1] << " " << tri[2] << " " << marker << "\n";
-		}
-	}
-	out << "0\n"; // the polygon holes list
-	// the region attributes list
-	if (attribute_points.empty())
-		out << "0\n";
-	else
-	{
-		const std::size_t nAttributePoints (attribute_points.size());
-		out << nAttributePoints << "\n";
-		for (std::size_t i=0; i<nAttributePoints; ++i)
-			out << i+1 << " " << attribute_points[i][0] << " " << attribute_points[i][1] << " " << attribute_points[i][2] << " " << 10*attribute_points[i].getID() << "\n";
-	}
-	INFO ("TetGenInterface::writeTetGenSmesh() - %d points and %d surfaces successfully written.", nPoints, nSurfaces);
-	out.close();
-	return true;
+    std::vector<GeoLib::Point*> const*const points = geo_objects.getPointVec(geo_name);
+    std::vector<GeoLib::Surface*> const*const surfaces = geo_objects.getSurfaceVec(geo_name);
+
+    if (points==nullptr)
+    {
+        ERR ("Geometry %s not found.", geo_name.c_str());
+        return false;
+    }
+    if (surfaces==nullptr)
+        WARN ("No surfaces found for geometry %s. Writing points only.", geo_name.c_str());
+
+    std::ofstream out( file_name.c_str(), std::ios::out );
+    out.precision(std::numeric_limits<double>::digits10);
+    // the points header
+    const std::size_t nPoints (points->size());
+    out << nPoints << " 3\n";
+    // the point list
+    for (std::size_t i=0; i<nPoints; ++i)
+        out << i << "  " << (*(*points)[i])[0] << " " << (*(*points)[i])[1] << " " << (*(*points)[i])[2] << "\n";
+    // the surfaces header
+    const std::size_t nSurfaces = (surfaces) ? surfaces->size() : 0;
+    std::size_t nTotalTriangles (0);
+    for (std::size_t i=0; i<nSurfaces; ++i)
+        nTotalTriangles += (*surfaces)[i]->getNTriangles();
+    out << nTotalTriangles << " 1\n";
+
+    for (std::size_t i=0; i<nSurfaces; ++i)
+    {
+        const std::size_t nTriangles ((*surfaces)[i]->getNTriangles());
+        const std::size_t marker (i+1); // must NOT be 0!
+        // the poly list
+        for (std::size_t j=0; j<nTriangles; ++j)
+        {
+            const GeoLib::Triangle &tri = *(*(*surfaces)[i])[j];
+            out << "3  " << tri[0] << " " << tri[1] << " " << tri[2] << " " << marker << "\n";
+        }
+    }
+    out << "0\n"; // the polygon holes list
+    // the region attributes list
+    if (attribute_points.empty())
+        out << "0\n";
+    else
+    {
+        const std::size_t nAttributePoints (attribute_points.size());
+        out << nAttributePoints << "\n";
+        for (std::size_t i=0; i<nAttributePoints; ++i)
+            out << i+1 << " " << attribute_points[i][0] << " " << attribute_points[i][1] << " " << attribute_points[i][2] << " " << 10*attribute_points[i].getID() << "\n";
+    }
+    INFO ("TetGenInterface::writeTetGenSmesh() - %d points and %d surfaces successfully written.", nPoints, nSurfaces);
+    out.close();
+    return true;
 }
 
 bool TetGenInterface::writeTetGenSmesh(const std::string &file_name,
                                        const MeshLib::Mesh &mesh,
                                        std::vector<MeshLib::Node> &attribute_points) const
 {
-	if (mesh.getDimension() == 1)
-		return false;
-
-	const std::vector<MeshLib::Node*> &nodes = mesh.getNodes();
-
-	std::ofstream out( file_name.c_str(), std::ios::out );
-	out.precision(std::numeric_limits<double>::digits10);
-	// the points header
-	const std::size_t nPoints (nodes.size());
-	out << nPoints << " 3\n";
-	// the point list
-	for (std::size_t i=0; i<nPoints; ++i)
-		out << i << "  " << (*nodes[i])[0] << " " << (*nodes[i])[1] << " " << (*nodes[i])[2] << "\n";
-
-	if (mesh.getDimension() == 2)
-		write2dElements(out, mesh);
-	else
-		write3dElements(out, mesh, attribute_points);
-
-	out << "0\n"; // the polygon holes list
-
-	// the region attributes list
-	if (attribute_points.empty())
-		out << "0\n";
-	else
-	{
-		const std::size_t nAttributePoints (attribute_points.size());
-		out << nAttributePoints << "\n";
-		for (std::size_t i=0; i<nAttributePoints; ++i)
-			out << i+1 << " " << attribute_points[i][0] << " " << attribute_points[i][1] << " " << attribute_points[i][2] << " " << 10*attribute_points[i].getID() << "\n";
-	}
-
-	INFO ("TetGenInterface::writeTetGenPoly() - %d points and %d surfaces successfully written.", nPoints, mesh.getNElements());
-	out.close();
-	return true;
+    if (mesh.getDimension() == 1)
+        return false;
+
+    const std::vector<MeshLib::Node*> &nodes = mesh.getNodes();
+
+    std::ofstream out( file_name.c_str(), std::ios::out );
+    out.precision(std::numeric_limits<double>::digits10);
+    // the points header
+    const std::size_t nPoints (nodes.size());
+    out << nPoints << " 3\n";
+    // the point list
+    for (std::size_t i=0; i<nPoints; ++i)
+        out << i << "  " << (*nodes[i])[0] << " " << (*nodes[i])[1] << " " << (*nodes[i])[2] << "\n";
+
+    if (mesh.getDimension() == 2)
+        write2dElements(out, mesh);
+    else
+        write3dElements(out, mesh, attribute_points);
+
+    out << "0\n"; // the polygon holes list
+
+    // the region attributes list
+    if (attribute_points.empty())
+        out << "0\n";
+    else
+    {
+        const std::size_t nAttributePoints (attribute_points.size());
+        out << nAttributePoints << "\n";
+        for (std::size_t i=0; i<nAttributePoints; ++i)
+            out << i+1 << " " << attribute_points[i][0] << " " << attribute_points[i][1] << " " << attribute_points[i][2] << " " << 10*attribute_points[i].getID() << "\n";
+    }
+
+    INFO ("TetGenInterface::writeTetGenPoly() - %d points and %d surfaces successfully written.", nPoints, mesh.getNElements());
+    out.close();
+    return true;
 }
 
 void TetGenInterface::write2dElements(std::ofstream &out,
-	                                  const MeshLib::Mesh &mesh) const
+                                      const MeshLib::Mesh &mesh) const
 {
-	// the surfaces header
-	const std::array<unsigned,7> types = MeshLib::MeshInformation::getNumberOfElementTypes(mesh);
-	const unsigned nTotalTriangles (types[1] + (2*types[2]));
-	out << nTotalTriangles << " 1\n";
-
-	const std::vector<MeshLib::Element*> &elements = mesh.getElements();
-	boost::optional< MeshLib::PropertyVector<int> const&> materialIds (mesh.getProperties().getPropertyVector<int>("MaterialIDs"));
-	const std::size_t nElements (elements.size());
-	unsigned element_count(0);
-	for (std::size_t i=0; i<nElements; ++i)
-	{
-		std::string matId = (materialIds) ? std::to_string((*materialIds)[i]) : "";
-		this->writeElementToFacets(out, *elements[i], element_count, matId);
-	}
+    // the surfaces header
+    const std::array<unsigned,7> types = MeshLib::MeshInformation::getNumberOfElementTypes(mesh);
+    const unsigned nTotalTriangles (types[1] + (2*types[2]));
+    out << nTotalTriangles << " 1\n";
+
+    const std::vector<MeshLib::Element*> &elements = mesh.getElements();
+    boost::optional< MeshLib::PropertyVector<int> const&> materialIds (mesh.getProperties().getPropertyVector<int>("MaterialIDs"));
+    const std::size_t nElements (elements.size());
+    unsigned element_count(0);
+    for (std::size_t i=0; i<nElements; ++i)
+    {
+        std::string matId = (materialIds) ? std::to_string((*materialIds)[i]) : "";
+        this->writeElementToFacets(out, *elements[i], element_count, matId);
+    }
 }
 
 void TetGenInterface::write3dElements(std::ofstream &out,
-	                                  const MeshLib::Mesh &mesh,
+                                      const MeshLib::Mesh &mesh,
                                       std::vector<MeshLib::Node> &attribute_points) const
 {
-	const std::vector<MeshLib::Element*> &elements = mesh.getElements();
-	const std::size_t nElements (elements.size());
-	if (!attribute_points.empty())
-		attribute_points.clear();
-
-	// get position where number of facets need to be written and figure out worst case of chars that are needed
-	const std::streamoff before_elems_pos (out.tellp());
-	const unsigned n_spaces (static_cast<unsigned>(std::floor(log(nElements*8))) + 1);
-	out << std::string(n_spaces, ' ') << " 1\n";
-	boost::optional< MeshLib::PropertyVector<int> const&> materialIds = mesh.getProperties().getPropertyVector<int>("MaterialIDs");
-	unsigned element_count(0);
-	for (std::size_t i=0; i<nElements; ++i)
-	{
-		if (elements[i]->getDimension() < 3)
-			continue;
-
-		const unsigned nFaces (elements[i]->getNNeighbors());
-		std::string const mat_id_str = (materialIds) ? std::to_string((*materialIds)[i]) : "";
-		for (std::size_t j=0; j<nFaces; ++j)
-		{
-			MeshLib::Element const*const neighbor ( elements[i]->getNeighbor(j) );
-
-			if (neighbor && materialIds && (*materialIds)[i] <= (*materialIds)[neighbor->getID()])
-				continue;
-
-			std::unique_ptr<MeshLib::Element const> const face (elements[i]->getFace(j));
-			this->writeElementToFacets(out, *face, element_count, mat_id_str);
-		}
-		if (materialIds)
-			attribute_points.push_back(MeshLib::Node(elements[i]->getCenterOfGravity().getCoords(), (*materialIds)[i]));
-	}
-	// add number of facets at correct position and jump back
-	const std::streamoff after_elems_pos (out.tellp());
-	out.seekp(before_elems_pos);
-	out << element_count;
-	out.seekp(after_elems_pos);
+    const std::vector<MeshLib::Element*> &elements = mesh.getElements();
+    const std::size_t nElements (elements.size());
+    if (!attribute_points.empty())
+        attribute_points.clear();
+
+    // get position where number of facets need to be written and figure out worst case of chars that are needed
+    const std::streamoff before_elems_pos (out.tellp());
+    const unsigned n_spaces (static_cast<unsigned>(std::floor(log(nElements*8))) + 1);
+    out << std::string(n_spaces, ' ') << " 1\n";
+    boost::optional< MeshLib::PropertyVector<int> const&> materialIds = mesh.getProperties().getPropertyVector<int>("MaterialIDs");
+    unsigned element_count(0);
+    for (std::size_t i=0; i<nElements; ++i)
+    {
+        if (elements[i]->getDimension() < 3)
+            continue;
+
+        const unsigned nFaces (elements[i]->getNNeighbors());
+        std::string const mat_id_str = (materialIds) ? std::to_string((*materialIds)[i]) : "";
+        for (std::size_t j=0; j<nFaces; ++j)
+        {
+            MeshLib::Element const*const neighbor ( elements[i]->getNeighbor(j) );
+
+            if (neighbor && materialIds && (*materialIds)[i] <= (*materialIds)[neighbor->getID()])
+                continue;
+
+            std::unique_ptr<MeshLib::Element const> const face (elements[i]->getFace(j));
+            this->writeElementToFacets(out, *face, element_count, mat_id_str);
+        }
+        if (materialIds)
+            attribute_points.push_back(MeshLib::Node(elements[i]->getCenterOfGravity().getCoords(), (*materialIds)[i]));
+    }
+    // add number of facets at correct position and jump back
+    const std::streamoff after_elems_pos (out.tellp());
+    out.seekp(before_elems_pos);
+    out << element_count;
+    out.seekp(after_elems_pos);
 }
 
 void TetGenInterface::writeElementToFacets(std::ofstream &out, const MeshLib::Element &element, unsigned &element_count, std::string const& matId) const
 {
-	element_count++;
-	if (element.getGeomType() == MeshLib::MeshElemType::TRIANGLE)
-		out << "3  " << element.getNodeIndex(0) << " " << element.getNodeIndex(1) << " " << element.getNodeIndex(2) << " " << matId << " # " << element_count << "\n";
-	else if (element.getGeomType() == MeshLib::MeshElemType::QUAD)
-	{
-		out << "3  " << element.getNodeIndex(0) << " " << element.getNodeIndex(1) << " " << element.getNodeIndex(2) << " " << matId << " # " << element_count << "\n";
-		element_count++;
-		out << "3  " << element.getNodeIndex(0) << " " << element.getNodeIndex(2) << " " << element.getNodeIndex(3) << " " << matId << " # " << element_count << "\n";
-	}
+    element_count++;
+    if (element.getGeomType() == MeshLib::MeshElemType::TRIANGLE)
+        out << "3  " << element.getNodeIndex(0) << " " << element.getNodeIndex(1) << " " << element.getNodeIndex(2) << " " << matId << " # " << element_count << "\n";
+    else if (element.getGeomType() == MeshLib::MeshElemType::QUAD)
+    {
+        out << "3  " << element.getNodeIndex(0) << " " << element.getNodeIndex(1) << " " << element.getNodeIndex(2) << " " << matId << " # " << element_count << "\n";
+        element_count++;
+        out << "3  " << element.getNodeIndex(0) << " " << element.getNodeIndex(2) << " " << element.getNodeIndex(3) << " " << matId << " # " << element_count << "\n";
+    }
 }
 
 } // end namespace FileIO
diff --git a/FileIO/TetGenInterface.h b/FileIO/TetGenInterface.h
index 297fceea09378d1e92ff8a700faa99af61ac8431..7cb274f7f6dd0b4dedb0b2aa60d6a43cc78e46d0 100644
--- a/FileIO/TetGenInterface.h
+++ b/FileIO/TetGenInterface.h
@@ -24,9 +24,9 @@
 // forward declaration of class Node and Element
 namespace MeshLib
 {
-	class Node;
-	class Element;
-	class Mesh;
+    class Node;
+    class Element;
+    class Mesh;
 }
 
 namespace FileIO
@@ -41,179 +41,179 @@ namespace FileIO
 class TetGenInterface
 {
 public:
-	TetGenInterface();
-	virtual ~TetGenInterface();
-
-	/**
-	 * Method reads geometry from a TetGen poly or smesh file.
-	 * @param geo_fname   file name of the poly file
-	 * @param geo_objects  where the geometry is written to
-	 * @return on success  the method returns true, otherwise it returns false
-	 */
-	bool readTetGenGeometry (std::string const& geo_fname,
-	                         GeoLib::GEOObjects &geo_objects);
-
-	/**
-	 * Method reads the TetGen mesh from node file and element file.
-	 * @param nodes_fname  file name of the nodes file
-	 * @param ele_fname    file name of the elements file
-	 * @return on success  the method returns a (pointer to a) CFEMesh, else the method returns nullptr
-	 */
-	MeshLib::Mesh* readTetGenMesh (std::string const& nodes_fname,
-	                               std::string const& ele_fname);
-
-	/**
-	 * Writes the geometry of a given name to TetGen smesh-file.
-	 * @param file_name         file name of the new smesh file.
-	 * @param geo_objects       the container for the geometry.
-	 * @param geo_name          the name for the geometry containing the subsurface boundary representation used for meshing.
-	 * @param attribute_points  attribute points containing material IDs (if the vector is empty no attributes are written).
-	 * @return returns true on success and false otherwise.
-	 */
-	bool writeTetGenSmesh(const std::string &file_name,
-	                      const GeoLib::GEOObjects &geo_objects,
-	                      const std::string &geo_name,
-	                      const std::vector<GeoLib::Point> &attribute_points) const;
-
-	/**
-	 * Writes the geometry of a given name to TetGen smesh-file.
-	 * @param file_name         file name of the new smesh file.
-	 * @param mesh              mesh containing the subsurface boundary representation used for meshing.
-	 * @param attribute_points  attribute points containing material IDs (if the vector is empty no attributes are written).
-	 * @return returns true on success and false otherwise.
-	 */
-	bool writeTetGenSmesh(const std::string &file_name,
-	                      const MeshLib::Mesh &mesh,
-	                      std::vector<MeshLib::Node> &attribute_points) const;
+    TetGenInterface();
+    virtual ~TetGenInterface();
+
+    /**
+     * Method reads geometry from a TetGen poly or smesh file.
+     * @param geo_fname   file name of the poly file
+     * @param geo_objects  where the geometry is written to
+     * @return on success  the method returns true, otherwise it returns false
+     */
+    bool readTetGenGeometry (std::string const& geo_fname,
+                             GeoLib::GEOObjects &geo_objects);
+
+    /**
+     * Method reads the TetGen mesh from node file and element file.
+     * @param nodes_fname  file name of the nodes file
+     * @param ele_fname    file name of the elements file
+     * @return on success  the method returns a (pointer to a) CFEMesh, else the method returns nullptr
+     */
+    MeshLib::Mesh* readTetGenMesh (std::string const& nodes_fname,
+                                   std::string const& ele_fname);
+
+    /**
+     * Writes the geometry of a given name to TetGen smesh-file.
+     * @param file_name         file name of the new smesh file.
+     * @param geo_objects       the container for the geometry.
+     * @param geo_name          the name for the geometry containing the subsurface boundary representation used for meshing.
+     * @param attribute_points  attribute points containing material IDs (if the vector is empty no attributes are written).
+     * @return returns true on success and false otherwise.
+     */
+    bool writeTetGenSmesh(const std::string &file_name,
+                          const GeoLib::GEOObjects &geo_objects,
+                          const std::string &geo_name,
+                          const std::vector<GeoLib::Point> &attribute_points) const;
+
+    /**
+     * Writes the geometry of a given name to TetGen smesh-file.
+     * @param file_name         file name of the new smesh file.
+     * @param mesh              mesh containing the subsurface boundary representation used for meshing.
+     * @param attribute_points  attribute points containing material IDs (if the vector is empty no attributes are written).
+     * @return returns true on success and false otherwise.
+     */
+    bool writeTetGenSmesh(const std::string &file_name,
+                          const MeshLib::Mesh &mesh,
+                          std::vector<MeshLib::Node> &attribute_points) const;
 
 private:
-	/// Returns the declared number of facets in the poly file.
-	std::size_t getNFacets(std::ifstream &input);
-
-	/**
-	 * Method parses the lines reading the facets from TetGen smesh file
-	 * @param input       the input stream (input)
-	 * @param surfaces    the vector of surfaces to be filled (output)
-	 * @param points      the point vector needed for creating surfaces (input)
-	 * @param pnt_id_map  the id map to compensate for possibly changed point ids after adding the point vector to GEOObjects
-	 * @return true, if the facets have been read correctly, false if the method detects an error
-	 */
-	bool parseSmeshFacets(std::ifstream &input,
-	                      std::vector<GeoLib::Surface*> &surfaces,
-	                      const std::vector<GeoLib::Point*> &points,
-						  const std::vector<std::size_t> &pnt_id_map);
-
-	/**
-	 * Method reads the nodes from stream and stores them in a node vector.
-	 * For this purpose it uses methods parseNodesFileHeader() and parseNodes().
-	 * @param input  the input stream
-	 * @return true, if all information is read, false if the method detects an error
-	 */
-	bool readNodesFromStream(std::ifstream &input,
-	                         std::vector<MeshLib::Node*> &nodes);
-
-	/**
-	 * Method parses the header of the nodes file created by TetGen
-	 * @param line              the header is in this string (input)
-	 * @param n_nodes           number of nodes in the file (output)
-	 * @param dim               the spatial dimension of the node (output)
-	 * @param n_attributes      the number of attributes for each node (output)
-	 * @param boundary_markers  have the nodes boundary information (output)
-	 * @return true, if the file header is read, false if the method detects an error
-	 */
-	bool parseNodesFileHeader(std::string &line,
-	                          std::size_t &n_nodes,
-	                          std::size_t &dim,
-	                          std::size_t &n_attributes,
-	                          bool &boundary_markers) const;
-	/**
-	 * method parses the lines reading the nodes from TetGen nodes file
-	 * @param ins      the input stream (input)
-	 * @param nodes    the nodes vector to be filled (input)
-	 * @param n_nodes  the number of nodes to read (input)
-	 * @param dim      the spatial dimension of the node (input)
-	 * @return true, if the nodes are read, false if the method detects an error
-	 */
-	bool parseNodes(std::ifstream &ins,
-	                std::vector<MeshLib::Node*> &nodes,
-	                std::size_t n_nodes,
-	                std::size_t dim);
-
-	/**
-	 * Method reads the elements from stream and stores them in an element vector.
-	 * For this purpose it uses methods parseElementsFileHeader() and parseElements().
-	 * @param input     the input stream
-	 * @param elements  the elements vector to be filled
-	 * @param materials the vector containing material ids to be filled
-	 * @param nodes     the node information needed for creating elements
-	 * @return true, if all information is read, false if the method detects an error
-	 */
-	bool readElementsFromStream(std::ifstream &input,
-	                            std::vector<MeshLib::Element*> &elements,
-	                            std::vector<int> &materials,
-	                            const std::vector<MeshLib::Node*> &nodes) const;
-	/**
-	 * Method parses the header of the elements file created by TetGen
-	 * @param line              the header is in this string (input)
-	 * @param n_tets            the number of tets to read (input)
-	 * @param n_nodes_per_tet   the number of nodes per tets (input)
-	 * @param region_attribute  is on output true, if there
-	 * @return
-	 */
-	bool parseElementsFileHeader(std::string &line,
-	                             std::size_t &n_tets,
-	                             std::size_t &n_nodes_per_tet,
-	                             bool &region_attribute) const;
-	/**
-	 * Method parses the tetrahedras and put them in the element vector of the mesh class.
-	 * @param ins the input stream
-	 * @param elements          the elements vector to be filled
-	 * @param materials         the vector containing material ids to be filled
-	 * @param nodes             the node information needed for creating elements
-	 * @param n_tets            the number of tetrahedras that should be read
-	 * @param n_nodes_per_tet   the number of nodes per tetrahedron
-	 * @param region_attribute  if region attribute is true, region information is read
-	 * @return true, if the tetrahedras are read, false if the method detects an error
-	 */
-	bool parseElements(std::ifstream& ins,
-	                   std::vector<MeshLib::Element*> &elements,
-	                   std::vector<int> &materials,
-	                   const std::vector<MeshLib::Node*> &nodes,
-	                   std::size_t n_tets,
-	                   std::size_t n_nodes_per_tet,
-	                   bool region_attribute) const;
-
-	/**
-	 * Writes the elements from a 2D mesh to a TetGen smesh-file.
-	 * @param out               the output stream the information is written to.
-	 * @param mesh              mesh containing the subsurface boundary representation used for meshing.
-	 * @return returns true on success and false otherwise.
-	 */
-	void write2dElements(std::ofstream &out,
-	                     const MeshLib::Mesh &mesh) const;
-
-	/**
-	 * Writes the elements from a 3D mesh to a TetGen smesh-file.
-	 * @param out               the output stream the information is written to.
-	 * @param mesh              the 3D mesh.
-	 * @param attribute_points  attribute points containing material IDs (emptied when called and then filled with correct values).
-	 * @return returns true on success and false otherwise.
-	 */
-	void write3dElements(std::ofstream &out,
-	                     const MeshLib::Mesh &mesh,
-	                     std::vector<MeshLib::Node> &attribute_points) const;
-
-	/// Writes facet information from a 2D element to the stream and increments the total element count accordingly
-	void writeElementToFacets(std::ofstream &out,
-	                          const MeshLib::Element &element,
-	                          unsigned &element_count,
-	                          std::string const& matId) const;
-
-	/// the value is true if the indexing is zero based, else false
-	bool _zero_based_idx;
-
-	/// true if boundary markers are set, false otherwise
-	bool _boundary_markers;
+    /// Returns the declared number of facets in the poly file.
+    std::size_t getNFacets(std::ifstream &input);
+
+    /**
+     * Method parses the lines reading the facets from TetGen smesh file
+     * @param input       the input stream (input)
+     * @param surfaces    the vector of surfaces to be filled (output)
+     * @param points      the point vector needed for creating surfaces (input)
+     * @param pnt_id_map  the id map to compensate for possibly changed point ids after adding the point vector to GEOObjects
+     * @return true, if the facets have been read correctly, false if the method detects an error
+     */
+    bool parseSmeshFacets(std::ifstream &input,
+                          std::vector<GeoLib::Surface*> &surfaces,
+                          const std::vector<GeoLib::Point*> &points,
+                          const std::vector<std::size_t> &pnt_id_map);
+
+    /**
+     * Method reads the nodes from stream and stores them in a node vector.
+     * For this purpose it uses methods parseNodesFileHeader() and parseNodes().
+     * @param input  the input stream
+     * @return true, if all information is read, false if the method detects an error
+     */
+    bool readNodesFromStream(std::ifstream &input,
+                             std::vector<MeshLib::Node*> &nodes);
+
+    /**
+     * Method parses the header of the nodes file created by TetGen
+     * @param line              the header is in this string (input)
+     * @param n_nodes           number of nodes in the file (output)
+     * @param dim               the spatial dimension of the node (output)
+     * @param n_attributes      the number of attributes for each node (output)
+     * @param boundary_markers  have the nodes boundary information (output)
+     * @return true, if the file header is read, false if the method detects an error
+     */
+    bool parseNodesFileHeader(std::string &line,
+                              std::size_t &n_nodes,
+                              std::size_t &dim,
+                              std::size_t &n_attributes,
+                              bool &boundary_markers) const;
+    /**
+     * method parses the lines reading the nodes from TetGen nodes file
+     * @param ins      the input stream (input)
+     * @param nodes    the nodes vector to be filled (input)
+     * @param n_nodes  the number of nodes to read (input)
+     * @param dim      the spatial dimension of the node (input)
+     * @return true, if the nodes are read, false if the method detects an error
+     */
+    bool parseNodes(std::ifstream &ins,
+                    std::vector<MeshLib::Node*> &nodes,
+                    std::size_t n_nodes,
+                    std::size_t dim);
+
+    /**
+     * Method reads the elements from stream and stores them in an element vector.
+     * For this purpose it uses methods parseElementsFileHeader() and parseElements().
+     * @param input     the input stream
+     * @param elements  the elements vector to be filled
+     * @param materials the vector containing material ids to be filled
+     * @param nodes     the node information needed for creating elements
+     * @return true, if all information is read, false if the method detects an error
+     */
+    bool readElementsFromStream(std::ifstream &input,
+                                std::vector<MeshLib::Element*> &elements,
+                                std::vector<int> &materials,
+                                const std::vector<MeshLib::Node*> &nodes) const;
+    /**
+     * Method parses the header of the elements file created by TetGen
+     * @param line              the header is in this string (input)
+     * @param n_tets            the number of tets to read (input)
+     * @param n_nodes_per_tet   the number of nodes per tets (input)
+     * @param region_attribute  is on output true, if there
+     * @return
+     */
+    bool parseElementsFileHeader(std::string &line,
+                                 std::size_t &n_tets,
+                                 std::size_t &n_nodes_per_tet,
+                                 bool &region_attribute) const;
+    /**
+     * Method parses the tetrahedras and put them in the element vector of the mesh class.
+     * @param ins the input stream
+     * @param elements          the elements vector to be filled
+     * @param materials         the vector containing material ids to be filled
+     * @param nodes             the node information needed for creating elements
+     * @param n_tets            the number of tetrahedras that should be read
+     * @param n_nodes_per_tet   the number of nodes per tetrahedron
+     * @param region_attribute  if region attribute is true, region information is read
+     * @return true, if the tetrahedras are read, false if the method detects an error
+     */
+    bool parseElements(std::ifstream& ins,
+                       std::vector<MeshLib::Element*> &elements,
+                       std::vector<int> &materials,
+                       const std::vector<MeshLib::Node*> &nodes,
+                       std::size_t n_tets,
+                       std::size_t n_nodes_per_tet,
+                       bool region_attribute) const;
+
+    /**
+     * Writes the elements from a 2D mesh to a TetGen smesh-file.
+     * @param out               the output stream the information is written to.
+     * @param mesh              mesh containing the subsurface boundary representation used for meshing.
+     * @return returns true on success and false otherwise.
+     */
+    void write2dElements(std::ofstream &out,
+                         const MeshLib::Mesh &mesh) const;
+
+    /**
+     * Writes the elements from a 3D mesh to a TetGen smesh-file.
+     * @param out               the output stream the information is written to.
+     * @param mesh              the 3D mesh.
+     * @param attribute_points  attribute points containing material IDs (emptied when called and then filled with correct values).
+     * @return returns true on success and false otherwise.
+     */
+    void write3dElements(std::ofstream &out,
+                         const MeshLib::Mesh &mesh,
+                         std::vector<MeshLib::Node> &attribute_points) const;
+
+    /// Writes facet information from a 2D element to the stream and increments the total element count accordingly
+    void writeElementToFacets(std::ofstream &out,
+                              const MeshLib::Element &element,
+                              unsigned &element_count,
+                              std::string const& matId) const;
+
+    /// the value is true if the indexing is zero based, else false
+    bool _zero_based_idx;
+
+    /// true if boundary markers are set, false otherwise
+    bool _boundary_markers;
 };
 }
 
diff --git a/FileIO/XmlIO/Qt/XmlGspInterface.cpp b/FileIO/XmlIO/Qt/XmlGspInterface.cpp
index 483ecf990c0b1e2444d7c4ed8024ccce9e17c767..a41eab63349e2e23de4113c03317a1d4a6d5a934 100644
--- a/FileIO/XmlIO/Qt/XmlGspInterface.cpp
+++ b/FileIO/XmlIO/Qt/XmlGspInterface.cpp
@@ -47,159 +47,159 @@ XmlGspInterface::XmlGspInterface(DataHolderLib::Project& project)
 
 int XmlGspInterface::readFile(const QString &fileName)
 {
-	if(XMLQtInterface::readFile(fileName) == 0)
-		return 0;
-
-	QFileInfo fi(fileName);
-	QString path = (fi.path().length() > 3) ? QString(fi.path() + "/") : fi.path();
-
-	QDomDocument doc("OGS-PROJECT-DOM");
-	doc.setContent(_fileData);
-	QDomElement docElement = doc.documentElement(); //OpenGeoSysProject
-	if (docElement.nodeName().compare("OpenGeoSysProject"))
-	{
-		ERR("XmlGspInterface::readFile(): Unexpected XML root.");
-		return 0;
-	}
-
-	QDomNodeList fileList = docElement.childNodes();
-
-	for(int i = 0; i < fileList.count(); i++)
-	{
-		const QString file_node(fileList.at(i).nodeName());
-		if (file_node.compare("geo") == 0)
-		{
-			GeoLib::IO::XmlGmlInterface gml(_project.getGEOObjects());
-			const QDomNodeList childList = fileList.at(i).childNodes();
-			for(int j = 0; j < childList.count(); j++)
-			{
-				const QDomNode child_node (childList.at(j));
-				if (child_node.nodeName().compare("file") == 0)
-				{
-					DBUG("XmlGspInterface::readFile(): path: \"%s\".",
-					     path.data());
-					DBUG("XmlGspInterface::readFile(): file name: \"%s\".",
-					     (child_node.toElement().text()).data());
-					gml.readFile(QString(path + child_node.toElement().text()));
-				}
-			}
-		}
-		else if (file_node.compare("stn") == 0)
-		{
-			GeoLib::IO::XmlStnInterface stn(_project.getGEOObjects());
-			const QDomNodeList childList = fileList.at(i).childNodes();
-			for(int j = 0; j < childList.count(); j++)
-				if (childList.at(j).nodeName().compare("file") == 0)
-					stn.readFile(QString(path +
-					                     childList.at(j).toElement().text()));
-		}
-		else if (file_node.compare("msh") == 0)
-		{
-			const std::string msh_name = path.toStdString() +
-			                             fileList.at(i).toElement().text().toStdString();
-			std::unique_ptr<MeshLib::Mesh> mesh(
-			    MeshLib::IO::readMeshFromFile(msh_name));
-			if (mesh)
-				_project.addMesh(std::move(mesh));
-		}
-	}
-
-	return 1;
+    if(XMLQtInterface::readFile(fileName) == 0)
+        return 0;
+
+    QFileInfo fi(fileName);
+    QString path = (fi.path().length() > 3) ? QString(fi.path() + "/") : fi.path();
+
+    QDomDocument doc("OGS-PROJECT-DOM");
+    doc.setContent(_fileData);
+    QDomElement docElement = doc.documentElement(); //OpenGeoSysProject
+    if (docElement.nodeName().compare("OpenGeoSysProject"))
+    {
+        ERR("XmlGspInterface::readFile(): Unexpected XML root.");
+        return 0;
+    }
+
+    QDomNodeList fileList = docElement.childNodes();
+
+    for(int i = 0; i < fileList.count(); i++)
+    {
+        const QString file_node(fileList.at(i).nodeName());
+        if (file_node.compare("geo") == 0)
+        {
+            GeoLib::IO::XmlGmlInterface gml(_project.getGEOObjects());
+            const QDomNodeList childList = fileList.at(i).childNodes();
+            for(int j = 0; j < childList.count(); j++)
+            {
+                const QDomNode child_node (childList.at(j));
+                if (child_node.nodeName().compare("file") == 0)
+                {
+                    DBUG("XmlGspInterface::readFile(): path: \"%s\".",
+                         path.data());
+                    DBUG("XmlGspInterface::readFile(): file name: \"%s\".",
+                         (child_node.toElement().text()).data());
+                    gml.readFile(QString(path + child_node.toElement().text()));
+                }
+            }
+        }
+        else if (file_node.compare("stn") == 0)
+        {
+            GeoLib::IO::XmlStnInterface stn(_project.getGEOObjects());
+            const QDomNodeList childList = fileList.at(i).childNodes();
+            for(int j = 0; j < childList.count(); j++)
+                if (childList.at(j).nodeName().compare("file") == 0)
+                    stn.readFile(QString(path +
+                                         childList.at(j).toElement().text()));
+        }
+        else if (file_node.compare("msh") == 0)
+        {
+            const std::string msh_name = path.toStdString() +
+                                         fileList.at(i).toElement().text().toStdString();
+            std::unique_ptr<MeshLib::Mesh> mesh(
+                MeshLib::IO::readMeshFromFile(msh_name));
+            if (mesh)
+                _project.addMesh(std::move(mesh));
+        }
+    }
+
+    return 1;
 }
 
 int XmlGspInterface::writeToFile(const std::string& filename)
 {
-	_filename = filename;
-	return BaseLib::IO::Writer::writeToFile(filename);
+    _filename = filename;
+    return BaseLib::IO::Writer::writeToFile(filename);
 }
 
 bool XmlGspInterface::write()
 {
-	GeoLib::GEOObjects& geoObjects = _project.getGEOObjects();
-	QFileInfo fi(QString::fromStdString(_filename));
-	std::string path((fi.absolutePath()).toStdString() + "/");
-
-	_out << "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"; // xml definition
-	_out << "<?xml-stylesheet type=\"text/xsl\" href=\"OpenGeoSysProject.xsl\"?>\n\n"; // stylefile definition
-
-	QDomDocument doc("OGS-PROJECT-DOM");
-	QDomElement root = doc.createElement("OpenGeoSysProject");
-	root.setAttribute( "xmlns:ogs", "http://www.opengeosys.org" );
-	root.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
-	root.setAttribute( "xsi:noNamespaceSchemaLocation",
-	                   "http://www.opengeosys.org/images/xsd/OpenGeoSysProject.xsd" );
-
-	doc.appendChild(root);
-
-	// GML
-	std::vector<std::string> geoNames;
-	geoObjects.getGeometryNames(geoNames);
-	for (std::vector<std::string>::const_iterator it(geoNames.begin()); it != geoNames.end(); ++it)
-	{
-		// write GLI file
-		GeoLib::IO::XmlGmlInterface gml(geoObjects);
-		std::string name(*it);
-		gml.setNameForExport(name);
-		if (gml.writeToFile(std::string(path + name + ".gml")))
-		{
-			// write entry in project file
-			QDomElement geoTag = doc.createElement("geo");
-			root.appendChild(geoTag);
-			QDomElement fileNameTag = doc.createElement("file");
-			geoTag.appendChild(fileNameTag);
-			QDomText fileNameText =
-			        doc.createTextNode(QString::fromStdString(name + ".gml"));
-			fileNameTag.appendChild(fileNameText);
-		}
-	}
-
-	// MSH
-	auto const& mesh_vector = _project.getMeshObjects();
-	for (auto const& mesh : mesh_vector)
-	{
-		// write mesh file
-		MeshLib::IO::Legacy::MeshIO meshIO;
-		meshIO.setMesh((&mesh)->get());
-		std::string fileName(path + mesh->getName());
-		meshIO.writeToFile(fileName);
-
-		// write entry in project file
-		QDomElement mshTag = doc.createElement("msh");
-		root.appendChild(mshTag);
-		QDomElement fileNameTag = doc.createElement("file");
-		mshTag.appendChild(fileNameTag);
-		QDomText fileNameText = doc.createTextNode(QString::fromStdString(mesh->getName()));
-		fileNameTag.appendChild(fileNameText);
-	}
-
-	// STN
-	std::vector<std::string> stnNames;
-	geoObjects.getStationVectorNames(stnNames);
-	for (std::vector<std::string>::const_iterator it(stnNames.begin()); it != stnNames.end(); ++it)
-	{
-		// write STN file
-		GeoLib::IO::XmlStnInterface stn(geoObjects);
-		std::string name(*it);
-		stn.setNameForExport(name);
-
-		if (stn.writeToFile(path + name + ".stn"))
-		{
-			// write entry in project file
-			QDomElement geoTag = doc.createElement("stn");
-			root.appendChild(geoTag);
-			QDomElement fileNameTag = doc.createElement("file");
-			geoTag.appendChild(fileNameTag);
-			QDomText fileNameText =
-			        doc.createTextNode(QString::fromStdString(name + ".stn"));
-			fileNameTag.appendChild(fileNameText);
-		}
-		else
-			ERR("XmlGspInterface::writeFile(): Error writing stn-file \"%s\".", name.c_str());
-	}
-
-	std::string xml = doc.toString().toStdString();
-	_out << xml;
-	return true;
+    GeoLib::GEOObjects& geoObjects = _project.getGEOObjects();
+    QFileInfo fi(QString::fromStdString(_filename));
+    std::string path((fi.absolutePath()).toStdString() + "/");
+
+    _out << "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"; // xml definition
+    _out << "<?xml-stylesheet type=\"text/xsl\" href=\"OpenGeoSysProject.xsl\"?>\n\n"; // stylefile definition
+
+    QDomDocument doc("OGS-PROJECT-DOM");
+    QDomElement root = doc.createElement("OpenGeoSysProject");
+    root.setAttribute( "xmlns:ogs", "http://www.opengeosys.org" );
+    root.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
+    root.setAttribute( "xsi:noNamespaceSchemaLocation",
+                       "http://www.opengeosys.org/images/xsd/OpenGeoSysProject.xsd" );
+
+    doc.appendChild(root);
+
+    // GML
+    std::vector<std::string> geoNames;
+    geoObjects.getGeometryNames(geoNames);
+    for (std::vector<std::string>::const_iterator it(geoNames.begin()); it != geoNames.end(); ++it)
+    {
+        // write GLI file
+        GeoLib::IO::XmlGmlInterface gml(geoObjects);
+        std::string name(*it);
+        gml.setNameForExport(name);
+        if (gml.writeToFile(std::string(path + name + ".gml")))
+        {
+            // write entry in project file
+            QDomElement geoTag = doc.createElement("geo");
+            root.appendChild(geoTag);
+            QDomElement fileNameTag = doc.createElement("file");
+            geoTag.appendChild(fileNameTag);
+            QDomText fileNameText =
+                    doc.createTextNode(QString::fromStdString(name + ".gml"));
+            fileNameTag.appendChild(fileNameText);
+        }
+    }
+
+    // MSH
+    auto const& mesh_vector = _project.getMeshObjects();
+    for (auto const& mesh : mesh_vector)
+    {
+        // write mesh file
+        MeshLib::IO::Legacy::MeshIO meshIO;
+        meshIO.setMesh((&mesh)->get());
+        std::string fileName(path + mesh->getName());
+        meshIO.writeToFile(fileName);
+
+        // write entry in project file
+        QDomElement mshTag = doc.createElement("msh");
+        root.appendChild(mshTag);
+        QDomElement fileNameTag = doc.createElement("file");
+        mshTag.appendChild(fileNameTag);
+        QDomText fileNameText = doc.createTextNode(QString::fromStdString(mesh->getName()));
+        fileNameTag.appendChild(fileNameText);
+    }
+
+    // STN
+    std::vector<std::string> stnNames;
+    geoObjects.getStationVectorNames(stnNames);
+    for (std::vector<std::string>::const_iterator it(stnNames.begin()); it != stnNames.end(); ++it)
+    {
+        // write STN file
+        GeoLib::IO::XmlStnInterface stn(geoObjects);
+        std::string name(*it);
+        stn.setNameForExport(name);
+
+        if (stn.writeToFile(path + name + ".stn"))
+        {
+            // write entry in project file
+            QDomElement geoTag = doc.createElement("stn");
+            root.appendChild(geoTag);
+            QDomElement fileNameTag = doc.createElement("file");
+            geoTag.appendChild(fileNameTag);
+            QDomText fileNameText =
+                    doc.createTextNode(QString::fromStdString(name + ".stn"));
+            fileNameTag.appendChild(fileNameText);
+        }
+        else
+            ERR("XmlGspInterface::writeFile(): Error writing stn-file \"%s\".", name.c_str());
+    }
+
+    std::string xml = doc.toString().toStdString();
+    _out << xml;
+    return true;
 }
 
 }
diff --git a/FileIO/XmlIO/Qt/XmlGspInterface.h b/FileIO/XmlIO/Qt/XmlGspInterface.h
index e936c1ce2bea245c914791bce105b4bfda640daa..2354d46d47a716b3aafb83a5720e5ea9a8899668 100644
--- a/FileIO/XmlIO/Qt/XmlGspInterface.h
+++ b/FileIO/XmlIO/Qt/XmlGspInterface.h
@@ -35,24 +35,24 @@ class XmlGspInterface : public BaseLib::IO::XMLInterface,
                         public BaseLib::IO::XMLQtInterface
 {
 public:
-	XmlGspInterface(DataHolderLib::Project &project);
+    XmlGspInterface(DataHolderLib::Project &project);
 
-	virtual ~XmlGspInterface() {}
+    virtual ~XmlGspInterface() {}
 
-	/// Reads an xml-file containing a GeoSys project.
-	/// Project files currently cover only geo-, msh- and station-data. This will be expanded in the future.
-	int readFile(const QString &fileName);
+    /// Reads an xml-file containing a GeoSys project.
+    /// Project files currently cover only geo-, msh- and station-data. This will be expanded in the future.
+    int readFile(const QString &fileName);
 
-	bool readFile(std::string const& fname) { return readFile(QString(fname.c_str())) != 0; }
+    bool readFile(std::string const& fname) { return readFile(QString(fname.c_str())) != 0; }
 
-	int writeToFile(const std::string& filename);
+    int writeToFile(const std::string& filename);
 
 protected:
-	bool write();
+    bool write();
 
 private:
-	std::string _filename;
-	DataHolderLib::Project& _project;
+    std::string _filename;
+    DataHolderLib::Project& _project;
 };
 
 } // end namespace FileIO
diff --git a/FileIO/XmlIO/Qt/XmlLutReader.h b/FileIO/XmlIO/Qt/XmlLutReader.h
index 52ff8efe2f33e7b3b2bd92a581ccad3c2be0b804..0baeaba930f24d74eb346e98fc8f1a10af8a9c55 100644
--- a/FileIO/XmlIO/Qt/XmlLutReader.h
+++ b/FileIO/XmlIO/Qt/XmlLutReader.h
@@ -32,76 +32,76 @@ namespace FileIO
 class XmlLutReader
 {
 public:
-	static VtkColorLookupTable* readFromFile(const QString &fileName)
-	{
-		VtkColorLookupTable* lut = VtkColorLookupTable::New();
-
-		QFile* file = new QFile(fileName);
-		if (!file->open(QIODevice::ReadOnly | QIODevice::Text))
-		{
-			ERR("XmlLutReader::readFromFile(): Can't open xml-file %s.", fileName.data());
-			delete file;
-			return NULL;
-		}
-
-		QDomDocument doc("ColorMap");
-		doc.setContent(file);
-		QDomElement docElement = doc.documentElement();
-		if (docElement.nodeName().compare("ColorMap"))
-		{
-			ERR("XmlLutReader::readFromFile(): Unexpected XML root.");
-			file->close();
-			delete file;
-			return NULL;
-		}
-
-		if (docElement.hasAttribute("interpolation"))
-		{
-			if (docElement.attribute("interpolation").compare("Linear") == 0)
-				lut->setInterpolationType(VtkColorLookupTable::LUTType::LINEAR);
-			else if (docElement.attribute("interpolation").compare("Exponential") == 0)
-				lut->setInterpolationType(VtkColorLookupTable::LUTType::EXPONENTIAL);
-			else
-				lut->setInterpolationType(VtkColorLookupTable::LUTType::NONE);
-		}
-		else // default
-			lut->setInterpolationType(VtkColorLookupTable::LUTType::NONE);
-
-		QDomElement point = docElement.firstChildElement();
-		double range[2] = { point.attribute("x").toDouble(), point.attribute("x").toDouble() };
-
-		while (!point.isNull())
-		{
-			if ((point.nodeName().compare("Point") == 0 )
-			    && point.hasAttribute("x")
-			    && point.hasAttribute("r")
-			    && point.hasAttribute("g")
-			    && point.hasAttribute("b"))
-			{
-				double value = point.attribute("x").toDouble();
-				unsigned char r = static_cast<int>(255 * point.attribute("r").toDouble());
-				unsigned char g = static_cast<int>(255 * point.attribute("g").toDouble());
-				unsigned char b = static_cast<int>(255 * point.attribute("b").toDouble());
-				unsigned char o = static_cast<int>(255 * (point.hasAttribute("o") ? point.attribute("o").toDouble() : 1));
-
-				if (value < range[0])
-					range[0] = value;
-				if (value > range[1])
-					range[1] = value;
-
-				unsigned char a[4] = { r, g, b, o };
-				lut->setColor(value, a);
-			}
-			point = point.nextSiblingElement();
-		}
-
-		lut->SetTableRange(range[0], range[1]);
-
-		file->close();
-		delete file;
-
-		return lut;
-	};
+    static VtkColorLookupTable* readFromFile(const QString &fileName)
+    {
+        VtkColorLookupTable* lut = VtkColorLookupTable::New();
+
+        QFile* file = new QFile(fileName);
+        if (!file->open(QIODevice::ReadOnly | QIODevice::Text))
+        {
+            ERR("XmlLutReader::readFromFile(): Can't open xml-file %s.", fileName.data());
+            delete file;
+            return NULL;
+        }
+
+        QDomDocument doc("ColorMap");
+        doc.setContent(file);
+        QDomElement docElement = doc.documentElement();
+        if (docElement.nodeName().compare("ColorMap"))
+        {
+            ERR("XmlLutReader::readFromFile(): Unexpected XML root.");
+            file->close();
+            delete file;
+            return NULL;
+        }
+
+        if (docElement.hasAttribute("interpolation"))
+        {
+            if (docElement.attribute("interpolation").compare("Linear") == 0)
+                lut->setInterpolationType(VtkColorLookupTable::LUTType::LINEAR);
+            else if (docElement.attribute("interpolation").compare("Exponential") == 0)
+                lut->setInterpolationType(VtkColorLookupTable::LUTType::EXPONENTIAL);
+            else
+                lut->setInterpolationType(VtkColorLookupTable::LUTType::NONE);
+        }
+        else // default
+            lut->setInterpolationType(VtkColorLookupTable::LUTType::NONE);
+
+        QDomElement point = docElement.firstChildElement();
+        double range[2] = { point.attribute("x").toDouble(), point.attribute("x").toDouble() };
+
+        while (!point.isNull())
+        {
+            if ((point.nodeName().compare("Point") == 0 )
+                && point.hasAttribute("x")
+                && point.hasAttribute("r")
+                && point.hasAttribute("g")
+                && point.hasAttribute("b"))
+            {
+                double value = point.attribute("x").toDouble();
+                unsigned char r = static_cast<int>(255 * point.attribute("r").toDouble());
+                unsigned char g = static_cast<int>(255 * point.attribute("g").toDouble());
+                unsigned char b = static_cast<int>(255 * point.attribute("b").toDouble());
+                unsigned char o = static_cast<int>(255 * (point.hasAttribute("o") ? point.attribute("o").toDouble() : 1));
+
+                if (value < range[0])
+                    range[0] = value;
+                if (value > range[1])
+                    range[1] = value;
+
+                unsigned char a[4] = { r, g, b, o };
+                lut->setColor(value, a);
+            }
+            point = point.nextSiblingElement();
+        }
+
+        lut->SetTableRange(range[0], range[1]);
+
+        file->close();
+        delete file;
+
+        return lut;
+    };
 
 
 };
diff --git a/FileIO/XmlIO/Qt/XmlNumInterface.cpp b/FileIO/XmlIO/Qt/XmlNumInterface.cpp
index 8f30141ceadb7a7cfc499a29f7e78a56caa13709..26c8c5bd217a1a8a8c16f34b722176a452d9a7f9 100644
--- a/FileIO/XmlIO/Qt/XmlNumInterface.cpp
+++ b/FileIO/XmlIO/Qt/XmlNumInterface.cpp
@@ -26,103 +26,103 @@
 namespace FileIO
 {
 XmlNumInterface::XmlNumInterface() :
-	XMLInterface(), XMLQtInterface(BaseLib::FileFinder().getPath("OpenGeoSysNUM.xsd"))
+    XMLInterface(), XMLQtInterface(BaseLib::FileFinder().getPath("OpenGeoSysNUM.xsd"))
 {
 }
 
 int XmlNumInterface::readFile(QString const& fileName)
 {
-	if(XMLQtInterface::readFile(fileName) == 0)
-		return 0;
-
-	QDomDocument doc("OGS-NUM-DOM");
-	doc.setContent(_fileData);
-	QDomElement const docElement = doc.documentElement(); //OGSNonlinearSolverSetup
-	if (docElement.nodeName().compare("OGSNonlinearSolverSetup"))
-	{
-		ERR("XmlNumInterface::readFile() - Unexpected XML root.");
-		return 0;
-	}
-
-	QDomElement num_node = docElement.firstChildElement();
-
-	while (!num_node.isNull())
-	{
-		if (num_node.nodeName().compare("Type") == 0)
-		{
-			std::string const solver_type = num_node.toElement().text().toStdString();
-			INFO("Non-linear solver type: %s.", solver_type.c_str());
-		}
-		else if (num_node.nodeName().compare("LinearSolver") == 0)
-			readLinearSolverConfiguration(num_node);
-		else if (num_node.nodeName().compare("IterationScheme") == 0)
-			readIterationScheme(num_node);
-		else if (num_node.nodeName().compare("Convergence") == 0)
-			readConvergenceCriteria(num_node);
-
-		num_node = num_node.nextSiblingElement();
-	}
-
-	return 1;
+    if(XMLQtInterface::readFile(fileName) == 0)
+        return 0;
+
+    QDomDocument doc("OGS-NUM-DOM");
+    doc.setContent(_fileData);
+    QDomElement const docElement = doc.documentElement(); //OGSNonlinearSolverSetup
+    if (docElement.nodeName().compare("OGSNonlinearSolverSetup"))
+    {
+        ERR("XmlNumInterface::readFile() - Unexpected XML root.");
+        return 0;
+    }
+
+    QDomElement num_node = docElement.firstChildElement();
+
+    while (!num_node.isNull())
+    {
+        if (num_node.nodeName().compare("Type") == 0)
+        {
+            std::string const solver_type = num_node.toElement().text().toStdString();
+            INFO("Non-linear solver type: %s.", solver_type.c_str());
+        }
+        else if (num_node.nodeName().compare("LinearSolver") == 0)
+            readLinearSolverConfiguration(num_node);
+        else if (num_node.nodeName().compare("IterationScheme") == 0)
+            readIterationScheme(num_node);
+        else if (num_node.nodeName().compare("Convergence") == 0)
+            readConvergenceCriteria(num_node);
+
+        num_node = num_node.nextSiblingElement();
+    }
+
+    return 1;
 }
 
 void XmlNumInterface::readLinearSolverConfiguration(QDomElement const& lin_root)
 {
-	std::string const library = lin_root.attribute("Library").toStdString();
-	std::string lin_solver_type, precond_type("no");
-
-	QDomElement linear_solver_node = lin_root.firstChildElement();
-	while (!linear_solver_node.isNull())
-	{
-		if (linear_solver_node.nodeName().compare("Type") == 0)
-			lin_solver_type = linear_solver_node.toElement().text().toStdString();
-		if (linear_solver_node.nodeName().compare("Preconditioner") == 0)
-			precond_type = linear_solver_node.toElement().text().toStdString();
-		linear_solver_node = linear_solver_node.nextSiblingElement();
-	}
-	INFO("Using %s-library with solver %s and %s preconditioner.", library.c_str(), lin_solver_type.c_str(), precond_type.c_str());
+    std::string const library = lin_root.attribute("Library").toStdString();
+    std::string lin_solver_type, precond_type("no");
+
+    QDomElement linear_solver_node = lin_root.firstChildElement();
+    while (!linear_solver_node.isNull())
+    {
+        if (linear_solver_node.nodeName().compare("Type") == 0)
+            lin_solver_type = linear_solver_node.toElement().text().toStdString();
+        if (linear_solver_node.nodeName().compare("Preconditioner") == 0)
+            precond_type = linear_solver_node.toElement().text().toStdString();
+        linear_solver_node = linear_solver_node.nextSiblingElement();
+    }
+    INFO("Using %s-library with solver %s and %s preconditioner.", library.c_str(), lin_solver_type.c_str(), precond_type.c_str());
 }
 
 
 void XmlNumInterface::readIterationScheme(QDomElement const& iteration_root)
 {
-	QDomElement iteration_node = iteration_root.firstChildElement();
-	int max_iterations(0), fixed_step_size(0);
-
-	while (!iteration_node.isNull())
-	{
-		if (iteration_node.nodeName().compare("MaxIterations") == 0)
-			max_iterations = iteration_node.toElement().text().toInt();
-		if (iteration_node.nodeName().compare("FixedStepSize") == 0)
-			fixed_step_size = iteration_node.toElement().text().toDouble();
-
-		iteration_node = iteration_node.nextSiblingElement();
-	}
-	INFO("Doing a maximum of %d iterations at fixed step size of %f", max_iterations, fixed_step_size);
+    QDomElement iteration_node = iteration_root.firstChildElement();
+    int max_iterations(0), fixed_step_size(0);
+
+    while (!iteration_node.isNull())
+    {
+        if (iteration_node.nodeName().compare("MaxIterations") == 0)
+            max_iterations = iteration_node.toElement().text().toInt();
+        if (iteration_node.nodeName().compare("FixedStepSize") == 0)
+            fixed_step_size = iteration_node.toElement().text().toDouble();
+
+        iteration_node = iteration_node.nextSiblingElement();
+    }
+    INFO("Doing a maximum of %d iterations at fixed step size of %f", max_iterations, fixed_step_size);
 }
 
 void XmlNumInterface::readConvergenceCriteria(QDomElement const& convergence_root)
 {
-	QDomElement conv_node = convergence_root.firstChildElement();
-	double error_threshold(0);
-	std::string error_method("");
-
-	while (!conv_node.isNull())
-	{
-		if (conv_node.nodeName().compare("Method") == 0)
-			error_method = conv_node.toElement().text().toStdString();
-		if (conv_node.nodeName().compare("ErrorThreshold") == 0)
-			error_threshold = conv_node.toElement().text().toDouble();
-
-		conv_node = conv_node.nextSiblingElement();
-	}
-	INFO("Convergence reached when error below %f using %s.", error_threshold, error_method.c_str());
+    QDomElement conv_node = convergence_root.firstChildElement();
+    double error_threshold(0);
+    std::string error_method("");
+
+    while (!conv_node.isNull())
+    {
+        if (conv_node.nodeName().compare("Method") == 0)
+            error_method = conv_node.toElement().text().toStdString();
+        if (conv_node.nodeName().compare("ErrorThreshold") == 0)
+            error_threshold = conv_node.toElement().text().toDouble();
+
+        conv_node = conv_node.nextSiblingElement();
+    }
+    INFO("Convergence reached when error below %f using %s.", error_threshold, error_method.c_str());
 }
 
 bool XmlNumInterface::write()
 {
-	INFO("Not yet implemented...");
-	return false;
+    INFO("Not yet implemented...");
+    return false;
 }
 
 } //namespace
diff --git a/FileIO/XmlIO/Qt/XmlNumInterface.h b/FileIO/XmlIO/Qt/XmlNumInterface.h
index 00c093a7cc70354876cab26de0750fff161243ec..e905dd70a9384488055e0f65802fc1cbdf1b1619 100644
--- a/FileIO/XmlIO/Qt/XmlNumInterface.h
+++ b/FileIO/XmlIO/Qt/XmlNumInterface.h
@@ -24,19 +24,19 @@ namespace FileIO
 class XmlNumInterface : public BaseLib::IO::XMLInterface, public BaseLib::IO::XMLQtInterface
 {
 public:
-	XmlNumInterface();
+    XmlNumInterface();
 
-	virtual ~XmlNumInterface() {}
+    virtual ~XmlNumInterface() {}
 
-	int readFile(QString const& fileName);
+    int readFile(QString const& fileName);
 
-	bool readFile(std::string const& fname) { return readFile(QString(fname.c_str())) != 0; }
+    bool readFile(std::string const& fname) { return readFile(QString(fname.c_str())) != 0; }
 
 protected:
-	void readLinearSolverConfiguration(QDomElement const& lin_root);
-	void readIterationScheme(QDomElement const& iteration_root);
-	void readConvergenceCriteria(QDomElement const& convergence_root);
-	bool write();
+    void readLinearSolverConfiguration(QDomElement const& lin_root);
+    void readIterationScheme(QDomElement const& iteration_root);
+    void readConvergenceCriteria(QDomElement const& convergence_root);
+    bool write();
 
 };