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

Abstract base class for input modules. More...

#include <Module.h>

Inheritance diagram for Nektar::Utilities::InputModule:
Inheritance graph
[legend]
Collaboration diagram for Nektar::Utilities::InputModule:
Collaboration graph
[legend]

Public Member Functions

 InputModule (FieldSharedPtr p_m)
void AddFile (string fileType, string fileName)
 InputModule (MeshSharedPtr p_m)
void OpenStream ()
 Open a file for input.
- Public Member Functions inherited from Nektar::Utilities::Module
 Module (FieldSharedPtr p_f)
virtual void Process (po::variables_map &vm)=0
void RegisterConfig (string key, string value)
 Register a configuration option with a module.
void PrintConfig ()
 Print out all configuration options for a module.
void SetDefaults ()
 Sets default configuration options for those which have not been set.
bool GetRequireEquiSpaced (void)
void SetRequireEquiSpaced (bool pVal)
 Module (MeshSharedPtr p_m)
virtual void Process ()=0
void RegisterConfig (string key, string value)
void PrintConfig ()
void SetDefaults ()
MeshSharedPtr GetMesh ()
virtual void ProcessVertices ()
 Extract element vertices.

Protected Member Functions

void PrintSummary ()
 Print summary of elements.
void PrintSummary ()
 Print summary of elements.
- Protected Member Functions inherited from Nektar::Utilities::Module
virtual void ProcessEdges (bool ReprocessEdges=true)
 Extract element edges.
virtual void ProcessFaces (bool ReprocessFaces=true)
 Extract element faces.
virtual void ProcessElements ()
 Generate element IDs.
virtual void ProcessComposites ()
 Generate composites.
void ReorderPrisms (PerMap &perFaces)
 Reorder node IDs so that prisms and tetrahedra are aligned correctly.
void PrismLines (int prism, PerMap &perFaces, set< int > &prismsDone, vector< ElementSharedPtr > &line)

Protected Attributes

set< string > m_allowedFiles
std::ifstream m_mshFile
 Input stream.
- Protected Attributes inherited from Nektar::Utilities::Module
FieldSharedPtr m_f
 Field object.
map< string, ConfigOptionm_config
 List of configuration values.
bool m_requireEquiSpaced
MeshSharedPtr m_mesh
 Mesh object.

Detailed Description

Abstract base class for input modules.

Input modules should read the contents of #fldFile in the Process() function and populate the members of #m. Typically any given module should populate Mesh::expDim, Mesh::spaceDim, Mesh::node and Mesh::element, then call the protected ProcessX functions to generate edges, faces, etc.

Input modules should read the contents of m_mshFile in the Process() function and populate the members of #m. Typically any given module should populate Mesh::expDim, Mesh::spaceDim, Mesh::node and Mesh::element, then call the protected ProcessX functions to generate edges, faces, etc.

Definition at line 171 of file PostProcessing/FieldConvert/Module.h.

Constructor & Destructor Documentation

Nektar::Utilities::InputModule::InputModule ( FieldSharedPtr  p_m)

Definition at line 65 of file PostProcessing/FieldConvert/Module.cpp.

References Nektar::Utilities::Module::m_config.

: Module(m)
{
m_config["infile"] = ConfigOption(false, "", "Input filename.");
}
Nektar::Utilities::InputModule::InputModule ( MeshSharedPtr  p_m)

Definition at line 64 of file PreProcessing/MeshConvert/Module.cpp.

References Nektar::Utilities::Module::m_config.

: Module(m)
{
m_config["infile"] = ConfigOption(false, "", "Input filename.");
}

Member Function Documentation

void Nektar::Utilities::InputModule::AddFile ( string  fileType,
string  fileName 
)

Definition at line 75 of file PostProcessing/FieldConvert/Module.cpp.

References m_allowedFiles, and Nektar::Utilities::Module::m_f.

Referenced by main().

{
// Check to see if this file type is allowed
if (m_allowedFiles.count(fileType) == 0)
{
cerr << "File type " << fileType << " not supported for this "
<< "module." << endl;
}
m_f->m_inputfiles[fileType].push_back(fileName);
}
void Nektar::Utilities::InputModule::OpenStream ( )

Open a file for input.

Definition at line 77 of file PreProcessing/MeshConvert/Module.cpp.

References Nektar::Utilities::Module::m_config, and m_mshFile.

Referenced by Nektar::Utilities::InputGmsh::Process(), Nektar::Utilities::InputSem::Process(), Nektar::Utilities::InputSwan::Process(), Nektar::Utilities::InputPly::Process(), Nektar::Utilities::InputTec::Process(), and Nektar::Utilities::InputNek::Process().

{
string fname = m_config["infile"].as<string>();
m_mshFile.open(fname.c_str());
if (!m_mshFile.good())
{
cerr << "Error opening file: " << fname << endl;
abort();
}
}
void Nektar::Utilities::InputModule::PrintSummary ( )
protected

Print summary of elements.

Print a brief summary of information.

Definition at line 164 of file PostProcessing/FieldConvert/Module.cpp.

References Nektar::Utilities::Module::m_f.

Referenced by Nektar::Utilities::InputSem::Process(), and Nektar::Utilities::InputTec::Process().

{
cout << "Field size = " <<
m_f->m_data[0].size() * sizeof(NekDouble) << endl;
}
void Nektar::Utilities::InputModule::PrintSummary ( )
protected

Print summary of elements.

Member Data Documentation

set<string> Nektar::Utilities::InputModule::m_allowedFiles
protected
std::ifstream Nektar::Utilities::InputModule::m_mshFile
protected