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::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
 
virtual std::string GetModuleName ()=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 (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 (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 ()
 
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

Definition at line 46 of file ProcessCyl.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 61 of file ProcessCyl.cpp.

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

61  : ProcessModule(m)
62 {
63  m_config["surf"] =
64  ConfigOption(false, "-1", "Tag identifying surface to process.");
65  m_config["r"] = ConfigOption(false, "0.0", "Radius of cylinder.");
66  m_config["N"] = ConfigOption(false, "7", "Number of points along edge.");
67 }
map< string, ConfigOption > m_config
List of configuration values.
Nektar::Utilities::ProcessCyl::~ProcessCyl ( )
virtual

Destructor.

Definition at line 72 of file ProcessCyl.cpp.

73 {
74 }

Member Function Documentation

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

Creates an instance of this class.

Definition at line 50 of file ProcessCyl.h.

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

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

Definition at line 117 of file ProcessCyl.cpp.

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

Referenced by Process().

118 {
119  NodeSharedPtr n1 = edge->m_n1;
120  NodeSharedPtr n2 = edge->m_n2;
121 
122  int nq = m_config["N"].as<int>();
123  double r = m_config["r"].as<double>();
124  double t1 = atan2(n1->m_y, n1->m_x);
125  double t2 = atan2(n2->m_y, n2->m_x);
126  double dt;
127  double dz;
128 
129  if (t1 < -M_PI / 2.0 && t2 > 0.0)
130  {
131  t1 += 2 * M_PI;
132  }
133  if (t2 < -M_PI / 2.0 && t1 > 0.0)
134  {
135  t2 += 2 * M_PI;
136  }
137 
138  dt = (t2 - t1) / (nq - 1);
139  dz = (n2->m_z - n1->m_z) / (nq - 1);
140 
141  edge->m_edgeNodes.resize(nq - 2);
142  Node dx = (*n2 - *n1) * (1.0 / (nq - 1.0));
143  for (int i = 1; i < nq - 1; ++i)
144  {
145  edge->m_edgeNodes[i - 1] = NodeSharedPtr(new Node(
146  0, r * cos(t1 + i * dt), r * sin(t1 + i * dt), n1->m_z + i * dz));
147  }
148  edge->m_curveType = LibUtilities::ePolyEvenlySpaced;
149 }
map< string, ConfigOption > m_config
List of configuration values.
Represents a point in the domain.
Definition: Node.h:60
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:63
boost::shared_ptr< Node > NodeSharedPtr
Definition: Node.h:50
void Nektar::Utilities::ProcessCyl::Process ( )
virtual

Write mesh to output file.

Implements Nektar::Utilities::Module.

Definition at line 76 of file ProcessCyl.cpp.

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

77 {
78  set<pair<int, int> > tmp;
79  int surfTag = m_config["surf"].as<int>();
80  int prismedge[2][3] = {{0, 5, 4}, {2, 6, 7}};
81  Node zax(0, 0, 0, 1);
82  int dim = m_mesh->m_expDim;
83 
84  for (int i = 0; i < m_mesh->m_element[dim].size(); ++i)
85  {
86  ElementSharedPtr el = m_mesh->m_element[dim][i];
87  int nSurf = dim == 3 ? el->GetFaceCount() : el->GetEdgeCount();
88 
89  for (int j = 0; j < nSurf; ++j)
90  {
91  int bl = el->GetBoundaryLink(j);
92  if (bl == -1)
93  {
94  continue;
95  }
96 
97  ElementSharedPtr bEl = m_mesh->m_element[dim - 1][bl];
98  vector<int> tags = bEl->GetTagList();
99 
100  if (find(tags.begin(), tags.end(), surfTag) == tags.end())
101  {
102  continue;
103  }
104 
105  ASSERTL0(j == 1 || j == 3, "rofl");
106 
107  // Check all edge interior points.
108  for (int k = 0; k < 3; ++k)
109  {
110  EdgeSharedPtr edge = el->GetEdge(prismedge[(j - 1) / 2][k]);
111  GenerateEdgeNodes(edge);
112  }
113  }
114  }
115 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
map< string, ConfigOption > m_config
List of configuration values.
MeshSharedPtr m_mesh
Mesh object.
Represents a point in the domain.
Definition: Node.h:60
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
Definition: Edge.h:196
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:315
boost::shared_ptr< Element > ElementSharedPtr
Definition: Edge.h:52
void GenerateEdgeNodes(EdgeSharedPtr edge)
Definition: ProcessCyl.cpp:117

Member Data Documentation

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

Definition at line 54 of file ProcessCyl.h.