39 #include <boost/core/ignore_unused.hpp>
40 #include <boost/format.hpp>
54 "Writes an Info file.");
60 "Number of partitions over which to create the info file");
69 boost::ignore_unused(vm);
72 string filename =
m_config[
"outfile"].as<
string>();
76 "Need to specify nparts for info output");
77 int nparts =
m_config[
"nparts"].as<
int>();
81 std::shared_ptr<LibUtilities::FieldIOXml> fldXml =
82 std::static_pointer_cast<LibUtilities::FieldIOXml>(
86 fs::path pinfilename(filename);
87 std::vector<std::string> filenames;
88 std::vector<std::vector<unsigned int>> ElementIDs;
90 for (
int p = 0;
p < nparts; ++
p)
94 std::string s = pad.str();
96 fs::path fullpath = pinfilename / s;
98 if (!fs::exists(fname))
105 std::vector<LibUtilities::FieldDefinitionsSharedPtr> fielddefs;
106 std::vector<unsigned int> PartElmtIDs;
109 fldXml->ImportFieldDefs(dataSource, fielddefs,
false);
112 for (
int i = 0; i < fielddefs.size(); ++i)
114 for (
int j = 0; j < fielddefs[i]->m_elementIDs.size(); ++j)
116 PartElmtIDs.push_back(fielddefs[i]->m_elementIDs[j]);
120 ElementIDs.push_back(PartElmtIDs);
121 filenames.push_back(s);
128 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 v_Process(po::variables_map &vm) override
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.