Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
Nektar::NekMeshUtils::SurfaceMesh Class Reference

class containing all surface meshing routines methods and classes More...

#include <SurfaceMesh.h>

Inheritance diagram for Nektar::NekMeshUtils::SurfaceMesh:
Inheritance graph
[legend]
Collaboration diagram for Nektar::NekMeshUtils::SurfaceMesh:
Collaboration graph
[legend]

Public Member Functions

 SurfaceMesh (MeshSharedPtr m)
 
virtual ~SurfaceMesh ()
 
virtual void Process ()
 
- 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 (MeshSharedPtr m)
 Creates an instance of this class. More...
 

Static Public Attributes

static ModuleKey className
 

Private Member Functions

void Report ()
 

Private Attributes

std::map< int, FaceMeshSharedPtrm_facemeshes
 map of individual surface meshes from parametric surfaces More...
 
std::map< int, CurveMeshSharedPtrm_curvemeshes
 map of individual curve meshes of the curves in the domain More...
 

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

class containing all surface meshing routines methods and classes

Definition at line 51 of file SurfaceMesh.h.

Constructor & Destructor Documentation

Nektar::NekMeshUtils::SurfaceMesh::SurfaceMesh ( MeshSharedPtr  m)

Definition at line 52 of file SurfaceMesh.cpp.

52  : ProcessModule(m)
53 {
54 
55 }
NEKMESHUTILS_EXPORT ProcessModule(MeshSharedPtr p_m)
Nektar::NekMeshUtils::SurfaceMesh::~SurfaceMesh ( )
virtual

Definition at line 57 of file SurfaceMesh.cpp.

58 {
59 }

Member Function Documentation

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

Creates an instance of this class.

Definition at line 56 of file SurfaceMesh.h.

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

57  {
59  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void Nektar::NekMeshUtils::SurfaceMesh::Process ( )
virtual

Implements Nektar::NekMeshUtils::Module.

Definition at line 61 of file SurfaceMesh.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::iterator, m_curvemeshes, m_facemeshes, Nektar::NekMeshUtils::Module::m_mesh, Nektar::LibUtilities::PrintProgressbar(), Nektar::NekMeshUtils::Module::ProcessComposites(), Nektar::NekMeshUtils::Module::ProcessEdges(), Nektar::NekMeshUtils::Module::ProcessElements(), Nektar::NekMeshUtils::Module::ProcessFaces(), Nektar::NekMeshUtils::Module::ProcessVertices(), and Report().

62 {
63  m_mesh->m_expDim--; //just to make it easier to surface mesh for now
64 
65  if (m_mesh->m_verbose)
66  cout << endl << "Surface meshing" << endl;
67 
68  if (m_mesh->m_verbose)
69  cout << endl << "\tCurve meshing:" << endl << endl;
70 
71  m_mesh->m_numNodes = m_mesh->m_cad->GetNumVerts();
72 
73  // linear mesh all curves
74  for (int i = 1; i <= m_mesh->m_cad->GetNumCurve(); i++)
75  {
76  if (m_mesh->m_verbose)
77  {
79  i, m_mesh->m_cad->GetNumCurve(), "Curve progress");
80  }
81 
83 
84  m_curvemeshes[i]->Mesh();
85  }
86 
87  if (m_mesh->m_verbose)
88  cout << endl << "\tFace meshing:" << endl << endl;
89 
90  bool validError = false;
91  for (int i = 1; i <= m_mesh->m_cad->GetNumSurf(); i++)
92  {
93  if (m_mesh->m_verbose)
94  {
96  i, m_mesh->m_cad->GetNumSurf(), "Validating curve meshes");
97  }
98  m_facemeshes[i] =
100  m_curvemeshes, i);
101 
102  validError = validError ? true : m_facemeshes[i]->ValidateCurves();
103  }
104 
105  ASSERTL0(!validError,"valdity error in curve meshes");
106 
107  // linear mesh all surfaces
109  int i = 1;
110  for(fit = m_facemeshes.begin(); fit != m_facemeshes.end(); fit++)
111  {
112  if (m_mesh->m_verbose)
113  {
115  i, m_mesh->m_cad->GetNumSurf(), "Face progress");
116  }
117  fit->second->Mesh();
118  i++;
119  }
120 
121  ProcessVertices();
122  ProcessEdges();
123  ProcessFaces();
124  ProcessElements();
126 
127  Report();
128 
130  for(it = m_mesh->m_edgeSet.begin(); it != m_mesh->m_edgeSet.end(); it++)
131  {
132  if((*it)->m_elLink.size() != 2)
133  {
134  ASSERTL0(false,"surface mesh connectivity error");
135  }
136  }
137 
138  m_mesh->m_expDim++; //revert dim
139 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
int PrintProgressbar(const int position, const int goal, const string message, int lastprogress=-1)
Prints a progressbar.
Definition: Progressbar.hpp:69
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual NEKMESHUTILS_EXPORT void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
std::map< int, CurveMeshSharedPtr > m_curvemeshes
map of individual curve meshes of the curves in the domain
Definition: SurfaceMesh.h:72
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.
std::map< int, FaceMeshSharedPtr > m_facemeshes
map of individual surface meshes from parametric surfaces
Definition: SurfaceMesh.h:70
virtual NEKMESHUTILS_EXPORT void ProcessComposites()
Generate composites.
void Nektar::NekMeshUtils::SurfaceMesh::Report ( )
private

Definition at line 141 of file SurfaceMesh.cpp.

References Nektar::NekMeshUtils::Module::m_mesh.

Referenced by Process().

142 {
143  if (m_mesh->m_verbose)
144  {
145  int ns = m_mesh->m_vertexSet.size();
146  int es = m_mesh->m_edgeSet.size();
147  int ts = m_mesh->m_element[2].size();
148  int ep = ns - es + ts;
149  cout << endl << "\tSurface mesh statistics" << endl;
150  cout << "\t\tNodes: " << ns << endl;
151  cout << "\t\tEdges: " << es << endl;
152  cout << "\t\tTriangles " << ts << endl;
153  cout << "\t\tEuler-PoincarĂ© characteristic: " << ep << endl;
154  }
155 }

Member Data Documentation

ModuleKey Nektar::NekMeshUtils::SurfaceMesh::className
static
Initial value:
ModuleKey(eProcessModule, "surfacemesh"),
"Generates a surface mesh")

Definition at line 60 of file SurfaceMesh.h.

std::map<int, CurveMeshSharedPtr> Nektar::NekMeshUtils::SurfaceMesh::m_curvemeshes
private

map of individual curve meshes of the curves in the domain

Definition at line 72 of file SurfaceMesh.h.

Referenced by Process().

std::map<int, FaceMeshSharedPtr> Nektar::NekMeshUtils::SurfaceMesh::m_facemeshes
private

map of individual surface meshes from parametric surfaces

Definition at line 70 of file SurfaceMesh.h.

Referenced by Process().