39 #include <boost/core/ignore_unused.hpp>
40 #include <boost/format.hpp>
55 "Writes an Info file.");
61 "Number of partitions over which to create the info file");
70 boost::ignore_unused(vm);
73 string filename =
m_config[
"outfile"].as<
string>();
77 "Need to specify nparts for info output");
78 int nparts =
m_config[
"nparts"].as<
int>();
82 std::shared_ptr<LibUtilities::FieldIOXml> fldXml =
83 std::static_pointer_cast<LibUtilities::FieldIOXml>(
87 fs::path pinfilename(filename);
88 std::vector<std::string> filenames;
89 std::vector<std::vector<unsigned int> > ElementIDs;
91 for (
int p = 0;
p < nparts; ++
p)
95 std::string s = pad.str();
97 fs::path fullpath = pinfilename / s;
99 if(!fs::exists(fname))
106 std::vector<LibUtilities::FieldDefinitionsSharedPtr> fielddefs;
107 std::vector<unsigned int> PartElmtIDs;
110 fldXml->ImportFieldDefs(dataSource,fielddefs,
false);
113 for(
int i = 0; i < fielddefs.size(); ++i)
115 for(
int j = 0; j < fielddefs[i]->m_elementIDs.size(); ++j)
117 PartElmtIDs.push_back(fielddefs[i]->m_elementIDs[j]);
121 ElementIDs.push_back(PartElmtIDs);
122 filenames.push_back(s);
129 fldXml->WriteMultiFldFileIDs(infofile,filenames, ElementIDs);
#define ASSERTL0(condition, msg)
FieldSharedPtr m_f
Field object.
std::map< std::string, ConfigOption > m_config
List of configuration values.
virtual void Process(po::variables_map &vm)
Write fld to output file.
Abstract base class for output modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static DataSourceSharedPtr create(const std::string &fn)
Create a new XML data source based on the filename.
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
std::shared_ptr< DataSource > DataSourceSharedPtr
std::string PortablePath(const boost::filesystem::path &path)
create portable path on different platforms for boost::filesystem path
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
The above copyright notice and this permission notice shall be included.
Represents a command-line configuration option.