35#include <boost/algorithm/string.hpp>
76 cerr <<
"File type " << fileType <<
" not supported for this "
80 m_f->m_inputfiles[fileType].push_back(fileName);
88 string fname =
m_config[
"outfile"].as<
string>();
92 cerr <<
"Error opening file: " << fname << endl;
105 cerr <<
"WARNING: Unrecognised config option " << key
106 <<
", proceeding anyway." << endl;
116 if (it->second.m_isBool && val ==
"")
118 it->second.m_value =
"1";
122 it->second.m_value = val;
134 cerr <<
"No configuration options for this module." << endl;
140 cerr << setw(10) << it.first <<
": " << it.second.m_desc << endl;
152 if (!it.second.m_beenSet)
154 it.second.m_value = it.second.m_defValue;
165 ifstream inFile(filename.c_str(), ios::binary);
166 vector<char> data(64, 0);
167 inFile.read(&data[0], 64);
169 string check(&data[0], 64);
172 if (check.compare(0, 4,
"#std") == 0)
180 if (check.compare(26, 7,
"Session") == 0)
196 cout <<
"Field size = " <<
m_f->m_data[0].size() *
sizeof(
NekDouble)
FIELD_UTILS_EXPORT void AddFile(std::string fileType, std::string fileName)
FIELD_UTILS_EXPORT void RegisterConfig(std::string key, std::string value="")
Register a configuration option with a module.
std::set< std::string > m_allowedFiles
List of allowed file formats.
FieldSharedPtr m_f
Field object.
FIELD_UTILS_EXPORT void PrintConfig()
Print out all configuration options for a module.
std::map< std::string, ConfigOption > m_config
List of configuration values.
FIELD_UTILS_EXPORT void SetDefaults()
Sets default configuration options for those which have not been set.
OutputModule(FieldSharedPtr p_f)
std::ofstream m_fldFile
Output stream.
FIELD_UTILS_EXPORT void OpenStream()
Open a file for output.
Provides a generic Factory class.
std::shared_ptr< Field > FieldSharedPtr
std::ostream & operator<<(std::ostream &os, const ModuleKey &rhs)
std::pair< ModuleType, std::string > ModuleKey
const std::string ModuleTypeMap[]
ModuleFactory & GetModuleFactory()
Represents a command-line configuration option.
std::string m_value
The value of the configuration option.
bool m_beenSet
True if the configuration option has been set at command line. If false, the default value will be pu...