42 #ifndef THYRA_DEFAULT_BLOCKED_TRIANGULAR_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
43 #define THYRA_DEFAULT_BLOCKED_TRIANGULAR_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
46 #include "Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_decl.hpp"
47 #include "Thyra_LinearOpWithSolveBase.hpp"
48 #include "Thyra_LinearOpWithSolveFactoryHelpers.hpp"
49 #include "Thyra_PhysicallyBlockedLinearOpBase.hpp"
50 #include "Thyra_PhysicallyBlockedLinearOpWithSolveBase.hpp"
51 #include "Thyra_DefaultBlockedTriangularLinearOpWithSolve.hpp"
52 #include "Thyra_DefaultLinearOpSource.hpp"
61 template<
class Scalar>
69 lowsf_.initialize(lowsf);
73 template<
class Scalar>
81 lowsf_.initialize(lowsf);
85 template<
class Scalar>
89 return lowsf_.getNonconstObj();
93 template<
class Scalar>
97 return lowsf_.getConstObj();
104 template<
class Scalar>
108 std::ostringstream oss;
112 if (!
is_null(lowsf_.getConstObj()))
113 oss << lowsf_.getConstObj()->description();
124 template<
class Scalar>
130 lowsf_.getNonconstObj()->setParameterList(paramList);
134 template<
class Scalar>
138 return lowsf_.getNonconstObj()->getNonconstParameterList();
142 template<
class Scalar>
146 return lowsf_.getNonconstObj()->unsetParameterList();
150 template<
class Scalar>
154 return lowsf_.getConstObj()->getParameterList();
158 template<
class Scalar>
162 return lowsf_.getConstObj()->getValidParameters();
169 template<
class Scalar>
177 template<
class Scalar>
185 "Error, we don't support a preconditioner factory!");
189 template<
class Scalar>
193 return Teuchos::null;
197 template<
class Scalar>
204 "Error, we don't support a preconditioner factory!");
208 template<
class Scalar>
219 template<
class Scalar>
223 return defaultBlockedTriangularLinearOpWithSolve<Scalar>();
227 template<
class Scalar>
237 using Teuchos::rcp_dynamic_cast;
244 lowsf_.getConstObj()->setOStream(this->getOStream());
245 lowsf_.getConstObj()->setVerbLevel(this->getVerbLevel());
250 rcp_dynamic_cast<
const PBLOB>(fwdOpSrc->getOp().assert_not_null());
256 DBTLOWS &btlows =
dyn_cast<DBTLOWS>(*Op);
261 const bool firstTime =
is_null(btlows.range());
266 btlows.beginBlockFill(blo->productRange(),blo->productDomain());
268 const int N = blo->productRange()->numBlocks();
269 for (
int k = 0; k < N; ++k ) {
275 btlows.setNonconstLOWSBlock( k, k,
276 linearOpWithSolve<Scalar>(*lowsf_.getConstObj(),fwdOp_k)
285 Thyra::initializeOp<Scalar>(*lowsf_.getConstObj(), fwdOp_k, invOp_k.
ptr());
292 btlows.endBlockFill();
297 btlows.setBlocks(blo);
300 btlows.setOStream(this->getOStream());
301 btlows.setVerbLevel(this->getVerbLevel());
306 template<
class Scalar>
317 template<
class Scalar>
328 using Teuchos::rcp_implicit_cast;
329 using Teuchos::rcp_dynamic_cast;
332 DBTLOWS &btlowsOp =
dyn_cast<DBTLOWS>(*Op);
336 *fwdOpSrc = defaultLinearOpSource<Scalar>(fwdOp);
338 *fwdOpSrc = Teuchos::null;
340 if (prec) *prec = Teuchos::null;
341 if (approxFwdOpSrc) *approxFwdOpSrc = Teuchos::null;
345 template<
class Scalar>
360 template<
class Scalar>
370 "Error, we don't support an external preconditioner!");
374 template<
class Scalar>
384 "Error, we don't support an external preconditioner!");
391 template<
class Scalar>
395 lowsf_.getConstObj()->setVerbLevel(this->getVerbLevel());
396 lowsf_.getConstObj()->setOStream(this->getOStream());
403 #endif // THYRA_DEFAULT_BLOCKED_TRIANGULAR_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
Base class for all linear operators that can support a high-level solve operation.
bool is_null(const boost::shared_ptr< T > &p)
virtual void initializePreconditionedOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const RCP< const PreconditionerBase< Scalar > > &prec, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
Concrete composite LinearOpWithSolveBase subclass that creates single upper or lower block triangular...
RCP< const ParameterList > getValidParameters() const
std::string description() const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void informUpdatedVerbosityState() const
Overridden from Teuchos::VerboseObjectBase.
T_To & dyn_cast(T_From &from)
virtual void unsetPreconditionerFactory(RCP< PreconditionerFactoryBase< Scalar > > *precFactory, std::string *precFactoryName)
Throws exception.
Simple interface class to access a precreated preconditioner as one or more linear operators objects ...
virtual bool isCompatible(const LinearOpSourceBase< Scalar > &fwdOpSrc) const
Implicit subclass that takes a blocked triangular LOWB object and turns it into a LOWSB object...
RCP< ParameterList > getNonconstParameterList()
Factory interface for creating LinearOpWithSolveBase objects from compatible LinearOpBase objects...
RCP< LinearOpWithSolveFactoryBase< Scalar > > getUnderlyingLOWSF()
Base interface for physically blocked linear operators.
virtual void initializeApproxPreconditionedOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const RCP< const LinearOpSourceBase< Scalar > > &approxFwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
virtual bool acceptsPreconditionerFactory() const
returns false.
virtual void initializeOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op, const ESupportSolveUse supportSolveUse) const
virtual std::string description() const
Factory interface for creating preconditioner objects from LinearOpBase objects.
Base interface for objects that can return a linear operator.
virtual RCP< PreconditionerFactoryBase< Scalar > > getPreconditionerFactory() const
Returns null .
virtual void uninitializeOp(LinearOpWithSolveBase< Scalar > *Op, RCP< const LinearOpSourceBase< Scalar > > *fwdOpSrc, RCP< const PreconditionerBase< Scalar > > *prec, RCP< const LinearOpSourceBase< Scalar > > *approxFwdOpSrc, ESupportSolveUse *supportSolveUse) const
virtual RCP< LinearOpWithSolveBase< Scalar > > createOp() const
const RCP< T > & assert_not_null() const
ESupportSolveUse
Enum that specifies how a LinearOpWithSolveBase object will be used for solves after it is constructe...
virtual void setPreconditionerFactory(const RCP< PreconditionerFactoryBase< Scalar > > &precFactory, const std::string &precFactoryName)
Throws exception.
virtual void initializeAndReuseOp(const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, LinearOpWithSolveBase< Scalar > *Op) const
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
virtual bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
EPreconditionerInputType
Enum defining the status of a preconditioner object.
RCP< const ParameterList > getParameterList() const
void setParameterList(RCP< ParameterList > const ¶mList)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
RCP< ParameterList > unsetParameterList()