47 namespace MultiRegions
49 std::string GlobalMatrix::def = LibUtilities::SessionReader::
50 RegisterDefaultSolverInfo(
"GlobalMatrixStorageType",
"SmvBSR");
51 std::string GlobalMatrix::lookupIds[3] = {
52 LibUtilities::SessionReader::RegisterEnumValue(
68 GlobalMatrix::GlobalMatrix(
79 GetSolverInfoAsEnum<MatrixStorageType>(
"GlobalMatrixStorageType");
81 unsigned int brows, bcols;
91 if(pSession->DefinesParameter(
"SparseBlockSize"))
93 pSession->LoadParameter(
"SparseBlockSize", block_size);
94 ASSERTL1(block_size > 0,
"SparseBlockSize parameter must to be positive");
97 brows = rows / block_size + (rows % block_size > 0);
98 bcols = columns / block_size + (columns % block_size > 0);
100 if (rows % block_size > 0)
m_copyOp =
true;
120 brows, bcols, block_size, bcoMat, matStorage );
135 cout <<
"Global matrix storage type: "
137 std::cout <<
"Global matrix memory, bytes = " << matBytes;
138 if (matBytes/(1024*1024) > 0)
140 std::cout <<
" ("<< matBytes/(1024*1024) <<
" MB)" << std::endl;
144 std::cout <<
" ("<< matBytes/1024 <<
" KB)" << std::endl;
146 std::cout <<
"Sparse storage block size = " << block_size << std::endl;
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
unsigned long m_mulCallsCounter
DNekSmvBsrMatSharedPtr m_smvbsrmatrix
Pointer to a double-precision Nektar++ sparse matrix.
Array< OneD, NekDouble > m_tmpout
unsigned long GetMulCallsCounter() const
unsigned int GetNumNonZeroEntries() const
Array< OneD, NekDouble > m_tmpin
void Multiply(const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out)
Perform a matrix-vector multiply.
std::shared_ptr< SparseStorageType > SparseStorageSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
const char *const MatrixStorageTypeMap[]
The above copyright notice and this permission notice shall be included.
void convertCooToBco(const unsigned int blkDim, const COOMatType &cooMat, BCOMatType &bcoMat)
std::map< CoordType, NekDouble > COOMatType
std::map< CoordType, BCOEntryType > BCOMatType
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)