112 const Teuchos::ParameterList& pL = GetParameterList();
114 RCP<SmootherPrototype> preSmoother, postSmoother;
115 ParameterList preSmootherParams, postSmootherParams;
117 if ((preOrPost &
PRE) && !preSmootherPrototype_.is_null()) {
118 if (currentLevel.
IsAvailable(
"PreSmoother data",
this))
119 preSmoother = currentLevel.
Get<RCP<SmootherPrototype> >(
"PreSmoother data",
this);
121 preSmoother = preSmootherPrototype_->Copy();
124 if (!currentLevel.
GetComm().is_null())
125 oldRank = preSmoother->SetProcRankVerbose(currentLevel.
GetComm()->getRank());
127 preSmoother->Setup(currentLevel);
128 preSmootherParams = preSmoother->GetParameterList();
131 preSmoother->SetProcRankVerbose(oldRank);
133 currentLevel.
Set<RCP<SmootherBase> >(
"PreSmoother", preSmoother,
this);
135 if (pL.get<
bool>(
"keep smoother data"))
136 Set(currentLevel,
"PreSmoother data", preSmoother);
139 if ((preOrPost &
POST) && !postSmootherPrototype_.is_null()) {
140 if (preOrPost ==
BOTH && preSmootherPrototype_ == postSmootherPrototype_) {
143 postSmoother = preSmoother;
170 if (currentLevel.
IsAvailable(
"PostSmoother data",
this)) {
171 postSmoother = currentLevel.
Get<RCP<SmootherPrototype> >(
"PostSmoother data",
this);
176 postSmoother = postSmootherPrototype_->Copy();
180 if (!currentLevel.
GetComm().is_null())
181 oldRank = postSmoother->SetProcRankVerbose(GetProcRankVerbose());
183 postSmoother->Setup(currentLevel);
184 postSmootherParams = postSmoother->GetParameterList();
187 postSmoother->SetProcRankVerbose(oldRank);
190 currentLevel.
Set<RCP<SmootherBase> >(
"PostSmoother", postSmoother,
this);
192 if (pL.get<
bool>(
"keep smoother data"))
193 Set(currentLevel,
"PostSmoother data", postSmoother);
196 ParameterList& paramList =
const_cast<ParameterList&
>(this->GetParameterList());
197 if (postSmoother == preSmoother && !preSmoother.is_null()) {
198 paramList.sublist(
"smoother",
false) = preSmoother->GetParameterList();
201 if (!preSmoother.is_null())
202 paramList.sublist(
"presmoother",
false) = preSmootherParams;
204 if (!postSmoother.is_null())
205 paramList.sublist(
"postsmoother",
false) = postSmootherParams;
225 out0 <<
"PreSmoother : ";
226 if (preSmootherPrototype_.is_null()) {
227 out0 <<
"null" << std::endl;
229 Teuchos::OSTab tab2(out);
230 preSmootherPrototype_->describe(out, verbLevel);
233 out0 <<
"PostSmoother: ";
234 if (postSmootherPrototype_ == preSmootherPrototype_) {
235 out0 <<
"same as PreSmoother" << std::endl;
236 }
else if (postSmootherPrototype_ == Teuchos::null) {
237 out0 <<
"null" << std::endl;
239 Teuchos::OSTab tab2(out);
240 postSmootherPrototype_->describe(out, verbLevel);
241 out0 <<
"PostSmoother is different than PreSmoother (not the same object)" << std::endl;
245 if (verbLevel &
Debug) {
246 if (preSmootherPrototype_ != Teuchos::null || postSmootherPrototype_ != Teuchos::null) {
247 out0 <<
"-" << std::endl;
249 if (preSmootherPrototype_ != Teuchos::null) {
250 out0 <<
"RCP<preSmootherPrototype_> : " << preSmootherPrototype_ << std::endl;
252 if (postSmootherPrototype_ != Teuchos::null) {
253 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)....