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

This processing module scales the input fld file. More...

#include <ProcessScaleInFld.h>

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

Public Member Functions

 ProcessScaleInFld (FieldSharedPtr f)
 
 ~ProcessScaleInFld () 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 scales the input fld file.

Definition at line 47 of file ProcessScaleInFld.h.

Constructor & Destructor Documentation

◆ ProcessScaleInFld()

Nektar::FieldUtils::ProcessScaleInFld::ProcessScaleInFld ( FieldSharedPtr  f)

Definition at line 51 of file ProcessScaleInFld.cpp.

51 : ProcessModule(f)
52{
53 m_config["scale"] = ConfigOption(false, "NotSet", "scale factor");
54}
std::map< std::string, ConfigOption > m_config
List of configuration values.
Definition: Module.h:272

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

◆ ~ProcessScaleInFld()

Nektar::FieldUtils::ProcessScaleInFld::~ProcessScaleInFld ( )
override

Definition at line 56 of file ProcessScaleInFld.cpp.

57{
58}

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 51 of file ProcessScaleInFld.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::ProcessScaleInFld::v_GetModuleDescription ( )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 69 of file ProcessScaleInFld.h.

70 {
71 return "Rescaling input fld";
72 }

◆ v_GetModuleName()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 64 of file ProcessScaleInFld.h.

65 {
66 return "ProcessScaleInFld";
67 }

◆ v_GetModulePriority()

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

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 74 of file ProcessScaleInFld.h.

75 {
76 return eModifyFieldData;
77 }

References Nektar::FieldUtils::eModifyFieldData.

◆ v_Process()

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

Write mesh to output file.

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 60 of file ProcessScaleInFld.cpp.

61{
62 ASSERTL0(m_config["scale"].as<string>().compare("NotSet") != 0,
63 "scaleinputfld: Need to specify a scale factor");
64
65 string scalestr = m_config["scale"].as<string>();
66 NekDouble scale = std::stod(scalestr);
67
68 for (int i = 0; i < m_f->m_data.size(); ++i)
69 {
70 int datalen = m_f->m_data[i].size();
71
72 Vmath::Smul(datalen, scale, &(m_f->m_data[i][0]), 1,
73 &(m_f->m_data[i][0]), 1);
74 }
75}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
FieldSharedPtr m_f
Field object.
Definition: Module.h:239
double NekDouble
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.hpp:100

References ASSERTL0, Nektar::FieldUtils::Module::m_config, Nektar::FieldUtils::Module::m_f, and Vmath::Smul().

Member Data Documentation

◆ className

ModuleKey Nektar::FieldUtils::ProcessScaleInFld::className
static
Initial value:
=
"rescale input field by a constant factor.")
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 55 of file ProcessScaleInFld.h.