Nektar++
GlobalMatrix.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: GlobalMatrix.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: GlobalMatrix header
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 #ifndef NEKTAR_LIB_MULTIREGIONS_GLOBALMATRIX_H
35 #define NEKTAR_LIB_MULTIREGIONS_GLOBALMATRIX_H
39 
40 namespace Nektar
41 {
42  namespace MultiRegions
43  {
44 
45  /// Represents a matrix of all degrees of freedom.
47  {
48  public:
50  typedef std::shared_ptr<DNekSmvBsrMat> DNekSmvBsrMatSharedPtr;
51 
52  /// Construct a new matrix.
55  unsigned int rows,
56  unsigned int columns,
57  const COOMatType &cooMat,
58  const MatrixStorage& matStorage = eFULL);
59 
61 
62 
63  /// Perform a matrix-vector multiply.
67 
68  MULTI_REGIONS_EXPORT unsigned long GetMulCallsCounter() const;
69  MULTI_REGIONS_EXPORT unsigned int GetNumNonZeroEntries() const;
70 
71  private:
72  /// Pointer to a double-precision Nektar++ sparse matrix.
73  DNekSmvBsrMatSharedPtr m_smvbsrmatrix;
74 
75  unsigned int m_rows;
78 
79  unsigned long m_mulCallsCounter;
80 
81  bool m_copyOp;
82 
83  static std::string def;
84  static std::string lookupIds[];
85  };
86 
87  /// Shared pointer to a GlobalMatrix object.
88  typedef std::shared_ptr<GlobalMatrix> GlobalMatrixSharedPtr;
89  /// Mapping from global matrix keys to global matrices.
90  typedef std::map<GlobalMatrixKey,GlobalMatrixSharedPtr> GlobalMatrixMap;
91  /// Shared pointer to a global matrix map.
92  typedef std::shared_ptr<GlobalMatrixMap> GlobalMatrixMapShPtr;
93 
94  } //end of namespace
95 } //end of namespace
96 
97 #endif
unsigned long GetMulCallsCounter() const
std::map< CoordType, NekDouble > COOMatType
std::map< GlobalMatrixKey, GlobalMatrixSharedPtr > GlobalMatrixMap
Mapping from global matrix keys to global matrices.
Definition: GlobalMatrix.h:90
Array< OneD, NekDouble > m_tmpout
Definition: GlobalMatrix.h:77
#define MULTI_REGIONS_EXPORT
static std::string lookupIds[]
Definition: GlobalMatrix.h:84
void Multiply(const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out)
Perform a matrix-vector multiply.
GlobalMatrix(const LibUtilities::SessionReaderSharedPtr &pSession, unsigned int rows, unsigned int columns, const COOMatType &cooMat, const MatrixStorage &matStorage=eFULL)
Construct a new matrix.
Represents a matrix of all degrees of freedom.
Definition: GlobalMatrix.h:46
Array< OneD, NekDouble > m_tmpin
Definition: GlobalMatrix.h:76
std::shared_ptr< GlobalMatrix > GlobalMatrixSharedPtr
Shared pointer to a GlobalMatrix object.
Definition: GlobalMatrix.h:88
NekSparseMatrix< StorageSmvBsr< NekDouble > > DNekSmvBsrMat
Definition: GlobalMatrix.h:49
std::shared_ptr< GlobalMatrixMap > GlobalMatrixMapShPtr
Shared pointer to a global matrix map.
Definition: GlobalMatrix.h:92
std::shared_ptr< DNekSmvBsrMat > DNekSmvBsrMatSharedPtr
Definition: GlobalMatrix.h:50
DNekSmvBsrMatSharedPtr m_smvbsrmatrix
Pointer to a double-precision Nektar++ sparse matrix.
Definition: GlobalMatrix.h:73
std::shared_ptr< SessionReader > SessionReaderSharedPtr
unsigned int GetNumNonZeroEntries() const