35 #ifndef FIELDUTILS_MODULE 36 #define FIELDUTILS_MODULE 54 namespace po = boost::program_options;
99 unsigned char u8[
sizeof(T)];
104 for (
size_t k = 0; k <
sizeof(T); k++)
106 dest.u8[k] = source.u8[
sizeof(T) - k - 1];
112 template <
typename T>
115 size_t vecSize = u.size();
116 for (
int i = 0; i < vecSize; ++i)
148 template <
typename T> T
as()
152 return boost::lexical_cast<T>(
m_value);
154 catch (
const std::exception &e)
156 std::cerr << e.what() << std::endl;
187 virtual void Process(po::variables_map &vm) = 0;
189 virtual std::string GetModuleName() = 0;
199 std::string value =
"");
273 std::ostream &os,
const ModuleKey &
rhs);
289 m_type =
"FieldConvert parallel";
295 m_type =
"FieldConvert parallel";
303 m_commRow = std::shared_ptr<FieldConvertComm>(
void swap_endian(T &u)
Swap endian ordering of the input variable.
std::map< std::string, ConfigOption > m_config
List of configuration values.
virtual ~FieldConvertComm()
Represents a command-line configuration option.
T as()
Re-interpret the value stored in #value as some type using boost::lexical_cast.
std::string m_desc
Description of the configuration option.
LibUtilities::NekFactory< ModuleKey, Module, FieldSharedPtr > ModuleFactory
FieldConvertComm(int argc, char *argv[], int size, int rank)
std::shared_ptr< Field > FieldSharedPtr
ConfigOption(bool isBool, std::string defValue, std::string desc)
Construct a new configuration option.
std::string m_value
The value of the configuration option.
std::pair< ModuleType, std::string > ModuleKey
const char *const ModuleTypeMap[]
std::string m_defValue
Default value of the configuration option.
bool v_TreatAsRankZero(void)
virtual std::string GetModuleDescription()
std::shared_ptr< InputModule > InputModuleSharedPtr
std::ofstream m_fldFile
Output stream.
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< Module > ModuleSharedPtr
std::ostream & operator<<(std::ostream &os, const ModuleKey &rhs)
#define FIELD_UTILS_EXPORT
void v_SplitComm(int pRows, int pColumns)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs
bool m_beenSet
True if the configuration option has been set at command line. If false, the default value will be pu...
FieldConvertComm(int size, int rank)
Abstract base class for processing modules.
bool m_isBool
True if the configuration option is a boolean (thus does not need additional arguments).
bool v_RemoveExistingFiles(void)
Abstract base class for output modules.
ProcessModule(FieldSharedPtr p_f)
Provides a generic Factory class.
ModuleFactory & GetModuleFactory()
FIELD_UTILS_EXPORT Module(FieldSharedPtr p_f)