Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
DDconverter.cpp
Go to the documentation of this file.
1/* This file is part of MODEL, the Mechanics Of Defect Evolution Library.
2 *
3 * Copyright (C) 2015 by Giacomo Po <gpo@ucla.edu>.
4 *
5 * model is distributed without any warranty under the
6 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
7 */
8
9#include <string>
10#include <experimental/filesystem>
12
13using namespace model;
14
15namespace fs = std::experimental::filesystem;
16
17
18int main(int argc, char** argv)
19{
20 const std::string path = "./config";
21
22 const std::string subS1="evl_";
23 const std::string subS2=".bin";
24
25 const bool writeSegments = argc > 1 ? std::atoi(argv[1]) : false;
26
27
28 for (const auto & p : fs::directory_iterator(path))
29 {
30
31 const size_t found1=p.path().string().find(subS1);
32 const size_t found2=p.path().string().find(subS2);
33
34 if ( found1 != std::string::npos
35 && found2 != std::string::npos)
36 {
37 const std::string stringID=p.path().string().substr(found1+subS1.length(),found2-(found1+subS1.length()));
38 const size_t runID=std::stol(stringID);
40 converter.bin2txt(runID,writeSegments);
41 }
42 }
43
44 return 0;
45
46}
47
48
void bin2txt(const size_t &runID, const bool &writeSegments)
void argv
void b int argc
vertex p[3]