Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (NekMeshUtils::MeshSharedPtr m)
 
virtual ~ProcessExtractTetPrismInterface ()
 
virtual void Process ()
 Write mesh to output file. More...
 
- Public Member Functions inherited from Nektar::NekMeshUtils::ProcessModule
NEKMESHUTILS_EXPORT ProcessModule (MeshSharedPtr p_m)
 
- Public Member Functions inherited from Nektar::NekMeshUtils::Module
NEKMESHUTILS_EXPORT Module (MeshSharedPtr p_m)
 
NEKMESHUTILS_EXPORT void RegisterConfig (std::string key, std::string value)
 Register a configuration option with a module. More...
 
NEKMESHUTILS_EXPORT void PrintConfig ()
 Print out all configuration options for a module. More...
 
NEKMESHUTILS_EXPORT void SetDefaults ()
 Sets default configuration options for those which have not been set. More...
 
NEKMESHUTILS_EXPORT MeshSharedPtr GetMesh ()
 
virtual NEKMESHUTILS_EXPORT void ProcessVertices ()
 Extract element vertices. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessEdges (bool ReprocessEdges=true)
 Extract element edges. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessFaces (bool ReprocessFaces=true)
 Extract element faces. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessElements ()
 Generate element IDs. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessComposites ()
 Generate composites. More...
 
virtual NEKMESHUTILS_EXPORT void ClearElementLinks ()
 

Static Public Member Functions

static boost::shared_ptr< Modulecreate (NekMeshUtils::MeshSharedPtr m)
 Creates an instance of this class. More...
 

Static Public Attributes

static NekMeshUtils::ModuleKey className
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::NekMeshUtils::Module
NEKMESHUTILS_EXPORT void ReorderPrisms (PerMap &perFaces)
 Reorder node IDs so that prisms and tetrahedra are aligned correctly. More...
 
NEKMESHUTILS_EXPORT void PrismLines (int prism, PerMap &perFaces, std::set< int > &prismsDone, std::vector< ElementSharedPtr > &line)
 
- Protected Attributes inherited from Nektar::NekMeshUtils::Module
MeshSharedPtr m_mesh
 Mesh object. More...
 
std::map< std::string,
ConfigOption
m_config
 List of configuration values. 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 ( NekMeshUtils::MeshSharedPtr  m)

Definition at line 59 of file ProcessExtractTetPrismInterface.cpp.

61  : ProcessModule(m)
62 {
63 }
NEKMESHUTILS_EXPORT ProcessModule(MeshSharedPtr p_m)
Nektar::Utilities::ProcessExtractTetPrismInterface::~ProcessExtractTetPrismInterface ( )
virtual

Definition at line 65 of file ProcessExtractTetPrismInterface.cpp.

66 {
67 }

Member Function Documentation

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

Creates an instance of this class.

Definition at line 55 of file ProcessExtractTetPrismInterface.h.

56  {
57  return MemoryManager<
58  ProcessExtractTetPrismInterface>::AllocateSharedPtr(m);
59  }
void Nektar::Utilities::ProcessExtractTetPrismInterface::Process ( )
virtual

Write mesh to output file.

Implements Nektar::NekMeshUtils::Module.

Definition at line 69 of file ProcessExtractTetPrismInterface.cpp.

References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, >::CreateInstance(), Nektar::LibUtilities::ePrism, Nektar::LibUtilities::eTetrahedron, Nektar::LibUtilities::eTriangle, Nektar::NekMeshUtils::GetElementFactory(), Nektar::iterator, Nektar::NekMeshUtils::Module::m_mesh, Nektar::NekMeshUtils::Module::ProcessComposites(), Nektar::NekMeshUtils::Module::ProcessEdges(), Nektar::NekMeshUtils::Module::ProcessElements(), Nektar::NekMeshUtils::Module::ProcessFaces(), and Nektar::NekMeshUtils::Module::ProcessVertices().

