Nektar++
GlobalLinSysKey.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: GlobalLinSysKey.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>>
49 
50 /// Describe a linear system.
52 {
53 public:
55  const StdRegions::MatrixType matrixType,
57  const StdRegions::ConstFactorMap &factors =
60  const VarFactorsMap &varFactos = NullVarFactorsMap);
61 
62  /// Copy constructor.
64 
65  /// Destructor.
67 
68  /// Less-than operator for GlobalLinSysKey comparison.
69  MULTI_REGIONS_EXPORT friend bool operator<(const GlobalLinSysKey &lhs,
70  const GlobalLinSysKey &rhs);
71 
72  /// Return the associated solution type.
74 
76 
78  const StdRegions::ConstFactorType &coeff) const;
79 
81 
82 protected:
83  /// Store the solution type associated with the linear system. This
84  /// may be none, full matrix, static condensation or multi-level
85  /// static condensation.
88  std::vector<std::size_t> m_varFactors_hashes;
89 
90 private:
91 };
92 
93 /// Writes information about the object to a given stream.
94 MULTI_REGIONS_EXPORT std::ostream &operator<<(std::ostream &os,
95  const GlobalLinSysKey &rhs);
96 
98 {
99  return m_solnType;
100 }
101 
103 {
104  return m_varFactors.size();
105 }
106 
108  const StdRegions::ConstFactorType &factor) const
109 {
110  ASSERTL1(m_varFactors.count(factor) > 0, "factor not found");
111  VarFactorsMap::const_iterator found = m_varFactors.find(factor);
112  return (*found).second;
113 }
114 
116 {
117  return m_varFactors;
118 }
119 } // namespace MultiRegions
120 } // namespace Nektar
121 
122 #endif
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
#define MULTI_REGIONS_EXPORT
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)
GlobalSysSolnType m_solnType
Store the solution type associated with the linear system. This may be none, full matrix,...
const VarFactorsMap & GetVarFactors() const
friend bool operator<(const GlobalLinSysKey &lhs, const GlobalLinSysKey &rhs)
Less-than operator for GlobalLinSysKey comparison.
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
std::vector< std::size_t > m_varFactors_hashes
Describes a matrix with ordering defined by a local to global map.
std::ostream & operator<<(std::ostream &os, const GlobalLinSysKey &rhs)
Writes information about the object to a given stream.
static AssemblyMapSharedPtr NullAssemblyMapSharedPtr
Definition: AssemblyMap.h:53
static VarFactorsMap NullVarFactorsMap
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition: AssemblyMap.h:51
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:399
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:400
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:344
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:343
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2