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

This processing module replaces all expansions by a single plane from 3DH1D fields, defined by the parameter planeid. More...

#include <ProcessZeroHomogeneousPlane.h>

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

Public Member Functions

 ProcessZeroHomogeneousPlane (FieldSharedPtr f)
 
 ~ProcessZeroHomogeneousPlane () override
 
- 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
 
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 className
 

Protected Member Functions

void v_Process (po::variables_map &vm) override
 Write mesh 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::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 replaces all expansions by a single plane from 3DH1D fields, defined by the parameter planeid.

Definition at line 48 of file ProcessZeroHomogeneousPlane.h.

Constructor & Destructor Documentation

◆ ProcessZeroHomogeneousPlane()

Nektar::FieldUtils::ProcessZeroHomogeneousPlane::ProcessZeroHomogeneousPlane ( FieldSharedPtr  f)

Definition at line 54 of file ProcessZeroHomogeneousPlane.cpp.

55 : ProcessModule(f)
56{
57 m_config["planeid"] = ConfigOption(
58 false, "0",
59 "plane id in wavespace to be set zero. Default planeid is zero");
60}
std::map< std::string, ConfigOption > m_config
List of configuration values.
Definition: Module.h:272

References Nektar::FieldUtils::Module::m_config.

◆ ~ProcessZeroHomogeneousPlane()

Nektar::FieldUtils::ProcessZeroHomogeneousPlane::~ProcessZeroHomogeneousPlane ( )
override

Definition at line 62 of file ProcessZeroHomogeneousPlane.cpp.

63{
64}

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 52 of file ProcessZeroHomogeneousPlane.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().

◆ v_GetModuleDescription()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 70 of file ProcessZeroHomogeneousPlane.h.

71 {
72 return "Zero the homogeneous plane to visualise the oscillations";
73 }

◆ v_GetModuleName()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 65 of file ProcessZeroHomogeneousPlane.h.

66 {
67 return "ProcessZeroHomogeneousPlane";
68 }

◆ v_GetModulePriority()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 75 of file ProcessZeroHomogeneousPlane.h.

76 {
77 return eModifyExp;
78 }

References Nektar::FieldUtils::eModifyExp.

◆ v_Process()

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

Write mesh to output file.

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 66 of file ProcessZeroHomogeneousPlane.cpp.

67{
68 m_f->SetUpExp(vm);
69
70 if (m_f->m_numHomogeneousDir != 1)
71 {
73 "ProcessZeroHomogeneousPlane only works for Homogeneous1D.");
74 }
75
76 // Skip in case of empty partition
77 if (m_f->m_exp[0]->GetNumElmts() == 0)
78 {
79 return;
80 }
81
82 int planeid = m_config["planeid"].as<int>();
83 int nfields = m_f->m_variables.size();
84
85 int nstrips;
86 m_f->m_session->LoadParameter("Strip_Z", nstrips, 1);
87
88 // Look for correct plane (because of parallel case)
89 int plane = -1;
90 for (int i = 0; i < m_f->m_exp[0]->GetZIDs().size(); ++i)
91 {
92 if (m_f->m_exp[0]->GetZIDs()[i] == planeid)
93 {
94 plane = i;
95 }
96 }
97
98 if (plane != -1)
99 {
100 for (int s = 0; s < nstrips; ++s)
101 {
102 for (int i = 0; i < nfields; ++i)
103 {
104 int n = s * nfields + i;
105
106 // Find the memory location, set zeros
107 int Ncoeff = m_f->m_exp[n]->GetPlane(plane)->GetNcoeffs();
108 Vmath::Zero(Ncoeff,
109 m_f->m_exp[n]->GetPlane(plane)->UpdateCoeffs(), 1);
110
111 m_f->m_exp[n]->BwdTrans(m_f->m_exp[n]->GetCoeffs(),
112 m_f->m_exp[n]->UpdatePhys());
113 }
114 }
115 }
116 else
117 {
118 NEKERROR(ErrorUtil::efatal, "Plane not found.");
119 }
120}
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202
FieldSharedPtr m_f
Field object.
Definition: Module.h:239
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273

References Nektar::ErrorUtil::efatal, Nektar::FieldUtils::Module::m_config, Nektar::FieldUtils::Module::m_f, NEKERROR, and Vmath::Zero().

Member Data Documentation

◆ className

ModuleKey Nektar::FieldUtils::ProcessZeroHomogeneousPlane::className
static
Initial value:
=
ModuleKey(eProcessModule, "zero-homo-plane"),
"Extracts a plane from a 3DH1D expansion, requires planeid to be "
"defined.")
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.
std::pair< ModuleType, std::string > ModuleKey
Definition: Module.h:180
ModuleFactory & GetModuleFactory()
Definition: Module.cpp:47

Definition at line 56 of file ProcessZeroHomogeneousPlane.h.