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