44 #include <boost/format.hpp>
54 "Writes an Info file.");
67 string filename =
m_config[
"outfile"].as<
string>();
72 cout <<
"OutputInfo: Writing Info file..." << endl;
77 "--nprocs nust be specified with info output");
79 int nprocs = vm[
"nprocs"].as<
int>();
83 vComm->SplitComm(1, nprocs);
86 string xml_ending =
"xml";
87 string xml_gz_ending =
"xml.gz";
89 std::vector<std::string> files;
91 for (
int i = 0; i <
m_f->m_inputfiles[xml_ending].size(); ++i)
93 files.push_back(
m_f->m_inputfiles[xml_ending][i]);
97 for (
int j = 0; j <
m_f->m_inputfiles[xml_gz_ending].size(); ++j)
99 files.push_back(
m_f->m_inputfiles[xml_gz_ending][j]);
103 boost::shared_ptr<LibUtilities::SessionReader>(
105 vSession->SetUpXmlDoc();
110 string vPartitionerName =
"Metis";
113 vPartitionerName =
"Scotch";
115 if (vSession->DefinesCmdLineArgument(
"use-metis"))
117 vPartitionerName =
"Metis";
119 if (vSession->DefinesCmdLineArgument(
"use-scotch"))
121 vPartitionerName =
"Scotch";
128 vMeshPartition->PartitionMesh(nprocs,
true);
131 std::vector<std::vector<unsigned int> > ElementIDs(nprocs);
134 for (i = 0; i < nprocs; ++i)
136 std::vector<unsigned int> tmp;
137 vMeshPartition->GetElementIDs(i, tmp);
142 std::vector<std::string> filenames;
143 for (
int i = 0; i < nprocs; ++i)
147 filenames.push_back(pad.str());
153 boost::shared_ptr<LibUtilities::FieldIOXml> fldXml =
map< string, ConfigOption > m_config
List of configuration values.
#define ASSERTL0(condition, msg)
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
boost::shared_ptr< MeshPartition > MeshPartitionSharedPtr
pair< ModuleType, string > ModuleKey
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
CommFactory & GetCommFactory()
virtual void Process(po::variables_map &vm)
Write fld to output file.
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
boost::shared_ptr< Field > FieldSharedPtr
void WriteMultiFldFileIDs(const std::string &outfile, const std::vector< std::string > fileNames, std::vector< std::vector< unsigned int > > &elementList, const FieldMetaDataMap &fieldinfomap=NullFieldMetaDataMap)
Write out a file containing element ID to partition mapping.
Reads and parses information from a Nektar++ XML session file.
MeshPartitionFactory & GetMeshPartitionFactory()
Abstract base class for output modules.
ModuleFactory & GetModuleFactory()
FieldSharedPtr m_f
Field object.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.