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;
48 
49  /// Describe a linear system.
51  {
52  public:
54  const StdRegions::MatrixType matrixType,
55  const AssemblyMapSharedPtr &locToGloMap =
57  const StdRegions::ConstFactorMap &factors =
59  const StdRegions::VarCoeffMap &varCoeffs =
61  const VarFactorsMap &varFactos = NullVarFactorsMap);
62 
63  /// Copy constructor.
65 
66  /// Destructor.
68 
69  /// Less-than operator for GlobalLinSysKey comparison.
70  MULTI_REGIONS_EXPORT friend bool operator<(
71  const GlobalLinSysKey &lhs,
72  const GlobalLinSysKey &rhs);
73 
74  /// Return the associated solution type.
76 
78 
80  GetVarFactors(const StdRegions::ConstFactorType& coeff) const;
81 
83 
84  protected:
85  /// Store the solution type associated with the linear system. This
86  /// may be none, full matrix, static condensation or multi-level
87  /// static condensation.
90  std::vector<std::size_t> m_varFactors_hashes;
91 
92  private:
93  };
94 
95  /// Writes information about the object to a given stream.
96  MULTI_REGIONS_EXPORT std::ostream& operator<<(std::ostream& os, const GlobalLinSysKey& rhs);
97 
99  const
100  {
101  return m_solnType;
102  }
103 
104 
106  {
107  return m_varFactors.size();
108  }
109 
110  inline const Array<OneD, const NekDouble> &
112  &factor) const
113  {
114  ASSERTL1(m_varFactors.count(factor) > 0, "factor not found");
115  VarFactorsMap::const_iterator found = m_varFactors.find(factor);
116  return (*found).second;
117  }
118 
120  {
121  return m_varFactors;
122  }
123  } //end of namespace
124 } //end of namespace
125 
126 #endif
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
#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:54
static VarFactorsMap NullVarFactorsMap
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition: AssemblyMap.h:52
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:272
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:314
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:315
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:273
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1