46 #ifndef MUELU_FACTORYMANAGER_DEF_HPP 47 #define MUELU_FACTORYMANAGER_DEF_HPP 54 #include "MueLu_AmalgamationFactory.hpp" 55 #include "MueLu_CoalesceDropFactory.hpp" 56 #include "MueLu_CoarseMapFactory.hpp" 57 #include "MueLu_ConstraintFactory.hpp" 58 #include "MueLu_DirectSolver.hpp" 59 #include "MueLu_LineDetectionFactory.hpp" 60 #include "MueLu_MultiVectorTransferFactory.hpp" 62 #include "MueLu_NullspaceFactory.hpp" 63 #include "MueLu_PatternFactory.hpp" 64 #include "MueLu_RAPFactory.hpp" 65 #include "MueLu_RepartitionHeuristicFactory.hpp" 66 #include "MueLu_RepartitionFactory.hpp" 67 #include "MueLu_SaPFactory.hpp" 68 #include "MueLu_SmootherFactory.hpp" 69 #include "MueLu_TentativePFactory.hpp" 70 #include "MueLu_TransPFactory.hpp" 71 #include "MueLu_TrilinosSmoother.hpp" 72 #include "MueLu_UncoupledAggregationFactory.hpp" 73 #include "MueLu_ZoltanInterface.hpp" 78 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
80 factoryTable_[varName] = factory;
83 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
85 if (factoryTable_.count(varName)) {
87 return factoryTable_.find(varName)->second;
91 return GetDefaultFactory(varName);
94 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
96 if (defaultFactoryTable_.count(varName)) {
98 return defaultFactoryTable_.find(varName)->second;
102 if (varName ==
"A")
return SetAndReturnDefaultFactory(varName,
rcp(
new RAPFactory()));
103 if (varName ==
"RAP Pattern")
return GetFactory(
"A");
104 if (varName ==
"AP Pattern")
return GetFactory(
"A");
105 if (varName ==
"Ptent")
return SetAndReturnDefaultFactory(varName,
rcp(
new TentativePFactory()));
106 if (varName ==
"P") {
109 factory->
SetFactory(
"P", GetFactory(
"Ptent"));
110 return SetAndReturnDefaultFactory(varName, factory);
112 if (varName ==
"Nullspace") {
115 factory->
SetFactory(
"Nullspace", GetFactory(
"Ptent"));
116 return SetAndReturnDefaultFactory(varName, factory);
119 if (varName ==
"R")
return SetAndReturnDefaultFactory(varName,
rcp(
new TransPFactory()));
120 #if defined(HAVE_MUELU_ZOLTAN) && defined(HAVE_MPI) 121 if (varName ==
"Partition")
return SetAndReturnDefaultFactory(varName,
rcp(
new ZoltanInterface()));
122 #endif //ifdef HAVE_MPI 124 if (varName ==
"Importer") {
131 if (varName ==
"number of partitions") {
140 if (varName ==
"UnAmalgamationInfo")
return SetAndReturnDefaultFactory(varName,
rcp(
new AmalgamationFactory()));
142 if (varName ==
"CoarseMap")
return SetAndReturnDefaultFactory(varName,
rcp(
new CoarseMapFactory()));
143 if (varName ==
"DofsPerNode")
return GetFactory(
"Graph");
144 if (varName ==
"Filtering")
return GetFactory(
"Graph");
145 if (varName ==
"LineDetection_VertLineIds")
return SetAndReturnDefaultFactory(varName,
rcp(
new LineDetectionFactory()));
146 if (varName ==
"LineDetection_Layers")
return GetFactory(
"LineDetection_VertLineIds");
147 if (varName ==
"CoarseNumZLayers")
return GetFactory(
"LineDetection_VertLineIds");
150 if (varName ==
"PreSmoother")
return GetFactory(
"Smoother");
151 if (varName ==
"PostSmoother")
return GetFactory(
"Smoother");
153 if (varName ==
"Ppattern") {
156 return SetAndReturnDefaultFactory(varName, PpFact);
158 if (varName ==
"Constraint")
return SetAndReturnDefaultFactory(varName,
rcp(
new ConstraintFactory()));
160 if (varName ==
"Smoother") {
162 smootherParamList.
set(
"relaxation: type",
"Symmetric Gauss-Seidel");
173 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
177 GetOStream(
Runtime1) <<
"Using default factory (" << factory->
description() <<
") for building '" << varName <<
"'." << std::endl;
179 defaultFactoryTable_[varName] = factory;
181 return defaultFactoryTable_[varName];
184 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
186 std::map<std::string, RCP<const FactoryBase> >::const_iterator it;
190 fancy <<
"Users factory table (factoryTable_):" << std::endl;
191 for (it = factoryTable_.begin(); it != factoryTable_.end(); it++)
192 fancy <<
" " << it->first <<
" -> " <<
Teuchos::toString(it->second.get()) << std::endl;
194 fancy <<
"Default factory table (defaultFactoryTable_):" << std::endl;
195 for (it = defaultFactoryTable_.begin(); it != defaultFactoryTable_.end(); it++)
196 fancy <<
" " << it->first <<
" -> " <<
Teuchos::toString(it->second.get()) << std::endl;
199 #ifdef HAVE_MUELU_DEBUG 200 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
202 std::map<std::string, RCP<const FactoryBase> >::const_iterator it;
204 for (it = factoryTable_.begin(); it != factoryTable_.end(); it++)
205 if (!it->second.is_null())
206 it->second->ResetDebugData();
208 for (it = defaultFactoryTable_.begin(); it != defaultFactoryTable_.end(); it++)
209 if (!it->second.is_null())
210 it->second->ResetDebugData();
221 #endif // MUELU_FACTORYMANAGER_DEF_HPP Generic Smoother Factory for generating the smoothers of the MG hierarchy.
This class specifies the default factory that should generate some data on a Level if the data does n...
Factory for determing the number of partitions for rebalancing.
Factory for generating coarse level map. Used by TentativePFactory.
Class that encapsulates external library smoothers.
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.
Print additional debugging information.
Namespace for MueLu classes and methods.
Interface to Zoltan library.This interface provides access to partitioning methods in Zoltan...
Factory for building tentative prolongator.
Class that encapsulates direct solvers. Autoselection of AmesosSmoother or Amesos2Smoother according ...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
const RCP< const FactoryBase > SetAndReturnDefaultFactory(const std::string &varName, const RCP< const FactoryBase > &factory) const
Factory for building line detection information.
AmalgamationFactory for subblocks of strided map based amalgamation data.
Factory for building the constraint operator.
void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)
Set Factory.
const RCP< const FactoryBase > GetFactory(const std::string &varName) const
Get factory associated with a particular data name.
Factory for creating a graph base on a given matrix.
Factory for building nonzero patterns for energy minimization.
Factory for building restriction operators.
virtual void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)
Configuration.
Exception throws to report errors in the internal logical of the program.
Description of what is happening (more verbose)
Factory for building coarse matrices.
Factory for building Smoothed Aggregation prolongators.Input/output of SaPFactory
const RCP< const FactoryBase > GetDefaultFactory(const std::string &varName) const
Factory for building uncoupled aggregates.
virtual std::string description() const
Return a simple one-line description of this object.
std::string toString(const T &t)
Factory for generating nullspace.
static const RCP< const NoFactory > getRCP()
Static Get() functions.