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
45namespace Nektar
46{
47namespace LocalRegions
48{
50{
51 unsigned short index;
52 short sign;
53};
54
56
58{
59public:
61 const IndexMapType indexmapType,
62 const LibUtilities::ShapeType shapeType, const unsigned short p,
63 const unsigned short q, const unsigned short r,
64 const unsigned short entityID = 0,
66
68 const IndexMapType indexmapType);
69
71
72 virtual ~IndexMapKey()
73 {
74 }
75
76 // Used to lookup the create function in NekManager.
77 struct opLess
78 {
80 const IndexMapKey &rhs) const;
81 };
82
83 // Used for finding value given the key in NekManager.
84 LOCAL_REGIONS_EXPORT friend bool operator<(const IndexMapKey &lhs,
85 const IndexMapKey &rhs);
86 LOCAL_REGIONS_EXPORT friend bool operator==(const IndexMapKey &lhs,
87 const IndexMapKey &rhs);
89 const IndexMapKey &lhs, const IndexMapKey &rhs) const;
90
92 {
93 return m_indexMapType;
94 }
95
97 {
98 return m_orientation;
99 }
100
101 int GetIndexEntity() const
102 {
103 return m_entityID;
104 }
105
106protected:
108
110
111 unsigned short m_p;
112 unsigned short m_q;
113 unsigned short m_r;
114
115 unsigned short m_entityID;
116
118
119private:
121};
122//==================================================================================
123
124LOCAL_REGIONS_EXPORT std::ostream &operator<<(std::ostream &os,
125 const IndexMapKey &rhs);
126
127typedef std::shared_ptr<IndexMapKey> IndexMapKeySharedPtr;
128typedef std::shared_ptr<IndexMapValues> IndexMapValuesSharedPtr;
129} // namespace LocalRegions
130} // namespace Nektar
131
132#endif
#define LOCAL_REGIONS_EXPORT
friend bool operator==(const IndexMapKey &lhs, const IndexMapKey &rhs)
LibUtilities::ShapeType m_shapeType
Definition: IndexMapKey.h:109
StdRegions::Orientation GetIndexOrientation() const
Definition: IndexMapKey.h:96
IndexMapType GetIndexMapType() const
Definition: IndexMapKey.h:91
StdRegions::Orientation m_orientation
Definition: IndexMapKey.h:117
friend bool operator<(const IndexMapKey &lhs, const IndexMapKey &rhs)
Definition: IndexMapKey.cpp:73
Array< OneD, IndexValue > IndexMapValues
Definition: IndexMapKey.h:55
std::shared_ptr< IndexMapValues > IndexMapValuesSharedPtr
Definition: IndexMapKey.h:128
std::shared_ptr< IndexMapKey > IndexMapKeySharedPtr
Definition: IndexMapKey.h:127
std::ostream & operator<<(std::ostream &os, const IndexMapKey &rhs)
std::vector< double > q(NPUPPER *NPUPPER)
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
bool operator()(const IndexMapKey &lhs, const IndexMapKey &rhs) const
Definition: IndexMapKey.cpp:67