46#ifndef MUELU_MERGEDBLOCKEDMATRIXFACTORY_DEF_HPP_
47#define MUELU_MERGEDBLOCKEDMATRIXFACTORY_DEF_HPP_
49#include <Xpetra_BlockedCrsMatrix.hpp>
52#include "MueLu_PerfUtils.hpp"
54#include "MueLu_MergedBlockedMatrixFactory.hpp"
58template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
62template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
64 RCP<ParameterList> validParamList = rcp(
new ParameterList());
66 validParamList->set< RCP<const FactoryBase> >(
"A",
MueLu::NoFactory::getRCP(),
"Generating factory of the matrix A used for building SchurComplement (must be a 2x2 blocked operator, default = MueLu::NoFactory::getRCP())");
68 return validParamList;
72template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
74 Input(currentLevel,
"A");
77template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
81 Teuchos::RCP<Matrix> A = Get<RCP<Matrix> >(currentLevel,
"A");
83 RCP<BlockedCrsMatrix> bA = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(A);
84 TEUCHOS_TEST_FOR_EXCEPTION(bA == Teuchos::null,
Exceptions::BadCast,
"MueLu::MergedBlockedMatrixFactory::Build: input matrix A is not of type BlockedCrsMatrix! A generated by AFact_ must be a 2x2 block operator. error.");
86 Teuchos::RCP<Matrix> mergedA = bA->Merge();
92 Set(currentLevel,
"A", mergedA);
Exception indicating invalid cast attempted.
Timer to be used in factories. Similar to Monitor but with additional timers.
Class that holds all level-specific information.
MergedBlockedMatrixFactory()
void DeclareInput(Level ¤tLevel) const
Specifies the data that this class needs, and the factories that generate that data.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void Build(Level ¤tLevel) const
Build an object with this factory.
static const RCP< const NoFactory > getRCP()
Static Get() functions.
static std::string PrintMatrixInfo(const Matrix &A, const std::string &msgTag, RCP< const Teuchos::ParameterList > params=Teuchos::null)
Namespace for MueLu classes and methods.
@ Statistics1
Print more statistics.