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

This processing module calculates the Jacobian of elements using SpatialDomains::GeomFactors and the Element::GetGeom method. For now it simply prints a list of elements which have negative Jacobian. More...

#include <ProcessLinkCheck.h>

Inheritance diagram for Nektar::Utilities::ProcessLinkCheck:
[legend]

Public Member Functions

 ProcessLinkCheck (NekMeshUtils::MeshSharedPtr m)
 
virtual ~ProcessLinkCheck ()
 
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=std::string())
 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 std::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, ConfigOptionm_config
 List of configuration values. More...
 

Detailed Description

This processing module calculates the Jacobian of elements using SpatialDomains::GeomFactors and the Element::GetGeom method. For now it simply prints a list of elements which have negative Jacobian.

Definition at line 51 of file ProcessLinkCheck.h.

Constructor & Destructor Documentation

◆ ProcessLinkCheck()

Nektar::Utilities::ProcessLinkCheck::ProcessLinkCheck ( NekMeshUtils::MeshSharedPtr  m)

Definition at line 51 of file ProcessLinkCheck.cpp.

51  : ProcessModule(m)
52 {
53 
54 }
NEKMESHUTILS_EXPORT ProcessModule(MeshSharedPtr p_m)

◆ ~ProcessLinkCheck()

Nektar::Utilities::ProcessLinkCheck::~ProcessLinkCheck ( )
virtual

Definition at line 56 of file ProcessLinkCheck.cpp.

57 {
58 }

Member Function Documentation

◆ create()

static std::shared_ptr<Module> Nektar::Utilities::ProcessLinkCheck::create ( NekMeshUtils::MeshSharedPtr  m)
inlinestatic

Creates an instance of this class.

Definition at line 55 of file ProcessLinkCheck.h.

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

56  {
58  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

◆ Process()

void Nektar::Utilities::ProcessLinkCheck::Process ( )
virtual

Write mesh to output file.

Implements Nektar::NekMeshUtils::Module.

Definition at line 60 of file ProcessLinkCheck.cpp.

References Nektar::NekMeshUtils::Module::ClearElementLinks(), 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().

61 {
62  if (m_mesh->m_verbose)
63  {
64  cout << "ProcessLinkCheck: Checking links... " << endl;
65  }
66 
67  //need to reset all links first to make sure there are no bugs!
70  ProcessEdges();
71  ProcessFaces();
74 
75  int count = 0;
76 
77  if(m_mesh->m_expDim == 2)
78  {
79  for(auto &edge : m_mesh->m_edgeSet)
80  {
81  if(edge->m_elLink.size() != 2)
82  {
83  count++;
84  }
85  }
86  }
87  else
88  {
89  for(auto &face : m_mesh->m_faceSet)
90  {
91  if(face->m_elLink.size() != 2)
92  {
93  count++;
94  }
95  }
96  }
97 
98 
99 
100  if (count - m_mesh->m_element[m_mesh->m_expDim-1].size() != 0)
101  {
102  cout << "Link Check Error: mesh contains incorrectly connected"
103  << " entities and is not valid: "
104  << count - m_mesh->m_element[m_mesh->m_expDim-1].size()
105  << endl;
106  }
107 }
virtual NEKMESHUTILS_EXPORT void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
virtual NEKMESHUTILS_EXPORT void ProcessElements()
Generate element IDs.
virtual NEKMESHUTILS_EXPORT void ClearElementLinks()
virtual NEKMESHUTILS_EXPORT void ProcessVertices()
Extract element vertices.
virtual NEKMESHUTILS_EXPORT void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
virtual NEKMESHUTILS_EXPORT void ProcessComposites()
Generate composites.

Member Data Documentation

◆ className

ModuleKey Nektar::Utilities::ProcessLinkCheck::className
static
Initial value:
ModuleKey(eProcessModule, "linkcheck"),
"Checks elemental links within elements.")

Definition at line 59 of file ProcessLinkCheck.h.