Tpetra parallel linear algebra Version of the Day
Loading...
Searching...
No Matches
TpetraExt_PointToBlockDiagPermute_decl.hpp
1// @HEADER
2// *****************************************************************************
3// TpetraExt: Tpetra Extended - Linear Algebra Services Package
4//
5// Copyright 2025 NTESS
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TPETRAEXT_POINTTOBLOCKDIAGPERMUTE_DECL_HPP
11#define TPETRAEXT_POINTTOBLOCKDIAGPERMUTE_DECL_HPP
12
13#include "Teuchos_ParameterList.hpp"
14#include "Teuchos_RCP.hpp"
15#include "Tpetra_CrsMatrix.hpp"
16#include "Tpetra_MultiVector.hpp"
17
18namespace Tpetra::Ext {
19
30template <class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
32 class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
33 class Node = ::Tpetra::Details::DefaultTypes::node_type>
35 public:
40
41 explicit PointToBlockDiagPermute(const crs_type& A);
42
43 virtual ~PointToBlockDiagPermute() = default;
44
45 int setParameters(Teuchos::ParameterList& list);
46 int compute();
47
48 Teuchos::RCP<crs_type> createCrsMatrix() const { return blockDiagMatrix_; }
49
50 private:
51 const crs_type* matrix_;
52 Teuchos::ParameterList list_;
53
54 bool purelyLocalMode_;
55 bool contiguousBlockMode_;
56 int contiguousBlockSize_;
57
58 int numBlocks_;
59 Teuchos::Array<int> blockStarts_;
60 Teuchos::Array<GlobalOrdinal> blockGids_;
61
62 Teuchos::RCP<const map_type> compatibleMap_;
63 Teuchos::RCP<crs_type> blockDiagMatrix_;
64
65 void cleanupBlockInfo();
66 int setupContiguousMode();
67 int extractBlockDiagonal();
68};
69
70} // namespace Tpetra::Ext
71
72#endif
Sparse matrix that presents a row-oriented interface that lets users read or modify entries.
Struct that holds views of the contents of a CrsMatrix.
Tpetra analogue of EpetraExt_PointToBlockDiagPermute.
int local_ordinal_type
Default value of Scalar template parameter.
Namespace for external Tpetra functionality.