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...
 
virtual std::string GetModuleName ()
 
- 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.
virtual std::string Nektar::Utilities::ProcessHomogeneousPlane::GetModuleName ( )
inlinevirtual

Implements Nektar::Utilities::Module.

Reimplemented in Nektar::Utilities::ProcessMeanMode.

Definition at line 66 of file ProcessHomogeneousPlane.h.

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