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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Headers for Index Maps
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef INDEXMAPKEY_H
37 #define INDEXMAPKEY_H
38 
41 #include <ostream>
42 #include <boost/shared_ptr.hpp>
43 
44 
45 namespace Nektar
46 {
47  namespace StdRegions
48  {
49  struct IndexValue
50  {
51  unsigned short index;
52  short sign;
53  };
54 
56 
58  {
59  public:
61  const StdRegions::IndexMapType indexmapType,
62  const LibUtilities::ShapeType shapeType,
63  const unsigned short p,
64  const unsigned short q,
65  const unsigned short r,
66  const unsigned short entityID = 0,
67  const StdRegions::Orientation orientation = eNoOrientation);
68 
69  STD_REGIONS_EXPORT IndexMapKey(const IndexMapKey& rhs,const StdRegions::IndexMapType indexmapType);
70 
71  STD_REGIONS_EXPORT IndexMapKey(const IndexMapKey& rhs);
72 
73  virtual ~IndexMapKey()
74  {
75  }
76 
77  // Used to lookup the create function in NekManager.
78  struct opLess
79  {
80  STD_REGIONS_EXPORT bool operator()(const IndexMapKey &lhs, const IndexMapKey &rhs) const;
81  };
82 
83  // Used for finding value given the key in NekManager.
84  STD_REGIONS_EXPORT friend bool operator<(const IndexMapKey &lhs, const IndexMapKey &rhs);
85  STD_REGIONS_EXPORT friend bool operator==(const IndexMapKey &lhs, const IndexMapKey &rhs);
86  STD_REGIONS_EXPORT friend bool opLess::operator()(const IndexMapKey &lhs, const IndexMapKey &rhs) const;
87 
89  {
90  return m_indexMapType;
91  }
92 
94  {
95  return m_orientation;
96  }
97 
98  int GetIndexEntity() const
99  {
100  return m_entityID;
101  }
102 
103  protected:
104 
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 
117  private:
118 
119  IndexMapKey();
120  };
121  //=======================================================================================
122 
123  STD_REGIONS_EXPORT std::ostream& operator<<(std::ostream& os, const IndexMapKey& rhs);
124 
125  typedef boost::shared_ptr<IndexMapKey> IndexMapKeySharedPtr;
126  typedef boost::shared_ptr<IndexMapValues> IndexMapValuesSharedPtr;
127  } // end of namespace
128 } // end of namespace
129 
130 #endif
Array< OneD, IndexValue > IndexMapValues
Definition: IndexMapKey.h:55
friend bool operator==(const IndexMapKey &lhs, const IndexMapKey &rhs)
boost::shared_ptr< IndexMapValues > IndexMapValuesSharedPtr
Definition: IndexMapKey.h:126
std::ostream & operator<<(std::ostream &os, const IndexMapKey &rhs)
StandardMatrixTag & lhs
boost::shared_ptr< IndexMapKey > IndexMapKeySharedPtr
Definition: IndexMapKey.h:125
bool operator()(const IndexMapKey &lhs, const IndexMapKey &rhs) const
Definition: IndexMapKey.cpp:84
LibUtilities::ShapeType m_shapeType
Definition: IndexMapKey.h:107
friend bool operator<(const IndexMapKey &lhs, const IndexMapKey &rhs)
Definition: IndexMapKey.cpp:90
#define STD_REGIONS_EXPORT
Orientation GetIndexOrientation() const
Definition: IndexMapKey.h:93
IndexMapType GetIndexMapType() const
Definition: IndexMapKey.h:88