45 #ifndef MUELU_PARAMETERLISTINTERPRETER_DEF_HPP
46 #define MUELU_PARAMETERLISTINTERPRETER_DEF_HPP
59 #include "MueLu_Hierarchy.hpp"
60 #include "MueLu_FactoryManager.hpp"
62 #include "MueLu_AggregationExportFactory.hpp"
63 #include "MueLu_AggregateQualityEstimateFactory.hpp"
64 #include "MueLu_BrickAggregationFactory.hpp"
65 #include "MueLu_ClassicalMapFactory.hpp"
66 #include "MueLu_ClassicalPFactory.hpp"
67 #include "MueLu_CoalesceDropFactory.hpp"
68 #include "MueLu_CoarseMapFactory.hpp"
69 #include "MueLu_ConstraintFactory.hpp"
70 #include "MueLu_CoordinatesTransferFactory.hpp"
71 #include "MueLu_DirectSolver.hpp"
72 #include "MueLu_EminPFactory.hpp"
74 #include "MueLu_FacadeClassFactory.hpp"
75 #include "MueLu_FactoryFactory.hpp"
76 #include "MueLu_FilteredAFactory.hpp"
77 #include "MueLu_GenericRFactory.hpp"
78 #include "MueLu_InitialBlockNumberFactory.hpp"
79 #include "MueLu_LineDetectionFactory.hpp"
80 #include "MueLu_LocalOrdinalTransferFactory.hpp"
81 #include "MueLu_NotayAggregationFactory.hpp"
82 #include "MueLu_NullspaceFactory.hpp"
83 #include "MueLu_PatternFactory.hpp"
84 #include "MueLu_ReplicatePFactory.hpp"
85 #include "MueLu_CombinePFactory.hpp"
86 #include "MueLu_PgPFactory.hpp"
87 #include "MueLu_RAPFactory.hpp"
88 #include "MueLu_RAPShiftFactory.hpp"
89 #include "MueLu_RebalanceAcFactory.hpp"
90 #include "MueLu_RebalanceTransferFactory.hpp"
91 #include "MueLu_RepartitionFactory.hpp"
92 #include "MueLu_ReitzingerPFactory.hpp"
93 #include "MueLu_SaPFactory.hpp"
94 #include "MueLu_ScaledNullspaceFactory.hpp"
95 #include "MueLu_SemiCoarsenPFactory.hpp"
96 #include "MueLu_SmootherFactory.hpp"
97 #include "MueLu_SmooVecCoalesceDropFactory.hpp"
98 #include "MueLu_TentativePFactory.hpp"
99 #include "MueLu_TogglePFactory.hpp"
100 #include "MueLu_ToggleCoordinatesTransferFactory.hpp"
101 #include "MueLu_TransPFactory.hpp"
102 #include "MueLu_UncoupledAggregationFactory.hpp"
103 #include "MueLu_ZoltanInterface.hpp"
104 #include "MueLu_Zoltan2Interface.hpp"
105 #include "MueLu_NodePartitionInterface.hpp"
106 #include "MueLu_LowPrecisionFactory.hpp"
108 #include "MueLu_CoalesceDropFactory_kokkos.hpp"
109 #include "MueLu_SemiCoarsenPFactory_kokkos.hpp"
110 #include "MueLu_TentativePFactory_kokkos.hpp"
112 #ifdef HAVE_MUELU_MATLAB
113 #include "../matlab/src/MueLu_MatlabSmoother_decl.hpp"
114 #include "../matlab/src/MueLu_MatlabSmoother_def.hpp"
115 #include "../matlab/src/MueLu_TwoLevelMatlabFactory_decl.hpp"
116 #include "../matlab/src/MueLu_TwoLevelMatlabFactory_def.hpp"
117 #include "../matlab/src/MueLu_SingleLevelMatlabFactory_decl.hpp"
118 #include "../matlab/src/MueLu_SingleLevelMatlabFactory_def.hpp"
121 #ifdef HAVE_MUELU_INTREPID2
122 #include "MueLu_IntrepidPCoarsenFactory.hpp"
125 #include <unordered_set>
129 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
131 : factFact_(factFact) {
133 if (facadeFact == Teuchos::null)
139 std::string filename = paramList.
get(
"xml parameter file",
"");
140 if (filename.length() != 0) {
156 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
158 : factFact_(factFact) {
160 if (facadeFact == Teuchos::null)
170 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
179 SetFactoryParameterList(paramList);
181 }
else if (paramList.
isParameter(
"MueLu preconditioner") ==
true) {
182 this->GetOStream(
Runtime0) <<
"Use facade class: " << paramList.
get<std::string>(
"MueLu preconditioner") << std::endl;
184 SetFactoryParameterList(*pp);
191 Validate(serialList);
192 SetEasyParameterList(paramList);
205 #define MUELU_SET_VAR_2LIST(paramList, defaultList, paramName, paramType, varName) \
207 if (paramList.isParameter(paramName)) \
208 varName = paramList.get<paramType>(paramName); \
209 else if (defaultList.isParameter(paramName)) \
210 varName = defaultList.get<paramType>(paramName); \
212 varName = MasterList::getDefault<paramType>(paramName);
214 #define MUELU_TEST_AND_SET_VAR(paramList, paramName, paramType, varName) \
215 (paramList.isParameter(paramName) ? varName = paramList.get<paramType>(paramName), true : false)
219 #define MUELU_TEST_AND_SET_PARAM_2LIST(paramList, defaultList, paramName, paramType, listWrite) \
221 if (paramList.isParameter(paramName)) \
222 listWrite.set(paramName, paramList.get<paramType>(paramName)); \
223 else if (defaultList.isParameter(paramName)) \
224 listWrite.set(paramName, defaultList.get<paramType>(paramName)); \
225 } catch (Teuchos::Exceptions::InvalidParameterType&) { \
226 TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(true, Teuchos::Exceptions::InvalidParameterType, \
227 "Error: parameter \"" << paramName << "\" must be of type " << Teuchos::TypeNameTraits<paramType>::name()); \
230 #define MUELU_TEST_PARAM_2LIST(paramList, defaultList, paramName, paramType, cmpValue) \
231 (cmpValue == (paramList.isParameter(paramName) ? paramList.get<paramType>(paramName) : (defaultList.isParameter(paramName) ? defaultList.get<paramType>(paramName) : MasterList::getDefault<paramType>(paramName))))
233 #define MUELU_KOKKOS_FACTORY(varName, oldFactory, newFactory) \
234 RCP<Factory> varName; \
236 varName = rcp(new oldFactory()); \
238 varName = rcp(new newFactory());
239 #define MUELU_KOKKOS_FACTORY_NO_DECL(varName, oldFactory, newFactory) \
241 varName = rcp(new oldFactory()); \
243 varName = rcp(new newFactory());
245 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
250 MUELU_SET_VAR_2LIST(constParamList, constParamList,
"problem: type", std::string, problemType);
251 if (problemType !=
"unknown") {
257 paramList = constParamList;
261 useKokkos_ = !Node::is_serial;
267 Factory::EnableTimerSync();
271 std::map<std::string, CycleType> cycleMap;
275 auto cycleType = paramList.
get<std::string>(
"cycle type");
277 "Invalid cycle type: \"" << cycleType <<
"\"");
278 Cycle_ = cycleMap[cycleType];
281 if (paramList.
isParameter(
"W cycle start level")) {
282 WCycleStartLevel_ = paramList.
get<
int>(
"W cycle start level");
285 if (paramList.
isParameter(
"coarse grid correction scaling factor"))
286 scalingFactor_ = paramList.
get<
double>(
"coarse grid correction scaling factor");
288 this->maxCoarseSize_ = paramList.
get<
int>(
"coarse: max size", MasterList::getDefault<int>(
"coarse: max size"));
289 this->numDesiredLevel_ = paramList.
get<
int>(
"max levels", MasterList::getDefault<int>(
"max levels"));
290 blockSize_ = paramList.
get<
int>(
"number of equations", MasterList::getDefault<int>(
"number of equations"));
296 this->dataToSave_ = Teuchos::getArrayFromStringParameter<std::string>(paramList,
"save data");
299 if (paramList.
isSublist(
"export data")) {
304 this->nullspaceToPrint_ = Teuchos::getArrayFromStringParameter<int>(printList,
"Nullspace");
306 this->coordinatesToPrint_ = Teuchos::getArrayFromStringParameter<int>(printList,
"Coordinates");
308 this->aggregatesToPrint_ = Teuchos::getArrayFromStringParameter<int>(printList,
"Aggregates");
309 if (printList.
isParameter(
"pcoarsen: element to node map"))
310 this->elementToNodeMapsToPrint_ = Teuchos::getArrayFromStringParameter<int>(printList,
"pcoarsen: element to node map");
314 const std::string& name = printList.
name(
iter);
316 if (name ==
"Nullspace" || name ==
"Coordinates" || name ==
"Aggregates" || name ==
"pcoarsen: element to node map")
319 this->matricesToPrint_[name] = Teuchos::getArrayFromStringParameter<int>(printList, name);
332 if (outputFilename !=
"")
342 useCoordinates_ =
false;
343 useBlockNumber_ =
false;
344 if (
MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"distance laplacian") ||
347 useCoordinates_ =
true;
348 }
else if (
MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal distance laplacian")) {
349 useCoordinates_ =
true;
350 useBlockNumber_ =
true;
351 }
else if (
MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal") ||
352 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal classical") ||
353 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal signed classical") ||
354 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal colored signed classical") ||
355 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"signed classical")) {
356 useBlockNumber_ =
true;
357 }
else if (paramList.
isSublist(
"smoother: params")) {
358 const auto smooParamList = paramList.
sublist(
"smoother: params");
359 if (smooParamList.isParameter(
"partitioner: type") &&
360 (smooParamList.get<std::string>(
"partitioner: type") ==
"line")) {
361 useCoordinates_ =
true;
364 for (
int levelID = 0; levelID < this->numDesiredLevel_; levelID++) {
365 std::string levelStr =
"level " +
toString(levelID);
370 if (
MUELU_TEST_PARAM_2LIST(levelList, paramList,
"aggregation: drop scheme", std::string,
"distance laplacian") ||
373 useCoordinates_ =
true;
374 }
else if (
MUELU_TEST_PARAM_2LIST(levelList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal distance laplacian")) {
375 useCoordinates_ =
true;
376 useBlockNumber_ =
true;
377 }
else if (
MUELU_TEST_PARAM_2LIST(levelList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal") ||
378 MUELU_TEST_PARAM_2LIST(levelList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal classical") ||
379 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal signed classical") ||
380 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal colored signed classical") ||
381 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"signed classical")) {
382 useBlockNumber_ =
true;
393 }
else if (!paramList.
isSublist(
"repartition: params")) {
394 useCoordinates_ =
true;
397 if (repParams.
isType<std::string>(
"algorithm")) {
398 const std::string algo = repParams.
get<std::string>(
"algorithm");
399 if (algo ==
"multijagged" || algo ==
"rcb") {
400 useCoordinates_ =
true;
403 useCoordinates_ =
true;
407 for (
int levelID = 0; levelID < this->numDesiredLevel_; levelID++) {
408 std::string levelStr =
"level " +
toString(levelID);
414 if (!levelList.
isSublist(
"repartition: params")) {
415 useCoordinates_ =
true;
419 if (repParams.
isType<std::string>(
"algorithm")) {
420 const std::string algo = repParams.
get<std::string>(
"algorithm");
421 if (algo ==
"multijagged" || algo ==
"rcb") {
422 useCoordinates_ =
true;
426 useCoordinates_ =
true;
435 changedPRrebalance_ =
false;
436 changedPRViaCopyrebalance_ =
false;
438 changedPRrebalance_ =
MUELU_TEST_AND_SET_VAR(paramList,
"repartition: rebalance P and R",
bool, this->doPRrebalance_);
439 changedPRViaCopyrebalance_ =
MUELU_TEST_AND_SET_VAR(paramList,
"repartition: explicit via new copy rebalance P and R",
bool, this->doPRViaCopyrebalance_);
443 changedImplicitTranspose_ =
MUELU_TEST_AND_SET_VAR(paramList,
"transpose: use implicit",
bool, this->implicitTranspose_);
446 (void)
MUELU_TEST_AND_SET_VAR(paramList,
"fuse prolongation and update",
bool, this->fuseProlongationAndUpdate_);
449 (void)
MUELU_TEST_AND_SET_VAR(paramList,
"nullspace: suppress dimension check",
bool, this->suppressNullspaceDimensionCheck_);
451 if (paramList.
isSublist(
"matvec params"))
452 this->matvecParams_ = Teuchos::parameterList(paramList.
sublist(
"matvec params"));
461 std::vector<keep_pair> keeps0;
462 UpdateFactoryManager(paramList,
ParameterList(), *defaultManager, 0 , keeps0);
468 for (
int levelID = 0; levelID < this->numDesiredLevel_; levelID++) {
477 std::vector<keep_pair> keeps;
481 UpdateFactoryManager(levelList, paramList, *levelManager, levelID, keeps);
485 UpdateFactoryManager(levelList, paramList, *levelManager, levelID, keeps);
488 this->keep_[levelID] = keeps;
489 this->AddFactoryManager(levelID, 1, levelManager);
499 this->GetOStream(static_cast<MsgType>(
Runtime1), 0) << paramList << std::endl;
514 for (
int levelID = 0; levelID < this->numDesiredLevel_; levelID++) {
515 std::string levelStr =
"level " +
toString(levelID);
530 std::ostringstream unusedParamsStream;
532 unusedParamList.
print(unusedParamsStream, indent);
534 this->GetOStream(
Warnings1) <<
"The following parameters were not used:\n"
535 << unusedParamsStream.str() << std::endl;
545 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
548 int levelID, std::vector<keep_pair>& keeps)
const {
552 using strings = std::unordered_set<std::string>;
562 MUELU_SET_VAR_2LIST(paramList, defaultList,
"multigrid algorithm", std::string, multigridAlgo);
563 TEUCHOS_TEST_FOR_EXCEPTION(strings({
"unsmoothed",
"sa",
"pg",
"emin",
"matlab",
"pcoarsen",
"classical",
"smoothed reitzinger",
"unsmoothed reitzinger",
"replicate",
"combine"}).count(multigridAlgo) == 0,
564 Exceptions::RuntimeError,
"Unknown \"multigrid algorithm\" value: \"" << multigridAlgo <<
"\". Please consult User's Guide.");
565 #ifndef HAVE_MUELU_MATLAB
567 "Cannot use matlab for multigrid algorithm - MueLu was not configured with MATLAB support.");
569 #ifndef HAVE_MUELU_INTREPID2
571 "Cannot use IntrepidPCoarsen prolongator factory - MueLu was not configured with Intrepid support.");
576 if (reuseType ==
"none" || reuseType ==
"S" || reuseType ==
"RP" || reuseType ==
"RAP") {
579 }
else if (reuseType ==
"tP" && (multigridAlgo !=
"sa" && multigridAlgo !=
"unsmoothed")) {
581 this->GetOStream(
Warnings0) <<
"Ignoring \"tP\" reuse option as it is only compatible with \"sa\", "
582 "or \"unsmoothed\" multigrid algorithms"
585 }
else if (reuseType ==
"emin" && multigridAlgo !=
"emin") {
587 this->GetOStream(
Warnings0) <<
"Ignoring \"emin\" reuse option it is only compatible with "
588 "\"emin\" multigrid algorithm"
594 bool have_userP =
false;
599 UpdateFactoryManager_CoarseSolvers(paramList, defaultList, manager, levelID, keeps);
602 UpdateFactoryManager_Smoothers(paramList, defaultList, manager, levelID, keeps);
606 UpdateFactoryManager_BlockNumber(paramList, defaultList, manager, levelID, keeps);
609 if (multigridAlgo ==
"unsmoothed reitzinger" || multigridAlgo ==
"smoothed reitzinger")
610 UpdateFactoryManager_Reitzinger(paramList, defaultList, manager, levelID, keeps);
612 UpdateFactoryManager_Aggregation_TentativeP(paramList, defaultList, manager, levelID, keeps);
616 UpdateFactoryManager_Nullspace(paramList, defaultList, manager, levelID, keeps, nullSpaceFactory);
627 }
else if (multigridAlgo ==
"unsmoothed" || multigridAlgo ==
"unsmoothed reitzinger") {
631 }
else if (multigridAlgo ==
"classical") {
635 }
else if (multigridAlgo ==
"sa" || multigridAlgo ==
"smoothed reitzinger") {
637 UpdateFactoryManager_SA(paramList, defaultList, manager, levelID, keeps);
639 }
else if (multigridAlgo ==
"emin") {
641 UpdateFactoryManager_Emin(paramList, defaultList, manager, levelID, keeps);
643 }
else if (multigridAlgo ==
"replicate") {
644 UpdateFactoryManager_Replicate(paramList, defaultList, manager, levelID, keeps);
646 }
else if (multigridAlgo ==
"combine") {
647 UpdateFactoryManager_Combine(paramList, defaultList, manager, levelID, keeps);
649 }
else if (multigridAlgo ==
"pg") {
651 UpdateFactoryManager_PG(paramList, defaultList, manager, levelID, keeps);
653 }
else if (multigridAlgo ==
"matlab") {
655 UpdateFactoryManager_Matlab(paramList, defaultList, manager, levelID, keeps);
657 }
else if (multigridAlgo ==
"pcoarsen") {
659 UpdateFactoryManager_PCoarsen(paramList, defaultList, manager, levelID, keeps);
663 UpdateFactoryManager_SemiCoarsen(paramList, defaultList, manager, levelID, keeps);
666 UpdateFactoryManager_Restriction(paramList, defaultList, manager, levelID, keeps);
669 UpdateFactoryManager_RAP(paramList, defaultList, manager, levelID, keeps);
672 UpdateFactoryManager_LocalOrdinalTransfer(
"BlockNumber", multigridAlgo, paramList, defaultList, manager, levelID, keeps);
675 UpdateFactoryManager_Coordinates(paramList, defaultList, manager, levelID, keeps);
678 if ((reuseType ==
"RP" || reuseType ==
"RAP" || reuseType ==
"full") && levelID)
681 if (reuseType ==
"RP" && levelID) {
683 if (!this->implicitTranspose_)
686 if ((reuseType ==
"tP" || reuseType ==
"RP" || reuseType ==
"emin") && useCoordinates_ && levelID)
690 UpdateFactoryManager_Repartition(paramList, defaultList, manager, levelID, keeps, nullSpaceFactory);
693 UpdateFactoryManager_LowPrecision(paramList, defaultList, manager, levelID, keeps);
696 if ((reuseType ==
"RAP" || reuseType ==
"full") && levelID) {
698 if (!this->implicitTranspose_)
711 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
714 FactoryManager& manager,
int levelID, std::vector<keep_pair>& keeps)
const {
715 MUELU_SET_VAR_2LIST(paramList, defaultList,
"multigrid algorithm", std::string, multigridAlgo);
717 bool useMaxAbsDiagonalScaling =
false;
718 if (defaultList.
isParameter(
"sa: use rowsumabs diagonal scaling"))
719 useMaxAbsDiagonalScaling = defaultList.
get<
bool>(
"sa: use rowsumabs diagonal scaling");
723 bool isCustomSmoother =
726 paramList.
isSublist(
"smoother: params") || paramList.
isSublist(
"smoother: pre params") || paramList.
isSublist(
"smoother: post params") ||
732 manager.
SetFactory(
"Smoother", Teuchos::null);
734 }
else if (isCustomSmoother) {
738 #define TEST_MUTUALLY_EXCLUSIVE(arg1, arg2) \
739 TEUCHOS_TEST_FOR_EXCEPTION(paramList.isParameter(#arg1) && paramList.isParameter(#arg2), \
740 Exceptions::InvalidArgument, "You cannot specify both \"" #arg1 "\" and \"" #arg2 "\"");
741 #define TEST_MUTUALLY_EXCLUSIVE_S(arg1, arg2) \
742 TEUCHOS_TEST_FOR_EXCEPTION(paramList.isSublist(#arg1) && paramList.isSublist(#arg2), \
743 Exceptions::InvalidArgument, "You cannot specify both \"" #arg1 "\" and \"" #arg2 "\"");
759 defaultSmootherParams.
set(
"relaxation: type",
"Symmetric Gauss-Seidel");
764 std::string preSmootherType, postSmootherType;
768 overlap = paramList.
get<
int>(
"smoother: overlap");
772 preSmootherType = paramList.
get<std::string>(
"smoother: pre type");
774 MUELU_SET_VAR_2LIST(paramList, defaultList,
"smoother: type", std::string, preSmootherTypeTmp);
775 preSmootherType = preSmootherTypeTmp;
777 if (paramList.
isParameter(
"smoother: pre overlap"))
778 overlap = paramList.
get<
int>(
"smoother: pre overlap");
780 if (paramList.
isSublist(
"smoother: pre params"))
781 preSmootherParams = paramList.
sublist(
"smoother: pre params");
782 else if (paramList.
isSublist(
"smoother: params"))
783 preSmootherParams = paramList.
sublist(
"smoother: params");
784 else if (defaultList.
isSublist(
"smoother: params"))
785 preSmootherParams = defaultList.
sublist(
"smoother: params");
786 else if (preSmootherType ==
"RELAXATION")
787 preSmootherParams = defaultSmootherParams;
789 if (preSmootherType ==
"CHEBYSHEV" && useMaxAbsDiagonalScaling)
790 preSmootherParams.
set(
"chebyshev: use rowsumabs diagonal scaling",
true);
792 #ifdef HAVE_MUELU_INTREPID2
794 if (multigridAlgo ==
"pcoarsen" && preSmootherType ==
"TOPOLOGICAL" &&
798 auto pcoarsen_schedule = Teuchos::getArrayFromStringParameter<int>(defaultList,
"pcoarsen: schedule");
799 auto pcoarsen_element = defaultList.
get<std::string>(
"pcoarsen: element");
801 if (levelID < (
int)pcoarsen_schedule.size()) {
803 auto lo = pcoarsen_element + std::to_string(pcoarsen_schedule[levelID]);
804 preSmootherParams.
set(
"pcoarsen: hi basis", lo);
809 #ifdef HAVE_MUELU_MATLAB
810 if (preSmootherType ==
"matlab")
819 postSmootherType = paramList.
get<std::string>(
"smoother: post type");
821 MUELU_SET_VAR_2LIST(paramList, defaultList,
"smoother: type", std::string, postSmootherTypeTmp);
822 postSmootherType = postSmootherTypeTmp;
825 if (paramList.
isSublist(
"smoother: post params"))
826 postSmootherParams = paramList.
sublist(
"smoother: post params");
827 else if (paramList.
isSublist(
"smoother: params"))
828 postSmootherParams = paramList.
sublist(
"smoother: params");
829 else if (defaultList.
isSublist(
"smoother: params"))
830 postSmootherParams = defaultList.
sublist(
"smoother: params");
831 else if (postSmootherType ==
"RELAXATION")
832 postSmootherParams = defaultSmootherParams;
833 if (paramList.
isParameter(
"smoother: post overlap"))
834 overlap = paramList.
get<
int>(
"smoother: post overlap");
836 if (postSmootherType ==
"CHEBYSHEV" && useMaxAbsDiagonalScaling)
837 postSmootherParams.
set(
"chebyshev: use rowsumabs diagonal scaling",
true);
839 if (postSmootherType == preSmootherType &&
areSame(preSmootherParams, postSmootherParams))
840 postSmoother = preSmoother;
842 #ifdef HAVE_MUELU_INTREPID2
844 if (multigridAlgo ==
"pcoarsen" && preSmootherType ==
"TOPOLOGICAL" &&
848 auto pcoarsen_schedule = Teuchos::getArrayFromStringParameter<int>(defaultList,
"pcoarsen: schedule");
849 auto pcoarsen_element = defaultList.
get<std::string>(
"pcoarsen: element");
851 if (levelID < (
int)pcoarsen_schedule.size()) {
853 auto lo = pcoarsen_element + std::to_string(pcoarsen_schedule[levelID]);
854 postSmootherParams.
set(
"pcoarsen: hi basis", lo);
859 #ifdef HAVE_MUELU_MATLAB
860 if (postSmootherType ==
"matlab")
868 if (preSmoother == postSmoother)
871 manager.
SetFactory(
"PreSmoother", preSmoother);
872 manager.
SetFactory(
"PostSmoother", postSmoother);
879 bool reuseSmoothers = (reuseType ==
"S" || reuseType !=
"none");
880 if (reuseSmoothers) {
881 auto preSmootherFactory = rcp_const_cast<
Factory>(rcp_dynamic_cast<
const Factory>(manager.
GetFactory(
"PreSmoother")));
883 if (preSmootherFactory != Teuchos::null) {
885 postSmootherFactoryParams.
set(
"keep smoother data",
true);
886 preSmootherFactory->SetParameterList(postSmootherFactoryParams);
888 keeps.push_back(
keep_pair(
"PreSmoother data", preSmootherFactory.get()));
891 auto postSmootherFactory = rcp_const_cast<Factory>(rcp_dynamic_cast<
const Factory>(manager.
GetFactory(
"PostSmoother")));
892 if (postSmootherFactory != Teuchos::null) {
894 postSmootherFactoryParams.
set(
"keep smoother data",
true);
895 postSmootherFactory->SetParameterList(postSmootherFactoryParams);
897 keeps.push_back(
keep_pair(
"PostSmoother data", postSmootherFactory.get()));
900 auto coarseFactory = rcp_const_cast<Factory>(rcp_dynamic_cast<
const Factory>(manager.
GetFactory(
"CoarseSolver")));
901 if (coarseFactory != Teuchos::null) {
903 coarseFactoryParams.
set(
"keep smoother data",
true);
904 coarseFactory->SetParameterList(coarseFactoryParams);
906 keeps.push_back(
keep_pair(
"PreSmoother data", coarseFactory.get()));
910 if ((reuseType ==
"RAP" && levelID) || (reuseType ==
"full")) {
929 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
934 bool isCustomCoarseSolver =
938 manager.
SetFactory(
"CoarseSolver", Teuchos::null);
940 }
else if (isCustomCoarseSolver) {
948 overlap = paramList.
get<
int>(
"coarse: overlap");
951 if (paramList.
isSublist(
"coarse: params"))
952 coarseParams = paramList.
sublist(
"coarse: params");
953 else if (defaultList.
isSublist(
"coarse: params"))
954 coarseParams = defaultList.
sublist(
"coarse: params");
956 using strings = std::unordered_set<std::string>;
962 if (strings({
"RELAXATION",
"CHEBYSHEV",
"ILUT",
"ILU",
"RILUK",
"SCHWARZ",
"Amesos",
963 "BLOCK RELAXATION",
"BLOCK_RELAXATION",
"BLOCKRELAXATION",
964 "SPARSE BLOCK RELAXATION",
"SPARSE_BLOCK_RELAXATION",
"SPARSEBLOCKRELAXATION",
965 "LINESMOOTHING_BANDEDRELAXATION",
"LINESMOOTHING_BANDED_RELAXATION",
"LINESMOOTHING_BANDED RELAXATION",
966 "LINESMOOTHING_TRIDIRELAXATION",
"LINESMOOTHING_TRIDI_RELAXATION",
"LINESMOOTHING_TRIDI RELAXATION",
967 "LINESMOOTHING_TRIDIAGONALRELAXATION",
"LINESMOOTHING_TRIDIAGONAL_RELAXATION",
"LINESMOOTHING_TRIDIAGONAL RELAXATION",
968 "TOPOLOGICAL",
"FAST_ILU",
"FAST_IC",
"FAST_ILDL",
"HIPTMAIR"})
969 .count(coarseType)) {
972 #ifdef HAVE_MUELU_MATLAB
973 if (coarseType ==
"matlab")
987 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
990 FactoryManager& manager,
int levelID, std::vector<keep_pair>& keeps)
const {
1006 rFactory->
SetFactory(
"D0", this->GetFactoryManager(levelID - 1)->GetFactory(
"D0"));
1018 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1021 FactoryManager& manager,
int levelID, std::vector<keep_pair>& keeps)
const {
1022 using strings = std::unordered_set<std::string>;
1032 if (aggType ==
"classical") {
1034 manager.
SetFactory(
"UnAmalgamationInfo", amalgFact);
1041 #ifdef HAVE_MUELU_MATLAB
1046 throw std::runtime_error(
"Cannot use MATLAB evolutionary strength-of-connection - MueLu was not configured with MATLAB support.");
1048 }
else if (
MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"unsupported vector smoothing")) {
1060 if (!rcp_dynamic_cast<CoalesceDropFactory>(dropFactory).
is_null())
1061 dropParams.
set(
"lightweight wrap",
true);
1084 if (dropParams.
isParameter(
"aggregation: drop scheme")) {
1085 std::string drop_scheme = dropParams.
get<std::string>(
"aggregation: drop scheme");
1086 if (drop_scheme ==
"block diagonal colored signed classical")
1087 manager.
SetFactory(
"Coloring Graph", dropFactory);
1088 if (drop_scheme.find(
"block diagonal") != std::string::npos || drop_scheme ==
"signed classical") {
1090 dropFactory->
SetFactory(
"BlockNumber", this->GetFactoryManager(levelID - 1)->GetFactory(
"BlockNumber"));
1101 #ifndef HAVE_MUELU_MATLAB
1102 if (aggType ==
"matlab")
1103 throw std::runtime_error(
"Cannot use MATLAB aggregation - MueLu was not configured with MATLAB support.");
1106 if (aggType ==
"uncoupled") {
1138 }
else if (aggType ==
"brick") {
1151 manager.
SetFactory(
"DofsPerNode", aggFactory);
1157 aggFactory->
SetFactory(
"Coordinates", this->GetFactoryManager(levelID - 1)->GetFactory(
"Coordinates"));
1159 }
else if (aggType ==
"classical") {
1168 std::string drop_algo = tempParams.
get<std::string>(
"aggregation: drop scheme");
1169 if (drop_algo ==
"block diagonal colored signed classical") {
1170 mapParams.
set(
"aggregation: coloring: use color graph",
true);
1190 if (drop_algo.find(
"block diagonal") != std::string::npos || drop_algo ==
"signed classical") {
1192 aggFactory->
SetFactory(
"BlockNumber", this->GetFactoryManager(levelID - 1)->GetFactory(
"BlockNumber"));
1201 if (reuseType ==
"tP" && levelID) {
1206 }
else if (aggType ==
"notay") {
1218 #ifdef HAVE_MUELU_MATLAB
1219 else if (aggType ==
"matlab") {
1226 manager.
SetFactory(
"Aggregates", aggFactory);
1234 if (
MUELU_TEST_PARAM_2LIST(paramList, defaultList,
"aggregation: compute aggregate qualities",
bool,
true)) {
1246 manager.
SetFactory(
"AggregateQualities", aggQualityFact);
1248 assert(aggType ==
"uncoupled");
1249 aggFactory->
SetFactory(
"AggregateQualities", aggQualityFact);
1255 if (paramList.
isSublist(
"matrixmatrix: kernel params"))
1256 ptentParams.
sublist(
"matrixmatrix: kernel params",
false) = paramList.
sublist(
"matrixmatrix: kernel params");
1257 if (defaultList.
isSublist(
"matrixmatrix: kernel params"))
1258 ptentParams.
sublist(
"matrixmatrix: kernel params",
false) = defaultList.
sublist(
"matrixmatrix: kernel params");
1261 Ptent->SetParameterList(ptentParams);
1262 Ptent->SetFactory(
"Aggregates", manager.
GetFactory(
"Aggregates"));
1263 Ptent->SetFactory(
"CoarseMap", manager.
GetFactory(
"CoarseMap"));
1266 if (reuseType ==
"tP" && levelID) {
1267 keeps.push_back(
keep_pair(
"Nullspace", Ptent.get()));
1268 keeps.push_back(
keep_pair(
"P", Ptent.get()));
1275 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1278 int levelID, std::vector<keep_pair>& keeps)
const {
1291 std::string alg = paramList.
get(
"rap: algorithm",
"galerkin");
1292 if (alg ==
"shift" || alg ==
"non-galerkin") {
1306 if (paramList.
isSublist(
"matrixmatrix: kernel params"))
1307 RAPparams.
sublist(
"matrixmatrix: kernel params",
false) = paramList.
sublist(
"matrixmatrix: kernel params");
1308 if (defaultList.
isSublist(
"matrixmatrix: kernel params"))
1309 RAPparams.
sublist(
"matrixmatrix: kernel params",
false) = defaultList.
sublist(
"matrixmatrix: kernel params");
1316 if (!paramList.
isParameter(
"rap: triple product") &&
1317 paramList.
isType<std::string>(
"multigrid algorithm") &&
1318 paramList.
get<std::string>(
"multigrid algorithm") ==
"unsmoothed")
1319 paramList.
set(
"rap: triple product",
true);
1324 if (paramList.
isParameter(
"aggregation: allow empty prolongator columns")) {
1325 RAPparams.
set(
"CheckMainDiagonal", paramList.
get<
bool>(
"aggregation: allow empty prolongator columns"));
1326 RAPparams.
set(
"RepairMainDiagonal", paramList.
get<
bool>(
"aggregation: allow empty prolongator columns"));
1327 }
else if (defaultList.
isParameter(
"aggregation: allow empty prolongator columns")) {
1328 RAPparams.
set(
"CheckMainDiagonal", defaultList.
get<
bool>(
"aggregation: allow empty prolongator columns"));
1329 RAPparams.
set(
"RepairMainDiagonal", defaultList.
get<
bool>(
"aggregation: allow empty prolongator columns"));
1345 if (!this->implicitTranspose_) {
1352 if (
MUELU_TEST_PARAM_2LIST(paramList, defaultList,
"aggregation: export visualization data",
bool,
true)) {
1376 MUELU_SET_VAR_2LIST(paramList, defaultList,
"sa: use filtered matrix",
bool, useFiltering);
1377 bool filteringChangesMatrix = useFiltering && !
MUELU_TEST_PARAM_2LIST(paramList, defaultList,
"aggregation: drop tol",
double, 0);
1379 if (reuseType ==
"RP" || (reuseType ==
"tP" && !filteringChangesMatrix)) {
1381 keeps.push_back(
keep_pair(
"AP reuse data", RAP.
get()));
1382 keeps.push_back(
keep_pair(
"RAP reuse data", RAP.
get()));
1385 keeps.push_back(
keep_pair(
"AP reuse data", RAPs.
get()));
1386 keeps.push_back(
keep_pair(
"RAP reuse data", RAPs.
get()));
1394 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1398 bool have_userCO =
false;
1402 if (useCoordinates_) {
1413 if (!RAP.is_null()) {
1414 RAP->AddTransferFactory(manager.
GetFactory(
"Coordinates"));
1417 RAPs->AddTransferFactory(manager.
GetFactory(
"Coordinates"));
1426 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1429 FactoryManager& manager,
int levelID, std::vector<keep_pair>& )
const {
1432 if (useBlockNumber_ && (levelID > 0)) {
1435 if (!RAP.is_null() || !RAPs.is_null()) {
1437 if (multigridAlgo ==
"classical")
1443 fact->
SetFactory(VarName, this->GetFactoryManager(levelID - 1)->GetFactory(VarName));
1448 RAP->AddTransferFactory(manager.
GetFactory(VarName));
1450 RAPs->AddTransferFactory(manager.
GetFactory(VarName));
1458 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1461 FactoryManager& manager,
int levelID, std::vector<keep_pair>& keeps)
const {
1462 if (useBlockNumber_) {
1474 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1477 int levelID, std::vector<keep_pair>& )
const {
1478 MUELU_SET_VAR_2LIST(paramList, defaultList,
"multigrid algorithm", std::string, multigridAlgo);
1479 bool have_userR =
false;
1485 if (!this->implicitTranspose_) {
1488 if (isSymmetric ==
false && (multigridAlgo ==
"unsmoothed" || multigridAlgo ==
"emin")) {
1489 this->GetOStream(
Warnings0) <<
"Switching \"problem: symmetric\" parameter to symmetric as multigrid algorithm. " << multigridAlgo <<
" is primarily supposed to be used for symmetric problems.\n\n"
1490 <<
"Please note: if you are using \"unsmoothed\" transfer operators the \"problem: symmetric\" parameter "
1491 <<
"has no real mathematical meaning, i.e. you can use it for non-symmetric\n"
1492 <<
"problems, too. With \"problem: symmetric\"=\"symmetric\" you can use implicit transpose for building "
1493 <<
"the restriction operators which may drastically reduce the amount of consumed memory." << std::endl;
1497 "Petrov-Galerkin smoothed transfer operators are only allowed for non-symmetric problems: Set \"problem: symmetric\" to false!\n"
1498 "While PG smoothed transfer operators generally would also work for symmetric problems this is an unusual use case. "
1499 "You can use the factory-based xml interface though if you need PG-AMG for symmetric problems.");
1518 if (paramList.
isParameter(
"restriction: scale nullspace") && paramList.
get<
bool>(
"restriction: scale nullspace")) {
1521 tentPlist.
set(
"Nullspace name",
"Scaled Nullspace");
1534 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1537 int levelID, std::vector<keep_pair>& keeps,
RCP<Factory>& nullSpaceFactory)
const {
1542 #if defined(HAVE_MPI) && (defined(HAVE_MUELU_ZOLTAN) || defined(HAVE_MUELU_ZOLTAN2)) // skip to the end, print warning, and turn off repartitioning if we don't have MPI and Zoltan/Zoltan2
1543 MUELU_SET_VAR_2LIST(paramList, defaultList,
"repartition: use subcommunicators in place",
bool, enableInPlace);
1580 "Reuse types \"tP\" and \"PR\" require \"repartition: rebalance P and R\" set to \"false\"");
1585 MUELU_SET_VAR_2LIST(paramList, defaultList,
"repartition: partitioner", std::string, partName);
1587 "Invalid partitioner name: \"" << partName <<
"\". Valid options: \"zoltan\", \"zoltan2\"");
1589 #ifndef HAVE_MUELU_ZOLTAN
1590 bool switched =
false;
1591 if (partName ==
"zoltan") {
1592 this->GetOStream(
Warnings0) <<
"Zoltan interface is not available, trying to switch to Zoltan2" << std::endl;
1593 partName =
"zoltan2";
1597 #ifndef HAVE_MUELU_ZOLTAN2
1598 bool switched =
false;
1599 #endif // HAVE_MUELU_ZOLTAN2
1600 #endif // HAVE_MUELU_ZOLTAN
1602 #ifndef HAVE_MUELU_ZOLTAN2
1603 if (partName ==
"zoltan2" && !switched) {
1604 this->GetOStream(
Warnings0) <<
"Zoltan2 interface is not available, trying to switch to Zoltan" << std::endl;
1605 partName =
"zoltan";
1607 #endif // HAVE_MUELU_ZOLTAN2
1609 MUELU_SET_VAR_2LIST(paramList, defaultList,
"repartition: node repartition level",
int, nodeRepartitionLevel);
1621 repartheurFactory->SetParameterList(repartheurParams);
1622 repartheurFactory->SetFactory(
"A", manager.
GetFactory(
"A"));
1623 manager.
SetFactory(
"number of partitions", repartheurFactory);
1624 manager.
SetFactory(
"repartition: heuristic target rows per process", repartheurFactory);
1628 if (levelID == nodeRepartitionLevel) {
1635 }
else if (partName ==
"zoltan") {
1636 #ifdef HAVE_MUELU_ZOLTAN
1641 #endif // HAVE_MUELU_ZOLTAN
1642 }
else if (partName ==
"zoltan2") {
1643 #ifdef HAVE_MUELU_ZOLTAN2
1647 partParams.
set(
"ParameterList", partpartParams);
1649 partitioner->
SetFactory(
"repartition: heuristic target rows per process",
1650 manager.
GetFactory(
"repartition: heuristic target rows per process"));
1653 #endif // HAVE_MUELU_ZOLTAN2
1658 if (useCoordinates_)
1660 manager.
SetFactory(
"Partition", partitioner);
1668 repartFactory->SetParameterList(repartParams);
1669 repartFactory->SetFactory(
"A", manager.
GetFactory(
"A"));
1670 repartFactory->SetFactory(
"number of partitions", manager.
GetFactory(
"number of partitions"));
1671 repartFactory->SetFactory(
"Partition", manager.
GetFactory(
"Partition"));
1672 manager.
SetFactory(
"Importer", repartFactory);
1673 if (reuseType !=
"none" && reuseType !=
"S" && levelID)
1676 if (enableInPlace) {
1684 newA->SetParameterList(rebAcParams);
1685 newA->SetFactory(
"A", manager.
GetFactory(
"A"));
1686 newA->SetFactory(
"InPlaceMap", manager.
GetFactory(
"InPlaceMap"));
1693 newA->SetParameterList(rebAcParams);
1694 newA->SetFactory(
"A", manager.
GetFactory(
"A"));
1695 newA->SetFactory(
"Importer", manager.
GetFactory(
"Importer"));
1701 newPparams.
set(
"type",
"Interpolation");
1702 if (changedPRrebalance_)
1703 newPparams.
set(
"repartition: rebalance P and R", this->doPRrebalance_);
1704 if (changedPRViaCopyrebalance_)
1705 newPparams.
set(
"repartition: explicit via new copy rebalance P and R",
true);
1707 newP->SetParameterList(newPparams);
1708 newP->SetFactory(
"Importer", manager.
GetFactory(
"Importer"));
1709 newP->SetFactory(
"P", manager.
GetFactory(
"P"));
1710 if (!paramList.
isParameter(
"semicoarsen: number of levels"))
1711 newP->SetFactory(
"Nullspace", manager.
GetFactory(
"Ptent"));
1713 newP->SetFactory(
"Nullspace", manager.
GetFactory(
"P"));
1714 if (useCoordinates_)
1715 newP->SetFactory(
"Coordinates", manager.
GetFactory(
"Coordinates"));
1717 if (useCoordinates_)
1719 if (useBlockNumber_ && (levelID > 0)) {
1720 newP->SetFactory(
"BlockNumber", manager.
GetFactory(
"BlockNumber"));
1727 newRparams.
set(
"type",
"Restriction");
1729 if (changedPRrebalance_)
1730 newRparams.
set(
"repartition: rebalance P and R", this->doPRrebalance_);
1731 if (changedPRViaCopyrebalance_)
1732 newPparams.
set(
"repartition: explicit via new copy rebalance P and R",
true);
1733 if (changedImplicitTranspose_)
1734 newRparams.
set(
"transpose: use implicit", this->implicitTranspose_);
1735 newR->SetParameterList(newRparams);
1736 newR->SetFactory(
"Importer", manager.
GetFactory(
"Importer"));
1737 if (!this->implicitTranspose_) {
1738 newR->SetFactory(
"R", manager.
GetFactory(
"R"));
1751 nullSpaceFactory->
SetFactory(
"Nullspace", newP);
1755 paramList.
set(
"repartition: enable",
false);
1757 this->GetOStream(
Warnings0) <<
"No repartitioning available for a serial run\n";
1759 this->GetOStream(
Warnings0) <<
"Zoltan/Zoltan2 are unavailable for repartitioning\n";
1761 #endif // defined(HAVE_MPI) && (defined(HAVE_MUELU_ZOLTAN) || defined(HAVE_MUELU_ZOLTAN2))
1768 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1771 int levelID, std::vector<keep_pair>& keeps)
const {
1772 MUELU_SET_VAR_2LIST(paramList, defaultList,
"transfers: half precision",
bool, enableLowPrecision);
1774 if (enableLowPrecision) {
1778 newPparams.
set(
"matrix key",
"P");
1779 newP->SetParameterList(newPparams);
1780 newP->SetFactory(
"P", manager.
GetFactory(
"P"));
1783 if (!this->implicitTranspose_) {
1787 newRparams.
set(
"matrix key",
"R");
1788 newR->SetParameterList(newRparams);
1789 newR->SetFactory(
"R", manager.
GetFactory(
"R"));
1798 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1801 int , std::vector<keep_pair>& ,
RCP<Factory>& nullSpaceFactory)
const {
1805 bool have_userNS =
false;
1816 nullSpaceFactory = nullSpace;
1818 if (paramList.
isParameter(
"restriction: scale nullspace") && paramList.
get<
bool>(
"restriction: scale nullspace")) {
1820 scaledNSfactory->
SetFactory(
"Nullspace", nullSpaceFactory);
1821 manager.
SetFactory(
"Scaled Nullspace", scaledNSfactory);
1828 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1831 int , std::vector<keep_pair>& )
const {
1834 if (paramList.
isParameter(
"semicoarsen: number of levels") &&
1835 paramList.
get<
int>(
"semicoarsen: number of levels") > 0) {
1862 manager.
SetFactory(
"CoarseNumZLayers", linedetectionFactory);
1863 manager.
SetFactory(
"LineDetection_Layers", linedetectionFactory);
1864 manager.
SetFactory(
"LineDetection_VertLineIds", linedetectionFactory);
1868 manager.
SetFactory(
"Nullspace", togglePFactory);
1871 if (paramList.
isParameter(
"semicoarsen: number of levels")) {
1873 tf->SetFactory(
"Chosen P", manager.
GetFactory(
"P"));
1874 tf->AddCoordTransferFactory(semicoarsenFactory);
1879 tf->AddCoordTransferFactory(coords);
1887 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1890 int levelID, std::vector<keep_pair>& keeps)
const {
1891 #ifdef HAVE_MUELU_INTREPID2
1896 auto pcoarsen_schedule = Teuchos::getArrayFromStringParameter<int>(defaultList,
"pcoarsen: schedule");
1897 auto pcoarsen_element = defaultList.get<std::string>(
"pcoarsen: element");
1899 if (levelID >= (
int)pcoarsen_schedule.size()) {
1902 UpdateFactoryManager_SA(paramList, defaultList, manager, levelID, keeps);
1908 std::string lo = pcoarsen_element + std::to_string(pcoarsen_schedule[levelID]);
1909 std::string hi = (levelID ? pcoarsen_element + std::to_string(pcoarsen_schedule[levelID - 1]) : lo);
1910 Pparams.
set(
"pcoarsen: hi basis", hi);
1911 Pparams.
set(
"pcoarsen: lo basis", lo);
1912 P->SetParameterList(Pparams);
1925 P->SetParameterList(Pparams);
1938 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1944 if (paramList.
isSublist(
"matrixmatrix: kernel params"))
1945 Pparams.
sublist(
"matrixmatrix: kernel params",
false) = paramList.
sublist(
"matrixmatrix: kernel params");
1946 if (defaultList.
isSublist(
"matrixmatrix: kernel params"))
1947 Pparams.
sublist(
"matrixmatrix: kernel params",
false) = defaultList.
sublist(
"matrixmatrix: kernel params");
1963 MUELU_SET_VAR_2LIST(paramList, defaultList,
"sa: use filtered matrix",
bool, useFiltering);
1997 bool filteringChangesMatrix = useFiltering && !
MUELU_TEST_PARAM_2LIST(paramList, defaultList,
"aggregation: drop tol",
double, 0);
1999 if (reuseType ==
"tP" && !filteringChangesMatrix)
2006 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2009 int , std::vector<keep_pair>& )
const {
2013 "Invalid pattern name: \"" << patternType <<
"\". Valid options: \"AkPtent\"");
2018 patternFactory->SetParameterList(patternParams);
2019 patternFactory->SetFactory(
"P", manager.
GetFactory(
"Ptent"));
2020 manager.
SetFactory(
"Ppattern", patternFactory);
2024 constraintFactory->SetFactory(
"Ppattern", manager.
GetFactory(
"Ppattern"));
2025 constraintFactory->SetFactory(
"CoarseNullspace", manager.
GetFactory(
"Ptent"));
2026 manager.
SetFactory(
"Constraint", constraintFactory);
2031 MUELU_SET_VAR_2LIST(paramList, defaultList,
"emin: use filtered matrix",
bool, useFiltering);
2055 P->SetFactory(
"A", filterFactory);
2058 P->SetFactory(
"A", manager.
GetFactory(
"Graph"));
2066 if (reuseType ==
"emin") {
2068 Pparams.
set(
"Keep P0",
true);
2069 Pparams.
set(
"Keep Constraint0",
true);
2071 P->SetParameterList(Pparams);
2072 P->SetFactory(
"P", manager.
GetFactory(
"Ptent"));
2073 P->SetFactory(
"Constraint", manager.
GetFactory(
"Constraint"));
2080 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2083 int , std::vector<keep_pair>& )
const {
2085 "Implicit transpose not supported with Petrov-Galerkin smoothed transfer operators: Set \"transpose: use implicit\" to false!\n"
2086 "Petrov-Galerkin transfer operator smoothing for non-symmetric problems requires a separate handling of the restriction operator which "
2087 "does not allow the usage of implicit transpose easily.");
2091 P->SetFactory(
"P", manager.
GetFactory(
"Ptent"));
2098 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2106 P->SetParameterList(Pparams);
2113 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2121 P->SetParameterList(Pparams);
2128 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2131 int , std::vector<keep_pair>& )
const {
2132 #ifdef HAVE_MUELU_MATLAB
2135 P->SetParameterList(Pparams);
2136 P->SetFactory(
"P", manager.
GetFactory(
"Ptent"));
2144 #undef MUELU_SET_VAR_2LIST
2145 #undef MUELU_TEST_AND_SET_VAR
2146 #undef MUELU_TEST_AND_SET_PARAM_2LIST
2147 #undef MUELU_TEST_PARAM_2LIST
2148 #undef MUELU_KOKKOS_FACTORY
2152 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2157 const int maxLevels = 100;
2160 std::vector<ParameterList> paramLists;
2161 for (
int levelID = 0; levelID < maxLevels; levelID++) {
2162 std::string sublistName =
"level " +
toString(levelID);
2164 paramLists.push_back(paramList.
sublist(sublistName));
2166 paramList.
remove(sublistName);
2169 paramLists.push_back(paramList);
2171 #ifdef HAVE_MUELU_MATLAB
2173 for (
size_t i = 0; i < paramLists.size(); i++) {
2174 std::vector<std::string> customVars;
2177 std::string paramName = paramLists[i].name(it);
2180 customVars.push_back(paramName);
2184 for (
size_t j = 0; j < customVars.size(); j++)
2185 paramLists[i].
remove(customVars[j],
false);
2189 const int maxDepth = 0;
2190 for (
size_t i = 0; i < paramLists.size(); i++) {
2193 paramLists[i].validateParameters(validList, maxDepth);
2196 std::string eString = e.what();
2199 size_t nameStart = eString.find_first_of(
'"') + 1;
2200 size_t nameEnd = eString.find_first_of(
'"', nameStart);
2201 std::string name = eString.substr(nameStart, nameEnd - nameStart);
2203 size_t bestScore = 100;
2204 std::string bestName =
"";
2206 const std::string& pName = validList.
name(it);
2207 this->GetOStream(
Runtime1) <<
"| " << pName;
2208 size_t score =
LevenshteinDistance(name.c_str(), name.length(), pName.c_str(), pName.length());
2209 this->GetOStream(
Runtime1) <<
" -> " << score << std::endl;
2210 if (score < bestScore) {
2215 if (bestScore < 10 && bestName !=
"") {
2217 eString <<
"The parameter name \"" + name +
"\" is not valid. Did you mean \"" + bestName <<
"\"?\n");
2221 eString <<
"The parameter name \"" + name +
"\" is not valid.\n");
2230 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2243 blockSize_ = paramList.
sublist(
"Matrix").
get<
int>(
"PDE equations", MasterList::getDefault<int>(
"number of equations"));
2248 if (factFact_ == Teuchos::null)
2261 this->BuildFactoryMap(paramList.
sublist(
"Factories"), factoryMap, factoryMap, factoryManagers);
2280 this->numDesiredLevel_ = hieraList.
get<
int>(
"max levels");
2281 hieraList.
remove(
"max levels");
2285 this->maxCoarseSize_ = hieraList.
get<
int>(
"coarse: max size");
2286 hieraList.
remove(
"coarse: max size");
2289 if (hieraList.
isParameter(
"repartition: rebalance P and R")) {
2290 this->doPRrebalance_ = hieraList.
get<
bool>(
"repartition: rebalance P and R");
2291 hieraList.
remove(
"repartition: rebalance P and R");
2294 if (hieraList.
isParameter(
"transpose: use implicit")) {
2295 this->implicitTranspose_ = hieraList.
get<
bool>(
"transpose: use implicit");
2296 hieraList.
remove(
"transpose: use implicit");
2299 if (hieraList.
isParameter(
"fuse prolongation and update")) {
2300 this->fuseProlongationAndUpdate_ = hieraList.
get<
bool>(
"fuse prolongation and update");
2301 hieraList.
remove(
"fuse prolongation and update");
2304 if (hieraList.
isParameter(
"nullspace: suppress dimension check")) {
2305 this->suppressNullspaceDimensionCheck_ = hieraList.
get<
bool>(
"nullspace: suppress dimension check");
2306 hieraList.
remove(
"nullspace: suppress dimension check");
2310 this->numDesiredLevel_ = hieraList.
get<
int>(
"number of vectors");
2311 hieraList.
remove(
"number of vectors");
2314 if (hieraList.
isSublist(
"matvec params"))
2315 this->matvecParams_ = Teuchos::parameterList(hieraList.
sublist(
"matvec params"));
2317 if (hieraList.
isParameter(
"coarse grid correction scaling factor")) {
2318 this->scalingFactor_ = hieraList.
get<
double>(
"coarse grid correction scaling factor");
2319 hieraList.
remove(
"coarse grid correction scaling factor");
2324 std::map<std::string, CycleType> cycleMap;
2328 std::string cycleType = hieraList.
get<std::string>(
"cycle type");
2330 this->Cycle_ = cycleMap[cycleType];
2333 if (hieraList.
isParameter(
"W cycle start level")) {
2334 this->WCycleStartLevel_ = hieraList.
get<
int>(
"W cycle start level");
2338 std::string vl = hieraList.
get<std::string>(
"verbosity");
2339 hieraList.
remove(
"verbosity");
2346 if (hieraList.
isParameter(
"dependencyOutputLevel"))
2347 this->graphOutputLevel_ = hieraList.
get<
int>(
"dependencyOutputLevel");
2353 if (hieraList.
isSublist(
"DataToWrite")) {
2357 std::string dataName =
"Matrices";
2359 this->matricesToPrint_[
"A"] = Teuchos::getArrayFromStringParameter<int>(foo, dataName);
2360 dataName =
"Prolongators";
2362 this->matricesToPrint_[
"P"] = Teuchos::getArrayFromStringParameter<int>(foo, dataName);
2363 dataName =
"Restrictors";
2365 this->matricesToPrint_[
"R"] = Teuchos::getArrayFromStringParameter<int>(foo, dataName);
2368 this->matricesToPrint_[
"D0"] = Teuchos::getArrayFromStringParameter<int>(foo, dataName);
2373 const std::string& paramName = hieraList.
name(param);
2375 if (paramName !=
"DataToWrite" && hieraList.
isSublist(paramName)) {
2380 startLevel = levelList.
get<
int>(
"startLevel");
2381 levelList.
remove(
"startLevel");
2383 int numDesiredLevel = 1;
2385 numDesiredLevel = levelList.
get<
int>(
"numDesiredLevel");
2386 levelList.
remove(
"numDesiredLevel");
2400 BuildFactoryMap(levelList, factoryMap, levelFactoryMap, factoryManagers);
2406 if (startLevel >= 0)
2407 this->AddFactoryManager(startLevel, numDesiredLevel, m);
2538 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2542 const std::string& paramName = paramList.
name(param);
2547 if (paramValue.
isList()) {
2548 ParameterList paramList1 = Teuchos::getValue<ParameterList>(paramValue);
2552 "MueLu::ParameterListInterpreter(): It seems that in the parameter lists for defining " << paramName <<
" there is both a 'factory' and 'dependency for' parameter. This is not allowed. Please remove the 'dependency for' parameter.");
2554 factoryMapOut[paramName] = factFact_->BuildFactory(paramValue, factoryMapIn, factoryManagers);
2556 }
else if (paramList1.
isParameter(
"dependency for")) {
2558 "MueLu::ParameterListInterpreter(): It seems that in the parameter lists for defining " << paramName <<
" there is both a 'factory' and 'dependency for' parameter. This is not allowed.");
2560 std::string factoryName = paramList1.
get<std::string>(
"dependency for");
2564 "MueLu::ParameterListInterpreter(): could not find factory " + factoryName +
" in factory map. Did you define it before?");
2572 const std::string& pName = validParamList->name(vparam);
2582 factory->SetFactory(pName, generatingFact.
create_weak());
2585 if (pName ==
"ParameterList") {
2594 factory->SetParameter(pName, paramList1.
getEntry(pName));
2600 std::string groupType = paramList1.
get<std::string>(
"group");
2602 "group must be of type \"FactoryManager\".");
2605 groupList.
remove(
"group");
2607 bool setKokkosRefactor =
false;
2608 bool kokkosRefactor = useKokkos_;
2609 if (groupList.
isParameter(
"use kokkos refactor")) {
2610 kokkosRefactor = groupList.
get<
bool>(
"use kokkos refactor");
2611 groupList.
remove(
"use kokkos refactor");
2612 setKokkosRefactor =
true;
2616 BuildFactoryMap(groupList, factoryMapIn, groupFactoryMap, factoryManagers);
2621 if (setKokkosRefactor)
2623 factoryManagers[paramName] = m;
2626 this->GetOStream(
Warnings0) <<
"Could not interpret parameter list " << paramList1 << std::endl;
2628 "XML Parameter list must either be of type \"factory\" or of type \"group\".");
2632 factoryMapOut[paramName] = factFact_->BuildFactory(paramValue, factoryMapIn, factoryManagers);
2640 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2643 Matrix& A =
dynamic_cast<Matrix&
>(Op);
2644 if (A.IsFixedBlockSizeSet() && (A.GetFixedBlockSize() != blockSize_))
2645 this->GetOStream(
Warnings0) <<
"Setting matrix block size to " << blockSize_ <<
" (value of the parameter in the list) "
2646 <<
"instead of " << A.GetFixedBlockSize() <<
" (provided matrix)." << std::endl
2647 <<
"You may want to check \"number of equations\" (or \"PDE equations\" for factory style list) parameter." << std::endl;
2649 A.SetFixedBlockSize(blockSize_, dofOffset_);
2651 #ifdef HAVE_MUELU_DEBUG
2652 MatrixUtils::checkLocalRowMapMatchesColMap(A);
2653 #endif // HAVE_MUELU_DEBUG
2655 }
catch (std::bad_cast&) {
2656 this->GetOStream(
Warnings0) <<
"Skipping setting block size as the operator is not a matrix" << std::endl;
2660 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2672 const std::string& name = it->first;
2679 compare(Teuchos::getValue<ParameterList>(entry1), Teuchos::getValue<ParameterList>(*entry2));
2695 #define MUELU_PARAMETERLISTINTERPRETER_SHORT
Important warning messages (one line)
Generic Smoother Factory for generating the smoothers of the MG hierarchy.
const std::string & name() const
This class specifies the default factory that should generate some data on a Level if the data does n...
void SetupHierarchy(Hierarchy &H) const
Call the SetupHierarchy routine from the HiearchyManager object.
ParameterList & setEntry(const std::string &name, U &&entry)
static VerbLevel GetDefaultVerbLevel()
Get the default (global) verbosity level.
ConstIterator end() const
void UpdateFactoryManager_Replicate(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
void UpdateFactoryManager_Reitzinger(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
Factory for determing the number of partitions for rebalancing.
#define MUELU_KOKKOS_FACTORY_NO_DECL(varName, oldFactory, newFactory)
Factory for generating coarse level map. Used by TentativePFactory.
bool is_null(const boost::shared_ptr< T > &p)
std::string toString(const T &what)
Little helper function to convert non-string types to strings.
Factory for building transfer operators based on coarsening in polynomial degree, following the Intre...
Factory for building coarse grid matrices, when the matrix is of the form K+a*M. Useful when you want...
Class for generating an initial LocalOrdinal-type BlockNumber vector, based on an input paraemter for...
void UpdateFactoryManager(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
Factory that can generate other factories from.
RCP< T > create_weak() const
T & get(const std::string &name, T def_value)
Class that encapsulates external library smoothers.
size_t LevenshteinDistance(const char *s, size_t len_s, const char *t, size_t len_t)
void UpdateFactoryManager_Matlab(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
static void DisableMultipleCheckGlobally()
#define MUELU_TEST_AND_SET_VAR(paramList, paramName, paramType, varName)
void AddProlongatorFactory(const RCP< const FactoryBase > &factory)
Add a prolongator factory in the end of list of prolongator factories.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Factory for building permutation matrix that can be be used to shuffle data (matrices, vectors) among processes.
Class for transferring a vector of local ordinals from a finer level to a coarser one...
Factory for converting matrices to half precision operators.
void SetKokkosRefactor(const bool useKokkos)
One-liner description of what is happening.
ParameterListInterpreter()
Empty constructor.
void UpdateFactoryManager_LowPrecision(ParameterList ¶mList, const ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
Ordinal numParams() const
void SetCycle(CycleType Cycle)
Supports VCYCLE and WCYCLE types.
void AddTransferFactory(const RCP< const FactoryBase > &factory)
Add transfer factory in the end of list of transfer factories in RepartitionAcFactory.
#define MUELU_KOKKOS_FACTORY(varName, oldFactory, newFactory)
Interface to Zoltan library.This interface provides access to partitioning methods in Zoltan...
bool IsParamMuemexVariable(const std::string &name)
Factory for creating a graph base on a given matrix.
void UpdateFactoryManager_SemiCoarsen(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
const RCP< const FactoryBase > GetFactory(const std::string &varName) const
Get factory associated with a particular data name.
std::map< std::string, RCP< FactoryManagerBase > > FactoryManagerMap
std::map< std::string, RCP< const FactoryBase > > FactoryMap
void UpdateFactoryManager_Nullspace(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps, RCP< Factory > &nullSpaceFactory) const
Factory for building tentative prolongator.
static void SetMueLuOFileStream(const std::string &filename)
#define TEST_MUTUALLY_EXCLUSIVE(arg1, arg2)
MsgType toVerbLevel(const std::string &verbLevelStr)
Class that encapsulates direct solvers. Autoselection of AmesosSmoother or Amesos2Smoother according ...
virtual void SetupOperator(Operator &A) const
Setup Operator object.
Prolongator factory performing semi-coarsening.
Factory for building restriction operators using a prolongator factory.
static RCP< Time > getNewTimer(const std::string &name)
ParameterEntry * getEntryPtr(const std::string &name)
void UpdateFactoryManager_PG(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
Teuchos::RCP< MueLu::FacadeClassFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node > > facadeFact_
FacadeClass factory.
Prolongator factory that replicates 'Psubblock' matrix to create new prolongator suitable for PDE sys...
bool isParameter(const std::string &name) const
bool remove(std::string const &name, bool throwIfNotExists=true)
void UpdateFactoryManager_Emin(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
static void SetDefaultVerbLevel(const VerbLevel defaultVerbLevel)
Set the default (global) verbosity level.
#define MUELU_TEST_AND_SET_PARAM_2LIST(paramList, defaultList, paramName, paramType, listWrite)
static bool compare(const ParameterList &list1, const ParameterList &list2)
virtual void SetParameterList(const Teuchos::ParameterList ¶mList)
Set parameters from a parameter list and return with default values.
static CycleType GetDefaultCycle()
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
MueLu::DefaultScalar Scalar
void UpdateFactoryManager_Coordinates(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
MueLu::DefaultGlobalOrdinal GlobalOrdinal
bool isSublist(const std::string &name) const
void SetCycleStartLevel(int cycleStart)
Factory for interacting with Matlab.
Factory for interacting with Matlab.
VerbLevel GetVerbLevel() const
Get the verbosity level.
Factory for building line detection information.
params_t::ConstIterator ConstIterator
void SetFactoryParameterList(const Teuchos::ParameterList ¶mList)
Factory interpreter stuff.
Factory to export aggregation info or visualize aggregates using VTK.
Prolongator factory which allows switching between two different prolongator strategies.
Interface to Zoltan2 library.This interface provides access to partitioning methods in Zoltan2...
AmalgamationFactory for subblocks of strided map based amalgamation data.
void UpdateFactoryManager_RAP(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
ConstIterator begin() const
Factory for building the constraint operator.
void UpdateFactoryManager_Restriction(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
void UpdateFactoryManager_BlockNumber(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
Applies permutation to grid transfer operators.
Prolongator factory that replicates 'Psubblock' matrix to create new prolongator suitable for PDE sys...
ParameterList & setParameters(const ParameterList &source)
void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)
Set Factory.
const RCP< FactoryBase > GetFactoryNonConst(const std::string &varName)
Get factory associated with a particular data name (NONCONST version)
Factory for generating a very special nullspace.
const ParameterEntry & entry(ConstIterator i) const
any & getAny(bool activeQry=true)
void UpdateFactoryManager_Aggregation_TentativeP(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
void AddTransferFactory(const RCP< const FactoryBase > &factory)
Add transfer factory in the end of list of transfer factories in RepartitionAcFactory.
Factory for creating a graph based on a given matrix.
void BuildFactoryMap(const Teuchos::ParameterList ¶mList, const FactoryMap &factoryMapIn, FactoryMap &factoryMapOut, FactoryManagerMap &factoryManagers) const
Interpret "Factories" sublist.
Class that encapsulates Matlab smoothers.
Partitioning within a node onlyThis interface provides partitioning within a node.
Factory for generating F/C-splitting and a coarse level map. Used by ClassicalPFactory.
void SetParameterList(const Teuchos::ParameterList ¶mList)
Set parameter list for Parameter list interpreter.
void UpdateFactoryManager_Combine(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
Class for transferring coordinates from a finer level to a coarser one.
void UpdateFactoryManager_SA(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
void SetVerbLevel(const VerbLevel verbLevel)
Set the verbosity level of this object.
virtual void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)=0
Configuration.
Factory for building nonzero patterns for energy minimization.
static Teuchos::RCP< Teuchos::ParameterList > GetProblemSpecificList(std::string const &problemType)
Return default parameter settings for the specified problem type.
bool isType(const std::string &name) const
Factory for building tentative prolongator.
Class for transferring coordinates from a finer level to a coarser one.
Factory for building restriction operators.
Factory for building Energy Minimization prolongators.
static bool areSame(const ParameterList &list1, const ParameterList &list2)
Helper functions to compare two paramter lists.
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
Factory for creating a graph based on a given matrix.
#define TEST_MUTUALLY_EXCLUSIVE_S(arg1, arg2)
static int GetDefaultCycleStartLevel()
void Validate(const Teuchos::ParameterList ¶mList) const
void UpdateFactoryManager_PCoarsen(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
void SetProlongatorScalingFactor(double scalingFactor)
Specify damping factor alpha such that x = x + alpha*P*c, where c is the coarse grid correction...
#define MUELU_TEST_PARAM_2LIST(paramList, defaultList, paramName, paramType, cmpValue)
Factory for building coarse matrices.
Exception throws to report errors in the internal logical of the program.
Factory for building filtered matrices using filtered graphs.
std::pair< std::string, const FactoryBase * > keep_pair
void UpdateFactoryManager_Repartition(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps, RCP< Factory > &nullSpaceFactory) const
Description of what is happening (more verbose)
Factory for building coarse matrices.
Factory for building Petrov-Galerkin Smoothed Aggregation prolongators.
An factory which assigns each aggregate a quality estimate. Originally developed by Napov and Notay i...
void UpdateFactoryManager_Smoothers(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
ParameterEntry & getEntry(const std::string &name)
void AddPtentFactory(const RCP< const FactoryBase > &factory)
Add a tentative prolongator factory in the end of list of prolongator factories.
Factory for building Smoothed Aggregation prolongators.Input/output of SaPFactory
Factory for building uncoupled aggregates.
static Teuchos::RCP< const Teuchos::ParameterList > List()
Return a "master" list of all valid parameters and their default values.
Prolongator factory performing semi-coarsening.
void UpdateFactoryManager_CoarseSolvers(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const
#define MUELU_SET_VAR_2LIST(paramList, defaultList, paramName, paramType, varName)
void SetEasyParameterList(const Teuchos::ParameterList ¶mList)
Provides methods to build a multigrid hierarchy and apply multigrid cycles.
void AddCoarseNullspaceFactory(const RCP< const FactoryBase > &factory)
Add a coarse nullspace factory in the end of list of coarse nullspace factories.
Factory for generating nullspace.
long ExtractNonSerializableData(const Teuchos::ParameterList &inList, Teuchos::ParameterList &serialList, Teuchos::ParameterList &nonSerialList)
Extract non-serializable data from level-specific sublists and move it to a separate parameter list...
virtual void SetupHierarchy(Hierarchy &H) const
Setup Hierarchy object.
Exception throws to report invalid user entry.
#define TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(throw_exception_test, Exception, msg)
static const RCP< const NoFactory > getRCP()
Static Get() functions.
void UpdateFactoryManager_LocalOrdinalTransfer(const std::string &VarName, const std::string &multigridAlgo, Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) const