10 #ifndef THYRA_DEFAULT_BLOCKED_TRIANGULAR_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
11 #define THYRA_DEFAULT_BLOCKED_TRIANGULAR_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
14 #include "Thyra_DefaultBlockedTriangularLinearOpWithSolveFactory_decl.hpp"
15 #include "Thyra_LinearOpWithSolveBase.hpp"
16 #include "Thyra_LinearOpWithSolveFactoryHelpers.hpp"
17 #include "Thyra_PhysicallyBlockedLinearOpBase.hpp"
18 #include "Thyra_PhysicallyBlockedLinearOpWithSolveBase.hpp"
19 #include "Thyra_DefaultBlockedTriangularLinearOpWithSolve.hpp"
20 #include "Thyra_DefaultLinearOpSource.hpp"
29 template<
class Scalar>
37 lowsf_.initialize(lowsf);
41 template<
class Scalar>
49 lowsf_.initialize(lowsf);
53 template<
class Scalar>
57 return lowsf_.getNonconstObj();
61 template<
class Scalar>
65 return lowsf_.getConstObj();
72 template<
class Scalar>
76 std::ostringstream oss;
80 if (!
is_null(lowsf_.getConstObj()))
81 oss << lowsf_.getConstObj()->description();
92 template<
class Scalar>
98 lowsf_.getNonconstObj()->setParameterList(paramList);
102 template<
class Scalar>
106 return lowsf_.getNonconstObj()->getNonconstParameterList();
110 template<
class Scalar>
114 return lowsf_.getNonconstObj()->unsetParameterList();
118 template<
class Scalar>
122 return lowsf_.getConstObj()->getParameterList();
126 template<
class Scalar>
130 return lowsf_.getConstObj()->getValidParameters();
137 template<
class Scalar>
145 template<
class Scalar>
153 "Error, we don't support a preconditioner factory!");
157 template<
class Scalar>
161 return Teuchos::null;
165 template<
class Scalar>
172 "Error, we don't support a preconditioner factory!");
176 template<
class Scalar>
187 template<
class Scalar>
191 return defaultBlockedTriangularLinearOpWithSolve<Scalar>();
195 template<
class Scalar>
205 using Teuchos::rcp_dynamic_cast;
212 lowsf_.getConstObj()->setOStream(this->getOStream());
213 lowsf_.getConstObj()->setVerbLevel(this->getVerbLevel());
218 rcp_dynamic_cast<
const PBLOB>(fwdOpSrc->getOp().assert_not_null());
224 DBTLOWS &btlows =
dyn_cast<DBTLOWS>(*Op);
229 const bool firstTime =
is_null(btlows.range());
234 btlows.beginBlockFill(blo->productRange(),blo->productDomain());
236 const int N = blo->productRange()->numBlocks();
237 for (
int k = 0; k < N; ++k ) {
243 btlows.setNonconstLOWSBlock( k, k,
244 linearOpWithSolve<Scalar>(*lowsf_.getConstObj(),fwdOp_k)
253 Thyra::initializeOp<Scalar>(*lowsf_.getConstObj(), fwdOp_k, invOp_k.
ptr());
260 btlows.endBlockFill();
265 btlows.setBlocks(blo);
268 btlows.setOStream(this->getOStream());
269 btlows.setVerbLevel(this->getVerbLevel());
274 template<
class Scalar>
285 template<
class Scalar>
296 using Teuchos::rcp_implicit_cast;
297 using Teuchos::rcp_dynamic_cast;
300 DBTLOWS &btlowsOp =
dyn_cast<DBTLOWS>(*Op);
304 *fwdOpSrc = defaultLinearOpSource<Scalar>(fwdOp);
306 *fwdOpSrc = Teuchos::null;
308 if (prec) *prec = Teuchos::null;
309 if (approxFwdOpSrc) *approxFwdOpSrc = Teuchos::null;
313 template<
class Scalar>
328 template<
class Scalar>
338 "Error, we don't support an external preconditioner!");
342 template<
class Scalar>
352 "Error, we don't support an external preconditioner!");
359 template<
class Scalar>
363 lowsf_.getConstObj()->setVerbLevel(this->getVerbLevel());
364 lowsf_.getConstObj()->setOStream(this->getOStream());
371 #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()