36 #ifndef UTILITIES_NEKMESH_MODULE
37 #define UTILITIES_NEKMESH_MODULE
74 typedef std::map<int, std::pair<FaceSharedPtr, std::vector<int> > >
PerMap;
88 ConfigOption(
bool isBool, std::string defValue, std::string desc) :
89 isBool(isBool), beenSet(false), value(), defValue(defValue),
92 isBool(false), beenSet(false), value(), defValue(), desc() {}
103 return boost::lexical_cast<T>(value);
105 catch(
const std::exception &e)
107 std::cerr << e.what() << std::endl;
119 bool returnval =
true;
122 boost::lexical_cast<T>(value);
124 catch(
const std::exception &e)
157 virtual void Process() = 0;
159 void RegisterConfig(std::string key, std::string value);
168 virtual void ProcessVertices();
170 virtual void ProcessEdges(
bool ReprocessEdges =
true);
172 virtual void ProcessFaces(
bool ReprocessFaces =
true);
174 virtual void ProcessElements();
176 virtual void ProcessComposites();
178 virtual void ClearElementLinks();
188 void ReorderPrisms(PerMap &perFaces);
189 void PrismLines (
int prism,
191 std::set<int> &prismsDone,
192 std::vector<ElementSharedPtr> &line);
237 class OutputModule :
public Module
249 typedef std::pair<ModuleType,std::string>
ModuleKey;
250 std::ostream&
operator<<(std::ostream& os,
const ModuleKey& rhs);
Module(MeshSharedPtr p_m)
LibUtilities::NekFactory< ModuleKey, Module, FieldSharedPtr > ModuleFactory
std::ostream & operator<<(std::ostream &os, const ModuleKey &rhs)
bool isType()
Interpret the value stored in value as some type using boost::lexical_cast and return true of false d...
pair< ModuleType, string > ModuleKey
bool isBool
True if the configuration option is a boolean (thus does not need additional arguments).
bool beenSet
True if the configuration option has been set at command line. If false, the default value will be pu...
MeshSharedPtr m_mesh
Mesh object.
std::string defValue
Default value of the configuration option.
T as()
Re-interpret the value stored in value as some type using boost::lexical_cast.
std::string value
The value of the configuration option.
ConfigOption(bool isBool, std::string defValue, std::string desc)
Construct a new configuration option.
boost::shared_ptr< Module > ModuleSharedPtr
ProcessModule(MeshSharedPtr p_m)
std::string desc
Description of the configuration option.
Represents a command-line configuration option.
std::map< int, std::pair< FaceSharedPtr, std::vector< int > > > PerMap
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
std::ofstream m_mshFile
Output stream.
std::map< std::string, ConfigOption > m_config
List of configuration values.
ModuleFactory & GetModuleFactory()
const char *const ModuleTypeMap[]
Abstract base class for processing modules.
Provides a generic Factory class.