26 if (initTimer_ == Teuchos::null)
27 initTimer_ = TimeMonitor::getNewTimer(
"PCDStrategy::initializePrec");
29 if (invSTimer_ == Teuchos::null)
30 invSTimer_ = TimeMonitor::getNewTimer(
"PCDStrategy::initializePrec invS");
32 if (invFTimer_ == Teuchos::null)
33 invFTimer_ = TimeMonitor::getNewTimer(
"PCDStrategy::initializePrec invF");
35 if (opsTimer_ == Teuchos::null)
36 opsTimer_ = TimeMonitor::getNewTimer(
"PCDStrategy::initializePrec buildOps");
92 Teko_DEBUG_SCOPE(
"PCDStrategy::initializeState", 10);
95 std::string pcdStr = getPCDString();
96 std::string presLapStr = getPressureLaplaceString();
97 std::string presMassStr = getPressureMassString();
102 Teuchos::TimeMonitor timer(*initTimer_,
true);
111 TEUCHOS_ASSERT(Qp != Teuchos::null);
116 if (massInverseType_ ==
NotDiag) {
118 Teko_DEBUG_SCOPE(
"Building inv(Mass)", 10);
120 if (invMass == Teuchos::null)
121 invMass = buildInverse(*invFactoryS_, Qp);
123 rebuildInverse(*invFactoryS_, Qp, invMass);
128 "Building inverse mass of type \"" << Teko::getDiagonalName(massInverseType_) <<
"\"", 10);
129 iQp = getInvDiagonalOp(Qp, massInverseType_);
136 Teuchos::TimeMonitor timerInvS(*invSTimer_,
true);
140 TEUCHOS_ASSERT(laplace != Teuchos::null);
141 if (invLaplace == Teuchos::null)
142 invLaplace = buildInverse(*invFactoryS_, laplace);
144 rebuildInverse(*invFactoryS_, laplace, invLaplace);
150 Teko_DEBUG_SCOPE(
"Building S", 10);
151 Teuchos::TimeMonitor timerS(*opsTimer_,
true);
156 TEUCHOS_ASSERT(pcd != Teuchos::null);
157 LinearOp invL = invLaplace;
160 if (schurCompOrdering_ ==
false)
161 invS = multiply(iQp, pcd, invL);
163 invS = multiply(invL, pcd, iQp);
171 Teko_DEBUG_SCOPE(
"Building inv(F)", 10);
172 Teuchos::TimeMonitor timerInvF(*invFTimer_,
true);
175 if (invF == Teuchos::null)
176 invF = buildInverse(*invFactoryF_, F);
178 rebuildInverse(*invFactoryF_, F, invF);
197 const InverseLibrary& invLib) {
198 Teko_DEBUG_SCOPE(
"PCDStrategy::initializeFromParameterList", 10);
200 std::string invStr =
"", invFStr =
"", invSStr =
"";
201#if defined(Teko_ENABLE_Amesos)
203#elif defined(Teko_ENABLE_Amesos2)
210 if (pl.isParameter(
"Inverse Type")) invStr = pl.get<std::string>(
"Inverse Type");
211 if (pl.isParameter(
"Inverse F Type")) invFStr = pl.get<std::string>(
"Inverse F Type");
212 if (pl.isParameter(
"Inverse Laplace Type")) invSStr = pl.get<std::string>(
"Inverse Laplace Type");
213 if (pl.isParameter(
"Inverse Mass Type")) {
214 std::string massInverseStr = pl.get<std::string>(
"Inverse Mass Type");
217 massInverseType_ = getDiagonalType(massInverseStr);
219 if (pl.isParameter(
"Flip Schur Complement Ordering"))
220 schurCompOrdering_ = pl.get<
bool>(
"Flip Schur Complement Ordering");
223 if (invFStr ==
"") invFStr = invStr;
224 if (invSStr ==
"") invSStr = invStr;
227 if (pl.isSublist(
"Pressure Laplace Parameters"))
229 Teuchos::rcp(
new Teuchos::ParameterList(pl.sublist(
"Pressure Laplace Parameters")));
231 lapParams_ = Teuchos::rcp(
new Teuchos::ParameterList);
234 if (pl.isSublist(
"Pressure Convection Diffusion Parameters"))
236 new Teuchos::ParameterList(pl.sublist(
"Pressure Convection Diffusion Parameters")));
238 pcdParams_ = Teuchos::rcp(
new Teuchos::ParameterList);
241 TEUCHOS_TEST_FOR_EXCEPTION(
242 lapParams_->isParameter(
"Name"), std::logic_error,
243 "Teko: Parameter \"Name\" is not allowed in the sublist \"" +
lapParams_->name() +
"\"");
244 TEUCHOS_TEST_FOR_EXCEPTION(
245 lapParams_->isParameter(
"Tag"), std::logic_error,
246 "Teko: Parameter \"Tag\" is not allowed in the sublist \"" +
lapParams_->name() +
"\"");
247 TEUCHOS_TEST_FOR_EXCEPTION(
248 pcdParams_->isParameter(
"Name"), std::logic_error,
249 "Teko: Parameter \"Name\" is not allowed in the sublist \"" +
pcdParams_->name() +
"\"");
250 TEUCHOS_TEST_FOR_EXCEPTION(
251 pcdParams_->isParameter(
"Tag"), std::logic_error,
252 "Teko: Parameter \"Tag\" is not allowed in the sublist \"" +
pcdParams_->name() +
"\"");
254 Teko_DEBUG_MSG_BEGIN(5) DEBUG_STREAM <<
"PCD Strategy Parameters: " << std::endl;
255 DEBUG_STREAM <<
" inv type = \"" << invStr <<
"\"" << std::endl;
256 DEBUG_STREAM <<
" inv F type = \"" << invFStr <<
"\"" << std::endl;
257 DEBUG_STREAM <<
" inv Laplace type = \"" << invSStr <<
"\"" << std::endl;
258 DEBUG_STREAM <<
" inv Mass type = \"" << Teko::getDiagonalName(massInverseType_) <<
"\""
260 DEBUG_STREAM <<
"PCD Strategy Parameter list: " << std::endl;
261 pl.print(DEBUG_STREAM);
265 invFactoryF_ = invLib.getInverseFactory(invFStr);
267 if (invFStr == invSStr)
268 invFactoryS_ = invFactoryF_;
270 invFactoryS_ = invLib.getInverseFactory(invSStr);
272 lapParams_->set(
"Name", getPressureLaplaceString());