MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_SparseConstraint_decl.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// MueLu: A package for multigrid based preconditioning
4//
5// Copyright 2012 NTESS and the MueLu contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef MUELU_SPARSECONSTRAINT_DECL_HPP
11#define MUELU_SPARSECONSTRAINT_DECL_HPP
12
13#include "Teuchos_ScalarTraits.hpp"
14
15#include <Xpetra_MultiVector_fwd.hpp>
16#include <Xpetra_Matrix.hpp>
17#include <Xpetra_CrsGraph_fwd.hpp>
18#include <Xpetra_MapFactory_fwd.hpp>
19
20#include "MueLu_ConfigDefs.hpp"
22#include "MueLu_Constraint.hpp"
23
24namespace MueLu {
25
26template <class Scalar = DefaultScalar,
29 class Node = DefaultNode>
31 : public Constraint<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
32#undef MUELU_SPARSECONSTRAINT_SHORT
34 public:
40 using MagnitudeType = typename Teuchos::ScalarTraits<Scalar>::magnitudeType;
41
43
44
45 SparseConstraint() = default;
46
53 SparseConstraint(const RCP<Matrix>& P_nodal, const RCP<Matrix>& D, const RCP<Matrix>& Dc, RCP<const CrsGraph> Ppattern, const std::string& solverType);
54
56
57 void Setup();
58
59 typename CrsGraph::local_graph_type FindBlocks(RCP<const CrsGraph>& /*XXt*/) override;
60
61 MagnitudeType ResidualNorm(RCP<const Matrix> P) const override;
62
63 void AssignMatrixEntriesToConstraintVector(const Matrix& A, MultiVector& vecC) const;
64
65 private:
67 RCP<Matrix> P_nodal_;
68
70 RCP<Matrix> D_;
71
73 RCP<Matrix> Dc_;
74 RCP<Matrix> big_Dc_;
75
77 RCP<const CrsGraph> RHS_pattern_;
78
80 Kokkos::View<bool*> block_is_singular_;
81};
82
83} // namespace MueLu
84
85#define MUELU_SPARSECONSTRAINT_SHORT
86#endif
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Constraint space information for the potential prolongator.
RCP< Matrix > P_nodal_
Nodal prolongator.
void AssignMatrixEntriesToConstraintVector(const Matrix &A, MultiVector &vecC) const
Kokkos::View< bool * > block_is_singular_
block_is_singular(i) indicates whether matrix for ith constraint is singular
RCP< Matrix > D_
Fine nullspace.
RCP< Matrix > Dc_
Coarse nullspace.
typename Teuchos::ScalarTraits< Scalar >::magnitudeType MagnitudeType
CrsGraph::local_graph_type FindBlocks(RCP< const CrsGraph > &) override
RCP< const CrsGraph > RHS_pattern_
Pattern for RHS.
MagnitudeType ResidualNorm(RCP< const Matrix > P) const override
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar