// @HEADER // ***************************************************************************** // MueLu: A package for multigrid based preconditioning // // Copyright 2012 NTESS and the MueLu contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef MUELU_CONSTRAINTFACTORY_DEF_HPP #define MUELU_CONSTRAINTFACTORY_DEF_HPP #include "MueLu_ConstraintFactory_decl.hpp" #include "MueLu_Constraint.hpp" #include "MueLu_Monitor.hpp" namespace MueLu { template RCP ConstraintFactory::GetValidParameterList() const { RCP validParamList = rcp(new ParameterList()); validParamList->set >("FineNullspace", Teuchos::null, "Generating factory for the nullspace"); validParamList->set >("CoarseNullspace", Teuchos::null, "Generating factory for the nullspace"); validParamList->set >("Ppattern", Teuchos::null, "Generating factory for the nonzero pattern"); return validParamList; } template void ConstraintFactory::DeclareInput(Level& fineLevel, Level& coarseLevel) const { Input(fineLevel, "Nullspace", "FineNullspace"); Input(coarseLevel, "Nullspace", "CoarseNullspace"); Input(coarseLevel, "Ppattern"); } template void ConstraintFactory::Build(Level& fineLevel, Level& coarseLevel) const { FactoryMonitor m(*this, "Constraint", coarseLevel); RCP fineNullspace = Get >(fineLevel, "Nullspace", "FineNullspace"); RCP coarseNullspace = Get >(coarseLevel, "Nullspace", "CoarseNullspace"); RCP constraint(new Constraint); constraint->Setup(*fineNullspace, *coarseNullspace, Get >(coarseLevel, "Ppattern")); Set(coarseLevel, "Constraint", constraint); } } // namespace MueLu #endif // MUELU_CONSTRAINTFACTORY_DEF_HPP