42 #ifndef STRATIMIKOS_DEFAULT_LINEAR_SOLVER_BUILDING_BASE 43 #define STRATIMIKOS_DEFAULT_LINEAR_SOLVER_BUILDING_BASE 45 #include "Stratimikos_ConfigDefs.hpp" 46 #include "Thyra_LinearSolverBuilderBase.hpp" 47 #include "Teuchos_AbstractFactory.hpp" 48 #include "Teuchos_StandardMemberCompositionMacros.hpp" 49 #include "Teuchos_StandardParameterEntryValidators.hpp" 52 #ifdef HAVE_STRATIMIKOS_THYRAEPETRAADAPTERS 53 #include "Thyra_EpetraThyraWrappers.hpp" 54 #include "Thyra_EpetraLinearOp.hpp" 56 #include "Thyra_LinearOpWithSolveFactoryHelpers.hpp" 57 #include "Thyra_LinearOpWithSolveBase.hpp" 58 #include "Thyra_PreconditionerFactoryHelpers.hpp" 59 #include "Thyra_DefaultScaledAdjointLinearOp.hpp" 60 #include "Thyra_DefaultPreconditioner.hpp" 61 #include "Thyra_MultiVectorStdOps.hpp" 62 #include "Thyra_VectorStdOps.hpp" 63 #include "Thyra_VectorBase.hpp" 66 namespace Teuchos {
class CommandLineProcessor; }
77 using Teuchos::AbstractFactory;
79 using Teuchos::ParameterList;
119 :
public Thyra::LinearSolverBuilderBase<double>
134 const std::string ¶msXmlFileName =
"" 135 ,
const std::string &extraParamsXmlString =
"" 136 ,
const std::string ¶msUsedXmlOutFileName =
"" 137 ,
const std::string ¶msXmlFileNameOption =
"linear-solver-params-file" 138 ,
const std::string &extraParamsXmlStringOption =
"extra-linear-solver-params" 139 ,
const std::string ¶msUsedXmlOutFileNameOption =
"linear-solver-params-used-file" 148 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,paramsXmlFileName);
153 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,extraParamsXmlString);
158 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,paramsUsedXmlOutFileName);
163 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,paramsXmlFileNameOption);
168 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,extraParamsXmlStringOption);
173 STANDARD_MEMBER_COMPOSITION_MEMBERS(std::string,paramsUsedXmlOutFileNameOption);
176 void setLinearSolveStrategyFactory(
177 const RCP<
const AbstractFactory<Thyra::LinearOpWithSolveFactoryBase<double> > >
178 &solveStrategyFactory,
179 const std::string &solveStrategyName,
180 const bool makeDefault =
false 184 void setDefaultLinearSolveStrategyFactoryName(
185 const std::string &solveStrategyName);
188 void setPreconditioningStrategyFactory(
189 const RCP<
const AbstractFactory<Thyra::PreconditionerFactoryBase<double> > >
190 &precStrategyFactory,
191 const std::string &precStrategyName,
192 const bool makeDefault =
false 196 void setDefaultPreconditioningStrategyFactoryName(
197 const std::string &precStrategyName);
215 void setupCLP( Teuchos::CommandLineProcessor *clp );
235 void readParameters( std::ostream *out );
252 void writeParamsFile(
253 const Thyra::LinearOpWithSolveFactoryBase<double> &lowsFactory,
254 const std::string &outputXmlFileName =
"" 260 std::string getLinearSolveStrategyName()
const;
265 std::string getPreconditionerStrategyName()
const;
273 void setParameterList(RCP<ParameterList>
const& paramList);
275 RCP<ParameterList> getNonconstParameterList();
277 RCP<ParameterList> unsetParameterList();
279 RCP<const ParameterList> getParameterList()
const;
281 RCP<const ParameterList> getValidParameters()
const;
289 RCP<Thyra::LinearOpWithSolveFactoryBase<double> >
290 createLinearSolveStrategy(
291 const std::string &linearSolveStrategyName
294 RCP<Thyra::PreconditionerFactoryBase<double> >
295 createPreconditioningStrategy(
296 const std::string &preconditioningStrategyName
306 typedef RCP<const AbstractFactory<Thyra::LinearOpWithSolveFactoryBase<double> > >
308 typedef RCP<const AbstractFactory<Thyra::PreconditionerFactoryBase<double> > >
314 RCP<ParameterList> paramList_;
315 Array<std::string> validLowsfNames_;
316 Array<lowsf_fcty_t> lowsfArray_;
317 std::string defaultLOWSF_;
318 Array<std::string> validPfNames_;
319 Array<pf_fcty_t> pfArray_;
320 std::string defaultPF_;
321 bool enableDelayedSolverConstruction_;
322 mutable RCP<const ParameterList> validParamList_;
323 mutable RCP<const Teuchos::StringToIntegralParameterEntryValidator<int> > lowsfValidator_;
324 mutable RCP<const Teuchos::StringToIntegralParameterEntryValidator<int> > pfValidator_;
329 void initializeDefaults();
330 void justInTimeInitialize()
const;
338 #endif // STRATIMIKOS_DEFAULT_LINEAR_SOLVER_BUILDING_BASE
Concrete subclass of Thyra::LinearSolverBuilderBase for creating LinearOpWithSolveFactoryBase objects...