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

This processing module prints the L2 and LInf norms of the variables in the field. More...

#include <ProcessPrintFldNorms.h>

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

Public Member Functions

 ProcessPrintFldNorms (FieldSharedPtr f)
 
 ~ProcessPrintFldNorms () 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
 
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 prints the L2 and LInf norms of the variables in the field.

Definition at line 47 of file ProcessPrintFldNorms.h.

Constructor & Destructor Documentation

◆ ProcessPrintFldNorms()

Nektar::FieldUtils::ProcessPrintFldNorms::ProcessPrintFldNorms ( FieldSharedPtr  f)

Definition at line 51 of file ProcessPrintFldNorms.cpp.

◆ ~ProcessPrintFldNorms()

Nektar::FieldUtils::ProcessPrintFldNorms::~ProcessPrintFldNorms ( )
override

Definition at line 55 of file ProcessPrintFldNorms.cpp.

56{
57}

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 51 of file ProcessPrintFldNorms.h.

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 68 of file ProcessPrintFldNorms.h.

69 {
70 return "Printing norms";
71 }

◆ v_GetModuleName()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 63 of file ProcessPrintFldNorms.h.

64 {
65 return "ProcessPrintFldNorms";
66 }

◆ v_GetModulePriority()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 73 of file ProcessPrintFldNorms.h.

74 {
75 return eModifyExp;
76 }

References Nektar::FieldUtils::eModifyExp.

◆ v_Process()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 59 of file ProcessPrintFldNorms.cpp.

60{
61 m_f->SetUpExp(vm);
62
63 // Skip in case of empty partition
64 if (m_f->m_exp[0]->GetNumElmts() == 0)
65 {
66 return;
67 }
68
69 // Evaluate norms and print
70 for (int j = 0; j < m_f->m_exp.size(); ++j)
71 {
72 NekDouble L2 = m_f->m_exp[j]->L2(m_f->m_exp[j]->GetPhys());
73 NekDouble LInf = m_f->m_exp[j]->Linf(m_f->m_exp[j]->GetPhys());
74
75 if (m_f->m_comm->GetSpaceComm()->TreatAsRankZero())
76 {
77 cout << "L 2 error (variable " << m_f->m_variables[j]
78 << ") : " << L2 << endl;
79 cout << "L inf error (variable " << m_f->m_variables[j]
80 << ") : " << LInf << endl;
81 }
82 }
83}
FieldSharedPtr m_f
Field object.
Definition: Module.h:239
double NekDouble

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

Member Data Documentation

◆ className

ModuleKey Nektar::FieldUtils::ProcessPrintFldNorms::className
static
Initial value:
=
ModuleKey(eProcessModule, "printfldnorms"),
ProcessPrintFldNorms::create, "Print L2 and LInf norms to stdout.")
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:197
std::pair< ModuleType, std::string > ModuleKey
Definition: Module.h:180
ModuleFactory & GetModuleFactory()
Definition: Module.cpp:47

Definition at line 55 of file ProcessPrintFldNorms.h.