Nektar++
GlobalLinSysKey.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File GlobalLinSysKeys.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 GlobalLinSysKey
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_LIBS_MULTIREGIONS_GLOBALLINSYSKEY_H
36 #define NEKTAR_LIBS_MULTIREGIONS_GLOBALLINSYSKEY_H
40 
41 namespace Nektar
42 {
43  namespace MultiRegions
44  {
45 
46  typedef std::map<StdRegions::ConstFactorType, Array<OneD, NekDouble> > VarFactorsMap;
47  static VarFactorsMap NullVarFactorsMap;
48 
49  /// Describe a linear system.
51  {
52  public:
54  const AssemblyMapSharedPtr &locToGloMap
58  const VarFactorsMap &varFactos = NullVarFactorsMap);
59 
60  /// Copy constructor.
61  MULTI_REGIONS_EXPORT GlobalLinSysKey(const GlobalLinSysKey &key);
62  /// Destructor.
64 
65  /// Less-than operator for GlobalLinSysKey comparison.
66  MULTI_REGIONS_EXPORT friend bool operator<(const GlobalLinSysKey &lhs,
67  const GlobalLinSysKey &rhs);
68  /// Return the associated solution type.
70 
72 
74  GetVarFactors(const StdRegions::ConstFactorType& coeff) const;
75  MULTI_REGIONS_EXPORT const VarFactorsMap & GetVarFactors() const;
76 
77  protected:
78  /// Store the solution type associated with the linear system. This
79  /// may be none, full matrix, static condensation or multi-level
80  /// static condensation.
82 
83  VarFactorsMap m_varFactors;
84 
85  std::vector<std::size_t> m_varFactors_hashes;
86  private:
87 
88  };
89 
90  /// Writes information about the object to a given stream.
91  MULTI_REGIONS_EXPORT std::ostream& operator<<(std::ostream& os, const GlobalLinSysKey& rhs);
92 
94  const
95  {
96  return m_solnType;
97  }
98 
99 
101  {
102  return m_varFactors.size();
103  }
104 
105  inline const Array<OneD, const NekDouble> &
107  &factor) const
108  {
109  ASSERTL1(m_varFactors.count(factor) > 0, "factor not found");
110  VarFactorsMap::const_iterator found = m_varFactors.find(factor);
111  return (*found).second;
112  }
113 
114  inline const VarFactorsMap & GlobalLinSysKey::GetVarFactors() const
115  {
116  return m_varFactors;
117  }
118  }
119 }
120 
121 #endif
static VarFactorsMap NullVarFactorsMap
std::vector< std::size_t > m_varFactors_hashes
GlobalSysSolnType m_solnType
Store the solution type associated with the linear system. This may be none, full matrix...
#define MULTI_REGIONS_EXPORT
friend bool operator<(const GlobalLinSysKey &lhs, const GlobalLinSysKey &rhs)
Less-than operator for GlobalLinSysKey comparison.
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:294
StandardMatrixTag & lhs
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition: AssemblyMap.h:52
std::ostream & operator<<(std::ostream &os, const GlobalLinSysKey &rhs)
Writes information about the object to a given stream.
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:264
GlobalLinSysKey(const StdRegions::MatrixType matrixType, const AssemblyMapSharedPtr &locToGloMap=NullAssemblyMapSharedPtr, const StdRegions::ConstFactorMap &factors=StdRegions::NullConstFactorMap, const StdRegions::VarCoeffMap &varCoeffs=StdRegions::NullVarCoeffMap, const VarFactorsMap &varFactos=NullVarFactorsMap)
const VarFactorsMap & GetVarFactors() const
Describe a linear system.
Describes a matrix with ordering defined by a local to global map.
static AssemblyMapSharedPtr NullAssemblyMapSharedPtr
Definition: AssemblyMap.h:54
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:265
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:295