24 RCP<ParameterList> validParamList = rcp(
new ParameterList());
26#define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
28 validParamList->getEntry(
"emin: constraint type").setValidator(rcp(
new Teuchos::StringValidator(Teuchos::tuple<std::string>(
"nullspace",
"maxwell"))));
31 validParamList->getEntry(
"emin: least squares solver type").setValidator(rcp(
new Teuchos::StringValidator(Teuchos::tuple<std::string>(
"Belos",
"direct"))));
34 validParamList->set<RCP<const FactoryBase>>(
"FineNullspace", Teuchos::null,
"Generating factory for the nullspace");
35 validParamList->set<RCP<const FactoryBase>>(
"CoarseNullspace", Teuchos::null,
"Generating factory for the nullspace");
36 validParamList->set<RCP<const FactoryBase>>(
"Ppattern", Teuchos::null,
"Generating factory for the nonzero pattern");
38 return validParamList;
52 auto Ppattern = Get<RCP<const CrsGraph>>(coarseLevel,
"Ppattern");
53 RCP<Constraint> constraint;
54 const ParameterList& pL = GetParameterList();
56 std::string solverType = pL.get<std::string>(
"emin: least squares solver type");
58 if (pL.get<std::string>(
"emin: constraint type") ==
"nullspace") {
59 RCP<MultiVector> fineNullspace = Get<RCP<MultiVector>>(fineLevel,
"Nullspace",
"FineNullspace");
60 RCP<MultiVector> coarseNullspace = Get<RCP<MultiVector>>(coarseLevel,
"Nullspace",
"CoarseNullspace");
63 constraint = rcp(
new DenseConstraint(fineNullspace, coarseNullspace, Ppattern, solverType));
66 TEUCHOS_ASSERT(
false);
69 Set(coarseLevel,
"Constraint", constraint);