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::ProcessHomogeneousPlane Class Reference

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

#include <ProcessHomogeneousPlane.h>

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

Public Member Functions

 ProcessHomogeneousPlane (FieldSharedPtr f)
 
virtual ~ProcessHomogeneousPlane ()
 
virtual void Process (po::variables_map &vm)
 Write mesh to output file. More...
 
- 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. More...
 
void PrintConfig ()
 Print out all configuration options for a module. More...
 
void SetDefaults ()
 Sets default configuration options for those which have not been set. More...
 
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 (std::string key, std::string value)
 
void PrintConfig ()
 
void SetDefaults ()
 
MeshSharedPtr GetMesh ()
 
virtual void ProcessVertices ()
 Extract element vertices. More...
 
virtual void ProcessEdges (bool ReprocessEdges=true)
 Extract element edges. More...
 
virtual void ProcessFaces (bool ReprocessFaces=true)
 Extract element faces. More...
 
virtual void ProcessElements ()
 Generate element IDs. More...
 
virtual void ProcessComposites ()
 Generate composites. More...
 
virtual void ClearElementLinks ()
 

Static Public Member Functions

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

Static Public Attributes

static ModuleKey className
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::Utilities::Module
 Module ()
 
void ReorderPrisms (PerMap &perFaces)
 Reorder node IDs so that prisms and tetrahedra are aligned correctly. More...
 
void PrismLines (int prism, PerMap &perFaces, std::set< int > &prismsDone, std::vector< ElementSharedPtr > &line)
 
- Protected Attributes inherited from Nektar::Utilities::Module
FieldSharedPtr m_f
 Field object. More...
 
map< string, ConfigOptionm_config
 List of configuration values. More...
 
bool m_requireEquiSpaced
 
MeshSharedPtr m_mesh
 Mesh object. More...
 
std::map< std::string,
ConfigOption
m_config
 List of configuration values. More...
 

Detailed Description

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

Definition at line 50 of file ProcessHomogeneousPlane.h.

Constructor & Destructor Documentation

Nektar::Utilities::ProcessHomogeneousPlane::ProcessHomogeneousPlane ( FieldSharedPtr  f)

Definition at line 57 of file ProcessHomogeneousPlane.cpp.

References Nektar::Utilities::Module::m_config.

58  : ProcessModule(f)
59 {
60  m_config["planeid"] = ConfigOption(false, "NotSet", "plane id to extract");
61  m_config["wavespace"] =
62  ConfigOption(true, "NotSet", "Extract plane in Fourier space");
63 }
map< string, ConfigOption > m_config
List of configuration values.
Nektar::Utilities::ProcessHomogeneousPlane::~ProcessHomogeneousPlane ( )
virtual

Definition at line 65 of file ProcessHomogeneousPlane.cpp.

66 {
67 }

Member Function Documentation

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

Creates an instance of this class.

Definition at line 54 of file ProcessHomogeneousPlane.h.

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

55  {
57  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void Nektar::Utilities::ProcessHomogeneousPlane::Process ( po::variables_map &  vm)
virtual

Write mesh to output file.

Implements Nektar::Utilities::Module.

Reimplemented in Nektar::Utilities::ProcessMeanMode.

Definition at line 69 of file ProcessHomogeneousPlane.cpp.

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

70 {
71  if (m_f->m_verbose)
72  {
73  cout << "ProcessHomogeneousPlane: Extracting plane..." << endl;
74  }
75 
76  if ((m_f->m_fielddef[0]->m_numHomogeneousDir) != 1)
77  {
78  ASSERTL0(false,
79  "ProcessHomogeneousPlane only works for Homogeneous1D.");
80  }
81 
82  ASSERTL0(m_config["planeid"].m_beenSet,
83  "Missing parameter planeid for ProcessHomogeneousPlane");
84 
85  int planeid = m_config["planeid"].as<int>();
86  int nfields = m_f->m_fielddef[0]->m_fields.size();
87 
88  int nstrips;
89  m_f->m_session->LoadParameter("Strip_Z", nstrips, 1);
90 
91  for (int s = 0; s < nstrips; ++s)
92  {
93  for (int i = 0; i < nfields; ++i)
94  {
95  int n = s * nfields + i;
96  m_f->m_exp[n] = m_f->m_exp[n]->GetPlane(planeid);
97 
98  if (m_config["wavespace"].m_beenSet)
99  {
100  m_f->m_exp[n]->BwdTrans(m_f->m_exp[n]->GetCoeffs(),
101  m_f->m_exp[n]->UpdatePhys());
102  }
103  else
104  {
105  m_f->m_exp[n]->FwdTrans(m_f->m_exp[n]->GetPhys(),
106  m_f->m_exp[n]->UpdateCoeffs());
107  }
108  }
109  }
110  std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
111  m_f->m_exp[0]->GetFieldDefinitions();
112  std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
113 
114  for (int s = 0; s < nstrips; ++s)
115  {
116  for (int j = 0; j < nfields; ++j)
117  {
118  for (int i = 0; i < FieldDef.size() / nstrips; ++i)
119  {
120  int n = s * FieldDef.size() / nstrips + i;
121 
122  FieldDef[n]->m_fields.push_back(
123  m_f->m_fielddef[0]->m_fields[j]);
124  m_f->m_exp[s * nfields + j]->AppendFieldData(FieldDef[n],
125  FieldData[n]);
126  }
127  }
128  }
129 
130  m_f->m_fielddef = FieldDef;
131  m_f->m_data = FieldData;
132 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
map< string, ConfigOption > m_config
List of configuration values.
FieldSharedPtr m_f
Field object.

Member Data Documentation

ModuleKey Nektar::Utilities::ProcessHomogeneousPlane::className
static
Initial value:
=
ModuleKey(eProcessModule, "homplane"),
"Extracts a plane from a 3DH1D expansion, requires planeid to be "
"defined.")

Definition at line 58 of file ProcessHomogeneousPlane.h.