Skip to content
Snippets Groups Projects
Commit 2244e87d authored by Soeren Peters's avatar Soeren Peters
Browse files

Remove remaining boost dependencies

parent 44d4ea71
No related branches found
No related tags found
1 merge request!43Remove boost serialization and fix the seg fault issue.
...@@ -7,8 +7,6 @@ endif() ...@@ -7,8 +7,6 @@ endif()
vf_add_library(PRIVATE_LINK ${additional_libraries} GridGenerator basics MPI::MPI_CXX) vf_add_library(PRIVATE_LINK ${additional_libraries} GridGenerator basics MPI::MPI_CXX)
linkBoost(COMPONENTS "serialization")
#SET(TPN_WIN32 "/EHsc") #SET(TPN_WIN32 "/EHsc")
#https://stackoverflow.com/questions/6832666/lnk2019-when-including-asio-headers-solution-generated-with-cmake #https://stackoverflow.com/questions/6832666/lnk2019-when-including-asio-headers-solution-generated-with-cmake
#https://stackoverflow.com/questions/27442885/syntax-error-with-stdnumeric-limitsmax #https://stackoverflow.com/questions/27442885/syntax-error-with-stdnumeric-limitsmax
......
...@@ -12,7 +12,6 @@ void readGeometry(Parameter* para, Communicator* comm, int lev, std::string geom ...@@ -12,7 +12,6 @@ void readGeometry(Parameter* para, Communicator* comm, int lev, std::string geom
{ {
dataRoot = new unsigned int[dataSizeTotal]; dataRoot = new unsigned int[dataSizeTotal];
VtkGeometryReader::readFile(geometryFile, dataRoot); VtkGeometryReader::readFile(geometryFile, dataRoot);
//vtk_xml_reader::getPointData<unsigned int>(geometryFile, "Node Type", "StructuredGrid", dataRoot, dataSizeTotal);
} }
std::cout << "dataSizePerGPU size: " << dataSizePerGPU << "\n"; std::cout << "dataSizePerGPU size: " << dataSizePerGPU << "\n";
......
/*
* 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
...@@ -52,8 +52,6 @@ ...@@ -52,8 +52,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
//#include <boost/shared_ptr.hpp>
//#define BSP boost::shared_ptr
// Initial condition // Initial condition
typedef struct InitCond{ typedef struct InitCond{
...@@ -146,20 +144,10 @@ typedef struct Distri19{ ...@@ -146,20 +144,10 @@ typedef struct Distri19{
// Distribution functions f 27 // Distribution functions f 27
typedef struct Distri27{ typedef struct Distri27{
real* f[27]; real* f[27];
////////////////////////////////////////////////////////////////////////////
////Restart
//friend class boost::serialization::access;
//template<class Archive>
//void serialize(Archive & ar, const unsigned int version)
//{
// ar & f[0];
//}
////////////////////////////////////////////////////////////////////////////
} Distributions27; } Distributions27;
//Q for second order BCs //Q for second order BCs
typedef struct QforBC{ typedef struct QforBC{
//boost::shared_ptr<int> k;
int* k; int* k;
int* kN; int* kN;
long long* valueQ; long long* valueQ;
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "basics/utilities/UbFileOutputASCII.h" #include "basics/utilities/UbFileOutputASCII.h"
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
#include "Input/ConfigFile.h" #include "Input/ConfigFile.h"
#include "Input/VtkXmlReader.hpp"
#include "Input/VtkGeometryReader.h" #include "Input/VtkGeometryReader.h"
#include "Input/kFullReader.h" #include "Input/kFullReader.h"
#include "Input/PositionReader.h" #include "Input/PositionReader.h"
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include "LBM/D3Q27.h" #include "LBM/D3Q27.h"
#include "Calculation/PorousMedia.h" #include "Calculation/PorousMedia.h"
//#include "Output/LogWriter.hpp" //#include "Output/LogWriter.hpp"
//#include "boost/serialization/serialization.hpp"
//#include "boost/serialization/vector.hpp"
#include <cuda_runtime.h> #include <cuda_runtime.h>
#include <helper_cuda.h> #include <helper_cuda.h>
...@@ -276,27 +274,6 @@ struct ParameterStruct{ ...@@ -276,27 +274,6 @@ struct ParameterStruct{
std::vector< ProcessNeighborF3 > recvProcessNeighborF3Y; std::vector< ProcessNeighborF3 > recvProcessNeighborF3Y;
std::vector< ProcessNeighborF3 > recvProcessNeighborF3Z; 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 class VIRTUALFLUIDS_GPU_EXPORT Parameter
...@@ -1103,27 +1080,7 @@ private: ...@@ -1103,27 +1080,7 @@ private:
std::vector<std::string> possNeighborFilesSendX, possNeighborFilesSendY, possNeighborFilesSendZ; std::vector<std::string> possNeighborFilesSendX, possNeighborFilesSendY, possNeighborFilesSendZ;
std::vector<std::string> possNeighborFilesRecvX, possNeighborFilesRecvY, possNeighborFilesRecvZ; std::vector<std::string> possNeighborFilesRecvX, possNeighborFilesRecvY, possNeighborFilesRecvZ;
bool isNeigborX, isNeigborY, isNeigborZ; 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 // initial condition
std::function<void(real,real,real,real&,real&,real&,real&)> initialCondition; std::function<void(real,real,real,real&,real&,real&,real&)> initialCondition;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment