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

Module to extract interface between prismatic and tetrahedral elements. More...

#include <ProcessExtractTetPrismInterface.h>

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

Public Member Functions

 ProcessExtractTetPrismInterface (MeshSharedPtr m)
 
virtual ~ProcessExtractTetPrismInterface ()
 
virtual void Process ()
 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)
 
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

Module to extract interface between prismatic and tetrahedral elements.

Definition at line 51 of file ProcessExtractTetPrismInterface.h.

Constructor & Destructor Documentation

Nektar::Utilities::ProcessExtractTetPrismInterface::ProcessExtractTetPrismInterface ( MeshSharedPtr  m)

Definition at line 58 of file ProcessExtractTetPrismInterface.cpp.

Nektar::Utilities::ProcessExtractTetPrismInterface::~ProcessExtractTetPrismInterface ( )
virtual

Definition at line 63 of file ProcessExtractTetPrismInterface.cpp.

64 {
65 }

Member Function Documentation

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

Creates an instance of this class.

Definition at line 55 of file ProcessExtractTetPrismInterface.h.

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

55  {
58  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void Nektar::Utilities::ProcessExtractTetPrismInterface::Process ( )
virtual

Write mesh to output file.

Implements Nektar::Utilities::Module.

Definition at line 67 of file ProcessExtractTetPrismInterface.cpp.

References ASSERTL0, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::eTetrahedron, Nektar::LibUtilities::eTriangle, Nektar::Utilities::GetElementFactory(), Nektar::iterator, Nektar::Utilities::Module::m_mesh, Nektar::Utilities::Module::ProcessComposites(), Nektar::Utilities::Module::ProcessEdges(), Nektar::Utilities::Module::ProcessElements(), Nektar::Utilities::Module::ProcessFaces(), and Nektar::Utilities::Module::ProcessVertices().

68 {
69  if (m_mesh->m_verbose)
70  {
71  cout << "ProcessExtractTetPrismInterface: Extracting tet-prism "
72  << "interface... " << endl;
73  }
74 
75  ASSERTL0(m_mesh->m_expDim == 3, "The prism-tet interface module"
76  " only works for three-dimensional meshes.");
77 
78  // Copy 3D elements and 2D boundary elements and clear existing.
79  vector<ElementSharedPtr> el = m_mesh->m_element[m_mesh->m_expDim];
80  vector<ElementSharedPtr> bndEl = m_mesh->m_element[
81  m_mesh->m_expDim-1];
82  m_mesh->m_element[m_mesh->m_expDim].clear();
83  m_mesh->m_element[m_mesh->m_expDim-1].clear();
84 
85  // Extract prismatic elements.
86  for (int i = 0; i < el.size(); ++i)
87  {
88  ElementSharedPtr elmt = el[i];
89 
90  if (elmt->GetConf().m_e == LibUtilities::ePrism)
91  {
92  m_mesh->m_element[m_mesh->m_expDim].push_back(elmt);
93  }
94  }
95 
96  ASSERTL0(m_mesh->m_element[m_mesh->m_expDim].size() > 0,
97  "Mesh does not contain any prismatic elements!");
98 
100 
101  // Extract boundary region already associated with prisms
102  // (i.e. outer wall of the computational domain)
103  for (fIt = m_mesh->m_faceSet.begin();
104  fIt != m_mesh->m_faceSet.end(); fIt++)
105  {
106  if ((*fIt)->m_elLink.size() == 1)
107  {
108  ElementSharedPtr el = (*fIt)->m_elLink[0].first;
109 
110  if (el->GetConf().m_e != LibUtilities::eTetrahedron)
111  {
112  m_mesh->m_element[m_mesh->m_expDim-1].push_back(
113  bndEl[el->GetBoundaryLink(
114  (*fIt)->m_elLink[0].second)]);
115  }
116  }
117  }
118 
119  // Now extract prismatic faces that are not connected to any other
120  // elements, which denotes the prism/tet boundary.
121  for (fIt = m_mesh->m_faceSet.begin();
122  fIt != m_mesh->m_faceSet.end(); fIt++)
123  {
124  if ((*fIt)->m_elLink.size() != 1)
125  {
126  ElementSharedPtr el1 = (*fIt)->m_elLink[0].first;
127  ElementSharedPtr el2 = (*fIt)->m_elLink[1].first;
128 
129  if ((el1->GetConf().m_e == LibUtilities::ePrism &&
130  el2->GetConf().m_e == LibUtilities::eTetrahedron) ||
131  (el2->GetConf().m_e == LibUtilities::ePrism &&
132  el1->GetConf().m_e == LibUtilities::eTetrahedron))
133  {
134  // Create a new linear triangle from face for boundary.
135  vector<NodeSharedPtr> nodeList(3);
136  vector<int> tags(1);
137  tags[0] = m_mesh->m_composite.size();
138 
139  nodeList = (*fIt)->m_vertexList;
140  ElmtConfig conf(
141  LibUtilities::eTriangle, 1, false, false, false);
143  CreateInstance(
144  LibUtilities::eTriangle, conf, nodeList, tags);
145 
146  m_mesh->m_element[m_mesh->m_expDim-1].push_back(tri);
147  }
148  }
149  }
150 
151  ProcessVertices();
152  ProcessEdges();
153  ProcessFaces();
154  ProcessElements();
156 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
MeshSharedPtr m_mesh
Mesh object.
virtual void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
boost::shared_ptr< Element > ElementSharedPtr
Shared pointer to an element.
Definition: MeshElements.h:63
virtual void ProcessVertices()
Extract element vertices.
virtual void ProcessElements()
Generate element IDs.
virtual void ProcessComposites()
Generate composites.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
ElementFactory & GetElementFactory()

Member Data Documentation

ModuleKey Nektar::Utilities::ProcessExtractTetPrismInterface::className
static
Initial value:
=
ModuleKey(eProcessModule, "extracttetprism"),
"Process elements to extract the faces between "
"tets and prisms.")

Definition at line 59 of file ProcessExtractTetPrismInterface.h.