diff --git a/mytools/loadZobov.cpp b/mytools/loadZobov.cpp index e2da368..f4ed8ad 100644 --- a/mytools/loadZobov.cpp +++ b/mytools/loadZobov.cpp @@ -9,11 +9,12 @@ using namespace std; -bool loadZobov(const char *descName, const char *adjName, const char *volName, ZobovRep& z) +bool loadZobov(const char *descName, const char *adjName, const char *voidsName, + const char *volName, ZobovRep& z) { ifstream descFile(descName); ifstream adjFile(adjName); - ifstream volFile(volName); + ifstream volFile(voidsName); int32_t numParticles, numZones, numPinZone; int32_t totalParticles; int32_t numVoids; @@ -77,6 +78,23 @@ bool loadZobov(const char *descName, const char *adjName, const char *volName, Z delete[] zId; } + if (volName != 0) + { + cout << "Loading particle volumes (requested)" << endl; + ifstream f(volName); + int numParticles; + + if (!f) + { + cerr << "No such file " << volName << endl; + abort(); + } + + f.read((char *)&numParticles, sizeof(int)); + z.particleVolume.resize(numParticles); + f.read((char *)&z.particleVolume[0], sizeof(float)*numParticles); + } + cout << "Loading description" << endl; string line; diff --git a/mytools/loadZobov.hpp b/mytools/loadZobov.hpp index e53dd44..8f6a9d6 100644 --- a/mytools/loadZobov.hpp +++ b/mytools/loadZobov.hpp @@ -20,9 +20,11 @@ struct ZobovRep { std::vector allZones; std::vector allVoids; + std::vector particleVolume; }; bool loadZobov(const char *descName, - const char *adjName, const char *volName, ZobovRep& z); + const char *adjName, const char *voidName, + const char *volName, ZobovRep& z); #endif