146 const Teuchos::ParameterList& pL = GetParameterList();
148 RCP<SmootherPrototype> preSmoother, postSmoother;
149 ParameterList preSmootherParams, postSmootherParams;
151 if ((preOrPost &
PRE) && !preSmootherPrototype_.is_null()) {
153 if (currentLevel.
IsAvailable(
"PreSmoother data",
this))
154 preSmoother = currentLevel.
Get<RCP<SmootherPrototype> >(
"PreSmoother data",
this);
156 preSmoother = preSmootherPrototype_->Copy();
159 if (!currentLevel.
GetComm().is_null())
160 oldRank = preSmoother->SetProcRankVerbose(currentLevel.
GetComm()->getRank());
162 preSmoother->Setup(currentLevel);
163 preSmootherParams = preSmoother->GetParameterList();
166 preSmoother->SetProcRankVerbose(oldRank);
168 currentLevel.
Set<RCP<SmootherBase> >(
"PreSmoother", preSmoother,
this);
170 if (pL.get<
bool>(
"keep smoother data"))
171 Set(currentLevel,
"PreSmoother data", preSmoother);
174 if ((preOrPost &
POST) && !postSmootherPrototype_.is_null()) {
175 if (preOrPost ==
BOTH && preSmootherPrototype_ == postSmootherPrototype_) {
178 postSmoother = preSmoother;
206 if (currentLevel.
IsAvailable(
"PostSmoother data",
this)) {
207 postSmoother = currentLevel.
Get<RCP<SmootherPrototype> >(
"PostSmoother data",
this);
212 postSmoother = postSmootherPrototype_->Copy();
216 if (!currentLevel.
GetComm().is_null())
217 oldRank = postSmoother->SetProcRankVerbose(GetProcRankVerbose());
219 postSmoother->Setup(currentLevel);
220 postSmootherParams = postSmoother->GetParameterList();
223 postSmoother->SetProcRankVerbose(oldRank);
226 currentLevel.
Set<RCP<SmootherBase> >(
"PostSmoother", postSmoother,
this);
228 if (pL.get<
bool>(
"keep smoother data"))
229 Set(currentLevel,
"PostSmoother data", postSmoother);
232 ParameterList& paramList =
const_cast<ParameterList&
>(this->GetParameterList());
233 if (postSmoother == preSmoother && !preSmoother.is_null()) {
234 paramList.sublist(
"smoother",
false) = preSmoother->GetParameterList();
237 if (!preSmoother.is_null())
238 paramList.sublist(
"presmoother",
false) = preSmootherParams;
240 if (!postSmoother.is_null())
241 paramList.sublist(
"postsmoother",
false) = postSmootherParams;
261 out0 <<
"PreSmoother : ";
262 if (preSmootherPrototype_.is_null()) {
263 out0 <<
"null" << std::endl;
265 Teuchos::OSTab tab2(out);
266 preSmootherPrototype_->describe(out, verbLevel);
269 out0 <<
"PostSmoother: ";
270 if (postSmootherPrototype_ == preSmootherPrototype_) { out0 <<
"same as PreSmoother" << std::endl; }
271 else if (postSmootherPrototype_ == Teuchos::null) { out0 <<
"null" << std::endl; }
273 Teuchos::OSTab tab2(out);
274 postSmootherPrototype_->describe(out, verbLevel);
275 out0 <<
"PostSmoother is different than PreSmoother (not the same object)" << std::endl;
279 if (verbLevel &
Debug) {
280 if (preSmootherPrototype_ != Teuchos::null || postSmootherPrototype_ != Teuchos::null) { out0 <<
"-" << std::endl; }
281 if (preSmootherPrototype_ != Teuchos::null) { out0 <<
"RCP<preSmootherPrototype_> : " << preSmootherPrototype_ << std::endl; }
282 if (postSmootherPrototype_ != Teuchos::null) { out0 <<
"RCP<postSmootherPrototype_>: " << postSmootherPrototype_ << std::endl; }
T & Get(const std::string &ename, const FactoryBase *factory=NoFactory::get())
Get data without decrementing associated storage counter (i.e., read-only access)....