42 #include <boost/format.hpp>
51 "Writes an Info file.");
64 string filename =
m_config[
"outfile"].as<
string>();
69 cout <<
"OutputInfo: Writing Info file..." << endl;
74 "--nprocs nust be specified with info output");
76 int nprocs = vm[
"nprocs"].as<
int>();
80 vComm->SplitComm(1,nprocs);
83 string xml_ending =
"xml";
84 string xml_gz_ending =
"xml.gz";
86 std::vector<std::string> files;
88 for (
int i = 0; i <
m_f->m_inputfiles[xml_ending].size(); ++i)
90 files.push_back(
m_f->m_inputfiles[xml_ending][i]);
94 for (
int j =0; j <
m_f->m_inputfiles[xml_gz_ending].size(); ++j)
96 files.push_back(
m_f->m_inputfiles[xml_gz_ending][j]);
100 boost::shared_ptr<LibUtilities::SessionReader>(
102 vSession->SetUpXmlDoc();
107 string vPartitionerName =
"Metis";
110 vPartitionerName =
"Scotch";
112 if (vSession->DefinesCmdLineArgument(
"use-metis"))
114 vPartitionerName =
"Metis";
116 if (vSession->DefinesCmdLineArgument(
"use-scotch"))
118 vPartitionerName =
"Scotch";
123 vPartitionerName, vSession);
125 vMeshPartition->PartitionMesh(
false);
128 std::vector<std::vector<unsigned int> > ElementIDs(nprocs);
131 for (i = 0; i < nprocs; ++i)
133 std::vector<unsigned int> tmp;
134 vMeshPartition->GetElementIDs(i,tmp);
139 std::vector<std::string> filenames;
140 for(
int i = 0; i < nprocs; ++i)
142 boost::format pad(
"P%1$07d.fld");
144 filenames.push_back(pad.str());
148 m_f->m_fld->WriteMultiFldFileIDs(filename,filenames, ElementIDs);