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 =
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)
std::map< std::string, ConfigOption > m_config
List of configuration values.
Represents a command-line configuration option.
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
std::shared_ptr< Field > FieldSharedPtr
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
virtual void Process(po::variables_map &vm)
Write fld to output file.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
std::pair< ModuleType, std::string > ModuleKey
std::shared_ptr< DataSource > DataSourceSharedPtr
static DataSourceSharedPtr create(const std::string &fn)
Create a new XML data source based on the filename.
std::string PortablePath(const boost::filesystem::path &path)
create portable path on different platforms for boost::filesystem path
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Abstract base class for output modules.
ModuleFactory & GetModuleFactory()
FieldSharedPtr m_f
Field object.