36 #ifndef NEKMESHUTILS_MODULE
37 #define NEKMESHUTILS_MODULE
39 #include <boost/iostreams/device/file_descriptor.hpp>
40 #include <boost/iostreams/filtering_stream.hpp>
54 namespace io = boost::iostreams;
58 namespace NekMeshUtils
78 typedef std::map<int, std::pair<FaceSharedPtr, std::vector<int> > >
PerMap;
93 isBool(isBool),
beenSet(false),
value(), defValue(defValue),
107 return boost::lexical_cast<T>(
value);
109 catch(
const std::exception &e)
111 std::cerr << e.what() << std::endl;
123 bool returnval =
true;
126 boost::lexical_cast<T>(
value);
128 catch(
const std::exception &e)
193 std::set<int> &prismsDone,
194 std::vector<ElementSharedPtr> &line);
bool isBool
True if the configuration option is a boolean (thus does not need additional arguments).
NEKMESHUTILS_EXPORT void SetDefaults()
Sets default configuration options for those which have not been set.
io::filtering_ostream m_mshFile
Output stream.
NEKMESHUTILS_EXPORT void OpenStream()
Open a file for output.
std::map< int, std::pair< FaceSharedPtr, std::vector< int > > > PerMap
Abstract base class for output modules.
LibUtilities::NekFactory< ModuleKey, Module, MeshSharedPtr > ModuleFactory
NEKMESHUTILS_EXPORT void RegisterConfig(std::string key, std::string value)
Register a configuration option with a module.
const char *const ModuleTypeMap[]
MeshSharedPtr m_mesh
Mesh object.
NEKMESHUTILS_EXPORT void PrintConfig()
Print out all configuration options for a module.
T as()
Re-interpret the value stored in value as some type using boost::lexical_cast.
std::ofstream m_mshFileStream
Input stream.
ModuleFactory & GetModuleFactory()
NEKMESHUTILS_EXPORT void ReorderPrisms(PerMap &perFaces)
Reorder node IDs so that prisms and tetrahedra are aligned correctly.
virtual NEKMESHUTILS_EXPORT void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
boost::shared_ptr< Module > ModuleSharedPtr
std::string value
The value of the configuration option.
virtual NEKMESHUTILS_EXPORT void ProcessElements()
Generate element IDs.
Represents a command-line configuration option.
NEKMESHUTILS_EXPORT ProcessModule(MeshSharedPtr p_m)
std::map< std::string, ConfigOption > m_config
List of configuration values.
virtual NEKMESHUTILS_EXPORT void ClearElementLinks()
std::string defValue
Default value of the configuration option.
std::ostream & operator<<(std::ostream &os, const NodeSharedPtr &n)
Print description of node to given ostream.
NEKMESHUTILS_EXPORT OutputModule(MeshSharedPtr p_m)
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Abstract base class for processing modules.
NEKMESHUTILS_EXPORT Module(MeshSharedPtr p_m)
NEKMESHUTILS_EXPORT void PrismLines(int prism, PerMap &perFaces, std::set< int > &prismsDone, std::vector< ElementSharedPtr > &line)
virtual NEKMESHUTILS_EXPORT void Process()=0
bool isType()
Interpret the value stored in value as some type using boost::lexical_cast and return true of false d...
virtual NEKMESHUTILS_EXPORT void ProcessVertices()
Extract element vertices.
#define NEKMESHUTILS_EXPORT
virtual NEKMESHUTILS_EXPORT void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
std::pair< ModuleType, std::string > ModuleKey
NEKMESHUTILS_EXPORT MeshSharedPtr GetMesh()
virtual NEKMESHUTILS_EXPORT void ProcessComposites()
Generate composites.
std::string desc
Description of the configuration option.
bool beenSet
True if the configuration option has been set at command line. If false, the default value will be pu...
ConfigOption(bool isBool, std::string defValue, std::string desc)
Construct a new configuration option.
Provides a generic Factory class.