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

#include <InputPts.h>

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

Public Member Functions

 InputPts (FieldSharedPtr f)
 Set up InputPts object. More...
 
 ~InputPts () override
 
- Public Member Functions inherited from Nektar::FieldUtils::InputModule
 InputModule (FieldSharedPtr p_m)
 
void PrintSummary ()
 Print a brief summary of information. 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 ModuleSharedPtr create (FieldSharedPtr f)
 Creates an instance of this class. More...
 
- Static Public Member Functions inherited from Nektar::FieldUtils::InputModule
static FIELD_UTILS_EXPORT std::string GuessFormat (std::string fileName)
 Tries to guess the format of the input file. More...
 

Static Public Attributes

static ModuleKey m_className []
 ModuleKey for class. More...
 

Protected Member Functions

void v_Process (po::variables_map &vm) override
 
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::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

Input module for Xml files.

Definition at line 46 of file InputPts.h.

Constructor & Destructor Documentation

◆ InputPts()

Nektar::FieldUtils::InputPts::InputPts ( FieldSharedPtr  f)

Set up InputPts object.

Definition at line 65 of file InputPts.cpp.

65 : InputModule(f)
66{
67 m_allowedFiles.insert("pts");
68 m_allowedFiles.insert("csv");
69}
InputModule(FieldSharedPtr p_m)
Definition: Module.cpp:61
std::set< std::string > m_allowedFiles
List of allowed file formats.
Definition: Module.h:274

References Nektar::FieldUtils::Module::m_allowedFiles.

◆ ~InputPts()

Nektar::FieldUtils::InputPts::~InputPts ( )
override

Definition at line 74 of file InputPts.cpp.

75{
76}

Member Function Documentation

◆ create()

static ModuleSharedPtr Nektar::FieldUtils::InputPts::create ( FieldSharedPtr  f)
inlinestatic

Creates an instance of this class.

Definition at line 53 of file InputPts.h.

54 {
56 }
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::InputPts::v_GetModuleDescription ( )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 68 of file InputPts.h.

69 {
70 return "Processing input pts file";
71 }

◆ v_GetModuleName()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 63 of file InputPts.h.

64 {
65 return "InputPts";
66 }

◆ v_GetModulePriority()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 73 of file InputPts.h.

74 {
75 return eCreatePts;
76 }

References Nektar::FieldUtils::eCreatePts.

◆ v_Process()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 81 of file InputPts.cpp.

82{
83 string inFile = m_config["infile"].as<string>();
84
85 // Determine appropriate field input
86 if (m_f->m_inputfiles.count("csv") != 0)
87 {
90 csvIO->Import(inFile, m_f->m_fieldPts);
91 }
92 else if (m_f->m_inputfiles.count("pts") != 0)
93 {
96 ptsIO->Import(inFile, m_f->m_fieldPts);
97 }
98 else
99 {
100 ASSERTL0(false, "unknown input file type");
101 }
102
103 // save field names
104 for (int j = 0; j < m_f->m_fieldPts->GetNFields(); ++j)
105 {
106 m_f->m_variables.push_back(m_f->m_fieldPts->GetFieldName(j));
107 }
108}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
FieldSharedPtr m_f
Field object.
Definition: Module.h:239
std::map< std::string, ConfigOption > m_config
List of configuration values.
Definition: Module.h:272
std::shared_ptr< CsvIO > CsvIOSharedPtr
Definition: CsvIO.h:74
std::shared_ptr< PtsIO > PtsIOSharedPtr
Definition: PtsIO.h:90

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::FieldUtils::Module::m_config, and Nektar::FieldUtils::Module::m_f.

Member Data Documentation

◆ m_className

ModuleKey Nektar::FieldUtils::InputPts::m_className
static
Initial value:
= {
ModuleKey(eInputModule, "pts"), InputPts::create, "Reads Pts file."),
ModuleKey(eInputModule, "pts.gz"), InputPts::create, "Reads Pts file."),
ModuleKey(eInputModule, "csv"), InputPts::create, "Reads csv file."),
ModuleKey(eInputModule, "csv.gz"), InputPts::create, "Reads csv file."),
}
static ModuleSharedPtr create(FieldSharedPtr f)
Creates an instance of this class.
Definition: InputPts.h:53
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

ModuleKey for class.

Definition at line 58 of file InputPts.h.