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.
virtual ~ProcessCyl ()
 Destructor.
virtual void Process ()
 Write mesh to output file.
void GenerateEdgeNodes (EdgeSharedPtr edge)
- Public Member Functions inherited from Nektar::Utilities::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.
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)
 Module (MeshSharedPtr p_m)
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 (MeshSharedPtr m)
 Creates an instance of this class.

Static Public Attributes

static ModuleKey className

Additional Inherited Members

- Protected Member Functions inherited from Nektar::Utilities::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

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.

{
m_config["surf"] = ConfigOption(false, "-1",
"Tag identifying surface to process.");
m_config["r"] = ConfigOption(false, "0.0",
"Radius of cylinder.");
m_config["N"] = ConfigOption(false, "7",
"Number of points along edge.");
}
Nektar::Utilities::ProcessCyl::~ProcessCyl ( )
virtual

Destructor.

Definition at line 39 of file ProcessCyl.cpp.

{
}

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.

{
return MemoryManager<ProcessCyl>::AllocateSharedPtr(m);
}
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().

{
NodeSharedPtr n1 = edge->m_n1;
NodeSharedPtr n2 = edge->m_n2;
int nq = m_config["N"].as<int>();
double r = m_config["r"].as<double>();
double t1 = atan2(n1->m_y, n1->m_x);
double t2 = atan2(n2->m_y, n2->m_x);
double dt;
double dz;
if (t1 < -M_PI/2.0 && t2 > 0.0)
{
t1 += 2*M_PI;
}
if (t2 < -M_PI/2.0 && t1 > 0.0)
{
t2 += 2*M_PI;
}
dt = (t2-t1) / (nq-1);
dz = (n2->m_z - n1->m_z) / (nq-1);
edge->m_edgeNodes.resize(nq-2);
Node dx = (*n2-*n1) * (1.0/(nq-1.0));
for (int i = 1; i < nq-1; ++i)
{
edge->m_edgeNodes[i-1] = NodeSharedPtr(
new Node(0, r*cos(t1 + i*dt),
r*sin(t1 + i*dt),
n1->m_z + i*dz));
}
edge->m_curveType = LibUtilities::ePolyEvenlySpaced;
}
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.

{
set<pair<int,int> > tmp;
int surfTag = m_config["surf"].as<int>();
int prismedge[2][3] = {{0,5,4}, {2,6,7}};
Node zax(0,0,0,1);
int dim = m_mesh->m_expDim;
for (int i = 0; i < m_mesh->m_element[dim].size(); ++i)
{
ElementSharedPtr el = m_mesh->m_element[dim][i];
int nSurf = dim == 3 ? el->GetFaceCount() : el->GetEdgeCount();
for (int j = 0; j < nSurf; ++j)
{
int bl = el->GetBoundaryLink(j);
if (bl == -1)
{
continue;
}
ElementSharedPtr bEl = m_mesh->m_element[dim - 1][bl];
vector<int> tags = bEl->GetTagList();
if (find(tags.begin(), tags.end(), surfTag) ==
tags.end())
{
continue;
}
ASSERTL0(j == 1 || j == 3, "rofl");
// Check all edge interior points.
for (int k = 0; k < 3; ++k)
{
EdgeSharedPtr edge = el->GetEdge(prismedge[(j-1)/2][k]);
}
}
}
}

Member Data Documentation

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

Definition at line 53 of file ProcessCyl.h.