Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
Nektar::NekMeshUtils::OutputModule Class Reference

Abstract base class for output modules. More...

#include <Module.h>

Inheritance diagram for Nektar::NekMeshUtils::OutputModule:
Inheritance graph
[legend]
Collaboration diagram for Nektar::NekMeshUtils::OutputModule:
Collaboration graph
[legend]

Public Member Functions

NEKMESHUTILS_EXPORT OutputModule (MeshSharedPtr p_m)
 
NEKMESHUTILS_EXPORT void OpenStream ()
 Open a file for output. More...
 
- Public Member Functions inherited from Nektar::NekMeshUtils::Module
NEKMESHUTILS_EXPORT Module (MeshSharedPtr p_m)
 
virtual NEKMESHUTILS_EXPORT void Process ()=0
 
NEKMESHUTILS_EXPORT void RegisterConfig (std::string key, std::string value)
 Register a configuration option with a module. More...
 
NEKMESHUTILS_EXPORT void PrintConfig ()
 Print out all configuration options for a module. More...
 
NEKMESHUTILS_EXPORT void SetDefaults ()
 Sets default configuration options for those which have not been set. More...
 
NEKMESHUTILS_EXPORT MeshSharedPtr GetMesh ()
 
virtual NEKMESHUTILS_EXPORT void ProcessVertices ()
 Extract element vertices. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessEdges (bool ReprocessEdges=true)
 Extract element edges. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessFaces (bool ReprocessFaces=true)
 Extract element faces. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessElements ()
 Generate element IDs. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessComposites ()
 Generate composites. More...
 
virtual NEKMESHUTILS_EXPORT void ClearElementLinks ()
 

Protected Attributes

io::filtering_ostream m_mshFile
 Output stream. More...
 
std::ofstream m_mshFileStream
 Input stream. More...
 
- Protected Attributes inherited from Nektar::NekMeshUtils::Module
MeshSharedPtr m_mesh
 Mesh object. More...
 
std::map< std::string,
ConfigOption
m_config
 List of configuration values. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::NekMeshUtils::Module
NEKMESHUTILS_EXPORT void ReorderPrisms (PerMap &perFaces)
 Reorder node IDs so that prisms and tetrahedra are aligned correctly. More...
 
NEKMESHUTILS_EXPORT void PrismLines (int prism, PerMap &perFaces, std::set< int > &prismsDone, std::vector< ElementSharedPtr > &line)
 

Detailed Description

Abstract base class for output modules.

Output modules take the mesh #m and write to the file specified by the stream m_mshFile.

Definition at line 241 of file NekMeshUtils/Module/Module.h.

Constructor & Destructor Documentation

Nektar::NekMeshUtils::OutputModule::OutputModule ( MeshSharedPtr  p_m)

Definition at line 73 of file NekMeshUtils/Module/Module.cpp.

References Nektar::NekMeshUtils::Module::m_config.

73  : Module(m)
74 {
75  m_config["outfile"] = ConfigOption(false, "", "Output filename.");
76 }
std::map< std::string, ConfigOption > m_config
List of configuration values.
NEKMESHUTILS_EXPORT Module(MeshSharedPtr p_m)

Member Function Documentation

void Nektar::NekMeshUtils::OutputModule::OpenStream ( )

Open a file for output.

Definition at line 107 of file NekMeshUtils/Module/Module.cpp.

References Nektar::NekMeshUtils::Module::m_config, m_mshFile, and m_mshFileStream.

Referenced by Nektar::Utilities::OutputSTL::Process(), and Nektar::Utilities::OutputGmsh::Process().

108 {
109  string fname = m_config["outfile"].as<string>();
110 
111  if (fname.size() > 3 && fname.substr(fname.size() - 3, 3) == ".gz")
112  {
113  m_mshFileStream.open(fname.c_str(), ios_base::out | ios_base::binary);
114  m_mshFile.push(io::gzip_compressor());
116  }
117  else
118  {
119  m_mshFileStream.open(fname.c_str());
121  }
122 
123  if (!m_mshFile.good())
124  {
125  cerr << "Error opening file: " << fname << endl;
126  abort();
127  }
128 }
io::filtering_ostream m_mshFile
Output stream.
std::map< std::string, ConfigOption > m_config
List of configuration values.

Member Data Documentation

io::filtering_ostream Nektar::NekMeshUtils::OutputModule::m_mshFile
protected
std::ofstream Nektar::NekMeshUtils::OutputModule::m_mshFileStream
protected

Input stream.

Definition at line 252 of file NekMeshUtils/Module/Module.h.

Referenced by OpenStream().