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

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

#include <ProcessScaleInFld.h>

Inheritance diagram for Nektar::Utilities::ProcessScaleInFld:
Inheritance graph
[legend]
Collaboration diagram for Nektar::Utilities::ProcessScaleInFld:
Collaboration graph
[legend]

Public Member Functions

 ProcessScaleInFld (FieldSharedPtr f)
virtual ~ProcessScaleInFld ()
virtual void Process (po::variables_map &vm)
 Write mesh to output file.
- Public Member Functions inherited from Nektar::Utilities::ProcessModule
 ProcessModule ()
 ProcessModule (FieldSharedPtr p_f)
 ProcessModule (MeshSharedPtr p_m)
- Public Member Functions inherited from Nektar::Utilities::Module
 Module (FieldSharedPtr p_f)
void RegisterConfig (string key, string value)
 Register a configuration option with a module.
void PrintConfig ()
 Print out all configuration options for a module.
void SetDefaults ()
 Sets default configuration options for those which have not been set.
bool GetRequireEquiSpaced (void)
void SetRequireEquiSpaced (bool pVal)
void EvaluateTriFieldAtEquiSpacedPts (LocalRegions::ExpansionSharedPtr &exp, const Array< OneD, const NekDouble > &infield, Array< OneD, NekDouble > &outfield)
 Module (MeshSharedPtr p_m)
virtual void Process ()=0
void RegisterConfig (string key, string value)
void PrintConfig ()
void SetDefaults ()
MeshSharedPtr GetMesh ()
virtual void ProcessVertices ()
 Extract element vertices.

Static Public Member Functions

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

Static Public Attributes

static ModuleKey className

Additional Inherited Members

- Protected Member Functions inherited from Nektar::Utilities::Module
 Module ()
virtual void ProcessEdges (bool ReprocessEdges=true)
 Extract element edges.
virtual void ProcessFaces (bool ReprocessFaces=true)
 Extract element faces.
virtual void ProcessElements ()
 Generate element IDs.
virtual void ProcessComposites ()
 Generate composites.
void ReorderPrisms (PerMap &perFaces)
 Reorder node IDs so that prisms and tetrahedra are aligned correctly.
void PrismLines (int prism, PerMap &perFaces, set< int > &prismsDone, vector< ElementSharedPtr > &line)
- Protected Attributes inherited from Nektar::Utilities::Module
FieldSharedPtr m_f
 Field object.
map< string, ConfigOptionm_config
 List of configuration values.
bool m_requireEquiSpaced
MeshSharedPtr m_mesh
 Mesh object.

Detailed Description

This processing module scales the input fld file.

Definition at line 49 of file ProcessScaleInFld.h.

Constructor & Destructor Documentation

Nektar::Utilities::ProcessScaleInFld::ProcessScaleInFld ( FieldSharedPtr  f)

Definition at line 55 of file ProcessScaleInFld.cpp.

References ASSERTL0, and Nektar::Utilities::Module::m_config.

{
if((f->m_inputfiles.count("fld") == 0) &&
(f->m_inputfiles.count("rst") == 0) &&
(f->m_inputfiles.count("chk") == 0))
{
cout << "A fld, chk or rst input file must be specified for the "
"scaleinputfld module" << endl;
exit(3);
}
m_config["scale"] = ConfigOption(false,"NotSet","scale factor");
ASSERTL0(m_config["scale"].as<string>().compare("NotSet") != 0,
"scaleinputfld: Need to specify a sacle factor");
}
Nektar::Utilities::ProcessScaleInFld::~ProcessScaleInFld ( )
virtual

Definition at line 71 of file ProcessScaleInFld.cpp.

{
}

Member Function Documentation

static boost::shared_ptr<Module> Nektar::Utilities::ProcessScaleInFld::create ( FieldSharedPtr  f)
inlinestatic

Creates an instance of this class.

Definition at line 53 of file ProcessScaleInFld.h.

void Nektar::Utilities::ProcessScaleInFld::Process ( po::variables_map &  vm)
virtual

Write mesh to output file.

Implements Nektar::Utilities::Module.

Definition at line 75 of file ProcessScaleInFld.cpp.

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

{
if (m_f->m_verbose)
{
cout << "ProcessScaleInFld: Rescaling input fld" << endl;
}
ASSERTL0(m_f->m_data.size() != 0,"No input data defined");
string scalestr = m_config["scale"].as<string>();
NekDouble scale = boost::lexical_cast<NekDouble>(scalestr);
for(int i = 0; i < m_f->m_data.size(); ++i)
{
int datalen = m_f->m_data[i].size();
Vmath::Smul(datalen, scale, &(m_f->m_data[i][0]), 1,
&(m_f->m_data[i][0]), 1);
}
if(m_f->m_exp.size())// expansiosn are defined reload field
{
int nfields = m_f->m_fielddef[0]->m_fields.size();
// import basic field again in case of rescaling
for (int j = 0; j < nfields; ++j)
{
for (int i = 0; i < m_f->m_data.size(); ++i)
{
m_f->m_exp[j]->ExtractDataToCoeffs(
m_f->m_fielddef[i],
m_f->m_data[i],
m_f->m_fielddef[i]->m_fields[j],
m_f->m_exp[j]->UpdateCoeffs());
}
}
}
}

Member Data Documentation

ModuleKey Nektar::Utilities::ProcessScaleInFld::className
static
Initial value:
ModuleKey(eProcessModule, "scaleinputfld"),
ProcessScaleInFld::create, "rescale input field by a constant factor.")

Definition at line 57 of file ProcessScaleInFld.h.