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

This processing module calculates the vorticity and adds it as an extra-field to the output file. More...

#include <ProcessNumModes.h>

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

Public Member Functions

 ProcessNumModes (FieldSharedPtr f)
 
virtual ~ProcessNumModes ()
 
virtual void Process (po::variables_map &vm)
 Write mesh to output file. More...
 
virtual std::string GetModuleName ()
 
virtual std::string GetModuleDescription ()
 
virtual ModulePriority GetModulePriority ()
 
- 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)
 
virtual ~Module ()=default
 
const ConfigOptionGetConfigOption (const std::string &key) const
 
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 className
 

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 ()
 
- 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

This processing module calculates the vorticity and adds it as an extra-field to the output file.

Definition at line 48 of file ProcessNumModes.h.

Constructor & Destructor Documentation

◆ ProcessNumModes()

Nektar::FieldUtils::ProcessNumModes::ProcessNumModes ( FieldSharedPtr  f)

Definition at line 57 of file ProcessNumModes.cpp.

57  : ProcessModule(f)
58 {
59 }

◆ ~ProcessNumModes()

Nektar::FieldUtils::ProcessNumModes::~ProcessNumModes ( )
virtual

Definition at line 61 of file ProcessNumModes.cpp.

62 {
63 }

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 52 of file ProcessNumModes.h.

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

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

◆ GetModuleDescription()

virtual std::string Nektar::FieldUtils::ProcessNumModes::GetModuleDescription ( )
inlinevirtual

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 69 of file ProcessNumModes.h.

70  {
71  return "Calculating number of modes";
72  }

◆ GetModuleName()

virtual std::string Nektar::FieldUtils::ProcessNumModes::GetModuleName ( )
inlinevirtual

Implements Nektar::FieldUtils::Module.

Definition at line 64 of file ProcessNumModes.h.

65  {
66  return "ProcessNumModes";
67  }

◆ GetModulePriority()

virtual ModulePriority Nektar::FieldUtils::ProcessNumModes::GetModulePriority ( )
inlinevirtual

Implements Nektar::FieldUtils::Module.

Definition at line 74 of file ProcessNumModes.h.

75  {
76  return eModifyExp;
77  }

References Nektar::FieldUtils::eModifyExp.

◆ Process()

void Nektar::FieldUtils::ProcessNumModes::Process ( po::variables_map &  vm)
virtual

Write mesh to output file.

Implements Nektar::FieldUtils::Module.

Definition at line 65 of file ProcessNumModes.cpp.

66 {
67  m_f->SetUpExp(vm);
68 
69  int i, s;
70  int expdim = m_f->m_graph->GetMeshDimension();
71  int nfields = m_f->m_variables.size();
72  int addfields = expdim;
73 
74  m_f->m_variables.push_back("P1");
75  if (addfields >= 2)
76  {
77  m_f->m_variables.push_back("P2");
78  }
79  if (addfields == 3)
80  {
81  m_f->m_variables.push_back("P3");
82  }
83 
84  // Skip in case of empty partition
85  if (m_f->m_exp[0]->GetNumElmts() == 0)
86  {
87  return;
88  }
89 
90  int npoints = m_f->m_exp[0]->GetNpoints();
91  Array<OneD, Array<OneD, NekDouble> > outfield(addfields);
92  int nstrips;
93 
94  m_f->m_session->LoadParameter("Strip_Z", nstrips, 1);
95 
96  for (i = 0; i < addfields; ++i)
97  {
98  outfield[i] = Array<OneD, NekDouble>(npoints);
99  }
100 
102 
103  int nExp, nq, offset;
104  nExp = m_f->m_exp[0]->GetExpSize();
105 
106  for (int n = 0; n < nExp; n++)
107  {
108  offset = m_f->m_exp[0]->GetPhys_Offset(n);
109  nq = m_f->m_exp[0]->GetExp(n)->GetTotPoints();
110 
111  for (i = 0; i < expdim; i++)
112  {
113  int P = m_f->m_exp[0]->GetExp(n)->GetBasis(i)->GetNumModes();
114  Array<OneD, NekDouble> result = outfield[i] + offset;
115  Vmath::Fill(nq, 1.0 * P, result, 1);
116  }
117  }
118 
119  for (s = 0; s < nstrips; ++s)
120  {
121  for (i = 0; i < addfields; ++i)
122  {
123  Exp = m_f->AppendExpList(m_f->m_numHomogeneousDir);
124  Vmath::Vcopy(npoints, outfield[i], 1, Exp->UpdatePhys(), 1);
125  Exp->FwdTrans_IterPerExp(outfield[i], Exp->UpdateCoeffs());
126 
127  auto it =
128  m_f->m_exp.begin() + s * (nfields + addfields) + nfields + i;
129  m_f->m_exp.insert(it, Exp);
130  }
131  }
132 
133 }
FieldSharedPtr m_f
Field object.
Definition: Module.h:230
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:45
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199
P
Definition: main.py:133

References Vmath::Fill(), Nektar::FieldUtils::Module::m_f, main::P, and Vmath::Vcopy().

Member Data Documentation

◆ className

ModuleKey Nektar::FieldUtils::ProcessNumModes::className
static
Initial value:
=
ModuleKey(eProcessModule, "nummodes"),
"Computes number of modes in each direction for each element.")
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:200
std::pair< ModuleType, std::string > ModuleKey
Definition: Module.h:290
ModuleFactory & GetModuleFactory()
Definition: Module.cpp:49

Definition at line 56 of file ProcessNumModes.h.