diff --git a/.gitignore b/.gitignore index 3c18f1fe5b1f164fab2096d5cd6db0492ee1ecb8..1e403ad1756de4f4b7f47208742356e8fbbf8709 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ tags # Conan package manager conanbuildinfo.cmake conaninfo.txt -CMakeLists.txt.user +CMakeLists.txt.user* diff --git a/FileIO/CMakeLists.txt b/FileIO/CMakeLists.txt index 6b96cb29f65add0a7fe0295960b223f9946d57ba..b0bbca03fcda55bbd3b9f3512e1296c5cb555588 100644 --- a/FileIO/CMakeLists.txt +++ b/FileIO/CMakeLists.txt @@ -3,15 +3,11 @@ set(SOURCES ${SOURCES_FileIO}) if(NOT Shapelib_FOUND) list(REMOVE_ITEM SOURCES SHPInterface.h SHPInterface.cpp) endif() -if(NOT QT4_FOUND) - list(REMOVE_ITEM SOURCES FEFLOWInterface.h FEFLOWInterface.cpp) -endif() GET_SOURCE_FILES(SOURCES_LEGACY Legacy) GET_SOURCE_FILES(SOURCES_GMSHIO GmshIO) -GET_SOURCE_FILES(SOURCES_RAPID_XML RapidXmlIO) GET_SOURCE_FILES(SOURCES_VTK VtkIO) -set(SOURCES ${SOURCES} ${SOURCES_LEGACY} ${SOURCES_GMSHIO} ${SOURCES_RAPID_XML} ${SOURCES_VTK}) +set(SOURCES ${SOURCES} ${SOURCES_LEGACY} ${SOURCES_GMSHIO} ${SOURCES_VTK}) GET_SOURCE_FILES(SOURCES_BASE_XML XmlIO) set(SOURCES ${SOURCES} ${SOURCES_BASE_XML}) diff --git a/GeoLib/CMakeLists.txt b/GeoLib/CMakeLists.txt index 2748a2e7a26e58d12a74e80d84f00124b005b001..8b6cc0586753a94b9ea8afd912174faa68e283de 100644 --- a/GeoLib/CMakeLists.txt +++ b/GeoLib/CMakeLists.txt @@ -8,7 +8,8 @@ set(SOURCES ${SOURCES} ${SOURCES_IO} ${SOURCES_IO_Legacy}) GET_SOURCE_FILES(SOURCES_IO_BASE_XML IO/XmlIO) GET_SOURCE_FILES(SOURCES_IO_BOOST_XML IO/XmlIO/Boost) -set(SOURCES ${SOURCES} ${SOURCES_IO_BASE_XML} ${SOURCES_IO_BOOST_XML}) +GET_SOURCE_FILES(SOURCES_IO_RAPID_XML IO/XmlIO/Rapid) +set(SOURCES ${SOURCES} ${SOURCES_IO_BASE_XML} ${SOURCES_IO_BOOST_XML} ${SOURCES_IO_RAPID_XML}) if(QT4_FOUND) GET_SOURCE_FILES(SOURCES_IO_QT_XML IO/XmlIO/Qt) diff --git a/FileIO/CsvInterface.cpp b/GeoLib/IO/CsvInterface.cpp similarity index 98% rename from FileIO/CsvInterface.cpp rename to GeoLib/IO/CsvInterface.cpp index ce2878960cf3a51b5ce117d150be8905acfd5bad..8a2ffa2f60809a23f48eec1a12bc7fccc1c659e1 100644 --- a/FileIO/CsvInterface.cpp +++ b/GeoLib/IO/CsvInterface.cpp @@ -18,7 +18,8 @@ #include "GeoLib/Point.h" -namespace FileIO { +namespace GeoLib { +namespace IO { int CsvInterface::readPoints(std::string const& fname, char delim, std::vector<GeoLib::Point*> &points) @@ -181,4 +182,5 @@ std::size_t CsvInterface::findColumn(std::string const& line, char delim, std::s return count; } -} // end namespace FileIO +} // end namespace IO +} // end namespace GeoLib diff --git a/FileIO/CsvInterface.h b/GeoLib/IO/CsvInterface.h similarity index 99% rename from FileIO/CsvInterface.h rename to GeoLib/IO/CsvInterface.h index 06c3cdd4a882dad10047306855d618afe62d6782..f01cbab2efb4933e4cb10f490d2081a13294c291 100644 --- a/FileIO/CsvInterface.h +++ b/GeoLib/IO/CsvInterface.h @@ -31,7 +31,8 @@ namespace GeoLib { class Point; } -namespace FileIO { +namespace GeoLib { +namespace IO { /** * Interface for reading CSV file formats. @@ -180,6 +181,7 @@ private: static std::size_t findColumn(std::string const& line, char delim, std::string const& column_name); }; -} +} // IO +} // GeoLib #endif /* CSVINTERFACE_H_ */ diff --git a/FileIO/OpenGeoSysGLI.xsd b/GeoLib/IO/XmlIO/OpenGeoSysGLI.xsd similarity index 98% rename from FileIO/OpenGeoSysGLI.xsd rename to GeoLib/IO/XmlIO/OpenGeoSysGLI.xsd index b4937b83ab43027cbce15899567d3dc27925d43e..ed8b0100a9640f7dd32a18d6919fa44474ed1eef 100644 --- a/FileIO/OpenGeoSysGLI.xsd +++ b/GeoLib/IO/XmlIO/OpenGeoSysGLI.xsd @@ -61,7 +61,7 @@ </xs:sequence> </xs:complexType> </xs:element> - + <!-- definition of polylines --> <xs:element name="polylines" minOccurs="0" maxOccurs="1"> <xs:complexType> @@ -87,10 +87,10 @@ <xs:element name="volume" type="volumeType" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> - </xs:element> - + </xs:element> + </xs:sequence> </xs:complexType> </xs:element> - + </xs:schema> diff --git a/FileIO/OpenGeoSysSTN.xsd b/GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd similarity index 93% rename from FileIO/OpenGeoSysSTN.xsd rename to GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd index 2d839edfa3f57aa068c8aea65e8a7139b3d44e1d..b07101ccf429eae09bcde70981dbcb12830dabf7 100644 --- a/FileIO/OpenGeoSysSTN.xsd +++ b/GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd @@ -2,8 +2,8 @@ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <!-- OpenGeoSysSTN schema; initial implementation: Karsten Rink, 2010-07-19 --> - - + + <!-- element definition --> <xs:element name="name" type="xs:string" /> <xs:element name="value" type="xs:decimal" /> @@ -59,7 +59,7 @@ <xs:attribute ref="y" use="required" /> <xs:attribute ref="z" use="required" /> </xs:complexType> - </xs:element> + </xs:element> </xs:sequence> </xs:complexType> @@ -75,26 +75,26 @@ <xs:element name="station" type="stationType" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> - </xs:element> + </xs:element> - <!-- case 2: list of boreholes --> + <!-- case 2: list of boreholes --> <xs:element name="boreholes"> <xs:complexType> <xs:sequence> <xs:element name="borehole" type="boreholeType" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> - </xs:element> + </xs:element> </xs:choice> </xs:group> - <!-- definition of file content --> + <!-- definition of file content --> <xs:element name="OpenGeoSysSTN"> <xs:complexType> <xs:sequence> - + <!-- definition of stationlist --> <xs:element name="stationlist" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> @@ -105,11 +105,11 @@ <!-- other list features can be inserted here --> </xs:sequence> </xs:complexType> - </xs:element> + </xs:element> <!-- end of "stationlist" --> - + </xs:sequence> - </xs:complexType> - </xs:element> + </xs:complexType> + </xs:element> </xs:schema> diff --git a/FileIO/RapidXmlIO/RapidStnInterface.cpp b/GeoLib/IO/XmlIO/Rapid/RapidStnInterface.cpp similarity index 99% rename from FileIO/RapidXmlIO/RapidStnInterface.cpp rename to GeoLib/IO/XmlIO/Rapid/RapidStnInterface.cpp index 019fe2be7a0f4864dcc010c6254bd7f8b4a49fcf..4da64c8462627c8ab441aaf5d5f0a7613144e37e 100644 --- a/FileIO/RapidXmlIO/RapidStnInterface.cpp +++ b/GeoLib/IO/XmlIO/Rapid/RapidStnInterface.cpp @@ -22,7 +22,9 @@ #include "GeoLib/Station.h" #include "GeoLib/StationBorehole.h" -namespace FileIO +namespace GeoLib +{ +namespace IO { std::vector<GeoLib::Point*> *RapidStnInterface::readStationFile(const std::string &fileName) @@ -230,4 +232,5 @@ void RapidStnInterface::readStratigraphy( const rapidxml::xml_node<>* strat_root } } -} +} // IO +} // GeoLib diff --git a/FileIO/RapidXmlIO/RapidStnInterface.h b/GeoLib/IO/XmlIO/Rapid/RapidStnInterface.h similarity index 96% rename from FileIO/RapidXmlIO/RapidStnInterface.h rename to GeoLib/IO/XmlIO/Rapid/RapidStnInterface.h index 797688a471d7bf3441ec5e834c421d916921c698..54e57349f3c2501a3cca37fbc9545e696c665e1d 100644 --- a/FileIO/RapidXmlIO/RapidStnInterface.h +++ b/GeoLib/IO/XmlIO/Rapid/RapidStnInterface.h @@ -26,7 +26,9 @@ namespace GeoLib { class StationBorehole; } -namespace FileIO +namespace GeoLib +{ +namespace IO { /** @@ -47,6 +49,7 @@ private: static void readStratigraphy(const rapidxml::xml_node<>* strat_root, GeoLib::StationBorehole* borehole); }; -} +} // IO +} // GeoLib #endif // RAPIDXMLINTERFACE_H diff --git a/FileIO/VtkIO/PVDFile.cpp b/MeshLib/IO/VtkIO/PVDFile.cpp similarity index 95% rename from FileIO/VtkIO/PVDFile.cpp rename to MeshLib/IO/VtkIO/PVDFile.cpp index 14a6430aa237d13456d8fede8afbd6efec76600c..0dbc8167981cdce6b0c9307c02d0bbf7f0cd6a41 100644 --- a/FileIO/VtkIO/PVDFile.cpp +++ b/MeshLib/IO/VtkIO/PVDFile.cpp @@ -14,7 +14,9 @@ #include <limits> #include <logog/include/logog.hpp> -namespace FileIO +namespace MeshLib +{ +namespace IO { void PVDFile::addVTUFile(const std::string &vtu_fname, double timestep) @@ -40,4 +42,5 @@ void PVDFile::addVTUFile(const std::string &vtu_fname, double timestep) fh << " </Collection>\n</VTKFile>\n"; } -} +} // IO +} // MeshLib diff --git a/FileIO/VtkIO/PVDFile.h b/MeshLib/IO/VtkIO/PVDFile.h similarity index 81% rename from FileIO/VtkIO/PVDFile.h rename to MeshLib/IO/VtkIO/PVDFile.h index 4cf48618d62daa5a77b8102c3c8dd3e9cb4d91ec..61c2de3cd68a2d09d02597f3ef529e1023b5f931 100644 --- a/FileIO/VtkIO/PVDFile.h +++ b/MeshLib/IO/VtkIO/PVDFile.h @@ -7,13 +7,15 @@ * */ -#ifndef FILEIO_VTK_PVDFILE_H -#define FILEIO_VTK_PVDFILE_H +#ifndef MESHLIB_VTKIO_PVDFILE_H +#define MESHLIB_VTKIO_PVDFILE_H #include <string> #include <vector> -namespace FileIO +namespace MeshLib +{ +namespace IO { /*! Writes a basic PVD file for use with Paraview. @@ -33,6 +35,7 @@ private: std::vector<std::pair<double, std::string>> _datasets; // a vector of (time, VTU file name) }; -} // namespace FileIO +} // namespace IO +} // namespace MeshLib -#endif // FILEIO_VTK_PVDFILE_H +#endif // MESHLIB_VTKIO_PVDFILE_H diff --git a/NumLib/CMakeLists.txt b/NumLib/CMakeLists.txt index f4b6c381ac3169720de94d6376af8f16f31f3b6f..7d5a00bb7cf2e6d9777d5443730ab8ab6e9f808a 100644 --- a/NumLib/CMakeLists.txt +++ b/NumLib/CMakeLists.txt @@ -28,6 +28,7 @@ set(SOURCES ${SOURCES} ${SOURCES_ODESOLVER}) GET_SOURCE_FILES(SOURCES_EXTRAPOLATION Extrapolation) set(SOURCES ${SOURCES} ${SOURCES_EXTRAPOLATION}) + # Create the library add_library(NumLib ${SOURCES}) diff --git a/ProcessLib/Output.h b/ProcessLib/Output.h index b83826acac758cca7a43419a5ff933f6f0eb6a43..b9b18ebb87ff5a0e190782c3a5239905e573d499 100644 --- a/ProcessLib/Output.h +++ b/ProcessLib/Output.h @@ -11,7 +11,7 @@ #define PROCESSLIB_OUTPUT_H #include "BaseLib/ConfigTree.h" -#include "FileIO/VtkIO/PVDFile.h" +#include "MeshLib/IO/VtkIO/PVDFile.h" #include "Process.h" namespace ProcessLib @@ -78,7 +78,7 @@ private: {} const unsigned process_index; - FileIO::PVDFile pvd_file; + MeshLib::IO::PVDFile pvd_file; }; Output(std::string const& prefix) diff --git a/Tests/FileIO/TestCsvReader.cpp b/Tests/FileIO/TestCsvReader.cpp index 57eea7588ac5bade825c160476767879e9e1ca38..f70fbe960715784eb0aa71ba43915f185cca735b 100644 --- a/Tests/FileIO/TestCsvReader.cpp +++ b/Tests/FileIO/TestCsvReader.cpp @@ -17,7 +17,7 @@ #include "gtest/gtest.h" #include "BaseLib/BuildInfo.h" -#include "FileIO/CsvInterface.h" +#include "GeoLib/IO/CsvInterface.h" #include "GeoLib/Point.h" class CsvInterfaceTest : public ::testing::Test @@ -56,9 +56,9 @@ TEST_F(CsvInterfaceTest, SimpleReadPoints) { std::vector<GeoLib::Point*> points; std::vector<GeoLib::Point*> points2; - _result = FileIO::CsvInterface::readPoints(_file_name, '\t', points); + _result = GeoLib::IO::CsvInterface::readPoints(_file_name, '\t', points); ASSERT_EQ(0, _result); - _result = FileIO::CsvInterface::readPoints(_file_name, '\t', points2, "x", "y", "z"); + _result = GeoLib::IO::CsvInterface::readPoints(_file_name, '\t', points2, "x", "y", "z"); ASSERT_EQ(0, _result); ASSERT_TRUE(points.size() == 10); ASSERT_TRUE(points2.size() == 10); @@ -77,7 +77,7 @@ TEST_F(CsvInterfaceTest, SimpleReadPoints) TEST_F(CsvInterfaceTest, StringInPointColumn) { std::vector<GeoLib::Point*> points; - _result = FileIO::CsvInterface::readPoints(_file_name, '\t', points, "x", "y", "name"); + _result = GeoLib::IO::CsvInterface::readPoints(_file_name, '\t', points, "x", "y", "name"); ASSERT_EQ(10, _result); ASSERT_TRUE(points.empty()); } @@ -86,11 +86,11 @@ TEST_F(CsvInterfaceTest, StringInPointColumn) TEST_F(CsvInterfaceTest, WrongColumnName) { std::vector<GeoLib::Point*> points; - _result = FileIO::CsvInterface::readPoints(_file_name, '\t', points, "x", "y", "wrong_column_name"); + _result = GeoLib::IO::CsvInterface::readPoints(_file_name, '\t', points, "x", "y", "wrong_column_name"); ASSERT_EQ(-1, _result); ASSERT_TRUE(points.empty()); - _result = FileIO::CsvInterface::readPoints(_file_name, '\t', points, "wrong_column_name", "y", "id"); + _result = GeoLib::IO::CsvInterface::readPoints(_file_name, '\t', points, "wrong_column_name", "y", "id"); ASSERT_EQ(-1, _result); ASSERT_TRUE(points.empty()); } @@ -99,7 +99,7 @@ TEST_F(CsvInterfaceTest, WrongColumnName) TEST_F(CsvInterfaceTest, MissingValues) { std::vector<GeoLib::Point*> points; - _result = FileIO::CsvInterface::readPoints(_file_name, '\t', points, "z", "value1", "value_two"); + _result = GeoLib::IO::CsvInterface::readPoints(_file_name, '\t', points, "z", "value1", "value_two"); ASSERT_EQ(3, _result); ASSERT_EQ(7, points.size()); ASSERT_NEAR(437.539, (*points[4])[2], std::numeric_limits<double>::epsilon()); @@ -111,7 +111,7 @@ TEST_F(CsvInterfaceTest, MissingValues) TEST_F(CsvInterfaceTest, Points2D) { std::vector<GeoLib::Point*> points; - _result = FileIO::CsvInterface::readPoints(_file_name, '\t', points, "x", "y"); + _result = GeoLib::IO::CsvInterface::readPoints(_file_name, '\t', points, "x", "y"); ASSERT_EQ(0, _result); ASSERT_EQ(10, points.size()); for (std::size_t i=0; i<points.size(); ++i) @@ -126,11 +126,11 @@ TEST_F(CsvInterfaceTest, CoordinateOrder) std::vector<GeoLib::Point*> points1; std::vector<GeoLib::Point*> points2; std::vector<GeoLib::Point*> points3; - _result = FileIO::CsvInterface::readPoints(_file_name, '\t', points1, "id", "y", "z"); + _result = GeoLib::IO::CsvInterface::readPoints(_file_name, '\t', points1, "id", "y", "z"); ASSERT_EQ(0, _result); - _result = FileIO::CsvInterface::readPoints(_file_name, '\t', points2, "id", "z", "y"); + _result = GeoLib::IO::CsvInterface::readPoints(_file_name, '\t', points2, "id", "z", "y"); ASSERT_EQ(0, _result); - _result = FileIO::CsvInterface::readPoints(_file_name, '\t', points3, "y", "id", "z"); + _result = GeoLib::IO::CsvInterface::readPoints(_file_name, '\t', points3, "y", "id", "z"); ASSERT_EQ(0, _result); ASSERT_EQ(10, points1.size()); ASSERT_EQ(10, points2.size()); @@ -156,12 +156,12 @@ TEST_F(CsvInterfaceTest, CoordinateOrder) TEST_F(CsvInterfaceTest, GetColumn) { std::vector<std::string> names; - _result = FileIO::CsvInterface::readColumn<std::string>(_file_name, '\t', names, "name"); + _result = GeoLib::IO::CsvInterface::readColumn<std::string>(_file_name, '\t', names, "name"); ASSERT_EQ(0, _result); ASSERT_EQ(10, names.size()); std::vector<double> values; - _result = FileIO::CsvInterface::readColumn<double>(_file_name, '\t', values, "value_two"); + _result = GeoLib::IO::CsvInterface::readColumn<double>(_file_name, '\t', values, "value_two"); ASSERT_EQ(2, _result); ASSERT_EQ(8, values.size()); } @@ -170,7 +170,7 @@ TEST_F(CsvInterfaceTest, GetColumn) TEST_F(CsvInterfaceTest, NonExistingColumn) { std::vector<double> values; - _result = FileIO::CsvInterface::readColumn<double>(_file_name, '\t', values, "value2"); + _result = GeoLib::IO::CsvInterface::readColumn<double>(_file_name, '\t', values, "value2"); ASSERT_EQ(-1, _result); ASSERT_TRUE(values.empty()); } @@ -179,12 +179,12 @@ TEST_F(CsvInterfaceTest, NonExistingColumn) TEST_F(CsvInterfaceTest, WrongDataType) { std::vector<double> values; - _result = FileIO::CsvInterface::readColumn<double>(_file_name, '\t', values, "name"); + _result = GeoLib::IO::CsvInterface::readColumn<double>(_file_name, '\t', values, "name"); ASSERT_EQ(10, _result); ASSERT_TRUE(values.empty()); std::vector<std::string> names; - _result = FileIO::CsvInterface::readColumn<std::string>(_file_name, '\t', names, "value1"); + _result = GeoLib::IO::CsvInterface::readColumn<std::string>(_file_name, '\t', names, "value1"); ASSERT_EQ(2, _result); ASSERT_EQ(8, names.size()); }