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;
199 std::string value =
"");
289 m_type =
"FieldConvert parallel";
295 m_type =
"FieldConvert parallel";
303 m_commRow = std::shared_ptr<FieldConvertComm>(
#define FIELD_UTILS_EXPORT
void v_SplitComm(int pRows, int pColumns)
bool v_TreatAsRankZero(void)
FieldConvertComm(int argc, char *argv[], int size, int rank)
virtual ~FieldConvertComm()
FieldConvertComm(int size, int rank)
bool v_RemoveExistingFiles(void)
virtual void Process(po::variables_map &vm)=0
FIELD_UTILS_EXPORT void RegisterConfig(std::string key, std::string value="")
Register a configuration option with a module.
FIELD_UTILS_EXPORT Module(FieldSharedPtr p_f)
virtual std::string GetModuleName()=0
FieldSharedPtr m_f
Field object.
virtual ModulePriority GetModulePriority()=0
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.
virtual std::string GetModuleDescription()
FIELD_UTILS_EXPORT void EvaluateTriFieldAtEquiSpacedPts(LocalRegions::ExpansionSharedPtr &exp, const Array< OneD, const NekDouble > &infield, Array< OneD, NekDouble > &outfield)
Abstract base class for output modules.
OutputModule(FieldSharedPtr p_f)
std::ofstream m_fldFile
Output stream.
FIELD_UTILS_EXPORT void OpenStream()
Open a file for output.
Abstract base class for processing modules.
ProcessModule(FieldSharedPtr p_f)
CommSharedPtr m_commColumn
Column communicator.
CommSharedPtr m_commRow
Row communicator.
int m_size
Number of processes.
std::string m_type
Type of communication.
Provides a generic Factory class.
LibUtilities::NekFactory< ModuleKey, Module, FieldSharedPtr > ModuleFactory
std::shared_ptr< Field > FieldSharedPtr
std::ostream & operator<<(std::ostream &os, const ModuleKey &rhs)
std::pair< ModuleType, std::string > ModuleKey
std::shared_ptr< InputModule > InputModuleSharedPtr
void swap_endian(T &u)
Swap endian ordering of the input variable.
std::shared_ptr< Module > ModuleSharedPtr
const char *const ModuleTypeMap[]
ModuleFactory & GetModuleFactory()
std::shared_ptr< Expansion > ExpansionSharedPtr
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs
Represents a command-line configuration option.
std::string m_value
The value of the configuration option.
ConfigOption(bool isBool, std::string defValue, std::string desc)
Construct a new configuration option.
bool m_beenSet
True if the configuration option has been set at command line. If false, the default value will be pu...
std::string m_defValue
Default value of the configuration option.
std::string m_desc
Description of the configuration option.
bool m_isBool
True if the configuration option is a boolean (thus does not need additional arguments).
T as()
Re-interpret the value stored in #value as some type using boost::lexical_cast.