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

This processing module sets up for the boundary field to be extracted. More...

#include <ProcessConcatenateFld.h>

Inheritance diagram for Nektar::FieldUtils::ProcessConcatenateFld:
Inheritance graph
[legend]
Collaboration diagram for Nektar::FieldUtils::ProcessConcatenateFld:
Collaboration graph
[legend]

Public Member Functions

 ProcessConcatenateFld (FieldSharedPtr f)
 
virtual ~ProcessConcatenateFld ()
 
virtual void Process (po::variables_map &vm)
 
virtual std::string GetModuleName ()
 
- Public Member Functions inherited from Nektar::FieldUtils::ProcessModule
 ProcessModule ()
 
 ProcessModule (FieldSharedPtr p_f)
 
- Public Member Functions inherited from Nektar::FieldUtils::Module
FIELD_UTILS_EXPORT Module (FieldSharedPtr p_f)
 
FIELD_UTILS_EXPORT void RegisterConfig (string key, 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 bool GetRequireEquiSpaced (void)
 
FIELD_UTILS_EXPORT void SetRequireEquiSpaced (bool pVal)
 
FIELD_UTILS_EXPORT void EvaluateTriFieldAtEquiSpacedPts (LocalRegions::ExpansionSharedPtr &exp, const Array< OneD, const NekDouble > &infield, Array< OneD, NekDouble > &outfield)
 

Static Public Member Functions

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

Static Public Attributes

static ModuleKey className
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::FieldUtils::Module
 Module ()
 
- Protected Attributes inherited from Nektar::FieldUtils::Module
FieldSharedPtr m_f
 Field object. More...
 
map< string, ConfigOptionm_config
 List of configuration values. More...
 
bool m_requireEquiSpaced
 

Detailed Description

This processing module sets up for the boundary field to be extracted.

Definition at line 49 of file ProcessConcatenateFld.h.

Constructor & Destructor Documentation

Nektar::FieldUtils::ProcessConcatenateFld::ProcessConcatenateFld ( FieldSharedPtr  f)

Definition at line 56 of file ProcessConcatenateFld.cpp.

57  : ProcessModule(f)
58 {
59  // check for correct input files
60  if ((f->m_inputfiles.count("xml") == 0) &&
61  (f->m_inputfiles.count("xml.gz") == 0))
62  {
63  cout << "An xml or xml.gz input file must be specified for the "
64  "concatenate module"
65  << endl;
66  exit(3);
67  }
68 
69  if ((f->m_inputfiles.count("fld") == 0) &&
70  (f->m_inputfiles.count("chk") == 0) &&
71  (f->m_inputfiles.count("rst") == 0))
72  {
73  cout << "A fld or chk or rst input file must be specified for the "
74  "concatenate module"
75  << endl;
76 
77  exit(3);
78  }
79 }
Nektar::FieldUtils::ProcessConcatenateFld::~ProcessConcatenateFld ( )
virtual

Definition at line 81 of file ProcessConcatenateFld.cpp.

82 {
83 }

Member Function Documentation

static boost::shared_ptr<Module> Nektar::FieldUtils::ProcessConcatenateFld::create ( FieldSharedPtr  f)
inlinestatic

Creates an instance of this class.

Definition at line 53 of file ProcessConcatenateFld.h.

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

54  {
56  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual std::string Nektar::FieldUtils::ProcessConcatenateFld::GetModuleName ( )
inlinevirtual

Implements Nektar::FieldUtils::Module.

Definition at line 64 of file ProcessConcatenateFld.h.

65  {
66  return "ProcessConcatenateFld";
67  }
void Nektar::FieldUtils::ProcessConcatenateFld::Process ( po::variables_map &  vm)
virtual

Implements Nektar::FieldUtils::Module.

Definition at line 85 of file ProcessConcatenateFld.cpp.

References Nektar::FieldUtils::Module::m_f.

86 {
87  if (m_f->m_verbose)
88  {
89  if (m_f->m_comm->TreatAsRankZero())
90  {
91  cout << "ProcessConcatenateFld: Concatenating field file..."
92  << endl;
93  }
94  }
95 
96  std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
97  m_f->m_exp[0]->GetFieldDefinitions();
98  std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
99 
100  // Copy Data into FieldData and set variable
101  for (int j = 0; j < m_f->m_exp.size(); ++j)
102  {
103  for (int i = 0; i < FieldDef.size(); ++i)
104  {
105  // Could do a search here to find correct variable
106  FieldDef[i]->m_fields.push_back(m_f->m_fielddef[0]->m_fields[j]);
107  m_f->m_exp[0]->AppendFieldData(FieldDef[i], FieldData[i],
108  m_f->m_exp[j]->UpdateCoeffs());
109  }
110  }
111 
112  m_f->m_fielddef = FieldDef;
113  m_f->m_data = FieldData;
114 }
FieldSharedPtr m_f
Field object.

Member Data Documentation

ModuleKey Nektar::FieldUtils::ProcessConcatenateFld::className
static
Initial value:
=
ModuleKey(eProcessModule, "concatenate"),
"Concatenate field file into single file")

Definition at line 57 of file ProcessConcatenateFld.h.