MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_Constraint_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_CONSTRAINT_DECL_HPP
11#define MUELU_CONSTRAINT_DECL_HPP
12
13#include <Teuchos_SerialDenseMatrix.hpp>
14
15#include <Xpetra_MultiVector_fwd.hpp>
16#include <Xpetra_Matrix_fwd.hpp>
17#include <Xpetra_CrsGraph_fwd.hpp>
18
19#include "MueLu_ConfigDefs.hpp"
20#include "MueLu_BaseClass.hpp"
21
22namespace MueLu {
23
25
65template <class Scalar = DefaultScalar,
68 class Node = DefaultNode>
69class Constraint : public BaseClass {
70#undef MUELU_CONSTRAINT_SHORT
72 public:
78 using MagnitudeType = typename Teuchos::ScalarTraits<Scalar>::magnitudeType;
79
81
82
88 void Setup(const RCP<MultiVector>& B, const RCP<MultiVector>& Bc, RCP<const CrsGraph> Ppattern);
89
90 MagnitudeType ResidualNorm(const RCP<const Matrix> P) const;
91
93
95
96
98 void Apply(const Matrix& P, Matrix& Projected) const;
99
101
102 RCP<const CrsGraph> GetPattern() const {
103 return Ppattern_;
104 }
105
106 private:
107 RCP<MultiVector> B_;
108 RCP<MultiVector> Bc_;
109 RCP<MultiVector> X_;
110 RCP<const CrsGraph> Ppattern_;
111 ArrayRCP<Teuchos::SerialDenseMatrix<LO, SC> > XXtInv_;
112};
113
114} // namespace MueLu
115
116#define MUELU_CONSTRAINT_SHORT
117#endif // MUELU_CONSTRAINT_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Base class for MueLu classes.
Constraint space information for the potential prolongator.
ArrayRCP< Teuchos::SerialDenseMatrix< LO, SC > > XXtInv_
Array storing .
RCP< const CrsGraph > Ppattern_
Nonzero sparsity pattern.
typename Teuchos::ScalarTraits< Scalar >::magnitudeType MagnitudeType
RCP< MultiVector > X_
Overlapped coarse nullspace.
RCP< const CrsGraph > GetPattern() const
void Setup(const RCP< MultiVector > &B, const RCP< MultiVector > &Bc, RCP< const CrsGraph > Ppattern)
void Apply(const Matrix &P, Matrix &Projected) const
Apply constraint.
MagnitudeType ResidualNorm(const RCP< const Matrix > P) const
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar