Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Member Functions | List of all members
Nektar::Utilities::ProcessCurvedEdges Class Referenceabstract

#include <ProcessCurvedEdges.h>

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

Public Member Functions

 ProcessCurvedEdges (NekMeshUtils::MeshSharedPtr m)
 Default constructor. More...
 
virtual ~ProcessCurvedEdges ()
 Destructor. More...
 
virtual void Process ()
 Write mesh to output file. More...
 
void GenerateEdgeNodes (NekMeshUtils::EdgeSharedPtr edge)
 
- 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 ()
 

Protected Member Functions

virtual void v_GenerateEdgeNodes (NekMeshUtils::EdgeSharedPtr edge)=0
 
- 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)
 

Additional Inherited Members

- 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

Definition at line 46 of file ProcessCurvedEdges.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 57 of file ProcessCurvedEdges.cpp.

References Nektar::NekMeshUtils::Module::m_config.

57  : ProcessModule(m)
58 {
59  m_config["surf"] =
60  ConfigOption(false, "-1", "Tag identifying surface to process.");
61  m_config["N"] = ConfigOption(false, "7", "Number of points along edge.");
62 }
Represents a command-line configuration option.
NEKMESHUTILS_EXPORT ProcessModule(MeshSharedPtr p_m)
std::map< std::string, ConfigOption > m_config
List of configuration values.
Nektar::Utilities::ProcessCurvedEdges::~ProcessCurvedEdges ( )
virtual

Destructor.

Definition at line 67 of file ProcessCurvedEdges.cpp.

68 {
69 }

Member Function Documentation

void Nektar::Utilities::ProcessCurvedEdges::GenerateEdgeNodes ( NekMeshUtils::EdgeSharedPtr  edge)
inline

Definition at line 54 of file ProcessCurvedEdges.h.

References v_GenerateEdgeNodes().

Referenced by Process().

55  {
56  v_GenerateEdgeNodes( edge);
57  }
virtual void v_GenerateEdgeNodes(NekMeshUtils::EdgeSharedPtr edge)=0
void Nektar::Utilities::ProcessCurvedEdges::Process ( )
virtual

Write mesh to output file.

Implements Nektar::NekMeshUtils::Module.

Definition at line 71 of file ProcessCurvedEdges.cpp.

References ASSERTL0, Nektar::StdRegions::find(), GenerateEdgeNodes(), Nektar::NekMeshUtils::Module::m_config, and Nektar::NekMeshUtils::Module::m_mesh.

72 {
73  int surfTag = m_config["surf"].as<int>();
74  int prismedge[2][3] = {{0, 5, 4}, {2, 6, 7}};
75  int dim = m_mesh->m_expDim;
76 
77  for (int i = 0; i < m_mesh->m_element[dim].size(); ++i)
78  {
79  ElementSharedPtr el = m_mesh->m_element[dim][i];
80  int nSurf = dim == 3 ? el->GetFaceCount() : el->GetEdgeCount();
81 
82  for (int j = 0; j < nSurf; ++j)
83  {
84  int bl = el->GetBoundaryLink(j);
85  if (bl == -1)
86  {
87  continue;
88  }
89 
90  ElementSharedPtr bEl = m_mesh->m_element[dim - 1][bl];
91  vector<int> tags = bEl->GetTagList();
92 
93  if (find(tags.begin(), tags.end(), surfTag) == tags.end())
94  {
95  continue;
96  }
97 
98  switch (dim)
99  {
100  case 2:
101  {
102  EdgeSharedPtr edge = el->GetEdge(j);
103  GenerateEdgeNodes(edge);
104  }
105  break;
106 
107  case 3:
108  {
109  ASSERTL0(j == 1 || j == 3,
110  "Curved edge needs to be on prism triangular face");
111  // Check all edge interior points.
112  for (int k = 0; k < 3; ++k)
113  {
114  EdgeSharedPtr edge =
115  el->GetEdge(prismedge[(j - 1) / 2][k]);
116  GenerateEdgeNodes(edge);
117  }
118  }
119  break;
120 
121  default:
122  ASSERTL0(0,"Dimension not supported");
123  break;
124  }
125  }
126  }
127 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
void GenerateEdgeNodes(NekMeshUtils::EdgeSharedPtr edge)
std::map< std::string, ConfigOption > m_config
List of configuration values.
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
Definition: Edge.h:135
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:316
boost::shared_ptr< Element > ElementSharedPtr
Definition: Edge.h:49
virtual void Nektar::Utilities::ProcessCurvedEdges::v_GenerateEdgeNodes ( NekMeshUtils::EdgeSharedPtr  edge)
protectedpure virtual