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
41{
42
43/// Represents a matrix of all degrees of freedom.
45{
46public:
48 typedef std::shared_ptr<DNekSmvBsrMat> DNekSmvBsrMatSharedPtr;
49
50 /// Construct a new matrix.
52 const LibUtilities::SessionReaderSharedPtr &pSession, unsigned int rows,
53 unsigned int columns, const COOMatType &cooMat,
54 const MatrixStorage &matStorage = eFULL);
55
57 {
58 }
59
60 /// Perform a matrix-vector multiply.
63
64 MULTI_REGIONS_EXPORT unsigned long GetMulCallsCounter() const;
65 MULTI_REGIONS_EXPORT unsigned int GetNumNonZeroEntries() const;
66
67private:
68 /// Pointer to a double-precision Nektar++ sparse matrix.
70
71 unsigned int m_rows;
74
75 unsigned long m_mulCallsCounter;
76
78
79 static std::string def;
80 static std::string lookupIds[];
81};
82
83/// Shared pointer to a GlobalMatrix object.
84typedef std::shared_ptr<GlobalMatrix> GlobalMatrixSharedPtr;
85/// Mapping from global matrix keys to global matrices.
86typedef std::map<GlobalMatrixKey, GlobalMatrixSharedPtr> GlobalMatrixMap;
87/// Shared pointer to a global matrix map.
88typedef std::shared_ptr<GlobalMatrixMap> GlobalMatrixMapShPtr;
89
90} // namespace Nektar::MultiRegions
91
92#endif
#define MULTI_REGIONS_EXPORT
Represents a matrix of all degrees of freedom.
Definition: GlobalMatrix.h:45
static std::string lookupIds[]
Definition: GlobalMatrix.h:80
GlobalMatrix(const LibUtilities::SessionReaderSharedPtr &pSession, unsigned int rows, unsigned int columns, const COOMatType &cooMat, const MatrixStorage &matStorage=eFULL)
Construct a new matrix.
DNekSmvBsrMatSharedPtr m_smvbsrmatrix
Pointer to a double-precision Nektar++ sparse matrix.
Definition: GlobalMatrix.h:69
std::shared_ptr< DNekSmvBsrMat > DNekSmvBsrMatSharedPtr
Definition: GlobalMatrix.h:48
NekSparseMatrix< StorageSmvBsr< NekDouble > > DNekSmvBsrMat
Definition: GlobalMatrix.h:47
Array< OneD, NekDouble > m_tmpout
Definition: GlobalMatrix.h:73
unsigned long GetMulCallsCounter() const
unsigned int GetNumNonZeroEntries() const
Array< OneD, NekDouble > m_tmpin
Definition: GlobalMatrix.h:72
void Multiply(const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out)
Perform a matrix-vector multiply.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< GlobalMatrix > GlobalMatrixSharedPtr
Shared pointer to a GlobalMatrix object.
Definition: GlobalMatrix.h:84
std::map< GlobalMatrixKey, GlobalMatrixSharedPtr > GlobalMatrixMap
Mapping from global matrix keys to global matrices.
Definition: GlobalMatrix.h:86
std::shared_ptr< GlobalMatrixMap > GlobalMatrixMapShPtr
Shared pointer to a global matrix map.
Definition: GlobalMatrix.h:88
std::map< CoordType, NekDouble > COOMatType