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

Converter from fld to vtk. More...

#include <OutputXml.h>

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

Public Member Functions

 OutputXml (FieldSharedPtr f)
 
 ~OutputXml () override
 
- Public Member Functions inherited from Nektar::FieldUtils::OutputModule
 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 ~Module ()=default
 
void Process (po::variables_map &vm)
 
std::string GetModuleName ()
 
std::string GetModuleDescription ()
 
const ConfigOptionGetConfigOption (const std::string &key) const
 
ModulePriority GetModulePriority ()
 
std::vector< ModuleKeyGetModulePrerequisites ()
 
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)
 

Static Public Member Functions

static std::shared_ptr< Modulecreate (FieldSharedPtr f)
 Creates an instance of this class. More...
 

Static Public Attributes

static ModuleKey m_className
 

Protected Member Functions

void v_Process (po::variables_map &vm) override
 Write fld to output file. More...
 
std::string v_GetModuleName () override
 
std::string v_GetModuleDescription () override
 
ModulePriority v_GetModulePriority () override
 
- Protected Member Functions inherited from Nektar::FieldUtils::Module
 Module ()
 
virtual void v_Process (po::variables_map &vm)
 
virtual std::string v_GetModuleName ()
 
virtual std::string v_GetModuleDescription ()
 
virtual ModulePriority v_GetModulePriority ()
 
virtual std::vector< ModuleKeyv_GetModulePrerequisites ()
 

Additional Inherited Members

- Public Attributes inherited from Nektar::FieldUtils::Module
FieldSharedPtr m_f
 Field object. More...
 
- Protected Attributes inherited from Nektar::FieldUtils::OutputModule
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...
 

Detailed Description

Converter from fld to vtk.

Definition at line 44 of file OutputXml.h.

Constructor & Destructor Documentation

◆ OutputXml()

Nektar::FieldUtils::OutputXml::OutputXml ( FieldSharedPtr  f)

Definition at line 48 of file OutputXml.cpp.

48 : OutputModule(f)
49{
50}
OutputModule(FieldSharedPtr p_f)
Definition: Module.cpp:66

◆ ~OutputXml()

Nektar::FieldUtils::OutputXml::~OutputXml ( )
override

Definition at line 52 of file OutputXml.cpp.

53{
54}

Member Function Documentation

◆ create()

static std::shared_ptr< Module > Nektar::FieldUtils::OutputXml::create ( FieldSharedPtr  f)
inlinestatic

Creates an instance of this class.

Definition at line 48 of file OutputXml.h.

49 {
51 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

◆ v_GetModuleDescription()

std::string Nektar::FieldUtils::OutputXml::v_GetModuleDescription ( )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 66 of file OutputXml.h.

67 {
68 return "Writing file";
69 }

◆ v_GetModuleName()

std::string Nektar::FieldUtils::OutputXml::v_GetModuleName ( )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 61 of file OutputXml.h.

62 {
63 return "OutputXml";
64 }

◆ v_GetModulePriority()

ModulePriority Nektar::FieldUtils::OutputXml::v_GetModulePriority ( )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 71 of file OutputXml.h.

72 {
73 return eOutput;
74 }

References Nektar::FieldUtils::eOutput.

◆ v_Process()

void Nektar::FieldUtils::OutputXml::v_Process ( po::variables_map &  vm)
overrideprotectedvirtual

Write fld to output file.

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 56 of file OutputXml.cpp.

57{
58 m_f->SetUpExp(vm);
59
60 if (!m_f->m_exp.size()) // do nothing if no expansion defined
61 {
62 return;
63 }
64
65 // Extract the output filename and extension
66 string filename = m_config["outfile"].as<string>();
67
68 auto graphIO =
70 graphIO->SetMeshGraph(m_f->m_graph);
71 graphIO->WriteGeometry(filename);
72 cout << "Written file: " << filename << endl;
73}
FieldSharedPtr m_f
Field object.
Definition: Module.h:239
std::map< std::string, ConfigOption > m_config
List of configuration values.
Definition: Module.h:272
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
MeshGraphIOFactory & GetMeshGraphIOFactory()
Definition: MeshGraphIO.cpp:47

References Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::SpatialDomains::GetMeshGraphIOFactory(), Nektar::FieldUtils::Module::m_config, and Nektar::FieldUtils::Module::m_f.

Member Data Documentation

◆ m_className

ModuleKey Nektar::FieldUtils::OutputXml::m_className
static
Initial value:
ModuleKey(eOutputModule, "xml"), OutputXml::create, "Writes an XML file.")
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
Definition: OutputXml.h:48
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::pair< ModuleType, std::string > ModuleKey
Definition: Module.h:180
ModuleFactory & GetModuleFactory()
Definition: Module.cpp:47

Definition at line 52 of file OutputXml.h.