Nektar++
Public Member Functions | Protected Attributes | List of all members
Nektar::FieldUtils::OutputModule Class Reference

Abstract base class for output modules. More...

#include <Module.h>

Inheritance diagram for Nektar::FieldUtils::OutputModule:
[legend]

Public Member Functions

 OutputModule (FieldSharedPtr p_f)
 
FIELD_UTILS_EXPORT void OpenStream ()
 Open a file for output. More...
 
- Public Member Functions inherited from Nektar::FieldUtils::Module
FIELD_UTILS_EXPORT Module (FieldSharedPtr p_f)
 
virtual void Process (po::variables_map &vm)=0
 
virtual ~Module ()=default
 
virtual std::string GetModuleName ()=0
 
virtual std::string GetModuleDescription ()
 
const ConfigOptionGetConfigOption (const std::string &key) const
 
virtual ModulePriority GetModulePriority ()=0
 
FIELD_UTILS_EXPORT void RegisterConfig (std::string key, std::string value="")
 Register a configuration option with a module. More...
 
FIELD_UTILS_EXPORT void PrintConfig ()
 Print out all configuration options for a module. More...
 
FIELD_UTILS_EXPORT void SetDefaults ()
 Sets default configuration options for those which have not been set. More...
 
FIELD_UTILS_EXPORT void AddFile (std::string fileType, std::string fileName)
 
FIELD_UTILS_EXPORT void EvaluateTriFieldAtEquiSpacedPts (LocalRegions::ExpansionSharedPtr &exp, const Array< OneD, const NekDouble > &infield, Array< OneD, NekDouble > &outfield)
 

Protected Attributes

std::ofstream m_fldFile
 Output stream. More...
 
- Protected Attributes inherited from Nektar::FieldUtils::Module
std::map< std::string, ConfigOptionm_config
 List of configuration values. More...
 
std::set< std::string > m_allowedFiles
 List of allowed file formats. More...
 

Additional Inherited Members

- Public Attributes inherited from Nektar::FieldUtils::Module
FieldSharedPtr m_f
 Field object. More...
 
- Protected Member Functions inherited from Nektar::FieldUtils::Module
 Module ()
 

Detailed Description

Abstract base class for output modules.

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

Definition at line 279 of file Module.h.

Constructor & Destructor Documentation

◆ OutputModule()

Nektar::FieldUtils::OutputModule::OutputModule ( FieldSharedPtr  p_f)

Definition at line 68 of file Module.cpp.

68  : Module(m)
69 {
70  m_config["outfile"] = ConfigOption(false, "", "Output filename.");
71 }
std::map< std::string, ConfigOption > m_config
List of configuration values.
Definition: Module.h:233

References Nektar::FieldUtils::Module::m_config.

Member Function Documentation

◆ OpenStream()

void Nektar::FieldUtils::OutputModule::OpenStream ( )

Open a file for output.

Definition at line 88 of file Module.cpp.

89 {
90  string fname = m_config["outfile"].as<string>();
91  m_fldFile.open(fname.c_str());
92  if (!m_fldFile.good())
93  {
94  cerr << "Error opening file: " << fname << endl;
95  abort();
96  }
97 }
std::ofstream m_fldFile
Output stream.
Definition: Module.h:287

References Nektar::FieldUtils::Module::m_config, and m_fldFile.

Member Data Documentation

◆ m_fldFile

std::ofstream Nektar::FieldUtils::OutputModule::m_fldFile
protected

Output stream.

Definition at line 287 of file Module.h.

Referenced by OpenStream().