From 2244e87dab14e40f5f567d810f6d2d05441690c2 Mon Sep 17 00:00:00 2001 From: Soeren Peters <peters@irmb.tu-bs.de> Date: Fri, 9 Apr 2021 15:26:10 +0000 Subject: [PATCH] Remove remaining boost dependencies --- src/gpu/VirtualFluids_GPU/CMakeLists.txt | 2 - .../VirtualFluids_GPU/Init/ReadGeometry.cpp | 1 - .../VirtualFluids_GPU/Input/VtkXmlReader.hpp | 88 ------------------- src/gpu/VirtualFluids_GPU/LBM/LB.h | 12 --- src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp | 1 - .../VirtualFluids_GPU/Parameter/Parameter.h | 45 +--------- 6 files changed, 1 insertion(+), 148 deletions(-) delete mode 100644 src/gpu/VirtualFluids_GPU/Input/VtkXmlReader.hpp diff --git a/src/gpu/VirtualFluids_GPU/CMakeLists.txt b/src/gpu/VirtualFluids_GPU/CMakeLists.txt index b80eec731..ce1bb9d92 100644 --- a/src/gpu/VirtualFluids_GPU/CMakeLists.txt +++ b/src/gpu/VirtualFluids_GPU/CMakeLists.txt @@ -7,8 +7,6 @@ endif() vf_add_library(PRIVATE_LINK ${additional_libraries} GridGenerator basics MPI::MPI_CXX) -linkBoost(COMPONENTS "serialization") - #SET(TPN_WIN32 "/EHsc") #https://stackoverflow.com/questions/6832666/lnk2019-when-including-asio-headers-solution-generated-with-cmake #https://stackoverflow.com/questions/27442885/syntax-error-with-stdnumeric-limitsmax diff --git a/src/gpu/VirtualFluids_GPU/Init/ReadGeometry.cpp b/src/gpu/VirtualFluids_GPU/Init/ReadGeometry.cpp index 4232f7e6b..b52e4eb64 100644 --- a/src/gpu/VirtualFluids_GPU/Init/ReadGeometry.cpp +++ b/src/gpu/VirtualFluids_GPU/Init/ReadGeometry.cpp @@ -12,7 +12,6 @@ void readGeometry(Parameter* para, Communicator* comm, int lev, std::string geom { dataRoot = new unsigned int[dataSizeTotal]; VtkGeometryReader::readFile(geometryFile, dataRoot); - //vtk_xml_reader::getPointData<unsigned int>(geometryFile, "Node Type", "StructuredGrid", dataRoot, dataSizeTotal); } std::cout << "dataSizePerGPU size: " << dataSizePerGPU << "\n"; diff --git a/src/gpu/VirtualFluids_GPU/Input/VtkXmlReader.hpp b/src/gpu/VirtualFluids_GPU/Input/VtkXmlReader.hpp deleted file mode 100644 index 3c94a6a91..000000000 --- a/src/gpu/VirtualFluids_GPU/Input/VtkXmlReader.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - * File: VtkXmlReader.hpp - * Author: kucher - * - * Created on 3. August 2010, 15:59 - * - * extract PointData from .VTK file - */ - -#ifndef VTK_XML_READER_H -#define VTK_XML_READER_H - -#include <boost/property_tree/ptree.hpp> -#include <boost/property_tree/xml_parser.hpp> -#include <boost/foreach.hpp> -#include <boost/algorithm/string.hpp> -#include <vector> -#include <iostream> - -#include "Core/StringUtilities/StringUtil.h" - -namespace vtk_xml_reader -{ - template <class T> - - // T* getPointData(const std::string &filename, const std::string &dataArrayName, const std::string &gridTyp){ - /*std::vector<T>*/ - void getPointData(const std::string &filename, const std::string &dataArrayName, const std::string &gridTyp, T* pointData, const int &pointDataSize){ - - //std::vector<T> pointData; - std::vector<std::string> pointDataStrings; - std::string str; - - // Create empty property tree object - using boost::property_tree::ptree; - ptree pt; - - - try - { - // Load XML file and put its contents in property tree. - // No namespace qualification is needed, because of Koenig - // lookup on the second argument. If reading fails, exception - // is thrown. - read_xml(filename, pt); - - std::string required_tag = "VTKFile." + gridTyp + ".Piece.PointData"; - - //BOOST_FOREACH(ptree::value_type &v, pt.get_child("VTKFile.UnstructuredGrid.Piece.PointData")){ - BOOST_FOREACH(ptree::value_type &v, pt.get_child(required_tag)){ - - if(v.first == "DataArray"){ - if(v.second.get<std::string>("<xmlattr>.Name") == dataArrayName) - str = v.second.data(); - } - } - } - catch (boost::property_tree::ptree_error e) - { - std::cout << e.what() << std::endl; - exit(0); - } - - boost::algorithm::split(pointDataStrings, str, boost::is_any_of("\t\n ")); - - int i = 0; - BOOST_FOREACH(std::string s, pointDataStrings){ - if (s != "") - { - //pointData.push_back(StringUtil::fromString<T>(s)); - pointData[i] = StringUtil::fromString<T>(s); - i++; - if (i > pointDataSize) - { - std::string exceptionText = "Bad allocation: pointDataStrings > pointDataSize"; - throw exceptionText; - } - } - } - - //return &pointData[0]; - //return pointData; - - } -} - -#endif - diff --git a/src/gpu/VirtualFluids_GPU/LBM/LB.h b/src/gpu/VirtualFluids_GPU/LBM/LB.h index 4ce6b1ff2..f5f917387 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/LB.h +++ b/src/gpu/VirtualFluids_GPU/LBM/LB.h @@ -52,8 +52,6 @@ #include <string> #include <vector> -//#include <boost/shared_ptr.hpp> -//#define BSP boost::shared_ptr // Initial condition typedef struct InitCond{ @@ -146,20 +144,10 @@ typedef struct Distri19{ // Distribution functions f 27 typedef struct Distri27{ real* f[27]; - //////////////////////////////////////////////////////////////////////////// - ////Restart - //friend class boost::serialization::access; - //template<class Archive> - //void serialize(Archive & ar, const unsigned int version) - //{ - // ar & f[0]; - //} - //////////////////////////////////////////////////////////////////////////// } Distributions27; //Q for second order BCs typedef struct QforBC{ - //boost::shared_ptr<int> k; int* k; int* kN; long long* valueQ; diff --git a/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp b/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp index 646ef9f82..c37827619 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp +++ b/src/gpu/VirtualFluids_GPU/LBM/Simulation.cpp @@ -8,7 +8,6 @@ #include "basics/utilities/UbFileOutputASCII.h" ////////////////////////////////////////////////////////////////////////// #include "Input/ConfigFile.h" -#include "Input/VtkXmlReader.hpp" #include "Input/VtkGeometryReader.h" #include "Input/kFullReader.h" #include "Input/PositionReader.h" diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h index c7696eac3..6b4202504 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h @@ -14,8 +14,6 @@ #include "LBM/D3Q27.h" #include "Calculation/PorousMedia.h" //#include "Output/LogWriter.hpp" -//#include "boost/serialization/serialization.hpp" -//#include "boost/serialization/vector.hpp" #include <cuda_runtime.h> #include <helper_cuda.h> @@ -276,27 +274,6 @@ struct ParameterStruct{ std::vector< ProcessNeighborF3 > recvProcessNeighborF3Y; std::vector< ProcessNeighborF3 > recvProcessNeighborF3Z; //////////////////////////////////////////////////////////////////////////// - - - - //////////////////////////////////////////////////////////////////////////// - ////Restart - //friend class boost::serialization::access; - //template<class Archive> - //void serialize(Archive & ar, const unsigned int version) - //{ - // unsigned int i; - // for (i=0; i<size_Mat_SP;i++) - // { - // ar & d0SP.f[0][i]; - // } - - // for (i=0; i<size_Mat;i++) - // { - // ar & k[i]; - // } - //} - //////////////////////////////////////////////////////////////////////////// }; class VIRTUALFLUIDS_GPU_EXPORT Parameter @@ -1103,27 +1080,7 @@ private: std::vector<std::string> possNeighborFilesSendX, possNeighborFilesSendY, possNeighborFilesSendZ; std::vector<std::string> possNeighborFilesRecvX, possNeighborFilesRecvY, possNeighborFilesRecvZ; bool isNeigborX, isNeigborY, isNeigborZ; - //////////////////////////////////////////////////////////////////////////// - ////Restart - //friend class boost::serialization::access; - //template<class Archive> - //void serialize(Archive & ar, const unsigned int version) - //{ - // unsigned int i; - // int j; - // for (j=coarse; j<=fine; j++) - // { - // for (i=0; i<parH[j]->size_Mat_SP;i++) - // { - // ar & parH[j]->d0SP.f[0][i]; - // } - - // for (i=0; i<parH[j]->size_Mat;i++) - // { - // ar & parH[j]->k[j]; - // } - // } - //} + //////////////////////////////////////////////////////////////////////////// // initial condition std::function<void(real,real,real,real&,real&,real&,real&)> initialCondition; -- GitLab