Nektar++
ProcessCurvedEdges.cpp
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: ProcessCurvedEdges.cpp
4 //
5 // For more information, please see: http://www.nektar.info/
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Abstract base class for creating curved edges on boundaries.
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
35 #include <LocalRegions/SegExp.h>
36 #include <LocalRegions/QuadExp.h>
37 #include <LocalRegions/TriExp.h>
39 
41 
43 
44 #include "ProcessCurvedEdges.h"
45 
46 using namespace std;
47 using namespace Nektar::NekMeshUtils;
48 
49 namespace Nektar
50 {
51 namespace Utilities
52 {
53 /**
54  * @brief Default constructor.
55  */
56 ProcessCurvedEdges::ProcessCurvedEdges(MeshSharedPtr m) : ProcessModule(m)
57 {
58  m_config["surf"] =
59  ConfigOption(false, "-1", "Tag identifying surface to process.");
60  m_config["N"] = ConfigOption(false, "7", "Number of points along edge.");
61 }
62 
63 /**
64  * @brief Destructor.
65  */
67 {
68 }
69 
71 {
72  int surfTag = m_config["surf"].as<int>();
73  int prismedge[2][3] = {{0, 5, 4}, {2, 6, 7}};
74  int dim = m_mesh->m_expDim;
75 
76  for (int i = 0; i < m_mesh->m_element[dim].size(); ++i)
77  {
78  ElementSharedPtr el = m_mesh->m_element[dim][i];
79  int nSurf = dim == 3 ? el->GetFaceCount() : el->GetEdgeCount();
80 
81  for (int j = 0; j < nSurf; ++j)
82  {
83  int bl = el->GetBoundaryLink(j);
84  if (bl == -1)
85  {
86  continue;
87  }
88 
89  ElementSharedPtr bEl = m_mesh->m_element[dim - 1][bl];
90  vector<int> tags = bEl->GetTagList();
91 
92  if (find(tags.begin(), tags.end(), surfTag) == tags.end())
93  {
94  continue;
95  }
96 
97  switch (dim)
98  {
99  case 2:
100  {
101  EdgeSharedPtr edge = el->GetEdge(j);
102  GenerateEdgeNodes(edge);
103  }
104  break;
105 
106  case 3:
107  {
108  ASSERTL0(j == 1 || j == 3,
109  "Curved edge needs to be on prism triangular face");
110  // Check all edge interior points.
111  for (int k = 0; k < 3; ++k)
112  {
113  EdgeSharedPtr edge =
114  el->GetEdge(prismedge[(j - 1) / 2][k]);
115  GenerateEdgeNodes(edge);
116  }
117  }
118  break;
119 
120  default:
121  ASSERTL0(0,"Dimension not supported");
122  break;
123  }
124  }
125  }
126 }
127 }
128 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
void GenerateEdgeNodes(NekMeshUtils::EdgeSharedPtr edge)
virtual void Process()
Write mesh to output file.
STL namespace.
std::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
Definition: Edge.h:136
std::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Definition: Mesh.h:156
std::shared_ptr< Element > ElementSharedPtr
Definition: Edge.h:49
Represents a command-line configuration option.
std::map< std::string, ConfigOption > m_config
List of configuration values.
Abstract base class for processing modules.
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:358