10 #ifndef MUELU_PARAMETERLISTINTERPRETER_DEF_HPP
11 #define MUELU_PARAMETERLISTINTERPRETER_DEF_HPP
24 #include "MueLu_Hierarchy.hpp"
25 #include "MueLu_FactoryManager.hpp"
27 #include "MueLu_AggregationExportFactory.hpp"
28 #include "MueLu_AggregateQualityEstimateFactory.hpp"
29 #include "MueLu_AmalgamationFactory.hpp"
30 #include "MueLu_BrickAggregationFactory.hpp"
31 #include "MueLu_ClassicalMapFactory.hpp"
32 #include "MueLu_ClassicalPFactory.hpp"
33 #include "MueLu_CoalesceDropFactory.hpp"
34 #include "MueLu_CoarseMapFactory.hpp"
35 #include "MueLu_ConstraintFactory.hpp"
36 #include "MueLu_CoordinatesTransferFactory.hpp"
37 #include "MueLu_DirectSolver.hpp"
38 #include "MueLu_EminPFactory.hpp"
40 #include "MueLu_FacadeClassFactory.hpp"
41 #include "MueLu_FactoryFactory.hpp"
42 #include "MueLu_FilteredAFactory.hpp"
43 #include "MueLu_GenericRFactory.hpp"
44 #include "MueLu_InitialBlockNumberFactory.hpp"
45 #include "MueLu_LineDetectionFactory.hpp"
46 #include "MueLu_LocalOrdinalTransferFactory.hpp"
47 #include "MueLu_MatrixAnalysisFactory.hpp"
48 #include "MueLu_MultiVectorTransferFactory.hpp"
49 #include "MueLu_NotayAggregationFactory.hpp"
50 #include "MueLu_NullspaceFactory.hpp"
51 #include "MueLu_PatternFactory.hpp"
52 #include "MueLu_ReplicatePFactory.hpp"
53 #include "MueLu_CombinePFactory.hpp"
54 #include "MueLu_PgPFactory.hpp"
55 #include "MueLu_RAPFactory.hpp"
56 #include "MueLu_RAPShiftFactory.hpp"
57 #include "MueLu_RebalanceAcFactory.hpp"
58 #include "MueLu_RebalanceTransferFactory.hpp"
59 #include "MueLu_RepartitionFactory.hpp"
60 #include "MueLu_RepartitionHeuristicFactory.hpp"
61 #include "MueLu_ReitzingerPFactory.hpp"
62 #include "MueLu_SaPFactory.hpp"
63 #include "MueLu_ScaledNullspaceFactory.hpp"
64 #include "MueLu_SemiCoarsenPFactory.hpp"
65 #include "MueLu_SmootherFactory.hpp"
66 #include "MueLu_SmooVecCoalesceDropFactory.hpp"
67 #include "MueLu_TentativePFactory.hpp"
68 #include "MueLu_TogglePFactory.hpp"
69 #include "MueLu_ToggleCoordinatesTransferFactory.hpp"
70 #include "MueLu_TransPFactory.hpp"
71 #include "MueLu_UncoupledAggregationFactory.hpp"
72 #include "MueLu_ZoltanInterface.hpp"
73 #include "MueLu_Zoltan2Interface.hpp"
74 #include "MueLu_NodePartitionInterface.hpp"
75 #include "MueLu_LowPrecisionFactory.hpp"
77 #include "MueLu_CoalesceDropFactory_kokkos.hpp"
78 #include "MueLu_SemiCoarsenPFactory_kokkos.hpp"
79 #include "MueLu_TentativePFactory_kokkos.hpp"
81 #ifdef HAVE_MUELU_MATLAB
82 #include "../matlab/src/MueLu_MatlabSmoother_decl.hpp"
83 #include "../matlab/src/MueLu_MatlabSmoother_def.hpp"
84 #include "../matlab/src/MueLu_TwoLevelMatlabFactory_decl.hpp"
85 #include "../matlab/src/MueLu_TwoLevelMatlabFactory_def.hpp"
86 #include "../matlab/src/MueLu_SingleLevelMatlabFactory_decl.hpp"
87 #include "../matlab/src/MueLu_SingleLevelMatlabFactory_def.hpp"
90 #ifdef HAVE_MUELU_INTREPID2
91 #include "MueLu_IntrepidPCoarsenFactory.hpp"
94 #include <unordered_set>
98 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
100 : factFact_(factFact) {
102 if (facadeFact == Teuchos::null)
108 std::string filename = paramList.
get(
"xml parameter file",
"");
109 if (filename.length() != 0) {
125 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
127 : factFact_(factFact) {
129 if (facadeFact == Teuchos::null)
139 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
142 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
151 SetFactoryParameterList(paramList);
153 }
else if (paramList.
isParameter(
"MueLu preconditioner") ==
true) {
154 this->GetOStream(
Runtime0) <<
"Use facade class: " << paramList.
get<std::string>(
"MueLu preconditioner") << std::endl;
156 SetFactoryParameterList(*pp);
163 Validate(serialList);
164 SetEasyParameterList(paramList);
177 #define MUELU_SET_VAR_2LIST(paramList, defaultList, paramName, paramType, varName) \
179 if (paramList.isParameter(paramName)) \
180 varName = paramList.get<paramType>(paramName); \
181 else if (defaultList.isParameter(paramName)) \
182 varName = defaultList.get<paramType>(paramName); \
184 varName = MasterList::getDefault<paramType>(paramName);
186 #define MUELU_TEST_AND_SET_VAR(paramList, paramName, paramType, varName) \
187 (paramList.isParameter(paramName) ? varName = paramList.get<paramType>(paramName), true : false)
191 #define MUELU_TEST_AND_SET_PARAM_2LIST(paramList, defaultList, paramName, paramType, listWrite) \
193 if (paramList.isParameter(paramName)) \
194 listWrite.set(paramName, paramList.get<paramType>(paramName)); \
195 else if (defaultList.isParameter(paramName)) \
196 listWrite.set(paramName, defaultList.get<paramType>(paramName)); \
197 } catch (Teuchos::Exceptions::InvalidParameterType&) { \
198 TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(true, Teuchos::Exceptions::InvalidParameterType, \
199 "Error: parameter \"" << paramName << "\" must be of type " << Teuchos::TypeNameTraits<paramType>::name()); \
202 #define MUELU_TEST_PARAM_2LIST(paramList, defaultList, paramName, paramType, cmpValue) \
203 (cmpValue == (paramList.isParameter(paramName) ? paramList.get<paramType>(paramName) : (defaultList.isParameter(paramName) ? defaultList.get<paramType>(paramName) : MasterList::getDefault<paramType>(paramName))))
205 #define MUELU_KOKKOS_FACTORY(varName, oldFactory, newFactory) \
206 RCP<Factory> varName; \
208 varName = rcp(new oldFactory()); \
210 varName = rcp(new newFactory());
211 #define MUELU_KOKKOS_FACTORY_NO_DECL(varName, oldFactory, newFactory) \
213 varName = rcp(new oldFactory()); \
215 varName = rcp(new newFactory());
217 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
222 MUELU_SET_VAR_2LIST(constParamList, constParamList,
"problem: type", std::string, problemType);
223 if (problemType !=
"unknown") {
229 paramList = constParamList;
233 useKokkos_ = !Node::is_serial;
243 std::map<std::string, CycleType> cycleMap;
247 auto cycleType = paramList.
get<std::string>(
"cycle type");
249 "Invalid cycle type: \"" << cycleType <<
"\"");
250 Cycle_ = cycleMap[cycleType];
253 if (paramList.
isParameter(
"W cycle start level")) {
254 WCycleStartLevel_ = paramList.
get<
int>(
"W cycle start level");
257 if (paramList.
isParameter(
"coarse grid correction scaling factor"))
258 scalingFactor_ = paramList.
get<
double>(
"coarse grid correction scaling factor");
260 this->maxCoarseSize_ = paramList.
get<
int>(
"coarse: max size", MasterList::getDefault<int>(
"coarse: max size"));
261 this->numDesiredLevel_ = paramList.
get<
int>(
"max levels", MasterList::getDefault<int>(
"max levels"));
262 blockSize_ = paramList.
get<
int>(
"number of equations", MasterList::getDefault<int>(
"number of equations"));
268 this->dataToKeep_ = Teuchos::getArrayFromStringParameter<std::string>(paramList,
"keep data");
271 if (paramList.
isSublist(
"export data")) {
276 this->nullspaceToPrint_ = Teuchos::getArrayFromStringParameter<int>(printList,
"Nullspace");
278 this->coordinatesToPrint_ = Teuchos::getArrayFromStringParameter<int>(printList,
"Coordinates");
280 this->materialToPrint_ = Teuchos::getArrayFromStringParameter<int>(printList,
"Material");
282 this->aggregatesToPrint_ = Teuchos::getArrayFromStringParameter<int>(printList,
"Aggregates");
283 if (printList.
isParameter(
"pcoarsen: element to node map"))
284 this->elementToNodeMapsToPrint_ = Teuchos::getArrayFromStringParameter<int>(printList,
"pcoarsen: element to node map");
288 const std::string& name = printList.
name(
iter);
290 if (name ==
"Nullspace" || name ==
"Coordinates" || name ==
"Material" || name ==
"Aggregates" || name ==
"pcoarsen: element to node map")
293 this->matricesToPrint_[name] = Teuchos::getArrayFromStringParameter<int>(printList, name);
306 if (outputFilename !=
"")
316 useCoordinates_ =
false;
317 useBlockNumber_ =
false;
318 if (
MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"distance laplacian") ||
321 useCoordinates_ =
true;
322 }
else if (
MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal distance laplacian")) {
323 useCoordinates_ =
true;
324 useBlockNumber_ =
true;
325 }
else if (
MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal") ||
326 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal classical") ||
327 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal signed classical") ||
328 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal colored signed classical") ||
329 MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"signed classical")) {
330 useBlockNumber_ =
true;
331 }
else if (paramList.
isSublist(
"smoother: params")) {
332 const auto smooParamList = paramList.
sublist(
"smoother: params");
333 if (smooParamList.isParameter(
"partitioner: type") &&
334 (smooParamList.get<std::string>(
"partitioner: type") ==
"line")) {
335 useCoordinates_ =
true;
338 for (
int levelID = 0; levelID < this->numDesiredLevel_; levelID++) {
339 std::string levelStr =
"level " +
toString(levelID);
344 if (
MUELU_TEST_PARAM_2LIST(levelList, paramList,
"aggregation: drop scheme", std::string,
"distance laplacian") ||
347 useCoordinates_ =
true;
348 }
else if (
MUELU_TEST_PARAM_2LIST(levelList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal distance laplacian")) {
349 useCoordinates_ =
true;
350 useBlockNumber_ =
true;
351 }
else if (
MUELU_TEST_PARAM_2LIST(levelList, paramList,
"aggregation: drop scheme", std::string,
"block diagonal") ||
352 MUELU_TEST_PARAM_2LIST(levelList, 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;
362 useMaterial_ =
false;
363 if (
MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: distance laplacian metric", std::string,
"material")) {
372 }
else if (!paramList.
isSublist(
"repartition: params")) {
373 useCoordinates_ =
true;
376 if (repParams.
isType<std::string>(
"algorithm")) {
377 const std::string algo = repParams.
get<std::string>(
"algorithm");
378 if (algo ==
"multijagged" || algo ==
"rcb") {
379 useCoordinates_ =
true;
382 useCoordinates_ =
true;
386 for (
int levelID = 0; levelID < this->numDesiredLevel_; levelID++) {
387 std::string levelStr =
"level " +
toString(levelID);
393 if (!levelList.
isSublist(
"repartition: params")) {
394 useCoordinates_ =
true;
398 if (repParams.
isType<std::string>(
"algorithm")) {
399 const std::string algo = repParams.
get<std::string>(
"algorithm");
400 if (algo ==
"multijagged" || algo ==
"rcb") {
401 useCoordinates_ =
true;
405 useCoordinates_ =
true;
414 changedPRrebalance_ =
false;
415 changedPRViaCopyrebalance_ =
false;
417 changedPRrebalance_ =
MUELU_TEST_AND_SET_VAR(paramList,
"repartition: rebalance P and R",
bool, this->doPRrebalance_);
418 changedPRViaCopyrebalance_ =
MUELU_TEST_AND_SET_VAR(paramList,
"repartition: explicit via new copy rebalance P and R",
bool, this->doPRViaCopyrebalance_);
422 changedImplicitTranspose_ =
MUELU_TEST_AND_SET_VAR(paramList,
"transpose: use implicit",
bool, this->implicitTranspose_);
425 (void)
MUELU_TEST_AND_SET_VAR(paramList,
"fuse prolongation and update",
bool, this->fuseProlongationAndUpdate_);
428 (void)
MUELU_TEST_AND_SET_VAR(paramList,
"nullspace: suppress dimension check",
bool, this->suppressNullspaceDimensionCheck_);
430 if (paramList.
isSublist(
"matvec params"))
431 this->matvecParams_ = Teuchos::parameterList(paramList.
sublist(
"matvec params"));
440 std::vector<keep_pair> keeps0;
441 UpdateFactoryManager(paramList,
ParameterList(), *defaultManager, 0 , keeps0);
447 for (
int levelID = 0; levelID < this->numDesiredLevel_; levelID++) {
456 std::vector<keep_pair> keeps;
460 UpdateFactoryManager(levelList, paramList, *levelManager, levelID, keeps);
464 UpdateFactoryManager(levelList, paramList, *levelManager, levelID, keeps);
467 this->keep_[levelID] = keeps;
468 this->AddFactoryManager(levelID, 1, levelManager);
478 this->GetOStream(static_cast<MsgType>(
Runtime1), 0) << paramList << std::endl;
493 for (
int levelID = 0; levelID < this->numDesiredLevel_; levelID++) {
494 std::string levelStr =
"level " +
toString(levelID);
509 std::ostringstream unusedParamsStream;
511 unusedParamList.
print(unusedParamsStream, indent);
513 this->GetOStream(
Warnings1) <<
"The following parameters were not used:\n"
514 << unusedParamsStream.str() << std::endl;
524 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
527 int levelID, std::vector<keep_pair>& keeps)
const {
531 using strings = std::unordered_set<std::string>;
541 MUELU_SET_VAR_2LIST(paramList, defaultList,
"multigrid algorithm", std::string, multigridAlgo);
542 TEUCHOS_TEST_FOR_EXCEPTION(strings({
"unsmoothed",
"sa",
"pg",
"emin",
"matlab",
"pcoarsen",
"classical",
"smoothed reitzinger",
"unsmoothed reitzinger",
"replicate",
"combine"}).count(multigridAlgo) == 0,
543 Exceptions::RuntimeError,
"Unknown \"multigrid algorithm\" value: \"" << multigridAlgo <<
"\". Please consult User's Guide.");
544 #ifndef HAVE_MUELU_MATLAB
546 "Cannot use matlab for multigrid algorithm - MueLu was not configured with MATLAB support.");
548 #ifndef HAVE_MUELU_INTREPID2
550 "Cannot use IntrepidPCoarsen prolongator factory - MueLu was not configured with Intrepid support.");
555 if (reuseType ==
"none" || reuseType ==
"S" || reuseType ==
"RP" || reuseType ==
"RAP") {
558 }
else if (reuseType ==
"tP" && (multigridAlgo !=
"sa" && multigridAlgo !=
"unsmoothed")) {
560 this->GetOStream(
Warnings0) <<
"Ignoring \"tP\" reuse option as it is only compatible with \"sa\", "
561 "or \"unsmoothed\" multigrid algorithms"
564 }
else if (reuseType ==
"emin" && multigridAlgo !=
"emin") {
566 this->GetOStream(
Warnings0) <<
"Ignoring \"emin\" reuse option it is only compatible with "
567 "\"emin\" multigrid algorithm"
573 bool have_userP =
false;
578 UpdateFactoryManager_CoarseSolvers(paramList, defaultList, manager, levelID, keeps);
581 UpdateFactoryManager_Smoothers(paramList, defaultList, manager, levelID, keeps);
585 UpdateFactoryManager_BlockNumber(paramList, defaultList, manager, levelID, keeps);
588 if (multigridAlgo ==
"unsmoothed reitzinger" || multigridAlgo ==
"smoothed reitzinger")
589 UpdateFactoryManager_Reitzinger(paramList, defaultList, manager, levelID, keeps);
591 UpdateFactoryManager_Aggregation_TentativeP(paramList, defaultList, manager, levelID, keeps);
595 UpdateFactoryManager_Nullspace(paramList, defaultList, manager, levelID, keeps, nullSpaceFactory);
606 }
else if (multigridAlgo ==
"unsmoothed" || multigridAlgo ==
"unsmoothed reitzinger") {
610 }
else if (multigridAlgo ==
"classical") {
614 }
else if (multigridAlgo ==
"sa" || multigridAlgo ==
"smoothed reitzinger") {
616 UpdateFactoryManager_SA(paramList, defaultList, manager, levelID, keeps);
618 }
else if (multigridAlgo ==
"emin") {
620 UpdateFactoryManager_Emin(paramList, defaultList, manager, levelID, keeps);
622 }
else if (multigridAlgo ==
"replicate") {
623 UpdateFactoryManager_Replicate(paramList, defaultList, manager, levelID, keeps);
625 }
else if (multigridAlgo ==
"combine") {
626 UpdateFactoryManager_Combine(paramList, defaultList, manager, levelID, keeps);
628 }
else if (multigridAlgo ==
"pg") {
630 UpdateFactoryManager_PG(paramList, defaultList, manager, levelID, keeps);
632 }
else if (multigridAlgo ==
"matlab") {
634 UpdateFactoryManager_Matlab(paramList, defaultList, manager, levelID, keeps);
636 }
else if (multigridAlgo ==
"pcoarsen") {
638 UpdateFactoryManager_PCoarsen(paramList, defaultList, manager, levelID, keeps);
642 UpdateFactoryManager_SemiCoarsen(paramList, defaultList, manager, levelID, keeps);
645 UpdateFactoryManager_Restriction(paramList, defaultList, manager, levelID, keeps);
648 UpdateFactoryManager_RAP(paramList, defaultList, manager, levelID, keeps);
651 UpdateFactoryManager_LocalOrdinalTransfer(
"BlockNumber", multigridAlgo, paramList, defaultList, manager, levelID, keeps);
654 UpdateFactoryManager_Coordinates(paramList, defaultList, manager, levelID, keeps);
657 UpdateFactoryManager_Material(paramList, defaultList, manager, levelID, keeps);
660 if ((reuseType ==
"RP" || reuseType ==
"RAP" || reuseType ==
"full") && levelID)
663 if (reuseType ==
"RP" && levelID) {
665 if (!this->implicitTranspose_)
668 if ((reuseType ==
"tP" || reuseType ==
"RP" || reuseType ==
"emin") && useCoordinates_ && levelID)
672 UpdateFactoryManager_Repartition(paramList, defaultList, manager, levelID, keeps, nullSpaceFactory);
675 UpdateFactoryManager_LowPrecision(paramList, defaultList, manager, levelID, keeps);
678 if ((reuseType ==
"RAP" || reuseType ==
"full") && levelID) {
680 if (!this->implicitTranspose_)
693 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
696 FactoryManager& manager,
int levelID, std::vector<keep_pair>& keeps)
const {
697 MUELU_SET_VAR_2LIST(paramList, defaultList,
"multigrid algorithm", std::string, multigridAlgo);
699 bool useMaxAbsDiagonalScaling =
false;
700 if (defaultList.
isParameter(
"sa: use rowsumabs diagonal scaling"))
701 useMaxAbsDiagonalScaling = defaultList.
get<
bool>(
"sa: use rowsumabs diagonal scaling");
705 bool isCustomSmoother =
708 paramList.
isSublist(
"smoother: params") || paramList.
isSublist(
"smoother: pre params") || paramList.
isSublist(
"smoother: post params") ||
714 manager.
SetFactory(
"Smoother", Teuchos::null);
716 }
else if (isCustomSmoother) {
720 #define TEST_MUTUALLY_EXCLUSIVE(arg1, arg2) \
721 TEUCHOS_TEST_FOR_EXCEPTION(paramList.isParameter(#arg1) && paramList.isParameter(#arg2), \
722 Exceptions::InvalidArgument, "You cannot specify both \"" #arg1 "\" and \"" #arg2 "\"");
723 #define TEST_MUTUALLY_EXCLUSIVE_S(arg1, arg2) \
724 TEUCHOS_TEST_FOR_EXCEPTION(paramList.isSublist(#arg1) && paramList.isSublist(#arg2), \
725 Exceptions::InvalidArgument, "You cannot specify both \"" #arg1 "\" and \"" #arg2 "\"");
741 defaultSmootherParams.
set(
"relaxation: type",
"Symmetric Gauss-Seidel");
746 std::string preSmootherType, postSmootherType;
750 overlap = paramList.
get<
int>(
"smoother: overlap");
754 preSmootherType = paramList.
get<std::string>(
"smoother: pre type");
756 MUELU_SET_VAR_2LIST(paramList, defaultList,
"smoother: type", std::string, preSmootherTypeTmp);
757 preSmootherType = preSmootherTypeTmp;
759 if (paramList.
isParameter(
"smoother: pre overlap"))
760 overlap = paramList.
get<
int>(
"smoother: pre overlap");
762 if (paramList.
isSublist(
"smoother: pre params"))
763 preSmootherParams = paramList.
sublist(
"smoother: pre params");
764 else if (paramList.
isSublist(
"smoother: params"))
765 preSmootherParams = paramList.
sublist(
"smoother: params");
766 else if (defaultList.
isSublist(
"smoother: params"))
767 preSmootherParams = defaultList.
sublist(
"smoother: params");
768 else if (preSmootherType ==
"RELAXATION")
769 preSmootherParams = defaultSmootherParams;
771 if (preSmootherType ==
"CHEBYSHEV" && useMaxAbsDiagonalScaling)
772 preSmootherParams.
set(
"chebyshev: use rowsumabs diagonal scaling",
true);
774 #ifdef HAVE_MUELU_INTREPID2
776 if (multigridAlgo ==
"pcoarsen" && preSmootherType ==
"TOPOLOGICAL" &&
780 auto pcoarsen_schedule = Teuchos::getArrayFromStringParameter<int>(defaultList,
"pcoarsen: schedule");
781 auto pcoarsen_element = defaultList.
get<std::string>(
"pcoarsen: element");
783 if (levelID < (
int)pcoarsen_schedule.size()) {
785 auto lo = pcoarsen_element + std::to_string(pcoarsen_schedule[levelID]);
786 preSmootherParams.
set(
"pcoarsen: hi basis", lo);
791 #ifdef HAVE_MUELU_MATLAB
792 if (preSmootherType ==
"matlab")
801 postSmootherType = paramList.
get<std::string>(
"smoother: post type");
803 MUELU_SET_VAR_2LIST(paramList, defaultList,
"smoother: type", std::string, postSmootherTypeTmp);
804 postSmootherType = postSmootherTypeTmp;
807 if (paramList.
isSublist(
"smoother: post params"))
808 postSmootherParams = paramList.
sublist(
"smoother: post params");
809 else if (paramList.
isSublist(
"smoother: params"))
810 postSmootherParams = paramList.
sublist(
"smoother: params");
811 else if (defaultList.
isSublist(
"smoother: params"))
812 postSmootherParams = defaultList.
sublist(
"smoother: params");
813 else if (postSmootherType ==
"RELAXATION")
814 postSmootherParams = defaultSmootherParams;
815 if (paramList.
isParameter(
"smoother: post overlap"))
816 overlap = paramList.
get<
int>(
"smoother: post overlap");
818 if (postSmootherType ==
"CHEBYSHEV" && useMaxAbsDiagonalScaling)
819 postSmootherParams.
set(
"chebyshev: use rowsumabs diagonal scaling",
true);
821 if (postSmootherType == preSmootherType &&
areSame(preSmootherParams, postSmootherParams))
822 postSmoother = preSmoother;
824 #ifdef HAVE_MUELU_INTREPID2
826 if (multigridAlgo ==
"pcoarsen" && preSmootherType ==
"TOPOLOGICAL" &&
830 auto pcoarsen_schedule = Teuchos::getArrayFromStringParameter<int>(defaultList,
"pcoarsen: schedule");
831 auto pcoarsen_element = defaultList.
get<std::string>(
"pcoarsen: element");
833 if (levelID < (
int)pcoarsen_schedule.size()) {
835 auto lo = pcoarsen_element + std::to_string(pcoarsen_schedule[levelID]);
836 postSmootherParams.
set(
"pcoarsen: hi basis", lo);
841 #ifdef HAVE_MUELU_MATLAB
842 if (postSmootherType ==
"matlab")
850 if (preSmoother == postSmoother)
853 manager.
SetFactory(
"PreSmoother", preSmoother);
854 manager.
SetFactory(
"PostSmoother", postSmoother);
861 bool reuseSmoothers = (reuseType ==
"S" || reuseType !=
"none");
862 if (reuseSmoothers) {
863 auto preSmootherFactory = rcp_const_cast<
Factory>(rcp_dynamic_cast<
const Factory>(manager.
GetFactory(
"PreSmoother")));
865 if (preSmootherFactory != Teuchos::null) {
867 postSmootherFactoryParams.
set(
"keep smoother data",
true);
868 preSmootherFactory->SetParameterList(postSmootherFactoryParams);
870 keeps.push_back(
keep_pair(
"PreSmoother data", preSmootherFactory.get()));
873 auto postSmootherFactory = rcp_const_cast<Factory>(rcp_dynamic_cast<
const Factory>(manager.
GetFactory(
"PostSmoother")));
874 if (postSmootherFactory != Teuchos::null) {
876 postSmootherFactoryParams.
set(
"keep smoother data",
true);
877 postSmootherFactory->SetParameterList(postSmootherFactoryParams);
879 keeps.push_back(
keep_pair(
"PostSmoother data", postSmootherFactory.get()));
882 auto coarseFactory = rcp_const_cast<Factory>(rcp_dynamic_cast<
const Factory>(manager.
GetFactory(
"CoarseSolver")));
883 if (coarseFactory != Teuchos::null) {
885 coarseFactoryParams.
set(
"keep smoother data",
true);
886 coarseFactory->SetParameterList(coarseFactoryParams);
888 keeps.push_back(
keep_pair(
"PreSmoother data", coarseFactory.get()));
892 if ((reuseType ==
"RAP" && levelID) || (reuseType ==
"full")) {
911 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
916 bool isCustomCoarseSolver =
920 manager.
SetFactory(
"CoarseSolver", Teuchos::null);
922 }
else if (isCustomCoarseSolver) {
930 overlap = paramList.
get<
int>(
"coarse: overlap");
933 if (paramList.
isSublist(
"coarse: params"))
934 coarseParams = paramList.
sublist(
"coarse: params");
935 else if (defaultList.
isSublist(
"coarse: params"))
936 coarseParams = defaultList.
sublist(
"coarse: params");
938 using strings = std::unordered_set<std::string>;
944 if (strings({
"RELAXATION",
"CHEBYSHEV",
"ILUT",
"ILU",
"RILUK",
"SCHWARZ",
"Amesos",
945 "BLOCK RELAXATION",
"BLOCK_RELAXATION",
"BLOCKRELAXATION",
946 "SPARSE BLOCK RELAXATION",
"SPARSE_BLOCK_RELAXATION",
"SPARSEBLOCKRELAXATION",
947 "LINESMOOTHING_BANDEDRELAXATION",
"LINESMOOTHING_BANDED_RELAXATION",
"LINESMOOTHING_BANDED RELAXATION",
948 "LINESMOOTHING_TRIDIRELAXATION",
"LINESMOOTHING_TRIDI_RELAXATION",
"LINESMOOTHING_TRIDI RELAXATION",
949 "LINESMOOTHING_TRIDIAGONALRELAXATION",
"LINESMOOTHING_TRIDIAGONAL_RELAXATION",
"LINESMOOTHING_TRIDIAGONAL RELAXATION",
950 "TOPOLOGICAL",
"FAST_ILU",
"FAST_IC",
"FAST_ILDL",
"HIPTMAIR"})
951 .count(coarseType)) {
954 #ifdef HAVE_MUELU_MATLAB
955 if (coarseType ==
"matlab")
969 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
972 FactoryManager& manager,
int levelID, std::vector<keep_pair>& keeps)
const {
988 rFactory->
SetFactory(
"D0", this->GetFactoryManager(levelID - 1)->GetFactory(
"D0"));
1000 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1003 FactoryManager& manager,
int levelID, std::vector<keep_pair>& keeps)
const {
1004 using strings = std::unordered_set<std::string>;
1014 if (aggType ==
"classical") {
1016 manager.
SetFactory(
"UnAmalgamationInfo", amalgFact);
1023 #ifdef HAVE_MUELU_MATLAB
1028 throw std::runtime_error(
"Cannot use MATLAB evolutionary strength-of-connection - MueLu was not configured with MATLAB support.");
1030 }
else if (
MUELU_TEST_PARAM_2LIST(paramList, paramList,
"aggregation: drop scheme", std::string,
"unsupported vector smoothing")) {
1042 if (!rcp_dynamic_cast<CoalesceDropFactory>(dropFactory).
is_null())
1043 dropParams.
set(
"lightweight wrap",
true);
1072 if (dropParams.
isParameter(
"aggregation: drop scheme")) {
1073 std::string drop_scheme = dropParams.
get<std::string>(
"aggregation: drop scheme");
1074 if (drop_scheme ==
"block diagonal colored signed classical")
1075 manager.
SetFactory(
"Coloring Graph", dropFactory);
1076 if (drop_scheme.find(
"block diagonal") != std::string::npos || drop_scheme ==
"signed classical") {
1078 dropFactory->
SetFactory(
"BlockNumber", this->GetFactoryManager(levelID - 1)->GetFactory(
"BlockNumber"));
1089 #ifndef HAVE_MUELU_MATLAB
1090 if (aggType ==
"matlab")
1091 throw std::runtime_error(
"Cannot use MATLAB aggregation - MueLu was not configured with MATLAB support.");
1094 if (aggType ==
"uncoupled") {
1123 }
else if (aggType ==
"brick") {
1136 manager.
SetFactory(
"DofsPerNode", aggFactory);
1142 aggFactory->
SetFactory(
"Coordinates", this->GetFactoryManager(levelID - 1)->GetFactory(
"Coordinates"));
1144 }
else if (aggType ==
"classical") {
1153 std::string drop_algo = tempParams.
get<std::string>(
"aggregation: drop scheme");
1154 if (drop_algo ==
"block diagonal colored signed classical") {
1155 mapParams.
set(
"aggregation: coloring: use color graph",
true);
1175 if (drop_algo.find(
"block diagonal") != std::string::npos || drop_algo ==
"signed classical") {
1177 aggFactory->
SetFactory(
"BlockNumber", this->GetFactoryManager(levelID - 1)->GetFactory(
"BlockNumber"));
1186 if (reuseType ==
"tP" && levelID) {
1191 }
else if (aggType ==
"notay") {
1202 #ifdef HAVE_MUELU_MATLAB
1203 else if (aggType ==
"matlab") {
1210 manager.
SetFactory(
"Aggregates", aggFactory);
1220 if (paramList.
isSublist(
"matrixmatrix: kernel params"))
1221 ptentParams.
sublist(
"matrixmatrix: kernel params",
false) = paramList.
sublist(
"matrixmatrix: kernel params");
1222 if (defaultList.
isSublist(
"matrixmatrix: kernel params"))
1223 ptentParams.
sublist(
"matrixmatrix: kernel params",
false) = defaultList.
sublist(
"matrixmatrix: kernel params");
1226 Ptent->SetParameterList(ptentParams);
1227 Ptent->SetFactory(
"Aggregates", manager.
GetFactory(
"Aggregates"));
1228 Ptent->SetFactory(
"CoarseMap", manager.
GetFactory(
"CoarseMap"));
1231 if (reuseType ==
"tP" && levelID) {
1232 keeps.push_back(
keep_pair(
"Nullspace", Ptent.get()));
1233 keeps.push_back(
keep_pair(
"P", Ptent.get()));
1240 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1243 int levelID, std::vector<keep_pair>& keeps)
const {
1256 std::string alg = paramList.
get(
"rap: algorithm",
"galerkin");
1257 if (alg ==
"shift" || alg ==
"non-galerkin") {
1271 if (paramList.
isSublist(
"matrixmatrix: kernel params"))
1272 RAPparams.
sublist(
"matrixmatrix: kernel params",
false) = paramList.
sublist(
"matrixmatrix: kernel params");
1273 if (defaultList.
isSublist(
"matrixmatrix: kernel params"))
1274 RAPparams.
sublist(
"matrixmatrix: kernel params",
false) = defaultList.
sublist(
"matrixmatrix: kernel params");
1281 if (!paramList.
isParameter(
"rap: triple product") &&
1282 paramList.
isType<std::string>(
"multigrid algorithm") &&
1283 paramList.
get<std::string>(
"multigrid algorithm") ==
"unsmoothed")
1284 paramList.
set(
"rap: triple product",
true);
1289 if (paramList.
isParameter(
"aggregation: allow empty prolongator columns")) {
1290 RAPparams.
set(
"CheckMainDiagonal", paramList.
get<
bool>(
"aggregation: allow empty prolongator columns"));
1291 RAPparams.
set(
"RepairMainDiagonal", paramList.
get<
bool>(
"aggregation: allow empty prolongator columns"));
1292 }
else if (defaultList.
isParameter(
"aggregation: allow empty prolongator columns")) {
1293 RAPparams.
set(
"CheckMainDiagonal", defaultList.
get<
bool>(
"aggregation: allow empty prolongator columns"));
1294 RAPparams.
set(
"RepairMainDiagonal", defaultList.
get<
bool>(
"aggregation: allow empty prolongator columns"));
1310 if (!this->implicitTranspose_) {
1328 if (
MUELU_TEST_PARAM_2LIST(paramList, defaultList,
"aggregation: compute aggregate qualities",
bool,
true)) {
1342 manager.
SetFactory(
"AggregateQualities", aggQualityFact);
1350 if (
MUELU_TEST_PARAM_2LIST(paramList, defaultList,
"aggregation: export visualization data",
bool,
true)) {
1379 MUELU_SET_VAR_2LIST(paramList, defaultList,
"sa: use filtered matrix",
bool, useFiltering);
1380 bool filteringChangesMatrix = useFiltering && !
MUELU_TEST_PARAM_2LIST(paramList, defaultList,
"aggregation: drop tol",
double, 0);
1382 if (reuseType ==
"RP" || (reuseType ==
"tP" && !filteringChangesMatrix)) {
1384 keeps.push_back(
keep_pair(
"AP reuse data", RAP.
get()));
1385 keeps.push_back(
keep_pair(
"RAP reuse data", RAP.
get()));
1388 keeps.push_back(
keep_pair(
"AP reuse data", RAPs.
get()));
1389 keeps.push_back(
keep_pair(
"RAP reuse data", RAPs.
get()));
1397 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1401 bool have_userCO =
false;
1405 if (useCoordinates_) {
1416 if (!RAP.is_null()) {
1417 RAP->AddTransferFactory(manager.
GetFactory(
"Coordinates"));
1420 RAPs->AddTransferFactory(manager.
GetFactory(
"Coordinates"));
1429 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1433 bool have_userMaterial =
false;
1435 have_userMaterial =
true;
1438 if (have_userMaterial) {
1443 materialTransferParameters.
set(
"Vector name",
"Material");
1444 materialTransferParameters.
set(
"Transfer name",
"P");
1445 materialTransferParameters.
set(
"Normalize",
true);
1448 manager.
SetFactory(
"Material", materialTransfer);
1451 if (!RAP.is_null()) {
1452 RAP->AddTransferFactory(manager.
GetFactory(
"Material"));
1455 RAPs->AddTransferFactory(manager.
GetFactory(
"Material"));
1464 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1467 FactoryManager& manager,
int levelID, std::vector<keep_pair>& )
const {
1470 if (useBlockNumber_ && (levelID > 0)) {
1473 if (!RAP.is_null() || !RAPs.is_null()) {
1475 if (multigridAlgo ==
"classical")
1481 fact->
SetFactory(VarName, this->GetFactoryManager(levelID - 1)->GetFactory(VarName));
1486 RAP->AddTransferFactory(manager.
GetFactory(VarName));
1488 RAPs->AddTransferFactory(manager.
GetFactory(VarName));
1496 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1499 FactoryManager& manager,
int levelID, std::vector<keep_pair>& keeps)
const {
1500 if (useBlockNumber_) {
1512 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1515 int levelID, std::vector<keep_pair>& )
const {
1516 MUELU_SET_VAR_2LIST(paramList, defaultList,
"multigrid algorithm", std::string, multigridAlgo);
1517 bool have_userR =
false;
1523 if (!this->implicitTranspose_) {
1526 if (isSymmetric ==
false && (multigridAlgo ==
"unsmoothed" || multigridAlgo ==
"emin")) {
1527 this->GetOStream(
Warnings0) <<
"Switching \"problem: symmetric\" parameter to symmetric as multigrid algorithm. " << multigridAlgo <<
" is primarily supposed to be used for symmetric problems.\n\n"
1528 <<
"Please note: if you are using \"unsmoothed\" transfer operators the \"problem: symmetric\" parameter "
1529 <<
"has no real mathematical meaning, i.e. you can use it for non-symmetric\n"
1530 <<
"problems, too. With \"problem: symmetric\"=\"symmetric\" you can use implicit transpose for building "
1531 <<
"the restriction operators which may drastically reduce the amount of consumed memory." << std::endl;
1535 "Petrov-Galerkin smoothed transfer operators are only allowed for non-symmetric problems: Set \"problem: symmetric\" to false!\n"
1536 "While PG smoothed transfer operators generally would also work for symmetric problems this is an unusual use case. "
1537 "You can use the factory-based xml interface though if you need PG-AMG for symmetric problems.");
1556 if (paramList.
isParameter(
"restriction: scale nullspace") && paramList.
get<
bool>(
"restriction: scale nullspace")) {
1559 tentPlist.
set(
"Nullspace name",
"Scaled Nullspace");
1572 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1575 int levelID, std::vector<keep_pair>& keeps,
RCP<Factory>& nullSpaceFactory)
const {
1580 #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
1581 MUELU_SET_VAR_2LIST(paramList, defaultList,
"repartition: use subcommunicators in place",
bool, enableInPlace);
1618 "Reuse types \"tP\" and \"PR\" require \"repartition: rebalance P and R\" set to \"false\"");
1623 MUELU_SET_VAR_2LIST(paramList, defaultList,
"repartition: partitioner", std::string, partName);
1625 "Invalid partitioner name: \"" << partName <<
"\". Valid options: \"zoltan\", \"zoltan2\"");
1627 #ifndef HAVE_MUELU_ZOLTAN
1628 bool switched =
false;
1629 if (partName ==
"zoltan") {
1630 this->GetOStream(
Warnings0) <<
"Zoltan interface is not available, trying to switch to Zoltan2" << std::endl;
1631 partName =
"zoltan2";
1635 #ifndef HAVE_MUELU_ZOLTAN2
1636 bool switched =
false;
1637 #endif // HAVE_MUELU_ZOLTAN2
1638 #endif // HAVE_MUELU_ZOLTAN
1640 #ifndef HAVE_MUELU_ZOLTAN2
1641 if (partName ==
"zoltan2" && !switched) {
1642 this->GetOStream(
Warnings0) <<
"Zoltan2 interface is not available, trying to switch to Zoltan" << std::endl;
1643 partName =
"zoltan";
1645 #endif // HAVE_MUELU_ZOLTAN2
1647 MUELU_SET_VAR_2LIST(paramList, defaultList,
"repartition: node repartition level",
int, nodeRepartitionLevel);
1659 repartheurFactory->SetParameterList(repartheurParams);
1660 repartheurFactory->SetFactory(
"A", manager.
GetFactory(
"A"));
1661 manager.
SetFactory(
"number of partitions", repartheurFactory);
1662 manager.
SetFactory(
"repartition: heuristic target rows per process", repartheurFactory);
1666 if (levelID == nodeRepartitionLevel) {
1673 }
else if (partName ==
"zoltan") {
1674 #ifdef HAVE_MUELU_ZOLTAN
1679 #endif // HAVE_MUELU_ZOLTAN
1680 }
else if (partName ==
"zoltan2") {
1681 #ifdef HAVE_MUELU_ZOLTAN2
1685 partParams.
set(
"ParameterList", partpartParams);
1687 partitioner->
SetFactory(
"repartition: heuristic target rows per process",
1688 manager.
GetFactory(
"repartition: heuristic target rows per process"));
1691 #endif // HAVE_MUELU_ZOLTAN2
1696 if (useCoordinates_)
1698 manager.
SetFactory(
"Partition", partitioner);
1707 repartFactory->SetParameterList(repartParams);
1708 repartFactory->SetFactory(
"A", manager.
GetFactory(
"A"));
1709 repartFactory->SetFactory(
"number of partitions", manager.
GetFactory(
"number of partitions"));
1710 repartFactory->SetFactory(
"Partition", manager.
GetFactory(
"Partition"));
1711 manager.
SetFactory(
"Importer", repartFactory);
1712 if (reuseType !=
"none" && reuseType !=
"S" && levelID)
1715 if (enableInPlace) {
1723 newA->SetParameterList(rebAcParams);
1724 newA->SetFactory(
"A", manager.
GetFactory(
"A"));
1725 newA->SetFactory(
"InPlaceMap", manager.
GetFactory(
"InPlaceMap"));
1732 newA->SetParameterList(rebAcParams);
1733 newA->SetFactory(
"A", manager.
GetFactory(
"A"));
1734 newA->SetFactory(
"Importer", manager.
GetFactory(
"Importer"));
1740 newPparams.
set(
"type",
"Interpolation");
1741 if (changedPRrebalance_)
1742 newPparams.
set(
"repartition: rebalance P and R", this->doPRrebalance_);
1743 if (changedPRViaCopyrebalance_)
1744 newPparams.
set(
"repartition: explicit via new copy rebalance P and R",
true);
1746 newP->SetParameterList(newPparams);
1747 newP->SetFactory(
"Importer", manager.
GetFactory(
"Importer"));
1748 newP->SetFactory(
"P", manager.
GetFactory(
"P"));
1750 if (!paramList.
isParameter(
"semicoarsen: number of levels"))
1751 newP->SetFactory(
"Nullspace", manager.
GetFactory(
"Ptent"));
1753 newP->SetFactory(
"Nullspace", manager.
GetFactory(
"P"));
1754 if (useCoordinates_) {
1755 newP->SetFactory(
"Coordinates", manager.
GetFactory(
"Coordinates"));
1759 newP->SetFactory(
"Material", manager.
GetFactory(
"Material"));
1762 if (useBlockNumber_ && (levelID > 0)) {
1763 newP->SetFactory(
"BlockNumber", manager.
GetFactory(
"BlockNumber"));
1770 newRparams.
set(
"type",
"Restriction");
1772 if (changedPRrebalance_)
1773 newRparams.
set(
"repartition: rebalance P and R", this->doPRrebalance_);
1774 if (changedPRViaCopyrebalance_)
1775 newPparams.
set(
"repartition: explicit via new copy rebalance P and R",
true);
1776 if (changedImplicitTranspose_)
1777 newRparams.
set(
"transpose: use implicit", this->implicitTranspose_);
1778 newR->SetParameterList(newRparams);
1779 newR->SetFactory(
"Importer", manager.
GetFactory(
"Importer"));
1780 if (!this->implicitTranspose_) {
1781 newR->SetFactory(
"R", manager.
GetFactory(
"R"));
1794 nullSpaceFactory->
SetFactory(
"Nullspace", newP);
1798 paramList.
set(
"repartition: enable",
false);
1800 this->GetOStream(
Warnings0) <<
"No repartitioning available for a serial run\n";
1802 this->GetOStream(
Warnings0) <<
"Zoltan/Zoltan2 are unavailable for repartitioning\n";
1804 #endif // defined(HAVE_MPI) && (defined(HAVE_MUELU_ZOLTAN) || defined(HAVE_MUELU_ZOLTAN2))
1811 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1814 int levelID, std::vector<keep_pair>& keeps)
const {
1815 MUELU_SET_VAR_2LIST(paramList, defaultList,
"transfers: half precision",
bool, enableLowPrecision);
1817 if (enableLowPrecision) {
1821 newPparams.
set(
"matrix key",
"P");
1822 newP->SetParameterList(newPparams);
1823 newP->SetFactory(
"P", manager.
GetFactory(
"P"));
1826 if (!this->implicitTranspose_) {
1830 newRparams.
set(
"matrix key",
"R");
1831 newR->SetParameterList(newRparams);
1832 newR->SetFactory(
"R", manager.
GetFactory(
"R"));
1841 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1844 int , std::vector<keep_pair>& ,
RCP<Factory>& nullSpaceFactory)
const {
1848 bool have_userNS =
false;
1859 nullSpaceFactory = nullSpace;
1861 if (paramList.
isParameter(
"restriction: scale nullspace") && paramList.
get<
bool>(
"restriction: scale nullspace")) {
1863 scaledNSfactory->
SetFactory(
"Nullspace", nullSpaceFactory);
1864 manager.
SetFactory(
"Scaled Nullspace", scaledNSfactory);
1871 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1874 int , std::vector<keep_pair>& )
const {
1877 if (paramList.
isParameter(
"semicoarsen: number of levels") &&
1878 paramList.
get<
int>(
"semicoarsen: number of levels") > 0) {
1905 manager.
SetFactory(
"CoarseNumZLayers", linedetectionFactory);
1906 manager.
SetFactory(
"LineDetection_Layers", linedetectionFactory);
1907 manager.
SetFactory(
"LineDetection_VertLineIds", linedetectionFactory);
1911 manager.
SetFactory(
"Nullspace", togglePFactory);
1914 if (paramList.
isParameter(
"semicoarsen: number of levels")) {
1916 tf->SetFactory(
"Chosen P", manager.
GetFactory(
"P"));
1917 tf->AddCoordTransferFactory(semicoarsenFactory);
1922 tf->AddCoordTransferFactory(coords);
1930 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1933 int levelID, std::vector<keep_pair>& keeps)
const {
1934 #ifdef HAVE_MUELU_INTREPID2
1939 auto pcoarsen_schedule = Teuchos::getArrayFromStringParameter<int>(defaultList,
"pcoarsen: schedule");
1940 auto pcoarsen_element = defaultList.get<std::string>(
"pcoarsen: element");
1942 if (levelID >= (
int)pcoarsen_schedule.size()) {
1945 UpdateFactoryManager_SA(paramList, defaultList, manager, levelID, keeps);
1951 std::string lo = pcoarsen_element + std::to_string(pcoarsen_schedule[levelID]);
1952 std::string hi = (levelID ? pcoarsen_element + std::to_string(pcoarsen_schedule[levelID - 1]) : lo);
1953 Pparams.
set(
"pcoarsen: hi basis", hi);
1954 Pparams.
set(
"pcoarsen: lo basis", lo);
1955 P->SetParameterList(Pparams);
1968 P->SetParameterList(Pparams);
1981 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
1987 if (paramList.
isSublist(
"matrixmatrix: kernel params"))
1988 Pparams.
sublist(
"matrixmatrix: kernel params",
false) = paramList.
sublist(
"matrixmatrix: kernel params");
1989 if (defaultList.
isSublist(
"matrixmatrix: kernel params"))
1990 Pparams.
sublist(
"matrixmatrix: kernel params",
false) = defaultList.
sublist(
"matrixmatrix: kernel params");
2006 MUELU_SET_VAR_2LIST(paramList, defaultList,
"sa: use filtered matrix",
bool, useFiltering);
2040 bool filteringChangesMatrix = useFiltering && !
MUELU_TEST_PARAM_2LIST(paramList, defaultList,
"aggregation: drop tol",
double, 0);
2042 if (reuseType ==
"tP" && !filteringChangesMatrix)
2049 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2052 int , std::vector<keep_pair>& )
const {
2056 "Invalid pattern name: \"" << patternType <<
"\". Valid options: \"AkPtent\"");
2061 patternFactory->SetParameterList(patternParams);
2062 patternFactory->SetFactory(
"P", manager.
GetFactory(
"Ptent"));
2063 manager.
SetFactory(
"Ppattern", patternFactory);
2067 constraintFactory->SetFactory(
"Ppattern", manager.
GetFactory(
"Ppattern"));
2068 constraintFactory->SetFactory(
"CoarseNullspace", manager.
GetFactory(
"Ptent"));
2069 manager.
SetFactory(
"Constraint", constraintFactory);
2074 MUELU_SET_VAR_2LIST(paramList, defaultList,
"emin: use filtered matrix",
bool, useFiltering);
2098 P->SetFactory(
"A", filterFactory);
2101 P->SetFactory(
"A", manager.
GetFactory(
"Graph"));
2109 if (reuseType ==
"emin") {
2111 Pparams.
set(
"Keep P0",
true);
2112 Pparams.
set(
"Keep Constraint0",
true);
2114 P->SetParameterList(Pparams);
2115 P->SetFactory(
"P", manager.
GetFactory(
"Ptent"));
2116 P->SetFactory(
"Constraint", manager.
GetFactory(
"Constraint"));
2123 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2126 int , std::vector<keep_pair>& )
const {
2128 "Implicit transpose not supported with Petrov-Galerkin smoothed transfer operators: Set \"transpose: use implicit\" to false!\n"
2129 "Petrov-Galerkin transfer operator smoothing for non-symmetric problems requires a separate handling of the restriction operator which "
2130 "does not allow the usage of implicit transpose easily.");
2134 P->SetFactory(
"P", manager.
GetFactory(
"Ptent"));
2141 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2149 P->SetParameterList(Pparams);
2156 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2164 P->SetParameterList(Pparams);
2171 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2174 int , std::vector<keep_pair>& )
const {
2175 #ifdef HAVE_MUELU_MATLAB
2178 P->SetParameterList(Pparams);
2179 P->SetFactory(
"P", manager.
GetFactory(
"Ptent"));
2187 #undef MUELU_SET_VAR_2LIST
2188 #undef MUELU_TEST_AND_SET_VAR
2189 #undef MUELU_TEST_AND_SET_PARAM_2LIST
2190 #undef MUELU_TEST_PARAM_2LIST
2191 #undef MUELU_KOKKOS_FACTORY
2195 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2200 const int maxLevels = 100;
2203 std::vector<ParameterList> paramLists;
2204 for (
int levelID = 0; levelID < maxLevels; levelID++) {
2205 std::string sublistName =
"level " +
toString(levelID);
2207 paramLists.push_back(paramList.
sublist(sublistName));
2209 paramList.
remove(sublistName);
2212 paramLists.push_back(paramList);
2214 #ifdef HAVE_MUELU_MATLAB
2216 for (
size_t i = 0; i < paramLists.size(); i++) {
2217 std::vector<std::string> customVars;
2220 std::string paramName = paramLists[i].name(it);
2223 customVars.push_back(paramName);
2227 for (
size_t j = 0; j < customVars.size(); j++)
2228 paramLists[i].
remove(customVars[j],
false);
2232 const int maxDepth = 0;
2233 for (
size_t i = 0; i < paramLists.size(); i++) {
2236 paramLists[i].validateParameters(validList, maxDepth);
2239 std::string eString = e.what();
2242 size_t nameStart = eString.find_first_of(
'"') + 1;
2243 size_t nameEnd = eString.find_first_of(
'"', nameStart);
2244 std::string name = eString.substr(nameStart, nameEnd - nameStart);
2246 size_t bestScore = 100;
2247 std::string bestName =
"";
2249 const std::string& pName = validList.
name(it);
2250 this->GetOStream(
Runtime1) <<
"| " << pName;
2251 size_t score =
LevenshteinDistance(name.c_str(), name.length(), pName.c_str(), pName.length());
2252 this->GetOStream(
Runtime1) <<
" -> " << score << std::endl;
2253 if (score < bestScore) {
2258 if (bestScore < 10 && bestName !=
"") {
2260 eString <<
"The parameter name \"" + name +
"\" is not valid. Did you mean \"" + bestName <<
"\"?\n");
2264 eString <<
"The parameter name \"" + name +
"\" is not valid.\n");
2273 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2286 blockSize_ = paramList.
sublist(
"Matrix").
get<
int>(
"PDE equations", MasterList::getDefault<int>(
"number of equations"));
2291 if (factFact_ == Teuchos::null)
2304 this->BuildFactoryMap(paramList.
sublist(
"Factories"), factoryMap, factoryMap, factoryManagers);
2323 this->numDesiredLevel_ = hieraList.
get<
int>(
"max levels");
2324 hieraList.
remove(
"max levels");
2328 this->maxCoarseSize_ = hieraList.
get<
int>(
"coarse: max size");
2329 hieraList.
remove(
"coarse: max size");
2332 if (hieraList.
isParameter(
"repartition: rebalance P and R")) {
2333 this->doPRrebalance_ = hieraList.
get<
bool>(
"repartition: rebalance P and R");
2334 hieraList.
remove(
"repartition: rebalance P and R");
2337 if (hieraList.
isParameter(
"transpose: use implicit")) {
2338 this->implicitTranspose_ = hieraList.
get<
bool>(
"transpose: use implicit");
2339 hieraList.
remove(
"transpose: use implicit");
2342 if (hieraList.
isParameter(
"fuse prolongation and update")) {
2343 this->fuseProlongationAndUpdate_ = hieraList.
get<
bool>(
"fuse prolongation and update");
2344 hieraList.
remove(
"fuse prolongation and update");
2347 if (hieraList.
isParameter(
"nullspace: suppress dimension check")) {
2348 this->suppressNullspaceDimensionCheck_ = hieraList.
get<
bool>(
"nullspace: suppress dimension check");
2349 hieraList.
remove(
"nullspace: suppress dimension check");
2353 this->sizeOfMultiVectors_ = hieraList.
get<
int>(
"number of vectors");
2354 hieraList.
remove(
"number of vectors");
2357 if (hieraList.
isSublist(
"matvec params"))
2358 this->matvecParams_ = Teuchos::parameterList(hieraList.
sublist(
"matvec params"));
2360 if (hieraList.
isParameter(
"coarse grid correction scaling factor")) {
2361 this->scalingFactor_ = hieraList.
get<
double>(
"coarse grid correction scaling factor");
2362 hieraList.
remove(
"coarse grid correction scaling factor");
2367 std::map<std::string, CycleType> cycleMap;
2371 std::string cycleType = hieraList.
get<std::string>(
"cycle type");
2373 this->Cycle_ = cycleMap[cycleType];
2376 if (hieraList.
isParameter(
"W cycle start level")) {
2377 this->WCycleStartLevel_ = hieraList.
get<
int>(
"W cycle start level");
2381 std::string vl = hieraList.
get<std::string>(
"verbosity");
2382 hieraList.
remove(
"verbosity");
2389 if (hieraList.
isParameter(
"dependencyOutputLevel"))
2390 this->graphOutputLevel_ = hieraList.
get<
int>(
"dependencyOutputLevel");
2396 if (hieraList.
isSublist(
"DataToWrite")) {
2400 std::string dataName =
"Matrices";
2402 this->matricesToPrint_[
"A"] = Teuchos::getArrayFromStringParameter<int>(foo, dataName);
2403 dataName =
"Prolongators";
2405 this->matricesToPrint_[
"P"] = Teuchos::getArrayFromStringParameter<int>(foo, dataName);
2406 dataName =
"Restrictors";
2408 this->matricesToPrint_[
"R"] = Teuchos::getArrayFromStringParameter<int>(foo, dataName);
2411 this->matricesToPrint_[
"D0"] = Teuchos::getArrayFromStringParameter<int>(foo, dataName);
2416 const std::string& paramName = hieraList.
name(param);
2418 if (paramName !=
"DataToWrite" && hieraList.
isSublist(paramName)) {
2423 startLevel = levelList.
get<
int>(
"startLevel");
2424 levelList.
remove(
"startLevel");
2426 int numDesiredLevel = 1;
2428 numDesiredLevel = levelList.
get<
int>(
"numDesiredLevel");
2429 levelList.
remove(
"numDesiredLevel");
2443 BuildFactoryMap(levelList, factoryMap, levelFactoryMap, factoryManagers);
2449 if (startLevel >= 0)
2450 this->AddFactoryManager(startLevel, numDesiredLevel, m);
2581 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2585 const std::string& paramName = paramList.
name(param);
2590 if (paramValue.
isList()) {
2591 ParameterList paramList1 = Teuchos::getValue<ParameterList>(paramValue);
2595 "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.");
2597 factoryMapOut[paramName] = factFact_->BuildFactory(paramValue, factoryMapIn, factoryManagers);
2599 }
else if (paramList1.
isParameter(
"dependency for")) {
2601 "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.");
2603 std::string factoryName = paramList1.
get<std::string>(
"dependency for");
2607 "MueLu::ParameterListInterpreter(): could not find factory " + factoryName +
" in factory map. Did you define it before?");
2615 const std::string& pName = validParamList->name(vparam);
2625 factory->SetFactory(pName, generatingFact.
create_weak());
2628 if (pName ==
"ParameterList") {
2637 factory->SetParameter(pName, paramList1.
getEntry(pName));
2643 std::string groupType = paramList1.
get<std::string>(
"group");
2645 "group must be of type \"FactoryManager\".");
2648 groupList.
remove(
"group");
2650 bool setKokkosRefactor =
false;
2651 bool kokkosRefactor = useKokkos_;
2652 if (groupList.
isParameter(
"use kokkos refactor")) {
2653 kokkosRefactor = groupList.
get<
bool>(
"use kokkos refactor");
2654 groupList.
remove(
"use kokkos refactor");
2655 setKokkosRefactor =
true;
2659 BuildFactoryMap(groupList, factoryMapIn, groupFactoryMap, factoryManagers);
2664 if (setKokkosRefactor)
2666 factoryManagers[paramName] = m;
2669 this->GetOStream(
Warnings0) <<
"Could not interpret parameter list " << paramList1 << std::endl;
2671 "XML Parameter list must either be of type \"factory\" or of type \"group\".");
2675 factoryMapOut[paramName] = factFact_->BuildFactory(paramValue, factoryMapIn, factoryManagers);
2683 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2686 Matrix& A =
dynamic_cast<Matrix&
>(Op);
2687 if (A.IsFixedBlockSizeSet() && (A.GetFixedBlockSize() != blockSize_))
2688 this->GetOStream(
Warnings0) <<
"Setting matrix block size to " << blockSize_ <<
" (value of the parameter in the list) "
2689 <<
"instead of " << A.GetFixedBlockSize() <<
" (provided matrix)." << std::endl
2690 <<
"You may want to check \"number of equations\" (or \"PDE equations\" for factory style list) parameter." << std::endl;
2692 A.SetFixedBlockSize(blockSize_, dofOffset_);
2694 #ifdef HAVE_MUELU_DEBUG
2695 MatrixUtils::checkLocalRowMapMatchesColMap(A);
2696 #endif // HAVE_MUELU_DEBUG
2698 }
catch (std::bad_cast&) {
2699 this->GetOStream(
Warnings0) <<
"Skipping setting block size as the operator is not a matrix" << std::endl;
2703 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2715 const std::string& name = it->first;
2722 compare(Teuchos::getValue<ParameterList>(entry1), Teuchos::getValue<ParameterList>(*entry2));
2738 #define MUELU_PARAMETERLISTINTERPRETER_SHORT
Important warning messages (one line)
Generic Smoother Factory for generating the smoothers of the MG hierarchy.
virtual ~ParameterListInterpreter()
Destructor.
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...
virtual void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)
Configuration.
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
#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.
#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)
Class for restricting a MultiVector from a finer to a coarser level.
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.
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#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.
static void DisableMultipleCheckGlobally()
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
static void EnableTimerSync()
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
void UpdateFactoryManager_Material(Teuchos::ParameterList ¶mList, const Teuchos::ParameterList &defaultList, FactoryManager &manager, int levelID, std::vector< keep_pair > &keeps) 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.
static const RCP< const NoFactory > getRCP()
Static Get() functions.
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...
virtual void SetupHierarchy(Hierarchy &H) const
Setup Hierarchy object.
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.
This class checks matrix properties of A on current level. This factory can be plugged in everywhere ...
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.
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...
Exception throws to report invalid user entry.
#define TEUCHOS_TEST_FOR_EXCEPTION_PURE_MSG(throw_exception_test, Exception, msg)
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