Nektar++
IndexMapKey.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: IndexMapKey.h
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: Headers for Index Maps
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef INDEXMAPKEY_H
36#define INDEXMAPKEY_H
37
41
42#include <memory>
43#include <ostream>
44
46{
48{
49 unsigned short index;
50 short sign;
51};
52
54
56{
57public:
59 const IndexMapType indexmapType,
60 const LibUtilities::ShapeType shapeType, const unsigned short p,
61 const unsigned short q, const unsigned short r,
62 const unsigned short entityID = 0,
64
66 const IndexMapType indexmapType);
67
69
70 virtual ~IndexMapKey()
71 {
72 }
73
74 // Used to lookup the create function in NekManager.
75 struct opLess
76 {
78 const IndexMapKey &rhs) const;
79 };
80
81 // Used for finding value given the key in NekManager.
82 LOCAL_REGIONS_EXPORT friend bool operator<(const IndexMapKey &lhs,
83 const IndexMapKey &rhs);
84 LOCAL_REGIONS_EXPORT friend bool operator==(const IndexMapKey &lhs,
85 const IndexMapKey &rhs);
87 const IndexMapKey &lhs, const IndexMapKey &rhs) const;
88
90 {
91 return m_indexMapType;
92 }
93
95 {
96 return m_orientation;
97 }
98
99 int GetIndexEntity() const
100 {
101 return m_entityID;
102 }
103
104protected:
106
108
109 unsigned short m_p;
110 unsigned short m_q;
111 unsigned short m_r;
112
113 unsigned short m_entityID;
114
116
117private:
119};
120//==================================================================================
121
122LOCAL_REGIONS_EXPORT std::ostream &operator<<(std::ostream &os,
123 const IndexMapKey &rhs);
124
125typedef std::shared_ptr<IndexMapKey> IndexMapKeySharedPtr;
126typedef std::shared_ptr<IndexMapValues> IndexMapValuesSharedPtr;
127} // namespace Nektar::LocalRegions
128
129#endif
#define LOCAL_REGIONS_EXPORT
friend bool operator==(const IndexMapKey &lhs, const IndexMapKey &rhs)
LibUtilities::ShapeType m_shapeType
Definition: IndexMapKey.h:107
StdRegions::Orientation GetIndexOrientation() const
Definition: IndexMapKey.h:94
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
Array< OneD, IndexValue > IndexMapValues
Definition: IndexMapKey.h:53
std::shared_ptr< IndexMapValues > IndexMapValuesSharedPtr
Definition: IndexMapKey.h:126
std::shared_ptr< IndexMapKey > IndexMapKeySharedPtr
Definition: IndexMapKey.h:125
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