Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MatrixKey.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File MatrixKey.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 // 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: Definition of MatrixKey based on StdMatrixKey
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 
37 #include <LocalRegions/MatrixKey.h>
38 
39 namespace Nektar
40 {
41  namespace LocalRegions
42  {
44  const LibUtilities::ShapeType shapeType,
45  const StdRegions::StdExpansion &stdExpansion,
46  const StdRegions::ConstFactorMap &factorMap,
47  const StdRegions::VarCoeffMap &varCoeffMap,
48  LibUtilities::PointsType nodalType) :
49  StdMatrixKey(matrixType, shapeType, stdExpansion, factorMap, varCoeffMap, nodalType),
50  m_metricinfo(stdExpansion.GetMetricInfo())
51  {
52  }
53 
55  const StdRegions::MatrixType matrixType) :
56  StdRegions::StdMatrixKey(mkey, matrixType),
57  m_metricinfo(mkey.m_metricinfo)
58  {
59  }
60 
62  StdRegions::StdMatrixKey(mkey)
63  {
64  }
65 
66  bool MatrixKey::opLess::operator()(const MatrixKey &lhs, const MatrixKey &rhs) const
67  {
68  {
69  return (lhs.GetMatrixType() < rhs.GetMatrixType());
70  }
71  }
72 
73  bool operator<(const MatrixKey &lhs, const MatrixKey &rhs)
74  {
75  if(lhs.m_metricinfo.get() < rhs.m_metricinfo.get())
76  {
77  return true;
78  }
79 
80 
81  if(lhs.m_metricinfo.get() > rhs.m_metricinfo.get())
82  {
83  return false;
84  }
85 
86  return (*dynamic_cast<const StdRegions::StdMatrixKey*>(&lhs)
87  < *dynamic_cast<const StdRegions::StdMatrixKey*>(&rhs));
88  }
89 
90  }
91 }
92 
93 /**
94 * $Log: MatrixKey.cpp,v $
95 * Revision 1.23 2008/12/17 16:57:04 pvos
96 * Performance updates
97 *
98 * Revision 1.22 2008/12/17 12:29:36 pvos
99 * Minor update
100 *
101 * Revision 1.21 2008/12/16 14:09:41 pvos
102 * Performance updates
103 *
104 * Revision 1.20 2008/11/19 16:46:43 pvos
105 * Fixed minor bug
106 *
107 * Revision 1.19 2008/11/19 16:01:41 pvos
108 * Added functionality for variable Laplacian coeffcients
109 *
110 * Revision 1.18 2008/07/09 11:39:47 sherwin
111 * Removed m_scalefactor and made operator< dependent upon StdMatKey
112 *
113 * Revision 1.17 2008/06/02 23:33:46 ehan
114 * Fixed warning : no new line at end of file
115 *
116 * Revision 1.16 2008/05/30 00:33:48 delisi
117 * Renamed StdRegions::ShapeType to StdRegions::ExpansionType.
118 *
119 * Revision 1.15 2008/05/29 01:02:13 bnelson
120 * Added precompiled header support.
121 *
122 * Revision 1.14 2007/12/17 13:04:29 sherwin
123 * Modified GenMatrix to take a StdMatrixKey and removed m_constant from MatrixKey
124 *
125 * Revision 1.13 2007/11/20 16:28:45 sherwin
126 * Added terms for UDG Helmholtz solver
127 *
128 * Revision 1.12 2007/07/28 05:09:32 sherwin
129 * Fixed version with updated MemoryManager
130 *
131 * Revision 1.11 2007/07/26 02:39:21 bnelson
132 * Fixed Visual C++ compiler errors when compiling in release mode.
133 *
134 * Revision 1.10 2007/07/20 00:45:50 bnelson
135 * Replaced boost::shared_ptr with Nektar::ptr
136 *
137 * Revision 1.9 2007/07/12 12:52:58 sherwin
138 * Updated to have a helmholtz matrix
139 *
140 * Revision 1.8 2007/07/10 17:17:22 sherwin
141 * Introduced Scaled Matrices into the MatrixManager
142 *
143 * Revision 1.7 2007/05/27 16:10:28 bnelson
144 * Update to new Array type.
145 *
146 * Revision 1.6 2007/04/08 03:33:30 jfrazier
147 * Minor reformatting and fixing SharedArray usage.
148 *
149 * Revision 1.5 2007/04/04 21:49:23 sherwin
150 * Update for SharedArray
151 *
152 * Revision 1.4 2007/03/20 09:13:37 kirby
153 * new geomfactor routines; update for metricinfo; update style
154 *
155 * Revision 1.3 2007/03/09 20:41:50 jfrazier
156 * *** empty log message ***
157 *
158 * Revision 1.2 2007/03/05 08:06:07 sherwin
159 * Updated to use MemoryManager
160 *
161 * Revision 1.1 2007/03/04 20:42:14 sherwin
162 * Keys for matrix managers
163 *
164 ***/
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: MatrixKey.h:86
MatrixType GetMatrixType() const
Definition: StdMatrixKey.h:82
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:252
StandardMatrixTag & lhs
The base class for all shapes.
Definition: StdExpansion.h:69
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:227
bool operator()(const MatrixKey &lhs, const MatrixKey &rhs) const
Definition: MatrixKey.cpp:66
friend bool operator<(const MatrixKey &lhs, const MatrixKey &rhs)
Used for finding value given the key in NekManager.
Definition: MatrixKey.cpp:73