70 {
71  if (m_mesh->m_verbose)
72  {
73  cout << "ProcessExtractTetPrismInterface: Extracting tet-prism "
74  << "interface... " << endl;
75  }
76 
77  ASSERTL0(m_mesh->m_expDim == 3,
78  "The prism-tet interface module"
79  " only works for three-dimensional meshes.");
80 
81  // Copy 3D elements and 2D boundary elements and clear existing.
82  vector<ElementSharedPtr> el = m_mesh->m_element[m_mesh->m_expDim];
83  vector<ElementSharedPtr> bndEl = m_mesh->m_element[m_mesh->m_expDim - 1];
84  m_mesh->m_element[m_mesh->m_expDim].clear();
85  m_mesh->m_element[m_mesh->m_expDim - 1].clear();
86 
87  // Extract prismatic elements.
88  for (int i = 0; i < el.size(); ++i)
89  {
90  ElementSharedPtr elmt = el[i];
91 
92  if (elmt->GetConf().m_e == LibUtilities::ePrism)
93  {
94  m_mesh->m_element[m_mesh->m_expDim].push_back(elmt);
95  }
96  }
97 
98  ASSERTL0(m_mesh->m_element[m_mesh->m_expDim].size() > 0,
99  "Mesh does not contain any prismatic elements!");
100 
101  FaceSet::iterator fIt;
102 
103  // Extract boundary region already associated with prisms
104  // (i.e. outer wall of the computational domain)
105  for (fIt = m_mesh->m_faceSet.begin(); fIt != m_mesh->m_faceSet.end(); fIt++)
106  {
107  if ((*fIt)->m_elLink.size() == 1)
108  {
109  ElementSharedPtr el = (*fIt)->m_elLink[0].first;
110 
111  if (el->GetConf().m_e != LibUtilities::eTetrahedron)
112  {
113  m_mesh->m_element[m_mesh->m_expDim - 1].push_back(
114  bndEl[el->GetBoundaryLink((*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(); fIt != m_mesh->m_faceSet.end(); fIt++)
122  {
123  if ((*fIt)->m_elLink.size() != 1)
124  {
125  ElementSharedPtr el1 = (*fIt)->m_elLink[0].first;
126  ElementSharedPtr el2 = (*fIt)->m_elLink[1].first;
127 
128  if ((el1->GetConf().m_e == LibUtilities::ePrism &&
129  el2->GetConf().m_e == LibUtilities::eTetrahedron) ||
130  (el2->GetConf().m_e == LibUtilities::ePrism &&
131  el1->GetConf().m_e == LibUtilities::eTetrahedron))
132  {
133  // Create a new linear triangle from face for boundary.
134  vector<NodeSharedPtr> nodeList(3);
135  vector<int> tags(1);
136  tags[0] = m_mesh->m_composite.size();
137 
138  nodeList = (*fIt)->m_vertexList;
139  ElmtConfig conf(
140  LibUtilities::eTriangle, 1, false, false, false);
142  LibUtilities::eTriangle, conf, nodeList, tags);
143 
144  m_mesh->m_element[m_mesh->m_expDim - 1].push_back(tri);
145  }
146  }
147  }
148 
149  ProcessVertices();
150  ProcessEdges();
151  ProcessFaces();
152  ProcessElements();
154 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
Basic information about an element.
Definition: ElementConfig.h:50
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:162
ElementFactory & GetElementFactory()
Definition: Element.cpp:47
virtual NEKMESHUTILS_EXPORT void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
virtual NEKMESHUTILS_EXPORT void ProcessElements()
Generate element IDs.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual NEKMESHUTILS_EXPORT void ProcessVertices()
Extract element vertices.
virtual NEKMESHUTILS_EXPORT void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
boost::shared_ptr< Element > ElementSharedPtr
Definition: Edge.h:49
virtual NEKMESHUTILS_EXPORT void ProcessComposites()
Generate composites.

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 60 of file ProcessExtractTetPrismInterface.h.