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
42{
43
44typedef std::map<StdRegions::ConstFactorType, Array<OneD, NekDouble>>
47
48/// Describe a linear system.
50{
51public:
53 const StdRegions::MatrixType matrixType,
58 const VarFactorsMap &varFactos = NullVarFactorsMap);
59
60 /// Copy constructor.
62
63 /// Destructor.
65
66 /// Less-than operator for GlobalLinSysKey comparison.
67 MULTI_REGIONS_EXPORT friend bool operator<(const GlobalLinSysKey &lhs,
68 const GlobalLinSysKey &rhs);
69
70 /// Return the associated solution type.
72
74
76 const StdRegions::ConstFactorType &coeff) const;
77
79
80protected:
81 /// Store the solution type associated with the linear system. This
82 /// may be none, full matrix, static condensation or multi-level
83 /// static condensation.
86 std::vector<std::size_t> m_varFactors_hashes;
87
88private:
89};
90
91/// Writes information about the object to a given stream.
92MULTI_REGIONS_EXPORT std::ostream &operator<<(std::ostream &os,
93 const GlobalLinSysKey &rhs);
94
96{
97 return m_solnType;
98}
99
101{
102 return m_varFactors.size();
103}
104
106 const StdRegions::ConstFactorType &factor) const
107{
108 ASSERTL1(m_varFactors.count(factor) > 0, "factor not found");
109 VarFactorsMap::const_iterator found = m_varFactors.find(factor);
110 return (*found).second;
111}
112
114{
115 return m_varFactors;
116}
117} // namespace Nektar::MultiRegions
118
119#endif
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
#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:51
static VarFactorsMap NullVarFactorsMap
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition: AssemblyMap.h:50
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:430
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:431
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:376
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:375
StdRegions::ConstFactorMap factors