Nektar++
IndexMapKey.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: IndexMapKey.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: Definition of IndexMapKey
32//
33///////////////////////////////////////////////////////////////////////////////
34
37
39{
41 const LibUtilities::ShapeType shapeType,
42 const unsigned short p, const unsigned short q,
43 const unsigned short r, const unsigned short entityID,
44 const StdRegions::Orientation orientation)
45 : m_indexMapType(indexmapType), m_shapeType(shapeType), m_p(p), m_q(q),
46 m_r(r), m_entityID(entityID), m_orientation(orientation)
47{
48}
49
51 const IndexMapType indexmapType)
52 : m_indexMapType(indexmapType), m_shapeType(rhs.m_shapeType), m_p(rhs.m_p),
53 m_q(rhs.m_q), m_r(rhs.m_r), m_entityID(rhs.m_entityID),
54 m_orientation(rhs.m_orientation)
55{
56}
57
59 : m_indexMapType(rhs.m_indexMapType), m_shapeType(rhs.m_shapeType),
60 m_p(rhs.m_p), m_q(rhs.m_q), m_r(rhs.m_r), m_entityID(rhs.m_entityID),
61 m_orientation(rhs.m_orientation)
62{
63}
64
66 const IndexMapKey &rhs) const
67{
68 return (lhs.m_indexMapType < rhs.m_indexMapType);
69}
70
71bool operator<(const IndexMapKey &lhs, const IndexMapKey &rhs)
72{
73 if (lhs.m_indexMapType < rhs.m_indexMapType)
74 {
75 return true;
76 }
77
78 if (lhs.m_indexMapType > rhs.m_indexMapType)
79 {
80 return false;
81 }
82
83 if (lhs.m_shapeType < rhs.m_shapeType)
84 {
85 return true;
86 }
87
88 if (lhs.m_shapeType > rhs.m_shapeType)
89 {
90 return false;
91 }
92
93 if (lhs.m_p < rhs.m_p)
94 {
95 return true;
96 }
97
98 if (lhs.m_p > rhs.m_p)
99 {
100 return false;
101 }
102
103 if (lhs.m_q < rhs.m_q)
104 {
105 return true;
106 }
107
108 if (lhs.m_q > rhs.m_q)
109 {
110 return false;
111 }
112
113 if (lhs.m_r < rhs.m_r)
114 {
115 return true;
116 }
117
118 if (lhs.m_r > rhs.m_r)
119 {
120 return false;
121 }
122
123 if (lhs.m_entityID < rhs.m_entityID)
124 {
125 return true;
126 }
127 if (lhs.m_entityID > rhs.m_entityID)
128 {
129 return false;
130 }
131
132 if (lhs.m_orientation < rhs.m_orientation)
133 {
134 return true;
135 }
136 if (lhs.m_orientation > rhs.m_orientation)
137 {
138 return false;
139 }
140
141 return false;
142}
143
144bool operator==(const IndexMapKey &lhs, const IndexMapKey &rhs)
145{
146 if (lhs.m_indexMapType != rhs.m_indexMapType)
147 {
148 return false;
149 }
150
151 if (lhs.m_shapeType != rhs.m_shapeType)
152 {
153 return false;
154 }
155
156 if (lhs.m_p != rhs.m_p)
157 {
158 return false;
159 }
160
161 if (lhs.m_q != rhs.m_q)
162 {
163 return false;
164 }
165
166 if (lhs.m_r != rhs.m_r)
167 {
168 return false;
169 }
170
171 if (lhs.m_entityID != rhs.m_entityID)
172 {
173 return false;
174 }
175
176 if (lhs.m_orientation != rhs.m_orientation)
177 {
178 return false;
179 }
180
181 return true;
182}
183
184std::ostream &operator<<(std::ostream &os, const IndexMapKey &rhs)
185{
186 os << "IndexMapType: " << IndexMapTypeMap[rhs.GetIndexMapType()]
187 << std::endl;
188 return os;
189}
190} // namespace Nektar::LocalRegions
friend bool operator==(const IndexMapKey &lhs, const IndexMapKey &rhs)
LibUtilities::ShapeType m_shapeType
Definition: IndexMapKey.h:107
IndexMapType GetIndexMapType() const
Definition: IndexMapKey.h:89
StdRegions::Orientation m_orientation
Definition: IndexMapKey.h:115
friend bool operator<(const IndexMapKey &lhs, const IndexMapKey &rhs)
Definition: IndexMapKey.cpp:71
const char *const IndexMapTypeMap[]
std::ostream & operator<<(std::ostream &os, const IndexMapKey &rhs)
std::vector< double > q(NPUPPER *NPUPPER)
bool operator()(const IndexMapKey &lhs, const IndexMapKey &rhs) const
Definition: IndexMapKey.cpp:65