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::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
 
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

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 59 of file ProcessExtractTetPrismInterface.cpp.

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 ( 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::Utilities::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::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().

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:188
Basic information about an element.
Definition: Element.h:58
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
MeshSharedPtr m_mesh
Mesh object.
ElementFactory & GetElementFactory()
Definition: Element.cpp:47
virtual void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
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.
boost::shared_ptr< Element > ElementSharedPtr
Definition: Edge.h:52

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.