39#include <boost/format.hpp>
51 "Writes an Info file.");
57 "Number of partitions over which to create the info file");
67 string filename =
m_config[
"outfile"].as<
string>();
71 "Need to specify nparts for info output");
72 int nparts =
m_config[
"nparts"].as<
int>();
76 std::shared_ptr<LibUtilities::FieldIOXml> fldXml =
77 std::static_pointer_cast<LibUtilities::FieldIOXml>(
81 fs::path pinfilename(filename);
82 std::vector<std::string> filenames;
83 std::vector<std::vector<unsigned int>> ElementIDs;
85 for (
int p = 0;
p < nparts; ++
p)
89 std::string s = pad.str();
91 fs::path fullpath = pinfilename / s;
93 if (!fs::exists(fname))
100 std::vector<LibUtilities::FieldDefinitionsSharedPtr> fielddefs;
101 std::vector<unsigned int> PartElmtIDs;
104 fldXml->ImportFieldDefs(dataSource, fielddefs,
false);
107 for (
int i = 0; i < fielddefs.size(); ++i)
109 for (
int j = 0; j < fielddefs[i]->m_elementIDs.size(); ++j)
111 PartElmtIDs.push_back(fielddefs[i]->m_elementIDs[j]);
115 ElementIDs.push_back(PartElmtIDs);
116 filenames.push_back(s);
123 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.
void v_Process(po::variables_map &vm) override
Write fld to output file.
OutputInfo(FieldSharedPtr f)
static ModuleKey m_className
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
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
static std::string PortablePath(const fs::path &path)
create portable path on different platforms for std::filesystem path.
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Represents a command-line configuration option.