26 RCP<ParameterList> validParamList = rcp(
new ParameterList());
28 validParamList->set<RCP<const FactoryBase>>(
"A", Teuchos::null,
"Generating factory of the matrix A");
29 validParamList->set<RCP<const FactoryBase>>(
"Aggregates", Teuchos::null,
"Generating factory of the aggregates");
30 validParamList->set<RCP<const FactoryBase>>(
"Nullspace", Teuchos::null,
"Generating factory of the nullspace");
31 validParamList->set<RCP<const FactoryBase>>(
"Scaled Nullspace", Teuchos::null,
"Generating factory of the scaled nullspace");
32 validParamList->set<RCP<const FactoryBase>>(
"UnAmalgamationInfo", Teuchos::null,
"Generating factory of UnAmalgamationInfo");
33 validParamList->set<RCP<const FactoryBase>>(
"CoarseMap", Teuchos::null,
"Generating factory of the coarse map");
34 validParamList->set<RCP<const FactoryBase>>(
"Coordinates", Teuchos::null,
"Generating factory of the coordinates");
37 ParameterList norecurse;
38 norecurse.disableRecursiveValidation();
39 validParamList->set<ParameterList>(
"matrixmatrix: kernel params", norecurse,
"MatrixMatrix kernel parameters");
41 return validParamList;
66 const ParameterList& pL = GetParameterList();
67 std::string nspName =
"Nullspace";
68 if (pL.isParameter(
"Nullspace name")) nspName = pL.get<std::string>(
"Nullspace name");
70 auto aggregates = Get<RCP<Aggregates>>(fineLevel,
"Aggregates");
71 auto amalgInfo = Get<RCP<AmalgamationInfo>>(fineLevel,
"UnAmalgamationInfo");
72 auto fineNullspace = Get<RCP<MultiVector>>(fineLevel, nspName);
73 auto coarseMap = Get<RCP<const Map>>(fineLevel,
"CoarseMap");
74 Teuchos::RCP<const Map> fineMap = fineNullspace->getMap();
77 if (aggregates->AggregatesCrossProcessors())
78 TEUCHOS_TEST_FOR_EXCEPTION(
true,
Exceptions::RuntimeError,
"MatrixFreeTentativePFactory does not support aggregates that cross processors!");
80 size_t NSDim = fineNullspace->getNumVectors();
81 RCP<MultiVector> coarseNullspace = MultiVectorFactory::Build(coarseMap, NSDim);
84 P->apply(*fineNullspace, *coarseNullspace, Teuchos::TRANS, 1.0, 0.0);
86 Set(coarseLevel,
"Nullspace", coarseNullspace);
87 Set(coarseLevel,
"P", P);