Nektar++
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Nektar::Utilities::ProcessCyl Class Reference

#include <ProcessCyl.h>

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

Public Member Functions

 ProcessCyl (MeshSharedPtr m)
 Default constructor. More...
 
virtual ~ProcessCyl ()
 Destructor. More...
 
virtual void Process ()
 Write mesh to output file. More...
 
void GenerateEdgeNodes (EdgeSharedPtr edge)
 
- 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)
 
virtual void Process (po::variables_map &vm)=0
 
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)
 
void RegisterConfig (string key, string value)
 
void PrintConfig ()
 
void SetDefaults ()
 
MeshSharedPtr GetMesh ()
 
virtual void ProcessVertices ()
 Extract element vertices. More...
 

Static Public Member Functions

static boost::shared_ptr< Modulecreate (MeshSharedPtr m)
 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 ()
 
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...
 
void ReorderPrisms (PerMap &perFaces)
 Reorder node IDs so that prisms and tetrahedra are aligned correctly. More...
 
void PrismLines (int prism, PerMap &perFaces, set< int > &prismsDone, 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...
 

Detailed Description

Definition at line 45 of file ProcessCyl.h.

Constructor & Destructor Documentation

Nektar::Utilities::ProcessCyl::ProcessCyl ( MeshSharedPtr  m)

Default constructor.

Definition at line 25 of file ProcessCyl.cpp.

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

25  : ProcessModule(m)
26  {
27  m_config["surf"] = ConfigOption(false, "-1",
28  "Tag identifying surface to process.");
29  m_config["r"] = ConfigOption(false, "0.0",
30  "Radius of cylinder.");
31  m_config["N"] = ConfigOption(false, "7",
32  "Number of points along edge.");
33  }
map< string, ConfigOption > m_config
List of configuration values.
Nektar::Utilities::ProcessCyl::~ProcessCyl ( )
virtual

Destructor.

Definition at line 39 of file ProcessCyl.cpp.

40  {
41  }

Member Function Documentation

static boost::shared_ptr<Module> Nektar::Utilities::ProcessCyl::create ( MeshSharedPtr  m)
inlinestatic

Creates an instance of this class.

Definition at line 49 of file ProcessCyl.h.

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

50  {
52  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void Nektar::Utilities::ProcessCyl::GenerateEdgeNodes ( EdgeSharedPtr  edge)

Definition at line 87 of file ProcessCyl.cpp.

References Nektar::LibUtilities::ePolyEvenlySpaced, and Nektar::Utilities::Module::m_config.

Referenced by Process().

88  {
89  NodeSharedPtr n1 = edge->m_n1;
90  NodeSharedPtr n2 = edge->m_n2;
91 
92  int nq = m_config["N"].as<int>();
93  double r = m_config["r"].as<double>();
94  double t1 = atan2(n1->m_y, n1->m_x);
95  double t2 = atan2(n2->m_y, n2->m_x);
96  double dt;
97  double dz;
98 
99  if (t1 < -M_PI/2.0 && t2 > 0.0)
100  {
101  t1 += 2*M_PI;
102  }
103  if (t2 < -M_PI/2.0 && t1 > 0.0)
104  {
105  t2 += 2*M_PI;
106  }
107 
108  dt = (t2-t1) / (nq-1);
109  dz = (n2->m_z - n1->m_z) / (nq-1);
110 
111  edge->m_edgeNodes.resize(nq-2);
112  Node dx = (*n2-*n1) * (1.0/(nq-1.0));
113  for (int i = 1; i < nq-1; ++i)
114  {
115  edge->m_edgeNodes[i-1] = NodeSharedPtr(
116  new Node(0, r*cos(t1 + i*dt),
117  r*sin(t1 + i*dt),
118  n1->m_z + i*dz));
119  }
120  edge->m_curveType = LibUtilities::ePolyEvenlySpaced;
121  }
map< string, ConfigOption > m_config
List of configuration values.
boost::shared_ptr< Node > NodeSharedPtr
Shared pointer to a Node.
Definition: MeshElements.h:195
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:63
void Nektar::Utilities::ProcessCyl::Process ( )
virtual

Write mesh to output file.

Implements Nektar::Utilities::Module.

Definition at line 44 of file ProcessCyl.cpp.

References ASSERTL0, Nektar::StdRegions::find(), GenerateEdgeNodes(), Nektar::Utilities::Module::m_config, and Nektar::Utilities::Module::m_mesh.

45  {
46  set<pair<int,int> > tmp;
47  int surfTag = m_config["surf"].as<int>();
48  int prismedge[2][3] = {{0,5,4}, {2,6,7}};
49  Node zax(0,0,0,1);
50  int dim = m_mesh->m_expDim;
51 
52  for (int i = 0; i < m_mesh->m_element[dim].size(); ++i)
53  {
54  ElementSharedPtr el = m_mesh->m_element[dim][i];
55  int nSurf = dim == 3 ? el->GetFaceCount() : el->GetEdgeCount();
56 
57  for (int j = 0; j < nSurf; ++j)
58  {
59  int bl = el->GetBoundaryLink(j);
60  if (bl == -1)
61  {
62  continue;
63  }
64 
65  ElementSharedPtr bEl = m_mesh->m_element[dim - 1][bl];
66  vector<int> tags = bEl->GetTagList();
67 
68  if (find(tags.begin(), tags.end(), surfTag) ==
69  tags.end())
70  {
71  continue;
72  }
73 
74  ASSERTL0(j == 1 || j == 3, "rofl");
75 
76  // Check all edge interior points.
77  for (int k = 0; k < 3; ++k)
78  {
79  EdgeSharedPtr edge = el->GetEdge(prismedge[(j-1)/2][k]);
80  GenerateEdgeNodes(edge);
81  }
82  }
83  }
84  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
Definition: MeshElements.h:318
map< string, ConfigOption > m_config
List of configuration values.
MeshSharedPtr m_mesh
Mesh object.
boost::shared_ptr< Element > ElementSharedPtr
Shared pointer to an element.
Definition: MeshElements.h:63
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:312
void GenerateEdgeNodes(EdgeSharedPtr edge)
Definition: ProcessCyl.cpp:87

Member Data Documentation

ModuleKey Nektar::Utilities::ProcessCyl::className
static
Initial value:

Definition at line 53 of file ProcessCyl.h.